Newer
Older
WebInquirer / inquirer.min.js
var merger=new function(){function t(){l.dsk||(l.dsk=document.createElement("div"),l.dsk.style.merge({position:"absolute",zIndex:510,top:0,left:0,width:"100%",height:"100%",fontFamily:"Verdana",fontSize:"10px",overflow:"hidden"}),l.bg=document.createElement("div"),l.bg.style.merge({backgroundColor:"gray",opacity:.3,position:"absolute",top:0,left:0,width:"100%",height:"100%"}),l.dsk.appendChild(l.bg),l.menu=document.createElement("div"),l.menu.style.merge({position:"absolute",zIndex:512,top:0,left:0,width:"100%",height:"21px",padding:"2px 9px 2px 9px",backgroundColor:"white",borderBottom:"1px solid black",boxSizing:"border-box"}),l.menu.sysMenu=document.createElement("img"),l.menu.sysMenu.style.width="16px",l.menu.sysMenu.style.height="16px",l.menu.sysMenu.src=d,l.menu.appendChild(l.menu.sysMenu),l.dsk.appendChild(l.menu)),document.body.contains(l.dsk)||document.body.appendChild(l.dsk)}function e(){document.body.contains(l.dsk)&&document.body.removeChild(l.dsk)}function o(t,e,o){o||(o=document.createElement("div")),o.setAttribute("id",t),o.setAttribute("name",t),o.style.position="absolute",o.setTop=function(t){e.top=t,this.style.top=t+"px"},o.setLeft=function(t){e.left=t,this.style.left=t+"px"},o.setWidth=function(t){e.width=t,this.style.width=t+"px"},o.setHeight=function(t){e.height=t,this.style.height=t+"px"},o.setVisible=function(t){this.style.display=t?"":"none"},o.setContent=function(t){for(var e=0;e<t.length;e++)this.appendChild(t[e])},o.setStyle=function(t){this.style.merge(t)};var n={};for(var i in e){var s=e[i];if("function"==typeof s)o[i]=e[i];else{var d="set"+i[0].toUpperCase()+i.substring(1),l=o[d];l&&"function"==typeof l&&(n[i]={f:l.bind(o),d:s})}}for(var i in n){var r=n[i];r.f(r.d)}return o}function n(t,e){void 0==e.top&&(e.top=(l.dsk.clientHeight-e.height)/2),void 0==e.left&&(e.left=(l.dsk.clientWidth-e.width)/2),e.content||(e.content=[]);var n,i=o("title",{visible:!e.hideTitle,style:{borderBottom:"1px solid black",textAlign:"center",height:"18px",boxSizing:"border-box",fontFamily:"Chicago, Verdana",fontSize:"12px",fontWeight:"bold",backgroundColor:"#F0F0F6",position:"relative",boxShadow:"0 0 1px #A5A5D6 inset",paddingTop:"1px"},content:[o("closeButton",{visible:!e.hideCloseButton,style:{top:"2px",left:"6px",width:"9px",height:"9px",border:"2px groove #EFEFEF",backgroundColor:"#DFDFEF",padding:0,boxSizing:"content-box"},onclick:function(){n.close()}},document.createElement("button"))],setTitle:function(t){this._textNode||(this._textNode=document.createTextNode(""),this.appendChild(this._textNode)),this._textNode.textContent=t}}),s=o("client",{content:e.content,style:{position:"relative"}});return e.content=[i,s],n=o(t,{setTitle:function(t){i.setTitle(t)},style:{backgroundColor:void 0==e.bg?"white":e.bg,border:"1px solid black",boxShadow:"1px 1px 0px rgba(0,0,0,0.5)",overflow:"hidden"},close:function(){var t=!0;this.onClose&&(t=this.onClose()),t&&this.setVisible(!1)}}.merge(e)),l.dsk.appendChild(n),l.w[t]=n,n}function i(t,e){var n=o(t,e);return n.style.border="1px solid red",n}function s(t){return l.w[t]}var d="data:image/gif;base64,R0lGODlhIAAgAOMAAP///zOZ/47N8FxqpgAAAMzM/7+/v9nu+QBjpAA9hP///////////////////////yH5BAEKAA8ALAAAAAAgACAAAATq8MlJH7k16y3JEQXGjZVXBGBIkKQpoEIqsuVRxHAsr3Rn6zndjuYCCo8F1ahoPCJDG2bTKbTxKNIpVWAbXH03atDZ9ZYKh49zXC0M3l/LKZA+Bthc99uMnd/rLzhBZXtxBH53dGpAKISFZ4mJCIpHjo99kQGTiWmdbgkJe3AGmJKZdwUPem+ghQavHX6bpyABoqyhBK+wh3ezpwGrtwMJurtymsCRwsPGpHK/ysyizhME0dLDo7DWBMqZ017HFQYX36jN4xrl3tnU6hzswMLVPfLLrtw9EvfB28/7KMhzUy9gBnYFDa6DtyECADs=";Object.prototype.merge||Object.defineProperty(Object.prototype,"merge",{writable:!0,value:function(t){if(void 0!=t)for(var e in t)this[e]=t[e];return this}});var l={w:{}};this.ui={},this.desktop=t,this.close=e,this.window=n,this.get=s,this.list=i,this.label=i,this.button=i};var inquirer=inquirer||new function(){function t(){jsTK.desktop();var t=jsTK.get("Werror");t||(t=jsTK.window("Werror",{title:"Error",width:400,height:200,content:[jsTK.label("Lerror",{top:30,left:10,text:"---"}),jsTK.list("Lerrors",{top:80,left:10,width:320,height:100}),jsTK.button("Bok",{top:80,left:10,width:320,height:100,text:"Ok",onClick:function(){}})]}))}function o(){jsTK.close()}function n(){h=window.onerror,window.onerror=function(t,o,n,r,e){i.bind(u)(t,{source:o,at:n+":"+r,error:e,raw:arguments})};var t=function(t){var o=[38,38,40,40,37,39,37,39,66,65],n=0;return function(i){i.keyCode==o[n]?n++:n=0,n==o.length&&t()}}(function(){this.show()}.bind(this));document.addEventListener("keydown",t,!1)}function i(o,n){this.autoShow&&t()}function r(){}function e(){}function s(){}var h,u=this;this.autoShow=!0,this.show=t,this.hide=o,this.hook=n,this.error=i,this.inspect=r,this.console=e,this.log=s,n()};