From: Michael M Slusarz Date: Fri, 17 Apr 2009 03:24:22 +0000 (-0600) Subject: More descriptive classnames for spellcheck classes X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=7471baa4b216bc04da8d1ec78471db4af44a4e38;p=horde.git More descriptive classnames for spellcheck classes --- diff --git a/imp/js/src/SpellChecker.js b/imp/js/src/SpellChecker.js index e21d90818..2271428fa 100644 --- a/imp/js/src/SpellChecker.js +++ b/imp/js/src/SpellChecker.js @@ -66,7 +66,7 @@ var SpellChecker = Class.create({ // showSuggestions mode. document.observe('click', this.onClick.bindAsEventListener(this)); - this.status('CheckSpelling'); + this.setStatus('CheckSpelling'); }, setLocale: function(e) @@ -108,7 +108,7 @@ var SpellChecker = Class.create({ p = $H(), url = this.url; - this.status('Checking'); + this.setStatus('Checking'); this.removeChoices(); this.onNoError = noerror; @@ -166,14 +166,14 @@ var SpellChecker = Class.create({ this.removeChoices(); if (Object.isUndefined(result)) { - this.status('Error'); + this.setStatus('Error'); return; } this.suggestions = result.suggestions || []; if (this.onNoError && !this.suggestions.size()) { - this.status('CheckSpelling'); + this.setStatus('CheckSpelling'); this.onNoError(); return; } @@ -189,7 +189,7 @@ var SpellChecker = Class.create({ $A(bad).each(function(node) { re = new RegExp("(?:^|\\b)" + RegExp.escape(node) + "(?:\\b|$)", 'g'); - re_text = '' + node + ''; + re_text = '' + node + ''; content = content.replace(re, re_text); // Go through and see if we matched anything inside a tag. if (this.htmlAreaParent) { @@ -213,7 +213,7 @@ var SpellChecker = Class.create({ this.reviewDiv.update(content); // Now attach results behavior to each link. - this.reviewDiv.select('span[name="incorrect"]').invoke('observe', 'click', this.showSuggestions.bindAsEventListener(this)); + this.reviewDiv.select('span.spellcheckIncorrect').invoke('observe', 'click', this.showSuggestions.bindAsEventListener(this)); // Falsify links this.reviewDiv.select('A').invoke('observe', 'click', Event.stop); @@ -226,7 +226,7 @@ var SpellChecker = Class.create({ input.hide().insert({ before: this.reviewDiv }); } - this.status('ResumeEdit'); + this.setStatus('ResumeEdit'); }, showSuggestions: function(e) @@ -257,7 +257,7 @@ var SpellChecker = Class.create({ replaceWord: function(li, word) { - word.update(li.innerHTML).writeAttribute({ className: 'corrected' }); + word.update(li.innerHTML).writeAttribute({ className: 'spellcheckCorrected' }); this.removeChoices(); }, @@ -280,7 +280,7 @@ var SpellChecker = Class.create({ var input = $(this.target), t; - this.reviewDiv.select('span[name="incorrect"]').each(function(n) { + this.reviewDiv.select('span.spellcheckIncorrect').each(function(n) { n.replace(n.innerHTML); }); @@ -300,7 +300,7 @@ var SpellChecker = Class.create({ this.reviewDiv.remove(); this.reviewDiv = null; - this.status('CheckSpelling'); + this.setStatus('CheckSpelling'); if (this.htmlAreaParent) { // Fix for Safari 3/fckeditor - Ticket #6909 @@ -314,7 +314,7 @@ var SpellChecker = Class.create({ } }, - status: function(state) + setStatus: function(state) { if (!this.statusButton) { return; @@ -330,7 +330,7 @@ var SpellChecker = Class.create({ this.statusButton.update(this.buttonStates[state]); break; } - this.statusButton.className = this.statusClass + ' ' + state; + this.statusButton.className = this.statusClass + ' spellcheck' + state; }, isActive: function() diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index 60fc80495..14fdcac30 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -70,15 +70,15 @@ div#quota { #spellcheck { color: #000; } -.Checking { +.spellcheckChecking { color: red; } -.incorrect { +.spellcheckIncorrect { text-decoration: underline; cursor: pointer; color: red; } -.corrected { +.spellcheckCorrected { text-decoration: underline; cursor: pointer; color: #090; diff --git a/imp/themes/screen.css b/imp/themes/screen.css index a77063753..adb6d976e 100644 --- a/imp/themes/screen.css +++ b/imp/themes/screen.css @@ -363,15 +363,15 @@ table.multipleMsgs td.msgheader { } /* SpellChecker styles. */ -.Checking { +.spellcheckChecking { color: #f00; } -.incorrect { +.spellcheckIncorrect { text-decoration: underline; cursor: pointer; color: #f00; } -.corrected { +.spellcheckCorrected { text-decoration: underline; cursor: pointer; color: #090;