X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=plugins%2Fsquirrelspell%2Fjs%2Fcheck_me.js;h=332c62cdbdbd923d79ba27c35b8d1ead2e375526;hp=1abc4e0dcb910ad2d9dc3c2c62e3c2db571cf1c2;hb=c4faef335b2362c81b8ebf026d4066c12d70536c;hpb=d112ed5aeee62953707e7042a1edc8e8c2b6a968 diff --git a/plugins/squirrelspell/js/check_me.js b/plugins/squirrelspell/js/check_me.js index 1abc4e0d..332c62cd 100644 --- a/plugins/squirrelspell/js/check_me.js +++ b/plugins/squirrelspell/js/check_me.js @@ -1,14 +1,13 @@ /** * check_me.js - * ------------ + * * 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$ - * - * @author Konstantin Riabitsev ($Author$) - * @version $Date$ + * @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.forms[0].subject.value=newSubject; - opener.document.forms[0].body.value=newBody; - + + 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