Revision: 2265
Author: seba.wagner
Date: Thu Sep 10 01:51:48 2009
Log: Issue 876
http://code.google.com/p/openmeetings/source/detail?r=2265
Modified:
/trunk/openmeetings_lps411/base/components/text/customEdittext.lzx
=======================================
--- /trunk/openmeetings_lps411/base/components/text/customEdittext.lzx Thu
Sep 10 00:31:34 2009
+++ /trunk/openmeetings_lps411/base/components/text/customEdittext.lzx Thu
Sep 10 01:51:48 2009
@@ -23,10 +23,21 @@
//
if (System.capabilities.os.indexOf('Linux')==-1) {
- return;
+ //return;
}
if ($debug) Debug.write("System.capabilities.os --
START ",System.capabilities.os,txt);
+
+ if (txt == null || txt.length == 0) {
+ return;
+ }
+
+
+ //Get the Last CharCode entered:
+ var lastChar = txt.substr(txt.length-2,1);
+ if ($debug) Debug.write("lastChar ",lastChar);
+ if ($debug) Debug.write("lastChar
CharCode ",txt.charCodeAt(txt.length-1))
+
//UTF8 character remappings
var cp1252 = new Object();
@@ -68,20 +79,26 @@
var d=i;
+ if ($debug) Debug.write("DO WHILE
-1- ",t.charCodeAt(i),cp1252[t.charCodeAt(i)],i,0x80,0xBF);
+
while (((t.charCodeAt(i)>=0x80 && t.charCodeAt(i)<=0xBF) ||
(cp1252[t.charCodeAt(i)])) && i>0) {
+
+ if ($debug) Debug.write("DO WHILE
-2- ",t.charCodeAt(i),cp1252[t.charCodeAt(i)],i);
+
if (cp1252[t.charCodeAt(i)]) {
t=t.substr(0,i)+String.fromCharCode(cp1252[t.charCodeAt(i)])+t.substr(i+1);
}
i--;
}
if (i==d) {
+ if ($debug) Debug.write("i == d NOTHING TO REPLACE!");
return;
}
var u=0;
if (t.charCodeAt(i)>=0xC2 && t.charCodeAt(i)<=0xDF && d-i==1) {
- // two-byte sequence
+ // two-byte sequence
u= (t.charCodeAt(i+1) & 0x3F) +
((t.charCodeAt(i ) & 3 ) << 6) +
((t.charCodeAt(i ) & 0x1C) << 6);
@@ -95,7 +112,12 @@
}
if (u!=0) {
+ if ($debug) Debug.write("Replace String -1- ",txt,u);
+
this.setAttribute("text",t.slice(0,i)+String.fromCharCode(u)+t.slice(d+1));
+
+ if ($debug) Debug.write("Replace String -2- ",txt,u);
+
this.setAttribute("text",txt.split(String.fromCharCode(0x03)).join(''));
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en
-~----------~----~----~----~------~----~------~--~---