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/scripts/spellcheck.js | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'lib/scripts') 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