From ea2eed85b6afedcf37443a4953bade0186b9aef2 Mon Sep 17 00:00:00 2001 From: andi Date: Sat, 11 Jun 2005 11:29:16 +0200 Subject: spellchecker fixes for Konqeror Konqeror seems to ignore the charset darcs-hash:20050611092916-9977f-311b99e63b66a83c9f9022c468ba61d0687822c2.gz --- lib/scripts/spellcheck.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/scripts/spellcheck.js') diff --git a/lib/scripts/spellcheck.js b/lib/scripts/spellcheck.js index b5fa35e60..03ca9c364 100644 --- a/lib/scripts/spellcheck.js +++ b/lib/scripts/spellcheck.js @@ -262,7 +262,7 @@ function ajax_spell_class(){ }else{ for(var i=1; i'; + qquote(args[i])+'\')">'; text += args[i]; text += '
'; } @@ -290,6 +290,11 @@ function ajax_spell_class(){ data = data.substring(1); if(error == '1'){ ajax_spell.setState('stop'); + // convert numeric entities back to UTF-8 + data = data.replace(/&#(\d+);/g, + function(whole,match1) { + return String.fromCharCode(+match1); + }); // replace textbox through div ajax_spell.showboxObj.innerHTML = data; ajax_spell.showboxObj.style.width = ajax_spell.textboxObj.style.width; @@ -315,6 +320,15 @@ function ajax_spell_class(){ */ this.stop = function(){ var data = this.response; + + // convert numeric entities back to UTF-8 + data = data.replace(/&#(\d+);/g, + function(whole,match1) { + return String.fromCharCode(+match1); + }); + // now remove & protection + data = data.replace(/&/g,'&'); + ajax_spell.setState('start'); // replace div with textbox again ajax_spell.textboxObj.value = data; -- cgit v1.2.3