X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fmyconsole.js;h=223abdc96d840905dbbf5519dad640bfd5065453;hb=8e29e6c5f6919cdf37bed7f6782ac549c14e6210;hp=4d47f4d8a3c767649fe1419748014e940dac6664;hpb=29d268c228f3bbea50358d0f489e1f434c078d21;p=brisk.git
diff --git a/web/myconsole.js b/web/myconsole.js
index 4d47f4d..223abdc 100644
--- a/web/myconsole.js
+++ b/web/myconsole.js
@@ -1,30 +1,76 @@
-function myconsole(ena) {
+function xynt_console(ena) {
var conbody, condiv;
this.enable = ena;
if (ena) {
- this.win = window.open("","","scrollbars=yes,height=500,width=400,left=0,top=800");
+ this.win = window.open("","xyntconsole","scrollbars=yes,height=500,width=800,left=0,top=800");
+
conbody = this.win.document.createElement("body");
this.div = condiv = this.win.document.createElement("div");
conbody.id = "console_body";
this.win.document.body.appendChild(condiv);
+ this.win.document.title = "xynt console";
}
}
-myconsole.prototype = {
+xynt_console.prototype = {
win: null,
div: null,
enable: false,
+ escapeHTML: function(s) {
+ var v = s+"";
+ return v.replace(/&/g,'&').
+ replace(/ /g,' ').
+ replace(/"/g,'"').
+ // replace(/'/g,''').
+ replace(/>/g,'>').
+ replace(/\n");
+ },
+
log: function(s) {
if (!this.enable) {
return;
}
- this.div.innerHTML += s + "
";
+ if (typeof(s) == "string" || typeof(s) == "function") {
+ this.div.innerHTML += this.escapeHTML(s);
+ }
+ else {
+ ind = 4;
+ this.dump_obj(s,ind);
+ }
+ this.div.innerHTML += "