X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fjs%2Fcheck_me.js;h=332c62cdbdbd923d79ba27c35b8d1ead2e375526;hp=ad56b7f25176e5c6cece093f159f215b9f7cbf2a;hb=c4faef335b2362c81b8ebf026d4066c12d70536c;hpb=145dc7aa9346d0fd8eeed8840f677e76364f63ee diff --git a/plugins/squirrelspell/js/check_me.js b/plugins/squirrelspell/js/check_me.js index ad56b7f2..332c62cd 100644 --- a/plugins/squirrelspell/js/check_me.js +++ b/plugins/squirrelspell/js/check_me.js @@ -1,14 +1,13 @@ /** * check_me.js * - * Copyright (c) 1999-2003 The SquirrelMail Project Team - * Licensed under the GNU GPL. For full terms see the file COPYING. - * * This JavaScript app is the driving power of the SquirrelSpell's * main spellchecker window. Hope you have as much pain figuring * it out as it took to write. ;)) * - * $Id$ + * @copyright 1999-2020 The SquirrelMail Project Team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ */ var CurrentError=0; @@ -33,7 +32,7 @@ function populateSqspellForm(){ } else { CurrentLocation++; } - + tmp = CurrentLoc.split(":"); CurrentLine=parseInt(tmp[0]); CurrentSymbol=parseInt(tmp[1]); @@ -53,7 +52,7 @@ function populateSqspellForm(){ } NewLineValue+=LineValue.substring(StartWith, CurrentSymbol) + "*" + Word + "*" + LineValue.substring(CurrentSymbol + Word.length, EndWith) + EndLine; document.forms[0].sqspell_line_area.value=NewLineValue; - + if (suggestions[CurrentError]){ WordSuggestions = suggestions[CurrentError].split(", "); for (i=0; i= 0){ allLoc = locations[i].split(", "); for (j=0; j lSymbol){ - tmp[1] = tmp[1] + difference; - allLoc[j] = tmp.join(":"); - } - } + if (allLoc[j].indexOf(lLine+":")==0){ + tmp = allLoc[j].split(":"); + tmp[0] = parseInt(tmp[0]); tmp[1] = parseInt(tmp[1]); + if (tmp[1] > lSymbol){ + tmp[1] = tmp[1] + difference; + allLoc[j] = tmp.join(":"); + } + } } locations[i] = allLoc.join(", "); } @@ -277,10 +276,10 @@ function sqspellCommitChanges(){ if (i!=1) newBody+="\r\n"; newBody += sqspell_lines[i]; } - + opener.document.compose.subject.value=newSubject; opener.document.compose.body.value=newBody; - + /** * See if any words were added to the dictionary. */ @@ -297,4 +296,4 @@ function sqspellCommitChanges(){ } else { self.close(); } -} +} \ No newline at end of file