summaryrefslogtreecommitdiff
path: root/lib/scripts/spellcheck.js
diff options
context:
space:
mode:
authorandi <andi@splitbrain.org>2005-06-08 20:27:58 +0200
committerandi <andi@splitbrain.org>2005-06-08 20:27:58 +0200
commit95657bc6773c23c04843d51d5224df0bbd5191f0 (patch)
tree119d23ef8bfb8977f79acc114e016ea66691d2c6 /lib/scripts/spellcheck.js
parent2765ac2310959056fc3548fbdd745258de6c048c (diff)
downloadrpg-95657bc6773c23c04843d51d5224df0bbd5191f0.tar.gz
rpg-95657bc6773c23c04843d51d5224df0bbd5191f0.tar.bz2
Spellchecker fixes
The spellchecker now works in IE6, Firefox and Opera 8 :-) SACK was updated to the latest release (plus a minor fix) Proper UTF-8 headers were added to the AJAX PHP backends darcs-hash:20050608182758-9977f-1eacd0ba9993a62f094433d982f668e38d17ba14.gz
Diffstat (limited to 'lib/scripts/spellcheck.js')
-rw-r--r--lib/scripts/spellcheck.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/scripts/spellcheck.js b/lib/scripts/spellcheck.js
index 5b7833601..feeeb0967 100644
--- a/lib/scripts/spellcheck.js
+++ b/lib/scripts/spellcheck.js
@@ -206,6 +206,7 @@ function ajax_spell_class(){
this.suggestObj.style.display = "none";
}
+
// --- Callbacks ---
/**
@@ -228,6 +229,9 @@ function ajax_spell_class(){
ajax_spell.editbarObj.style.visibility = 'hidden';
ajax_spell.showboxObj.style.display = 'block';
}else{
+ if(error == '2'){
+ alert(data);
+ }
ajax_spell.textboxObj.disabled = false;
ajax_spell.editbarObj.style.visibility = 'visible';
ajax_spell.setState('noerr');
@@ -263,8 +267,9 @@ function ajax_spell_class(){
this.setState('run');
this.textboxObj.disabled = true;
var ajax = new sack(this.handler);
+ ajax.AjaxFailedAlert = '';
ajax.encodeURIString = false;
- ajax.onCompletion = this.start;
+ ajax.onCompletion = this.start;
ajax.runAJAX('call=check&data='+encodeURIComponent(this.textboxObj.value));
}
@@ -278,8 +283,9 @@ function ajax_spell_class(){
var text = this.showboxObj.innerHTML;
if(text != ''){
var ajax = new sack(this.handler);
+ ajax.AjaxFailedAlert = '';
ajax.encodeURIString = false;
- ajax.onCompletion = this.stop;
+ ajax.onCompletion = this.stop;
ajax.runAJAX('call=resume&data='+encodeURIComponent(text));
}
}
@@ -299,7 +305,14 @@ function ajax_spell_class(){
this.suggestObj.style.display = "none";
var x = findPosX('spell_error'+id);
var y = findPosY('spell_error'+id);
- var scrollPos = this.showboxObj.scrollTop;
+
+ // handle scrolling
+ if(is_opera){
+ var scrollPos = 0; //FIXME how to do this without browser sniffing?
+ }else{
+ var scrollPos = this.showboxObj.scrollTop;
+ }
+
this.suggestObj.style.left = x+'px';
this.suggestObj.style.top = (y+16-scrollPos)+'px';