Commit 5143de7a authored by Wandenberg Peixoto's avatar Wandenberg Peixoto

unescaping CRLF before add text to textarea on chat examples

parent 92491f7c
......@@ -27,6 +27,6 @@
#define NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_
static const ngx_str_t NGX_HTTP_PUSH_STREAM_TAG = ngx_string("0.3.2");
static const ngx_str_t NGX_HTTP_PUSH_STREAM_COMMIT = ngx_string("01d608aaaa8e724a104b571461b66388d0dd5dc6");
static const ngx_str_t NGX_HTTP_PUSH_STREAM_COMMIT = ngx_string("92491f7c847bbc6bf092c08701438622770aab90");
#endif /* NGX_HTTP_PUSH_STREAM_MODULE_VERSION_H_ */
......@@ -61,7 +61,7 @@
var chat = $("#chat");
if (eventMessage != '') {
var values = $.parseJSON(eventMessage);
var line = values.nick + ': ' + values.text;
var line = values.nick + ': ' + values.text.replace(/\\r/g, '\r').replace(/\\n/g, '\n');
if (chat.val() == '') {
chat.val(line);
} else {
......@@ -90,8 +90,8 @@
function _connect(channel) {
pushstream.removeAllChannels();
pushstream.addChannel(channel);
try {
pushstream.addChannel(channel);
pushstream.connect();
} catch(e) {alert(e)};
......
......@@ -61,7 +61,7 @@
var chat = $("#chat");
if (eventMessage != '') {
var values = $.parseJSON(eventMessage);
var line = values.nick + ': ' + values.text;
var line = values.nick + ': ' + values.text.replace(/\\r/g, '\r').replace(/\\n/g, '\n');
if (chat.val() == '') {
chat.val(line);
} else {
......@@ -90,8 +90,8 @@
function _connect(channel) {
pushstream.removeAllChannels();
pushstream.addChannel(channel);
try {
pushstream.addChannel(channel);
pushstream.connect();
} catch(e) {alert(e)};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment