From 58bef9895361367926408711774311e4310e007a Mon Sep 17 00:00:00 2001 From: matthiasgrimm Date: Mon, 13 Jun 2005 20:27:25 +0200 Subject: spellchecker button control This patch replaces the big textual spellchecker controls with a nice one using toolbar like buttons darcs-hash:20050613182725-7ef76-34661fe2322682059335dced7ad60dfb31350c30.gz --- lib/images/toolbar/spellcheck.png | Bin 0 -> 996 bytes lib/images/toolbar/spellnoerr.png | Bin 0 -> 1003 bytes lib/images/toolbar/spellstop.png | Bin 0 -> 899 bytes lib/images/toolbar/spellwait.gif | Bin 0 -> 5005 bytes lib/scripts/spellcheck.js | 35 +++++++++++++++++++++++++++-------- 5 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 lib/images/toolbar/spellcheck.png create mode 100644 lib/images/toolbar/spellnoerr.png create mode 100644 lib/images/toolbar/spellstop.png create mode 100644 lib/images/toolbar/spellwait.gif (limited to 'lib') diff --git a/lib/images/toolbar/spellcheck.png b/lib/images/toolbar/spellcheck.png new file mode 100644 index 000000000..b620dbeb1 Binary files /dev/null and b/lib/images/toolbar/spellcheck.png differ diff --git a/lib/images/toolbar/spellnoerr.png b/lib/images/toolbar/spellnoerr.png new file mode 100644 index 000000000..5ef60e66e Binary files /dev/null and b/lib/images/toolbar/spellnoerr.png differ diff --git a/lib/images/toolbar/spellstop.png b/lib/images/toolbar/spellstop.png new file mode 100644 index 000000000..21fd4edab Binary files /dev/null and b/lib/images/toolbar/spellstop.png differ diff --git a/lib/images/toolbar/spellwait.gif b/lib/images/toolbar/spellwait.gif new file mode 100644 index 000000000..574ed111c Binary files /dev/null and b/lib/images/toolbar/spellwait.gif differ diff --git a/lib/scripts/spellcheck.js b/lib/scripts/spellcheck.js index 03ca9c364..3df9a25ff 100644 --- a/lib/scripts/spellcheck.js +++ b/lib/scripts/spellcheck.js @@ -89,6 +89,29 @@ function qquote(str){ return str.split('\'').join('\\\''); } +/** + * This function generates a spellchecker button with localized tooltips + */ +function spellButton(imageFile, speedTip, funcCall, accessKey) { + speedTip=escapeQuotes(speedTip); + funcCall=escapeQuotes(funcCall); + + button = ""; + button = button+"\""+"; + button = button+""; + return button; +} + /** * AJAX Spellchecker Class * @@ -186,20 +209,16 @@ function ajax_spell_class(){ this.setState = function(state){ switch (state){ case 'stop': - ajax_spell.actionObj.innerHTML = - ''+ajax_spell.txtStop+''; + ajax_spell.actionObj.innerHTML = spellButton("spellstop.png",ajax_spell.txtStop,"ajax_spell.resume()",""); break; case 'noerr': - ajax_spell.actionObj.innerHTML = - ''+ajax_spell.txtNoErr+''; + ajax_spell.actionObj.innerHTML = spellButton("spellnoerr.png",ajax_spell.txtNoErr,"ajax_spell.setState(\"start\")",""); break; case 'run': - ajax_spell.actionObj.innerHTML = - ''+ajax_spell.txtRun+''; + ajax_spell.actionObj.innerHTML = spellButton("spellwait.gif",ajax_spell.txtRun,"",""); break; default: - ajax_spell.actionObj.innerHTML = - ''+ajax_spell.txtStart+''; + ajax_spell.actionObj.innerHTML = spellButton("spellcheck.png",ajax_spell.txtStart,"ajax_spell.run()","c"); break; } } -- cgit v1.2.3