xynt-console enhanced to allow multiple instaces of it
[xynt.git] / web / xynt / xynt-console.js
index c4bf044..fcce3e6 100644 (file)
@@ -3,16 +3,24 @@ function xynt_console(ena) {
 
     this.enable = ena;
     if (ena) {
-        this.win = window.open("","xynt console","navigation=no,scrollbars=yes,height=500,width=800,left=0,top=800");
-        // titl = this.win.document.createElement("title");
-        // titl.innerHTML = "xynt console";
-        conbody = this.win.document.createElement("body");
-        this.div = condiv = this.win.document.createElement("div");
-
-        conbody.id = "console_body";
-        // this.win.document.head.appendChild(titl);
-        this.win.document.body.appendChild(condiv);
-        this.win.document.title = "xynt console";
+        this.win = window.open("","xyntconsole","scrollbars=yes,height=500,width=400,left=0,top=800");
+
+
+        conbody = this.win.document.getElementById("console_body");
+        if (!conbody) {
+            conbody = this.win.document.createElement("body");
+            conbody.id = "console_body";
+            this.win.document.title = "xynt console";
+        }
+        
+        condiv = this.win.document.getElementById("console_div");
+        if (!condiv) {
+            condiv = this.win.document.createElement("div");
+            condiv.id = "console_div";
+            this.win.document.body.appendChild(condiv);
+        }
+        this.div = condiv;
+
     }
 }
 
@@ -96,7 +104,7 @@ var console_enable = true;
 
 if(typeof(console) == "undefined") {
     var console;
-    
+
     console = new xynt_console(console_enable);
 
     is_xynt_console = true;