console.js: quote html text (Forum #102595)
git-svn-id: https://svn.fhem.de/fhem/trunk@19907 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -2,13 +2,14 @@
|
|||||||
FW_version["console.js"] = "$Id$";
|
FW_version["console.js"] = "$Id$";
|
||||||
|
|
||||||
var consConn;
|
var consConn;
|
||||||
|
var debug;
|
||||||
|
|
||||||
var consFilter, oldFilter, consFType="";
|
var consFilter, oldFilter, consFType="";
|
||||||
var consLastIndex = 0;
|
var consLastIndex = 0;
|
||||||
var withLog = 0;
|
var withLog = 0;
|
||||||
var mustScroll = 1;
|
var mustScroll = 1;
|
||||||
|
|
||||||
log("Event monitor is starting");
|
log("Event monitor is starting!");
|
||||||
|
|
||||||
function
|
function
|
||||||
cons_closeConn()
|
cons_closeConn()
|
||||||
@@ -59,8 +60,15 @@ consUpdate(evt)
|
|||||||
if(new_content == undefined || new_content.length == 0)
|
if(new_content == undefined || new_content.length == 0)
|
||||||
return;
|
return;
|
||||||
log("Console Rcvd: "+new_content);
|
log("Console Rcvd: "+new_content);
|
||||||
if(new_content.indexOf('<') != 0)
|
var ma = new_content.match(/(.*)<br>[\r\n]+$/); // Strange stuff.
|
||||||
new_content = new_content.replace(/ /g, " ");
|
if(ma) {
|
||||||
|
new_content = ma[1];
|
||||||
|
if(new_content.indexOf('<') != 0) {
|
||||||
|
var rTab = {'<':'<', '>':'>',' ':' '};
|
||||||
|
new_content = new_content.replace(/[<> ]/g, function(a){return rTab[a]});
|
||||||
|
}
|
||||||
|
new_content += '<br>';
|
||||||
|
}
|
||||||
|
|
||||||
$("#console").append(new_content);
|
$("#console").append(new_content);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user