/**
* 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 <icon@duke.edu> ($Author$)
- * @version $Date$
+ * @copyright 1999-2011 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
*/
var CurrentError=0;
} else {
CurrentLocation++;
}
-
+
tmp = CurrentLoc.split(":");
CurrentLine=parseInt(tmp[0]);
CurrentSymbol=parseInt(tmp[1]);
}
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<WordSuggestions.length; i++){
document.forms[0].sqspell_oruse.focus();
document.forms[0].sqspell_oruse.select();
}
-
+
document.forms[0].sqspell_suggestion.selectedIndex=0;
if (!document.forms[0].sqspell_oruse.value)
document.forms[0].sqspell_oruse.value=document.forms[0].sqspell_suggestion.options[document.forms[0].sqspell_suggestion.selectedIndex].value;
* Load it again to reflect the changes in symbol data
*/
allLoc = locations[CurrentError].split(", ");
- }
+ }
CurrentLocation=0;
proceed();
}
/**
* This function is called when the "Ignore All" button is pressed.
- *
+ *
* @return void
*/
function sqspellIgnoreAll(){
for (i=0; i<document.forms[0].sqspell_suggestion.length; i++){
document.forms[0].sqspell_suggestion.options[i]=null;
}
-
+
/**
* Now, I've been instructed by the Netscape Developer docs to call
* history.go(0) to refresh the page after I've changed the options.
} else {
if (ChangesMade || document.forms[0].words.value){
if (confirm(ui_completed))
- sqspellCommitChanges();
+ sqspellCommitChanges();
else self.close();
} else {
confirm (ui_nochange);
* @return void
*/
function updateSymbol(lLine, lSymbol, difference){
- /**
+ /**
* Now, I will admit that this is not the best way to do stuff,
* However that's the solution I've come up with.
*
* If you are wondering why I didn't use two-dimensional arrays instead,
* well, sometimes there will be a long line with an error close to the
- * end of it, so the coordinates would be something like 2,98 and
- * some Javascript implementations will create 98 empty members of an
- * array just to have a filled number 98. This is too resource-wasteful
- * and I have decided to go with the below solution instead. It takes
+ * end of it, so the coordinates would be something like 2,98 and
+ * some Javascript implementations will create 98 empty members of an
+ * array just to have a filled number 98. This is too resource-wasteful
+ * and I have decided to go with the below solution instead. It takes
* a little more processing, but it saves a lot on memory.
*
* It just looks heinous. In real life it's really nice and sane. ;)
*/
-
+
for (i=0; i<misses.length; i++){
if(locations[i].indexOf(lLine + ":") >= 0){
allLoc = locations[i].split(", ");
for (j=0; j<allLoc.length; j++){
- 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(":");
- }
- }
+ 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(", ");
}
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.
*/
} else {
self.close();
}
-}
+}
\ No newline at end of file