diff options
Diffstat (limited to 'lib/scripts/spellcheck.js')
-rw-r--r-- | lib/scripts/spellcheck.js | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/lib/scripts/spellcheck.js b/lib/scripts/spellcheck.js index 9ce529131..2af56642f 100644 --- a/lib/scripts/spellcheck.js +++ b/lib/scripts/spellcheck.js @@ -1,5 +1,5 @@ /** - * DokuWiki Spellcheck AJAX clientside script + * DokuWiki Spellcheck AJAX clientside script * * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * @author Andreas Gohr <andi@splitbrain.org> @@ -16,27 +16,27 @@ * Copyright (c) 2005, Garrison Locke * All rights reserved. * - * Redistribution and use in source and binary forms, with or without + * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * - * * Redistributions of source code must retain the above copyright notice, + * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * * Neither the name of the http://www.broken-notebook.com nor the names of its - * contributors may be used to endorse or promote products derived from this + * * Neither the name of the http://www.broken-notebook.com nor the names of its + * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. */ @@ -81,7 +81,7 @@ function ajax_spell_class(){ this.utf8ok = 1; this.handler = DOKU_BASE+'lib/exe/spellcheck.php'; // to hold the page objects (initialized with init()) - this.textboxObj = null; + this.textboxObj = null; this.showboxObj = null; this.suggestObj = null; this.editbarObj = null; @@ -114,25 +114,25 @@ function ajax_spell_class(){ if(ajax.failed){ return; } // get Elements - this.textboxObj = document.getElementById('wikitext'); - this.editbarObj = document.getElementById('wikieditbar'); - this.showboxObj = document.getElementById('spell_result'); - this.suggestObj = document.getElementById('spell_suggest'); + this.textboxObj = document.getElementById('wiki__text'); + this.editbarObj = document.getElementById('wiki__editbar'); + this.showboxObj = document.getElementById('spell__result'); + this.suggestObj = document.getElementById('spell__suggest'); // set Translation Strings this.txtStart = txtStart; this.txtStop = txtStop; this.txtRun = txtRun; - this.txtNoErr = txtNoErr; + this.txtNoErr = txtNoErr; this.txtNoSug = txtNoSug; this.txtChange= txtChange; // create ToolBar Button with ID and add it to the toolbar with null action - var toolbarObj = document.getElementById('toolbar'); - this.buttonObj = createToolButton('spellcheck.png',txtStart,'k','spellcheck'); + var toolbarObj = document.getElementById('tool__bar'); + this.buttonObj = createToolButton('spellcheck.png',txtStart,'k','spell__check'); this.buttonObj.onclick = function(){return false;}; toolbarObj.appendChild(this.buttonObj); - this.imageObj = document.getElementById('spellcheck_ico'); + this.imageObj = document.getElementById('spell__check_ico'); // start UTF-8 compliance test - send an UTF-8 char and see what comes back ajax.AjaxFailedAlert = ''; @@ -204,7 +204,7 @@ function ajax_spell_class(){ * @author Garrison Locke <http://www.broken-notebook.com> */ this.correct = function (id, word){ - var obj = document.getElementById('spell_error'+id); + var obj = document.getElementById('spell__error'+id); obj.innerHTML = decodeURIComponent(word); obj.style.color = "#005500"; this.suggestObj.style.display = "none"; @@ -212,11 +212,11 @@ function ajax_spell_class(){ /** * Opens a prompt to let the user change the word her self - * + * * @author Andreas Gohr <andi@splitbrain.org> */ this.ask = function(id){ - var word = document.getElementById('spell_error'+id).innerHTML; + var word = document.getElementById('spell__error'+id).innerHTML; word = prompt(this.txtChange,word); if(word){ this.correct(id,encodeURIComponent(word)); @@ -236,10 +236,10 @@ function ajax_spell_class(){ // set position of the popup this.suggestObj.style.display = "none"; - var x = findPosX('spell_error'+id); - var y = findPosY('spell_error'+id); + var x = findPosX('spell__error'+id); + var y = findPosY('spell__error'+id); - // handle scrolling + // handle scrolling var scrollPos; if(is_opera){ scrollPos = 0; //FIXME how to do this without browser sniffing? @@ -294,7 +294,7 @@ function ajax_spell_class(){ addEvent(ajax_spell.textboxObj,'focus',ajax_spell.setState); // get started - ajax_spell.setState('start'); + ajax_spell.setState('start'); }; /** @@ -302,7 +302,7 @@ function ajax_spell_class(){ * Inside the callback 'this' is the SACK object!! * * @author Andreas Gohr <andi@splitbrain.org> - */ + */ this.start = function(){ var data = this.response; var error = data.charAt(0); @@ -350,7 +350,7 @@ function ajax_spell_class(){ return String.fromCharCode(+match1); }); // now remove & protection - data = data.replace(/&/g,'&'); + data = data.replace(/&/g,'&'); } // replace div with textbox again |