diff --git a/Inquirer.js b/Inquirer.js index a833324..043e034 100644 --- a/Inquirer.js +++ b/Inquirer.js @@ -53,6 +53,9 @@ text: "Tools", items: [merger.ui.menuItem("tool_console", { text: "Console", + onClick: function () { + this.getApp().showConsole(); + } }) ] }), @@ -61,7 +64,7 @@ title: "Error", width: 400, height: 250, - visible:false, + visible: false, content: [merger.ui.picture("Iico", { src: bugico, top: 0, @@ -110,16 +113,127 @@ this.content.Lerror.setText(message); this.content.Tinfo.setText(JSON.stringify(data, null, 2)); } + }), merger.ui.window("Wconsole", { + title: "Console", + width: 500, + height: 350, + visible: false, + content: [ + merger.ui.html("Hconsole", { + top: 0, + left: 0, + width: 500, + height: 310, + style: { + overflow: "scroll", + }, + }), + merger.ui.textbox("Tinput", { + top: 315, + left: 0, + width: 500, + height: 35, + multiple: true, + style: { + whiteSpace: "pre", + fontFamily: "Lucida Console, Monospace", + border: "0", + overflow: "scroll", + background: "#EEE", + padding: "5px", + }, + onkeydown: function (e) { + if (e.keyCode == 13) { + this.getWindow().exec(this.getText()); + this.setText(""); + return false; + } + }, + }), + ], + onClose: function () { + this.hide(); + }, + log: function (type, object) { + var row = document.createElement("div"); + var head = document.createElement("div"); + var clear = document.createElement("div"); + var d = document.createElement("div"); + row.style.merge({ + margin: "0 0 0 13px", + }); + head.style.merge({ + fontFamily: "Lucida Console, Monospace", + fontWeight: "bold", + float: "left", + margin: "0 0 0 -13px", + width: "13px", + }); + d.style.merge({ + whiteSpace: "pre-wrap", + float: "right", + fontFamily: "Lucida Console, Monospace", + border: "0", + width: "100%", + }); + clear.style.merge({ + clear: "both", + }); + switch (type) { + case 'i': + d.innerText = object; + head.appendChild(document.createTextNode(">")); + head.style.color = "#88F"; + break; + case 'o': + d.innerText = object; + d.style.borderBottom = "1px solid #EEE"; + head.appendChild(document.createTextNode("<")); + head.style.color = "#DDD"; + break; + case 'e': + d.innerText = object; + head.appendChild(document.createTextNode("!")); + head.style.color = "#F88"; + d.style.background = "#FEE"; + head.style.background = "#FEE"; + break; + } + d.data = object; + row.appendChild(head); + row.appendChild(d); + row.appendChild(clear); + this.content.Hconsole.appendChild(row); + this.content.Hconsole.scrollTop = this.content.Hconsole.scrollHeight; + }, + exec: function (code) { + if (code == null || typeof code != "string" || code.length < 1) + return; + var err; + this.log('i', code); + try { + this.log('o', eval('(' + code + ')')); + } catch (err) { + this.log('e', err); + } + }, + setError: function (message, data) { + this.content.Lerror.setText(message); + this.content.Tinfo.setText(JSON.stringify(data, null, 2)); + } })], onLoad: function () { }, onAbout: function () { - alert("Pos claro"); + merger.dialogs.messageBox(this, "Inquirer ©2016-2017 XWolf Override.
Debugger application layer for web pages. Useful for embedded browser debugging", "About Inquirer", null, this.icon, 100); }, showError: function (message, data) { this.windows.Wmain.setError(message, data); this.windows.Wmain.show(); }, + showConsole: function () { + this.windows.Wconsole.show(); + }, log: function (info) { } diff --git a/Merger.js b/Merger.js index e4ff4b4..ba64f86 100644 --- a/Merger.js +++ b/Merger.js @@ -28,7 +28,7 @@ sys = { // Configuration _type: "system", icon: "data:image/gif;base64,R0lGODlhIAAgAOMAAP///zOZ/47N8FxqpgAAAMzM/7+/v9nu+QBjpAA9hP///////////////////////yH5BAEKAA8ALAAAAAAgACAAAATq8MlJH7k16y3JEQXGjZVXBGBIkKQpoEIqsuVRxHAsr3Rn6zndjuYCCo8F1ahoPCJDG2bTKbTxKNIpVWAbXH03atDZ9ZYKh49zXC0M3l/LKZA+Bthc99uMnd/rLzhBZXtxBH53dGpAKISFZ4mJCIpHjo99kQGTiWmdbgkJe3AGmJKZdwUPem+ghQavHX6bpyABoqyhBK+wh3ezpwGrtwMJurtymsCRwsPGpHK/ysyizhME0dLDo7DWBMqZ017HFQYX36jN4xrl3tnU6hzswMLVPfLLrtw9EvfB28/7KMhzUy9gBnYFDa6DtyECADs=", - ver: "0.3", + ver: "0.3b", color: { frame: "teal", //"orange" client: "white", @@ -1069,7 +1069,7 @@ var def = { modal: true, title: title, - width: icon ? 260 : 200, + width: icon ? 360 : 300, height: height || 75, content: [ ] @@ -1088,7 +1088,7 @@ html("htText", { top: 24, left: icon ? 60 : 0, - width: 200, + width: 300, html: text, }) ); diff --git a/MergerTester.js b/MergerTester.js index 5c56fa8..e0cecc1 100644 --- a/MergerTester.js +++ b/MergerTester.js @@ -112,6 +112,6 @@ onLoad: function () { }, onAbout: function () { - merger.dialogs.messageBox(this, "MergerTester (C)2017 XWolf Override.
Merger desktop is a framework that mimiks a classic desktop over a webpage.", "About merger", null, this.icon, 100); + merger.dialogs.messageBox(this, "MergerTester ©2017 XWolf Override.
Merger desktop is a framework that mimiks a classic desktop over a webpage, and allows development of desktop look and feel web applications. 🐉", "About merger", null, this.icon, 100); }, }); diff --git a/WebInquirer.html b/WebInquirer.html index 23577ce..36d6d31 100644 --- a/WebInquirer.html +++ b/WebInquirer.html @@ -1,8 +1,8 @@ - inquirer Tester +