diff options
Diffstat (limited to 'lib/scripts/spellcheck.js')
-rw-r--r-- | lib/scripts/spellcheck.js | 19 |
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'; |