Index: openacs-4/packages/xowiki/www/ajax/scripted-streaming-chat.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ajax/Attic/scripted-streaming-chat.js,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/ajax/scripted-streaming-chat.js 13 Sep 2012 16:05:34 -0000 1.3 +++ openacs-4/packages/xowiki/www/ajax/scripted-streaming-chat.js 17 Feb 2013 11:48:06 -0000 1.4 @@ -2,25 +2,7 @@ // $Id$ // -gustaf neumann April 2006 -function getHttpObject() { - var http_request = false; - if (window.XMLHttpRequest) { // Mozilla, Safari,... - http_request = new XMLHttpRequest(); - } else if (window.ActiveXObject) { // IE - try { - http_request = new ActiveXObject('Msxml2.XMLHTTP'); - } catch (e) { - try { - http_request = new ActiveXObject('Microsoft.XMLHTTP'); - } catch (e) {} - } - } - - if (!http_request) { - alert('Cannot create and instance of XMLHTTP'); - } - return http_request; -} +var http_send = getHttpObject(); function getData(data) { var messages = document.getElementById('messages'); @@ -38,7 +20,7 @@ p.appendChild(span); span = document.createElement('span'); - span.innerHTML = data.messages[i].msg; + span.innerHTML = decodeURI(unescape(data.messages[i].msg)); span.className = 'message'; p.appendChild(span); @@ -47,15 +29,10 @@ } } -var http_send = getHttpObject(); - function chatSendMsg() { var msg = document.getElementById('chatMsg').value; - if (msg == '') { - return; - } - //alert(send_url + encodeURIComponent(msg)); - http_send.open('GET', send_url + encodeURIComponent(msg), true); + if (msg == '') { return; } + http_send.open('GET', send_url + encodeURIComponent(escape(msg)), true); http_send.onreadystatechange = function() { if (http_send.readyState == 4) { if (http_send.status != 200) { @@ -65,9 +42,4 @@ }; http_send.send(null); document.getElementById('chatMsg').value = ''; -} - -function tell(msg) { - document.monitor.window.value = msg; -} - +} \ No newline at end of file