Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

samsung 2011 support added

  • Loading branch information...
commit 9bf4fd75e8ac5a6a83783fbe53addc59ea5a9b25 1 parent 31ce1eb
@nkashyap authored
View
2  dist/app/console.app.css
@@ -5,7 +5,7 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
code {
View
2  dist/app/console.app.js
@@ -5,7 +5,7 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
/**
View
2  dist/app/console.app.min.css
@@ -5,7 +5,7 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
View
2  dist/app/console.app.min.js
@@ -5,7 +5,7 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
"undefined"==typeof window.ConsoleIO&&(window.ConsoleIO={domReady:!1,namespace:function(a){var b,c=a.split("."),d=window,e=c.length;for(b=0;e>b;b++)d=d[c[b]]=d[c[b]]||{}},ready:function(a){function b(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",b,!1),a()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",b),a())}"complete"===document.readyState&&setTimeout(a,1),document.addEventListener?(document.addEventListener("DOMContentLoaded",b,!1),window.addEventListener("load",a,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",b),window.attachEvent("onload",a))},every:function(){return Array.prototype.every?function(a,b,c){return(a||[]).every(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length;if(e)do if(!b.call(c||a,a[d],d,a))return!1;while(++d<e);return!0}}(),forEach:function(){return Array.prototype.forEach?function(a,b,c){(a||[]).forEach(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length;if(e)do b.call(c||a,a[d],d,a);while(++d<e)}}(),queryParams:function(a){var b={};return a&&a.length>0&&(a=a.replace(/"/gim,""),a.indexOf("?")>-1?(a=a.split("?"),b.URL=a[0],a=a[1],this.forEach(a.split("&"),function(a){a=a.split("="),this[a[0]]=a[1]},b)):b.URL=a),b},cookieToJSON:function(a){var b={};return this.forEach(unescape(a).split("; "),function(a){a=a.split("="),this[a[0]]=a[1]},b),b},forEachProperty:function(a,b,c){var d;for(d in a)b.call(c||a,a[d],d,a)},toArray:function(a){return Array.prototype.slice.call(a)},isArray:Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},keys:Object.keys||function(a){var b,c=[],d=Object.prototype.hasOwnProperty;for(b in a)d.call(a,b)&&c.push(b);return c},extend:function(a,b){return this.forEachProperty(b,function(b,c){a[c]=b}),a},async:function(a,b){return setTimeout(function(){a.call(b)},4)},getUniqueId:function(){var a=1e5;return function(){return++a}}(),addCSSRule:function(a,b,c){var d=ConsoleIO.styleSheet;try{d.insertRule?d.insertRule(a+"{"+b+"}",c):d.addRule&&d.addRule(a,b,c)}catch(e){}},deleteCSSRule:function(a){var b=ConsoleIO.styleSheet,c=b.cssRules||b.rules;this.forEach(this.toArray(c),function(c,d){c.selectorText&&c.selectorText.replace("::",":")===a.replace("::",":")&&(b.deleteRule?b.deleteRule(d):b.removeRule&&b.removeRule(d))})}}),ConsoleIO.namespace("ConsoleIO.Service.Socket"),ConsoleIO.Service.Socket={io:null,name:null,guid:null,connectionMode:null,connect:function(){ConsoleIO.Service.Socket.guid=ConsoleIO.Service.Storage.getItem("guid"),ConsoleIO.Service.Socket.guid||(ConsoleIO.Service.Socket.guid=((new Date).getTime()+"-"+Math.random()).replace(".",""),ConsoleIO.Service.Storage.addItem("guid",ConsoleIO.Service.Socket.guid,365)),this.io=window.io.connect(window.location.origin,{secure:window.location.origin.indexOf("https")>-1,resource:(window.location.pathname.split("/").slice(0,-1).join("/")+"/socket.io").substring(1),"sync disconnect on unload":!0}),this.io.on("connect",this.onConnect),this.io.on("connecting",this.onConnecting),this.io.on("reconnect",this.onReconnect),this.io.on("disconnect",this.onDisconnect)},emit:function(a,b){this.io&&this.io.socket.connected&&this.io.emit("user:"+a,b||{})},on:function(a,b,c){this.io.on(a,function(){b.apply(c||this,arguments)})},off:function(a,b,c){this.io.removeListener(a,function(){b.apply(c||this,arguments)}),ConsoleIO.isArray(this.io.$events[a])||delete this.io.$events[a]},forceReconnect:function(){try{var a=ConsoleIO.Service.Socket;a.io.socket.disconnectSync(),a.io.socket.reconnect()}catch(b){console.warn(b)}},onConnect:function(){ConsoleIO.Service.Socket.emit("setUp")},onConnecting:function(a){ConsoleIO.Service.Socket.connectionMode=a},onReconnect:function(a){ConsoleIO.Service.Socket.connectionMode=a},onDisconnect:function(a){(!a||a&&"booted"!==a)&&ConsoleIO.Service.Socket.forceReconnect()}},ConsoleIO.namespace("ConsoleIO.Service.Storage"),ConsoleIO.Service.Storage={Store:{},addItem:function(a,b,c){if(b&&"undefined"!==b){var d="";if(c){var e=new Date;e.setTime(e.getTime()+1e3*60*60*24*c),d="; expires="+e.toGMTString()}document.cookie=a+"="+b+d+"; path=/",ConsoleIO.Service.Storage.Store[a]=b}},removeItem:function(a){this.addItem(a,"",-1),delete ConsoleIO.Service.Storage.Store[a]},getItem:function(a){return ConsoleIO.Service.Storage.Store[a]}},ConsoleIO.namespace("ConsoleIO.Service.DHTMLXHelper"),ConsoleIO.Service.DHTMLXHelper={populateToolbar:function(a,b){ConsoleIO.forEach(a,function(a,b){switch(a.type){case"button":this.addButton(a.id,b,a.text,a.imgEnabled,a.imgDisabled);break;case"separator":this.addSeparator("separator+"+b,b);break;case"twoState":this.addButtonTwoState(a.id,b,a.text,a.imgEnabled,a.imgDisabled),this.setItemState(a.id,!!a.pressed);break;case"select":"pagesizes"===a.opts&&(a.opts=[],ConsoleIO.forEach(ConsoleIO.Settings.pageSize.list,function(b){a.opts.push([a.id+"-"+b,"obj",b])}),a.selected=a.id+"-"+ConsoleIO.Settings.pageSize.active),this.addButtonSelect(a.id,b,a.text,a.opts,a.imgEnabled,a.imgDisabled),a.selected&&this.setListOptionSelected(a.id,a.selected);break;case"text":this.addText(a.id,b,a.text);break;case"input":this.addInput(a.id,b,a.value)}a.disabled&&this.disableItem(a.id),a.hidden&&this.hideItem(a.id),a.width&&this.setWidth(a.id,a.width),a.tooltip&&this.setItemToolTip(a.id,a.tooltip)},b)},elements:{},createElement:function(a){a.tag=a.tag||"div",this.elements[a.tag]||(this.elements[a.tag]=document.createElement(a.tag));var b=this.elements[a.tag].cloneNode(!1);return ConsoleIO.forEachProperty(a.attr,function(a,c){a&&b.setAttribute(c,a)}),ConsoleIO.forEachProperty(a.prop,function(a,c){a&&(b[c]=a)}),a.target&&(a.insert&&"top"===a.insert?a.target.insertBefore(b,a.target.firstElementChild||a.target.firstChild):a.target.appendChild(b)),b},stripBrackets:function(a){var b=a.length-1;return"["===a.charAt(0)&&"]"===a.charAt(b)?a.substring(1,b):a}},ConsoleIO.namespace("ConsoleIO.Model.DHTMLX"),ConsoleIO.Model.DHTMLX={ToolBarItem:{Separator:{type:"separator"},PageSize:{id:"pagesize",type:"select",text:"PageSize",imgEnabled:"pagesize.gif",tooltip:"Page Size",width:90,opts:"pagesizes"},Preview:{id:"preview",type:"button",text:"Preview",imgEnabled:"preview.gif",imgDisabled:"preview_dis.gif",tooltip:"Preview"},ScreenShot:{id:"screenShot",type:"button",text:"Capture",imgEnabled:"screenshot.png",imgDisabled:"screenshot_dis.png",tooltip:"ScreenShot"},DeviceNameLabel:{id:"deviceNameLabel",type:"text",text:"Device Name:",tooltip:"Device Name"},DeviceNameText:{id:"deviceNameText",type:"input",value:"",width:120,tooltip:"Enter Device Name"},DeviceNameSet:{id:"deviceNameSet",type:"button",imgEnabled:"go.png",tooltip:"Set Device Name"},SearchText:{id:"searchText",type:"input",value:"",width:100,tooltip:"Search Text"},Search:{id:"search",type:"button",imgEnabled:"search.gif",imgDisabled:"search_dis.gif",tooltip:"Search"},Execute:{id:"execute",type:"button",text:"Execute",imgEnabled:"execute.png",imgDisabled:"execute_dis.png",tooltip:"Execute (Ctrl+Enter)"},Clear:{id:"clear",type:"button",text:"Clear",imgEnabled:"clear.gif",tooltip:"Clear"},Refresh:{id:"refresh",type:"button",text:"Refresh",imgEnabled:"refresh.gif",tooltip:"Refresh"},Reload:{id:"reload",type:"button",text:"Reload",imgEnabled:"reload.png",tooltip:"Reload Browser"},Open:{id:"open",type:"select",text:"Open",imgEnabled:"open.gif",imgDisabled:"open_dis.gif",tooltip:"Open",opts:[]},Save:{id:"save",type:"select",text:"Save",imgEnabled:"save.gif",imgDisabled:"save_dis.gif",tooltip:"Save",disabled:!0,opts:[["saveAs","obj","Save As","save_as.gif"]]},Export:{id:"export",type:"button",text:"Export",imgEnabled:"downloads.gif",tooltip:"Export"},Undo:{id:"undo",type:"button",text:"Undo",imgEnabled:"undo.gif",imgDisabled:"undo_dis.gif",tooltip:"Undo",disabled:!0},Redo:{id:"redo",type:"button",text:"Redo",imgEnabled:"redo.gif",imgDisabled:"redo_dis.gif",tooltip:"Redo",disabled:!0},SelectAll:{id:"selectAll",type:"button",text:"Select All",imgEnabled:"select_all.gif",tooltip:"Select All"},Cut:{id:"cut",type:"button",text:"Cut",imgEnabled:"cut.gif",imgDisabled:"cut_dis.gif",tooltip:"Cut"},Copy:{id:"copy",type:"button",text:"Copy",imgEnabled:"copy.gif",imgDisabled:"copy_dis.gif",tooltip:"Copy"},Paste:{id:"paste",type:"button",text:"Paste",imgEnabled:"paste.gif",imgDisabled:"paste_dis.gif",tooltip:"Paste"},Profiler:{id:"profiler",type:"twoState",text:"Start Profiling",imgEnabled:"rec.png",imgDisabled:"rec_dis.png",tooltip:"Start CPU Profiling",pressed:!1},ProfileView:{id:"displaySelector",type:"select",text:"Tree (Top Down)",width:110,hidden:!0,disabled:!0,opts:[["heavy","obj","Heavy (Bottom Up)"],["tree","obj","Tree (Top Down)"]]},TimeOrPercent:{id:"timePercent",type:"twoState",imgEnabled:"percent.png",imgDisabled:"percent.png",tooltip:"Show total and self time in percentage",hidden:!0,disabled:!0,pressed:!1},FocusFn:{id:"focusFn",type:"button",imgEnabled:"zoom.png",imgDisabled:"zoom_dis.png",tooltip:"Focus selected function",hidden:!0,disabled:!0},RestoreFn:{id:"restoreFn",type:"button",imgEnabled:"undo.gif",imgDisabled:"undo_dis.gif",tooltip:"Restore all functions",hidden:!0,disabled:!0},ExcludeFn:{id:"excludeFn",type:"button",imgEnabled:"clear.gif",imgDisabled:"clear_dis.gif",tooltip:"Exclude selected function",hidden:!0,disabled:!0},Web:{id:"web",type:"twoState",text:"Web Console",imgEnabled:"console.gif",tooltip:"Web Console",pressed:!1},PlayPause:{id:"playPause",type:"twoState",text:"Pause",imgEnabled:"pause.png",tooltip:"Pause logs",pressed:!1},WordWrap:{id:"wordwrap",type:"twoState",text:"Word-Wrap",imgEnabled:"word_wrap.gif",tooltip:"Word Wrap",pressed:!1},Beautify:{id:"beautify",type:"twoState",text:"Beautify",imgEnabled:"beautify.png",tooltip:"Beautify",pressed:!1},FilterLabel:{id:"filterLabel",type:"text",text:"Filters:",tooltip:"Filter Console Logs"},Info:{id:"filter-info",type:"twoState",text:"Info",imgEnabled:"info.gif",tooltip:"Info",pressed:!1},Log:{id:"filter-log",type:"twoState",text:"Log",imgEnabled:"log.png",tooltip:"Log",pressed:!1},Warn:{id:"filter-warn",type:"twoState",text:"Warn",imgEnabled:"warn.png",tooltip:"Warn",pressed:!1},Debug:{id:"filter-debug",type:"twoState",text:"Debug",imgEnabled:"debug.gif",tooltip:"Debug",pressed:!1},Error:{id:"filter-error",type:"twoState",text:"Error",imgEnabled:"error.gif",tooltip:"Error",pressed:!1}}},ConsoleIO.namespace("ConsoleIO.View.App"),ConsoleIO.View.App=function(a,b){this.ctrl=a,this.model=b,this.layout=null,this.statusBar=null},ConsoleIO.View.App.prototype.render=function(){this.layout=new dhtmlXLayoutObject(this.model.target,this.model.type,ConsoleIO.Constant.THEMES.get("layout")),this.layout.cont.obj._offsetTop=5,this.layout.cont.obj._offsetLeft=5,this.layout.cont.obj._offsetHeight=-10,this.layout.cont.obj._offsetWidth=-10,this.layout.setSizes(),this.layout.setEffect("resize",!0),this.statusBar=this.layout.attachStatusBar(),this.statusBar.setText(this.model.status)},ConsoleIO.View.App.prototype.setTitle=function(a,b){this.layout&&(this.layout.cells(a).setText(b),this.layout.setCollapsedText(a,b))},ConsoleIO.View.App.prototype.getContextById=function(a){return this.layout?this.layout.cells(a):null},ConsoleIO.namespace("ConsoleIO.View.Device"),ConsoleIO.View.Device=function(a,b){this.ctrl=a,this.model=b,this.target=null,this.tabs=null},ConsoleIO.View.Device.prototype.render=function(a){this.target=a,this.tabs=this.target.attachTabbar(),this.tabs.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("tab")),this.tabs.attachEvent("onTabClick",function(a){this.onTabClick(a.split("-")[0].toLowerCase())},this.ctrl)},ConsoleIO.View.Device.prototype.destroy=function(){this.tabs.clearAll()},ConsoleIO.namespace("ConsoleIO.View.Browser"),ConsoleIO.View.Browser=function(a,b){this.ctrl=a,this.model=b,this.tree=null,this.target=null,this.toolbar=null},ConsoleIO.View.Browser.prototype.render=function(a){var b=this;this.target=a,this.target.setWidth(this.model.width),this.target.setHeight(this.model.height),this.toolbar=this.target.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar),this.tree=this.target.attachTree(),this.tree.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("tree")),this.tree.setIconPath(ConsoleIO.Settings.iconPath),this.tree.enableHighlighting(!0),this.tree.enableTreeImages(!0),this.tree.enableTreeLines(!0),this.tree.enableIEImageFix(!0),this.tree.attachEvent("onDblClick",function(a){b.tree.hasChildren(a)||b.ctrl.subscribe(a)}),this.tree.attachEvent("onOpenEnd",function(a,c){b.tree.hasChildren(a)&&this.openNode(a,c)},this.ctrl)},ConsoleIO.View.Browser.prototype.add=function(a,b,c,d){this.tree.getParentId(a)||(d?this.tree.insertNewItem(c,a,b,0,d,d,d):this.tree.insertNewItem(c,a,b))},ConsoleIO.View.Browser.prototype.addOrUpdate=function(a,b,c,d){this.tree.getParentId(a)&&this.tree.deleteItem(a),d?this.tree.insertNewItem(c,a,b,0,d,d,d):this.tree.insertNewItem(c,a,b)},ConsoleIO.View.Browser.prototype.deleteItem=function(a){this.tree.deleteItem(a)},ConsoleIO.View.Browser.prototype.closeItem=function(a,b){b?this.tree.closeAllItems(a):this.tree.closeItem(a)},ConsoleIO.View.Browser.prototype.setIcon=function(a,b){this.tree.setItemImage(a,b)},ConsoleIO.namespace("ConsoleIO.View.Device.Console"),ConsoleIO.View.Device.Console=function(a,b){this.ctrl=a,this.model=b,this.target=null,this.tab=null,this.toolbar=null,this.id=[this.model.name,this.model.serialNumber].join("-"),this.container=ConsoleIO.Service.DHTMLXHelper.createElement({attr:{id:"console-"+this.id}})},ConsoleIO.View.Device.Console.prototype.render=function(a){this.target=a,this.target.addTab(this.id,this.model.name),this.target.setContent(this.id,this.container),this.tab=this.target.cells(this.id),this.toolbar=this.tab.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.toolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),this.toolbar.attachEvent("onEnter",function(a,b){this.applySearch(b)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar)},ConsoleIO.View.Device.Console.prototype.destroy=function(){this.clear(),this.container.parentNode.removeChild(this.container),this.target.removeTab(this.id)},ConsoleIO.View.Device.Console.prototype.add=function(a){var b=this.getElementData(a);ConsoleIO.Service.DHTMLXHelper.createElement({tag:b.tag,attr:{"class":b.className},prop:{innerHTML:b.message},target:this.container,insert:"top"}),this.removeOverflowElement()},ConsoleIO.View.Device.Console.prototype.addBatch=function(a){if(a.length>0){var b=document.createDocumentFragment();ConsoleIO.forEach(a,function(a){var c=this.getElementData(a);ConsoleIO.Service.DHTMLXHelper.createElement({tag:c.tag,attr:{"class":c.className},prop:{innerHTML:c.message},target:b,insert:"bottom"})},this),this.container.insertBefore(b,this.container.firstElementChild||this.container.firstChild),this.removeOverflowElement()}},ConsoleIO.View.Device.Console.prototype.clear=function(){for(;this.container.firstChild;)this.container.removeChild(this.container.firstChild)},ConsoleIO.View.Device.Console.prototype.removeOverflowElement=function(){for(var a=this.container.childElementCount||this.container.children.length;a>ConsoleIO.Settings.pageSize.active;)this.container.removeChild(this.container.lastElementChild||this.container.lastChild),a--},ConsoleIO.View.Device.Console.prototype.setTabActive=function(){this.target.setTabActive(this.id)},ConsoleIO.View.Device.Console.prototype.setItemState=function(a,b){this.toolbar&&this.toolbar.setItemState(a,b)},ConsoleIO.View.Device.Console.prototype.setValue=function(a,b){this.toolbar&&this.toolbar.setValue(a,b)},ConsoleIO.View.Device.Console.prototype.getElementData=function(a){a.message=unescape(a.message);var b,c,d,e="code",f=a.type,g=a.origin,h=ConsoleIO.Service.DHTMLXHelper.stripBrackets(a.message);if("assert"===a.type){var i=ConsoleIO.Service.DHTMLXHelper.stripBrackets(h).split(",");"true"!==i[0].toLowerCase()&&(f="assert-failed")}if(h=h.replace(/%20/gim," "),h.indexOf("{")>-1&&h.indexOf("}")>-1&&(e="pre"),d=prettyPrintOne(h),a.stack){var j=a.stack.split(",").join("\n").replace(/"/gim,"").replace(/%20/gim," ");c=ConsoleIO.Service.DHTMLXHelper.stripBrackets(j),d+="\n"+prettyPrintOne(c)}return["assert","dir","dirxml","error","trace"].indexOf(a.type)>-1&&(e="pre"),g&&(g=a.origin.replace(/(\/|:|\.)/gim,""),b="content: 'iframe:"+a.origin+"'; position: absolute; top: 0px; right: 0px; padding: 2px 8px; "+"font-size: 12px; color: lightgrey; "+"background-color: rgba(0, 0, 0, 0.6); "+"font-family: Monaco,Menlo,Consolas,'Courier New',monospace;",ConsoleIO.deleteCSSRule("."+g+":before"),ConsoleIO.addCSSRule("."+g+":before",b)),{tag:e,className:"console type-"+f+(g?" "+g:""),message:d||"."}},ConsoleIO.View.Device.Console.prototype.getHTML=function(){return this.container.innerHTML},ConsoleIO.View.Device.Console.prototype.getValue=function(a){return this.toolbar.getValue(a)},ConsoleIO.namespace("ConsoleIO.View.Device.Explorer"),ConsoleIO.View.Device.Explorer=function(a,b){this.ctrl=a,this.model=b,this.tree=null,this.target=null,this.toolbar=null},ConsoleIO.View.Device.Explorer.prototype.render=function(a){var b=this;this.target=a,this.target.setWidth(this.model.width),this.toolbar=this.target.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar),this.tree=this.target.attachTree(),this.tree.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("tree")),this.tree.setIconPath(ConsoleIO.Settings.iconPath),this.tree.enableHighlighting(!0),this.tree.enableTreeImages(!0),this.tree.enableTreeLines(!0),this.tree.enableIEImageFix(!0),this.tree.attachEvent("onDblClick",function(a){b.tree.hasChildren(a)||this.onDblClick(a)},this.ctrl),this.tree.attachEvent("onOpenEnd",function(a,c){b.tree.hasChildren(a)&&this.onOpenEnd(a,c)},this.ctrl)},ConsoleIO.View.Device.Explorer.prototype.destroy=function(){this.tree.destructor()},ConsoleIO.View.Device.Explorer.prototype.add=function(a,b,c,d){d?this.tree.insertNewItem(c,a,b,0,d,d,d):this.tree.insertNewItem(c,a,b)},ConsoleIO.View.Device.Explorer.prototype.deleteItem=function(a){this.tree.deleteItem(a)},ConsoleIO.View.Device.Explorer.prototype.closeItem=function(a,b){b?this.tree.closeAllItems(a):this.tree.closeItem(a)},ConsoleIO.View.Device.Explorer.prototype.setIcon=function(a,b){this.tree.setItemImage(a,b)},ConsoleIO.namespace("ConsoleIO.View.Device.Preview"),ConsoleIO.View.Device.Preview=function(a,b){this.ctrl=a,this.model=b,this.target=null,this.toolbar=null,this.tab=null,this.dhxWins=null,this.previewFrame=null,this.image=null,this.id=[this.model.name,this.model.serialNumber].join("-")},ConsoleIO.View.Device.Preview.prototype.render=function(a){this.target=a,this.target.addTab(this.id,this.model.name),this.tab=this.target.cells(this.id),this.toolbar=this.tab.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.toolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar),this.previewFrame=ConsoleIO.Service.DHTMLXHelper.createElement({tag:"iframe",attr:{height:"100%",width:"100%"},target:document.body}),this.image=ConsoleIO.Service.DHTMLXHelper.createElement({tag:"img",target:document.body}),this.dhxWins=new dhtmlXWindows,this.dhxWins.enableAutoViewport(!0),this.dhxWins.attachViewportTo(document.body),this.dhxWins.setSkin(ConsoleIO.Constant.THEMES.get("win")),this.dhxWins.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("win"))},ConsoleIO.View.Device.Preview.prototype.destroy=function(){document.body.removeChild(this.previewFrame),document.body.removeChild(this.image),this.dhxWins.unload(),this.target.removeTab(this.id)},ConsoleIO.View.Device.Preview.prototype.toggleButton=function(a,b){this.toolbar&&(b?this.toolbar.enableItem(a):this.toolbar.disableItem(a))},ConsoleIO.View.Device.Preview.prototype.preview=function(a){if(this.dhxWins){this.previewFrame.src="data:text/html,"+escape(a.content);var b=this.dhxWins.createWindow("preview",0,0,900,700);b.setText("Preview"),b.button("park").hide(),b.keepInViewport(!0),b.setModal(!0),b.centerOnScreen(),b.button("close").attachEvent("onClick",function(){b.detachObject(this.previewFrame),b.close()},this),b.attachObject(this.previewFrame)}},ConsoleIO.View.Device.Preview.prototype.screenShot=function(a){if(this.dhxWins)if(a.screen){this.image.src=a.screen;var b=this.dhxWins.createWindow("screen",0,0,900,700);b.setText("Capture"),b.button("park").hide(),b.keepInViewport(!0),b.setModal(!0),b.centerOnScreen(),b.button("close").attachEvent("onClick",function(){b.detachObject(this.image),b.close()},this),b.attachObject(this.image)}else alert("Sorry!, Console.IO was unable to capture screen. Check console for more details.")},ConsoleIO.View.Device.Preview.prototype.setTabActive=function(){this.target.setTabActive(this.id)},ConsoleIO.View.Device.Preview.prototype.setItemState=function(a,b){if(this.toolbar){var c=ConsoleIO.Model.DHTMLX.ToolBarItem[a];c&&this.toolbar.setItemState(c.id,b)}},ConsoleIO.namespace("ConsoleIO.View.Device.Profile"),ConsoleIO.View.Device.Profile=function(a,b){this.ctrl=a,this.model=b,this.target=null,this.tab=null,this.toolbar=null,this.layout=null,this.listCell=null,this.list=null,this.treeCell=null,this.treeToolbar=null,this.tree=null,this.gridCell=null,this.grid=null,this.id=[this.model.name,this.model.serialNumber].join("-")},ConsoleIO.View.Device.Profile.prototype.render=function(a){this.target=a,this.target.addTab(this.id,this.model.name),this.tab=this.target.cells(this.id),this.toolbar=this.tab.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.toolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar),this.layout=this.tab.attachLayout("3W"),this.layout.setEffect("resize",!0),this.listCell=this.layout.cells(this.model.list.context),this.listCell.setText(this.model.list.title),this.listCell.setWidth(this.model.list.width),this.list=this.listCell.attachTree(),this.list.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("tree")),this.list.setIconPath(ConsoleIO.Settings.iconPath),this.list.enableHighlighting(!0),this.list.enableTreeImages(!0),this.list.enableTreeLines(!0),this.list.enableIEImageFix(!0),this.list.attachEvent("onClick",function(a){this.onListClick(a)},this.ctrl),this.treeCell=this.layout.cells(this.model.tree.context),this.treeCell.setText(this.model.tree.title),this.treeCell.setWidth(this.model.tree.width),this.treeToolbar=this.treeCell.attachToolbar(),this.treeToolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.treeToolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.treeToolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.tree.toolbar,this.treeToolbar),this.tree=this.treeCell.attachTree(),this.tree.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("tree")),this.tree.setIconPath(ConsoleIO.Settings.iconPath),this.tree.enableHighlighting(!0),this.tree.enableTreeImages(!0),this.tree.enableTreeLines(!0),this.tree.enableIEImageFix(!0),this.tree.attachEvent("onOpenEnd",function(a,b){return this.onTreeOpenEnd(a,b),!0},this.ctrl),this.gridCell=this.layout.cells(this.model.grid.context),this.gridCell.setText(this.model.grid.title),this.grid=this.gridCell.attachGrid(),this.grid.setIconsPath(ConsoleIO.Settings.iconPath),this.grid.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("grid")),this.grid.setHeader("Self,Total,Count,Function,Url"),this.grid.setInitWidthsP("10,10,10,50,20"),this.grid.setColAlign("right,right,right,left,right"),this.grid.setColTypes("ro,ro,ro,ro,ro"),this.grid.setColSorting("int,int,int,str,str"),this.grid.setSkin(ConsoleIO.Constant.THEMES.get("win")),this.grid.init()},ConsoleIO.View.Device.Profile.prototype.destroy=function(){this.target.removeTab(this.id)},ConsoleIO.View.Device.Profile.prototype.show=function(){this.target.showTab(this.id)},ConsoleIO.View.Device.Profile.prototype.hide=function(){this.target.hideTab(this.id,!0)},ConsoleIO.View.Device.Profile.prototype.addToList=function(a,b,c){this.list.insertNewItem(0,a,b,0,c,c,c)},ConsoleIO.View.Device.Profile.prototype.addTreeItem=function(a,b,c,d){this.tree.insertNewItem(a,b,c,0,d,d,d)},ConsoleIO.View.Device.Profile.prototype.addGridItem=function(a){this.grid.addRow(a.id,[a.selfTime,a.totalTime,a.numberOfCalls,a.functionName,a.url])},ConsoleIO.View.Device.Profile.prototype.closeItem=function(a,b){b?this.tree.closeAllItems(a):this.tree.closeItem(a)},ConsoleIO.View.Device.Profile.prototype.deleteListItem=function(a){this.list.deleteItem(a)},ConsoleIO.View.Device.Profile.prototype.resetTree=function(){this.tree.deleteItem(this.tree.getItemIdByIndex(0,0))},ConsoleIO.View.Device.Profile.prototype.resetGrid=function(){this.grid.clearAll()},ConsoleIO.View.Device.Profile.prototype.setTabActive=function(){this.target.setTabActive(this.id)},ConsoleIO.View.Device.Profile.prototype.setTitle=function(a){this.treeCell.setText([this.model.tree.title,a||""].join(": "))},ConsoleIO.View.Device.Profile.prototype.setItemText=function(a,b){if(this.toolbar){var c=ConsoleIO.Model.DHTMLX.ToolBarItem[a];c&&this.toolbar.setItemText(c.id,b||c.text)}},ConsoleIO.View.Device.Profile.prototype.showItem=function(a){if(this.treeToolbar){var b=ConsoleIO.Model.DHTMLX.ToolBarItem[a];b&&this.treeToolbar.showItem(b.id)}},ConsoleIO.View.Device.Profile.prototype.hideItem=function(a){if(this.treeToolbar){var b=ConsoleIO.Model.DHTMLX.ToolBarItem[a];b&&this.treeToolbar.hideItem(b.id)}},ConsoleIO.namespace("ConsoleIO.View.Device.Source"),ConsoleIO.View.Device.Source=function(a,b){this.ctrl=a,this.model=b,this.target=null,this.toolbar=null,this.layout=null,this.tab=null,this.id=[this.model.name,this.model.serialNumber].join("-")},ConsoleIO.View.Device.Source.prototype.render=function(a){this.target=a,this.target.addTab(this.id,this.model.name),this.tab=this.target.cells(this.id),this.layout=this.tab.attachLayout("2U"),this.toolbar=this.getContextById(this.ctrl.context.source).attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.toolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar)},ConsoleIO.View.Device.Source.prototype.destroy=function(){this.target.removeTab(this.id)},ConsoleIO.View.Device.Source.prototype.getContextById=function(a){return this.layout?this.layout.cells(a):null},ConsoleIO.View.Device.Source.prototype.setTabActive=function(){this.target.setTabActive(this.id)},ConsoleIO.View.Device.Source.prototype.setTitle=function(a,b){this.layout&&(this.layout.cells(a).setText(b),this.layout.setCollapsedText(a,b))},ConsoleIO.View.Device.Source.prototype.setItemState=function(a,b){if(this.toolbar){var c=ConsoleIO.Model.DHTMLX.ToolBarItem[a];c&&this.toolbar.setItemState(c.id,b)}},ConsoleIO.namespace("ConsoleIO.View.Device.Status"),ConsoleIO.View.Device.Status=function(a,b){this.ctrl=a,this.model=b,this.target=null,this.toolbar=null,this.tab=null,this.accordion=null,this.id=[this.model.name,this.model.serialNumber].join("-"),this.grids={}},ConsoleIO.View.Device.Status.prototype.render=function(a){this.target=a,this.target.addTab(this.id,this.model.name),this.tab=this.target.cells(this.id),this.toolbar=this.tab.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.toolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),this.accordion=this.tab.attachAccordion(),this.accordion.setIconsPath(ConsoleIO.Settings.iconPath),this.accordion.attachEvent("onActive",function(a){this.setActive(a.replace(this.view.id+"-",""))},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar)},ConsoleIO.View.Device.Status.prototype.destroy=function(){this.target.removeTab(this.id)},ConsoleIO.View.Device.Status.prototype.clear=function(){if(this.accordion){ConsoleIO.forEachProperty(this.grids,function(a){a.destructor()},this),this.grids={};var a=this;this.accordion.forEachItem(function(b){a.accordion.removeItem(b.getId())})}},ConsoleIO.View.Device.Status.prototype.open=function(a){var b=this.id+"-"+a;this.accordion.cells(b)&&this.accordion.cells(b).open()},ConsoleIO.View.Device.Status.prototype.addLabel=function(a){var b,c=this.id+"-"+a;this.accordion.cells(c)||(this.accordion.addItem(c,a),this.grids[a]=b=this.accordion.cells(c).attachGrid(),b.setIconsPath(ConsoleIO.Settings.iconPath),b.setImagePath(ConsoleIO.Constant.IMAGE_URL.get("grid")),b.setHeader("Name,Value"),b.setInitWidthsP("20,80"),b.setColAlign("right,left"),b.setColTypes("ro,ro"),b.setColSorting("str,str"),b.setSkin(ConsoleIO.Constant.THEMES.get("win")),b.init())},ConsoleIO.View.Device.Status.prototype.add=function(a,b,c){var d,e=this.grids[c];e&&("object"==typeof b?ConsoleIO.forEachProperty(b,function(b,c){d=this.getUniqueId(this.id,a),e.addRow(d,[a+"."+c,b]),e.setCellTextStyle(d,0,"font-weight:bold;")},this):(d=this.getUniqueId(this.id,a),e.addRow(d,[a,b]),e.setCellTextStyle(d,0,"font-weight:bold;")))},ConsoleIO.View.Device.Status.prototype.setTabActive=function(){this.target.setTabActive(this.id)},ConsoleIO.View.Device.Status.prototype.setItemState=function(a,b){this.toolbar&&this.toolbar.setItemState(a,b)},ConsoleIO.View.Device.Status.prototype.getUniqueId=function(){var a=0;return function(b,c){return[b,c,++a].join("-")}}(),ConsoleIO.View.Device.Status.prototype.getValue=function(a){return this.toolbar.getValue(a)},ConsoleIO.namespace("ConsoleIO.View.Editor"),ConsoleIO.View.Editor=function(a,b){this.ctrl=a,this.model=b,this.container=null,this.textArea=null,this.target=null,this.toolbar=null,this.createElements()},ConsoleIO.View.Editor.prototype.render=function(a){this.target=a,this.target.attachObject(this.container),this.model.toolbar&&(this.toolbar=this.target.attachToolbar(),this.toolbar.setIconsPath(ConsoleIO.Settings.iconPath),this.toolbar.attachEvent("onClick",function(a){this.onButtonClick(a)},this.ctrl),this.toolbar.attachEvent("onStateChange",function(a,b){this.onButtonClick(a,b)},this.ctrl),ConsoleIO.Service.DHTMLXHelper.populateToolbar(this.model.toolbar,this.toolbar))},ConsoleIO.View.Editor.prototype.destroy=function(){this.container.removeChild(this.textArea),this.container.parentNode.removeChild(this.container),this.toolbar&&this.toolbar.unload()},ConsoleIO.View.Editor.prototype.fileList=function(a){var b=this;this.toolbar.forEachListOption("open",function(a){b.toolbar.removeListOption("open",a)}),ConsoleIO.forEach(a,function(a,c){b.toolbar.addListOption("open","script-"+a,c,"button",a,ConsoleIO.Constant.ICONS.JAVASCRIPT)},this)},ConsoleIO.View.Editor.prototype.addScript=function(a){var b="script-"+a.name,c=this.toolbar.getAllListOptions("open").length;this.toolbar.removeListOption("open",b),this.toolbar.addListOption("open",b,c,"button",a.name,ConsoleIO.Constant.ICONS.JAVASCRIPT)},ConsoleIO.View.Editor.prototype.createElements=function(){this.container=ConsoleIO.Service.DHTMLXHelper.createElement({attr:{"class":"editor"},target:document.body}),this.textArea=ConsoleIO.Service.DHTMLXHelper.createElement({tag:"textarea",attr:{placeholder:this.model.placeholder},target:this.container})},ConsoleIO.View.Editor.prototype.toggleButton=function(a,b){this.toolbar&&(b?this.toolbar.enableItem(a):this.toolbar.disableItem(a))
View
7 dist/client/console.io.js
@@ -5,7 +5,7 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
var ConsoleIO = ("undefined" === typeof module ? {} : module.exports);
@@ -2576,8 +2576,8 @@ ConsoleIO.version = "0.2.2";
'prototype.trim': !!String.prototype.trim
},
"JSON": {
- 'parse': !!JSON.parse,
- 'stringify': !!JSON.stringify
+ 'parse': !!global.JSON && !!global.JSON.parse,
+ 'stringify': !!global.JSON && !!global.JSON.stringify
}
}
}
@@ -3132,6 +3132,7 @@ ConsoleIO.version = "0.2.2";
var styles = [
'background-color: rgba(244, 244, 244, 0.9)',
+ 'background-color: rgb(244, 244, 244)',
'color: black',
'z-index: 5000',
'overflow: auto',
View
6 dist/client/console.io.min.js
@@ -5,8 +5,8 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
-var ConsoleIO="undefined"==typeof module?{}:module.exports;ConsoleIO.version="0.2.2",function(){!function(a,b){var c=a.util={},d=!1,e=[];c.getScripts=function(){return c.toArray(document.scripts||document.getElementsByName("script"))},c.getStyles=function(){return c.toArray(document.getElementsByTagName("link"))},c.getFirstElement=function(a){return a?a.firstElementChild||a.firstChild:!1},c.getOrigin=function(){return b.location.origin||b.location.protocol+"//"+(b.location.host||b.location.hostname+":"+b.location.port)},c.getHashParams=function(){var a={},d=b.location.hash||b.location.href.replace(c.getOrigin()+b.location.pathname,"");return d&&c.forEach(d.split("#"),function(b){var c=b.split("=");a[c[0]]=c[1]}),a},c.getQueryParams=function(a){a=a||b.location.href;var d={},e=a.indexOf("?");return e>-1&&c.forEach(a.substring(e+1,a.length).split("&"),function(a){var b=a.split("=");d[b[0]]=b[1]}),d},c.queryParams=function(){var a={},b=c.getScripts();return c.every(b,function(b){var d=(b.src||b.getAttribute("src")||"").toLowerCase();if(-1===d.indexOf("console.io.js"))return!0;if(a.secure=d.indexOf("https")>-1,c.extend(a,c.getQueryParams(d)),!a.url){var e=new RegExp("^(?:f|ht)tp(?:s)?://([^/]+)","im"),f=d.indexOf("?"),g=f>-1?d.substring(0,f):d;a.url=(a.secure?"https://":"http://")+g.match(e)[1].toString()}return a.base||(a.base=d.indexOf("/console.io/")>-1?"console.io/":""),!1}),c.extend(a,c.getHashParams()),a},c.checkFile=function(a){var b=a.indexOf(".js")>-1,d=a.indexOf(".css")>-1,e=b?c.getScripts():d?c.getStyles():null,f=b?"src":d?"href":null,g=!1;return e&&c.every(e,function(b){var c=b.getAttribute(f)||"";return g=c.indexOf(a)>-1,!g}),g},c.removeFile=function(a){var b,d,e=a.indexOf(".js")>-1?"script":a.indexOf(".css")>-1?"link":null;e&&(d="script"===e?"src":"href",b=document.getElementsByTagName(e),c.forEach(c.toArray(b),function(b){var c=b.getAttribute(d)||"";c.indexOf(a)>-1&&b.parentNode.removeChild(b)}))},c.requireCSS=function(a,d){if(c.checkFile(a))return d&&setTimeout(function(){d(a)},10),!1;var e=document.styleSheets.length,f=document.createElement("link"),g=document.getElementsByTagName("head")[0];if(d)var h=b.setInterval(function(){document.styleSheets.length>e&&(d(a),b.clearInterval(h))},10);f.type="text/css",f.rel="stylesheet",f.media="all",f.href=a,g.appendChild(f)},c.requireScript=function(d,e){function f(){h.removeEventListener?(h.removeEventListener("load",f,!1),e(d)):h.attachEvent&&(b.opera||"complete"!==h.readyState&&"loaded"!==h.readyState||(h.detachEvent("onreadystatechange",f),e(d)))}function g(){j.web?a.console.exception(d,arguments):a.debug("failed to load "+d),h.removeEventListener("error",g,!1)}if(c.checkFile(d))return setTimeout(function(){e(d)},10),!1;var h=document.createElement("script"),i=document.getElementsByTagName("head")[0],j=a.getConfig();h.type="text/javascript",h.charset="utf-8",h.async=!0,b.opera||"complete"!==h.readyState&&"loaded"!==h.readyState||setTimeout(function(){e(d)},1),h.addEventListener?(h.addEventListener("load",f,!1),h.addEventListener("error",g,!1)):!h.attachEvent||h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0||b.opera||(h.onload=f,h.attachEvent("onreadystatechange",f)),h.src=d,i.appendChild(h)},c.ready=function(a){function f(){d=!0,c.forEach(e,function(a){a()}),e=[]}function g(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",g,!1),f()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",g),f())}return d?(setTimeout(a,1),!1):(e.push(a),e.length>1?!1:("complete"===document.readyState&&setTimeout(f,1),document.addEventListener?(document.addEventListener("DOMContentLoaded",g,!1),b.addEventListener("load",f,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",g),b.attachEvent("onload",f)),void 0))},c.require=function(a,b){function d(a){var c=!0;i[a]=!0;for(var d in i)i[d]||(c=!1);!g&&c&&(g=!0,b())}"string"==typeof a&&(a=[a]);var e,f,g=!1,h=a.length,i={};for(e=0;h>e;e++)f=a[e],i[f]=!1,f.indexOf(".css")>-1?c.requireCSS(f,d):c.requireScript(f,d)},c.addCSSRule=function(a,b,c,d){try{a.insertRule?a.insertRule(b+"{"+c+"}",d):a.addRule&&a.addRule(b,c,d)}catch(e){}},c.deleteCSSRule=function(a,b){var d=a.cssRules||a.rules;c.forEach(c.toArray(d),function(c,d){c.selectorText&&c.selectorText.replace("::",":")===b.replace("::",":")&&(a.deleteRule?a.deleteRule(d):a.removeRule&&a.removeRule(d))})},c.getAppliedStyles=function(a){var d=document.defaultView||b,e=[];if(d.getComputedStyle){var f=d.getComputedStyle(a,"");c.forEach(c.toArray(f),function(a){e.push(a+":"+f.getPropertyValue(a))})}else a.currentStyle?c.forEachProperty(a.currentStyle,function(a,b){e.push(b+":"+a)}):c.forEach(c.toArray(a.style),function(b){e.push(b+":"+a.style[b])});return e.join("; ")},c.getUrl=function(b){var c=a.getConfig(),d=c.url,e=d.length-1,f=c[b];return"/"===d.charAt(e)&&(d=d.substr(0,e)),d+=(c.base.length>0?"/"+c.base:"/")+f},c.getProfileUrl=function(a,b){return-1===b.indexOf(".js")?b:(-1===b.indexOf("http:")&&-1===b.indexOf("https:")&&(b=0===b.indexOf("/")?[location.origin,b].join("/"):[location.origin,location.pathname,b].join("/")),a+"?url="+b)},c.showInfo=function(b,d){var e="consoleio",f=d?"rgba(0, 130, 30, 0.8)":"rgba(0, 0, 0, 0.8)",g="content: 'Console.IO:"+b+"'; position: fixed; top: 0px; left: 0px; padding: 2px 8px; "+"font-size: 12px; font-weight: bold; color: lightgrey; "+"background-color: "+f+"; border: 1px solid rgb(0, 0, 0); "+"font-family: Monaco,Menlo,Consolas,'Courier New',monospace;";c.deleteCSSRule(a.styleSheet,"."+e+":after"),c.addCSSRule(a.styleSheet,"."+e+":after",g),document.body.setAttribute("class",e)},c.isIFrameChild=function(){return b.location!==b.parent.location},c.foundRequireJS=function(){return"undefined"!=typeof b.requirejs},c.foundDefine=function(){return"function"==typeof define&&define.amd},c.getType=function(a){return Object.prototype.toString.apply(a).replace("[object ","").replace("]","")},c.getFunctionName=function(a){var b;return a&&(b=a.getName instanceof Function?a.getName():a.name,b=b||a.toString().match(/function\s*([_$\w\d]*)/)[1]),b||"anonymous"},c.toArray=function(a){return Array.prototype.slice.call(a)},c.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},c.every=function(){return Array.prototype.every?function(a,b,c){return(a||[]).every(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length;if(e)do if(!b.call(c||a,a[d],d,a))return!1;while(++d<e);return!0}}(),c.filter=function(){return Array.prototype.filter?function(a,b,c){return(a||[]).filter(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length,f=[];if(e)do b.call(c||a,a[d],d,a)&&f.push(a[d]);while(++d<e);return f}}(),c.forEach=function(){return Array.prototype.forEach?function(a,b,c){(a||[]).forEach(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length;if(e)do b.call(c||a,a[d],d,a);while(++d<e)}}(),c.noop=function(){},c.asyncForEach=function(a,b,d,e){a=[].concat(a||[]),c.asyncIteration(a,b||c.noop,d||c.noop,e)},c.asyncIteration=function(a,b,d,e){a.length>0?setTimeout(function(){b.call(e||a,a.shift(),function(){c.asyncIteration(a,b,d,e)})},4):d.call(e)},c.forEachProperty=function(a,b,c){var d;for(d in a)b.call(c||a,a[d],d,a)},c.async=function(a,b){return setTimeout(function(){a.call(b)},4)},c.extend=function(a,b){return c.forEachProperty(b,function(b,c){a[c]=b}),a}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){var b=a.storage={},c={};a.util.ready(function(){var b,d,e,f,g=document.cookie.split("; "),h=g.length;for(b=0;h>b;b++)d=g[b].split("="),e=d[0],f=d[1],c[e]=f;a.util.forEachProperty(c,function(b,c){"serialNumber"===c&&(a.serialNumber=b),"deviceName"===c&&(a.name=b)})}),b.addItem=function(a,b,d){if(b&&"undefined"!==b){var e="";if(d){var f=new Date;f.setTime(f.getTime()+1e3*60*60*24*d),e="; expires="+f.toGMTString()}document.cookie=a+"="+b+e+"; path=/",c[a]=b}},b.removeItem=function(a){b.addItem(a,"",-1),delete c[a]},b.getItem=function(a){return c[a]}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){function b(){}a.EventEmitter=b,b.prototype.on=function(b,c){return this.$events||(this.$events={}),this.$events[b]?a.util.isArray(this.$events[b])?this.$events[b].push(c):this.$events[b]=[this.$events[b],c]:this.$events[b]=c,this},b.prototype.addListener=b.prototype.on,b.prototype.once=function(a,b){function c(){d.removeListener(a,c),b.apply(this,arguments)}var d=this;return c.listener=b,this.on(a,c),this},b.prototype.removeListener=function(b,c){if(this.$events&&this.$events[b]){var d=this.$events[b];if(a.util.isArray(d)){for(var e=-1,f=0,g=d.length;g>f;f++)if(d[f]===c||d[f].listener&&d[f].listener===c){e=f;break}if(0>e)return this;d.splice(e,1),d.length||delete this.$events[b]}else(d===c||d.listener&&d.listener===c)&&delete this.$events[b]}return this},b.prototype.removeAllListeners=function(a){return void 0===a?(this.$events={},this):(this.$events&&this.$events[a]&&(this.$events[a]=null),this)},b.prototype.listeners=function(b){return this.$events||(this.$events={}),this.$events[b]||(this.$events[b]=[]),a.util.isArray(this.$events[b])||(this.$events[b]=[this.$events[b]]),this.$events[b]},b.prototype.emit=function(b){if(!this.$events)return!1;var c=this.$events[b];if(!c)return!1;var d=Array.prototype.slice.call(arguments,1);if("function"==typeof c)c.apply(this,d);else{if(!a.util.isArray(c))return!1;for(var e=c.slice(),f=0,g=e.length;g>f;f++)e[f].apply(this,d)}return!0}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){var b=a.stringify={};b.objects=["Arguments","Array","String","Number","Boolean","Function","Object","Geoposition","Coordinates","CRuntimeObject"],b.events=["Event","KeyboardEvent","MouseEvent","TouchEvent","WheelEvent","UIEvent","CustomEvent","NotifyAudioAvailableEvent","CompositionEvent","CloseEvent","MessageEvent","MessageEvent","XMLHttpRequestProgressEvent","ProgressEvent"],b.errors=["Error","ErrorEvent","DOMException","PositionError"],b.parse=function(c,d,e){var f="",g=a.util.getType(c);if(e="undefined"==typeof e?!0:e,d=d||1,b.objects.indexOf(g)>-1||b.events.indexOf(g)>-1||b.errors.indexOf(g)>-1)switch(g){case"Error":case"ErrorEvent":c=c.message;case"String":f=b.parseString(c);break;case"Arguments":c=a.util.toArray(c);case"Array":f=b.parseArray(c,d);break;case"Number":f=String(c);break;case"Boolean":f=c?"true":"false";break;case"Function":f='"'+a.util.getFunctionName(c)+'"';break;default:f=b.parseObject(g,c,d)}else if(null===c)f='"null"';else if(void 0===c)f='"undefined"';else if(e)f=b.parseObject(g,c,d);else try{f=String(c)}catch(h){a.console.error(h)}return f},b.valueOf=function(c,d,e){var f=a.util.getType(c);return(b.objects.indexOf(f)>-1||b.events.indexOf(f)>-1||b.errors.indexOf(f)>-1)&&!d?this.parse(c,e):("Function"===f?f="[Function "+a.util.getFunctionName(c)+"]":c&&c.constructor&&c.constructor.name&&(f="[object "+c.constructor.name+"]"),f)},b.parseString=function(a){return'"'+a.replace(/"/g,"'").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'},b.parseArray=function(c,d){var e,f=[];return a.util.forEach(c,function(a,c){this[c]=b.valueOf(a,!1,d)},f),e=f.length>0?"[ "+f.join(", ")+" ]":"[ "+c.toString()+" ]"},b.parseObject=function(c,d,e){var f,g="",h="[object global]"===c,i=new Array(e).join(" "),j=new Array(++e).join(" "),k=[];return d&&d.constructor&&(g=d.constructor.name),a.util.forEachProperty(d,function(a,c){this.push(j+'"'+c+'": '+b.valueOf(a,h,e))},k),f=k.length>0?(g||c)+": {\n"+k.join(",\n")+"\n"+i+"}":d.toString()+"\n"}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){function b(a){for(var c=[],d=Array.prototype.slice,e=0;e<a.length;++e){var f=a[e];void 0===f?c[e]="undefined":null===f?c[e]="null":f.constructor&&(f.constructor===Array?c[e]=f.length<3?"["+b(f)+"]":"["+b(d.call(f,0,1))+"..."+b(d.call(f,-1))+"]":f.constructor===Object?c[e]="#object":f.constructor===Function?c[e]="#function":f.constructor===String?c[e]='"'+f+'"':f.constructor===Number&&(c[e]=f))}return c.join(",")}var c=a.formatter={};c.chrome=function(a){var b=(a.stack+"\n").replace(/^\S[^\(]+?[\n$]/gm,"").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}()@$1$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}()@$1").split("\n");return b.pop(),b},c.safari=function(a){return a.stack.replace(/\[native code\]\n/m,"").replace(/^(?=\w+Error\:).*$\n/m,"").replace(/^@/gm,"{anonymous}()@").split("\n")},c.ie=function(a){var b=/^.*at (\w+) \(([^\)]+)\)$/gm;return a.stack.replace(/at Anonymous function /gm,"{anonymous}()@").replace(/^(?=\w+Error\:).*$\n/m,"").replace(b,"$1@$2").split("\n")},c.firefox=function(a){return a.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^[\(@]/gm,"{anonymous}()@").split("\n")},c.opera11=function(a){for(var b="{anonymous}",c=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/,d=a.stacktrace.split("\n"),e=[],f=0,g=d.length;g>f;f+=2){var h=c.exec(d[f]);if(h){var i=h[4]+":"+h[1]+":"+h[2],j=h[3]||"global code";j=j.replace(/<anonymous function: (\S+)>/,"$1").replace(/<anonymous function>/,b),e.push(j+"@"+i+" -- "+d[f+1].replace(/^\s+/,""))}}return e},c.opera10b=function(a){for(var b=/^(.*)@(.+):(\d+)$/,c=a.stacktrace.split("\n"),d=[],e=0,f=c.length;f>e;e++){var g=b.exec(c[e]);if(g){var h=g[1]?g[1]+"()":"global code";d.push(h+"@"+g[2]+":"+g[3])}}return d},c.opera10a=function(a){for(var b="{anonymous}",c=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,d=a.stacktrace.split("\n"),e=[],f=0,g=d.length;g>f;f+=2){var h=c.exec(d[f]);if(h){var i=h[3]||b;e.push(i+"()@"+h[2]+":"+h[1]+" -- "+d[f+1].replace(/^\s+/,""))}}return e},c.opera9=function(a){for(var b="{anonymous}",c=/Line (\d+).*script (?:in )?(\S+)/i,d=a.message.split("\n"),e=[],f=2,g=d.length;g>f;f+=2){var h=c.exec(d[f]);h&&e.push(b+"()@"+h[2]+":"+h[1]+" -- "+d[f+1].replace(/^\s+/,""))}return e},c.other=function(a){for(var c,d,e="{anonymous}",f=/function\s*([\w\-$]+)?\s*\(/i,g=[],h=10;a&&a.arguments&&g.length<h;)c=f.test(a.toString())?RegExp.$1||e:e,d=Array.prototype.slice.call(a.arguments||[]),g[g.length]=c+"("+b(d)+")",a=a.caller;return g}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){function b(){try{void 0()}catch(a){return a}}function c(b){return b.arguments&&b.stack?a.formatter.chrome:b.stack&&b.sourceURL?a.formatter.safari:b.stack&&b.number?a.formatter.ie:"string"==typeof b.message&&"undefined"!=typeof window&&window.opera?b.stacktrace?b.message.indexOf("\n")>-1&&b.message.split("\n").length>b.stacktrace.split("\n").length?a.formatter.opera9:b.stack?b.stacktrace.indexOf("called from line")<0?a.formatter.opera10b:a.formatter.opera11:a.formatter.opera10a:a.formatter.opera9:b.stack?a.formatter.firefox:"other"}var d=a.stacktrace={};d.allowedErrorStackLookUp=["Error","ErrorEvent","DOMException","PositionError"],d.get=function(e){e=e||b();var f=c(e);if("function"==typeof f)return f(e);var g=a.util.getType(e);return-1===d.allowedErrorStackLookUp.indexOf(g)?g+' is missing from "stacktrace.allowedErrorStackLookUp['+d.allowedErrorStackLookUp.join(",")+']";':a.formatter.other(arguments.callee)}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(a){var b=a.data;m.emit(b.event,{type:b.type,message:b.message,stack:b.stack,origin:a.origin})}function d(){m.emit("setUp",a.client.getConfig()),a.console.log("Connected to the Server",arguments)}function e(b){m.connectionMode=b,m.showInfoBar("connecting",!1),a.console.log("Connecting to the Server",b)}function f(b,c){m.connectionMode=b,m.emit("online",a.client.getConfig()),a.console.log("Reconnected to the Server after "+c+" attempts.",b,c)}function g(){m.showInfoBar("reconnecting",!1),a.console.log("Reconnecting to the Server",arguments)}function h(b){m.showInfoBar("disconnect",!1),a.console.log("Disconnected from the Server",b),(!b||b&&"booted"!==b)&&m.forceReconnect()}function i(){m.showInfoBar("connection failed",!1),a.console.warn("Failed to connect to the Server",arguments)}function j(){m.showInfoBar("reconnection failed",!1),a.console.warn("Failed to reconnect to the Server",arguments)}function k(b){m.showInfoBar("connection error",!1),a.console.warn("Socket Error",b)}var l,m=a.transport={},n=[],o=[];m.connectionMode="",m.setUp=function(){!function(a){if(a.Transport["jsonp-polling"]){var b=a.Transport["jsonp-polling"].prototype.post;a.Transport["jsonp-polling"].prototype.requestQueue=[],a.Transport["jsonp-polling"].prototype.isProcessingQueue=!1,a.Transport["jsonp-polling"].prototype.hasOutstandingRequests=!1,a.Transport["jsonp-polling"].prototype.postRequest=function(){var a=this;this.isProcessingQueue=!0,setTimeout(function(){b.call(a,a.requestQueue.shift())},10)},a.Transport["jsonp-polling"].prototype.completePostRequest=function(){var a=this;setTimeout(function(){a.socket.setBuffer(!1),a.hasOutstandingRequests=a.requestQueue.length>0,a.isProcessingQueue=!1,a.processPendingRequests()},250)},a.Transport["jsonp-polling"].prototype.processPendingRequests=function(){this.hasOutstandingRequests&&!this.isProcessingQueue&&(this.postRequest(),this.completePostRequest())},a.Transport["jsonp-polling"].prototype.post=function(a){this.requestQueue.push(a),this.hasOutstandingRequests=!0,this.processPendingRequests()}}}(b.io),l=a.getConfig(),m.io=a.io.connect(l.url,{secure:l.secure,resource:l.base+"socket.io","sync disconnect on unload":!0}),a.console.on("console",function(a){m.emit("console",{type:a.type,message:escape(a.message),stack:a.stack})}),b.addEventListener?b.addEventListener("message",c,!1):b.attachEvent&&b.attachEvent("onmessage",c),m.io.on("connect",d),m.io.on("connecting",e),m.io.on("reconnect",f),m.io.on("reconnecting",g),m.io.on("disconnect",h),m.io.on("connect_failed",i),m.io.on("reconnect_failed",j),m.io.on("error",k),a.util.forEach(o,function(a){m.on(a.name,a.callback,a.scope)}),o=[]},m.emit=function(a,b){return m.isConnected()?(m.io.emit("device:"+a,b||{}),!0):(n.push({name:a,data:b}),!1)},m.on=function(a,b,c){m.io?m.io.on(a,function(){b.apply(c||this,arguments)}):o.push({name:a,callback:b,scope:c})},m.isConnected=function(){return m.io&&m.io.socket?m.io.socket.connected:!1},m.forceReconnect=function(){try{m.io.socket.disconnectSync(),m.io.socket.reconnect()}catch(b){a.console.error(b)}},m.showInfoBar=function(b,c){var d=a.getConfig(),e=[];a.name&&e.push(a.name),a.serialNumber&&e.push(a.serialNumber),d.secure&&e.push("secure"),d.web&&e.push("web"),d.url&&e.push(d.url),d.base&&e.push(d.base),e.push(b),e.push(c?"online":"offline"),a.util.showInfo(e.join("|"),c)},m.clearPendingQueue=function(){var b=[];a.util.forEach(n,function(a){var c=m.emit(a.name,a.data);c||b.push(a)}),n=b}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(){function c(b){"report"===b.data.type?a.transport.emit("profile",b.data.report):a.console.log(b.data)}function d(b){a.console.error(b)}var h=e.worker=new b.Worker(a.util.getUrl("profileWorker"));h.addEventListener("message",c,!1),h.addEventListener("error",d,!1),e.begin=function(b,c,d,f){if(!f){var g=a.util.getType(c[0]).toLowerCase().indexOf("event")>-1;g&&!c[0].__profiled&&(f=g,c[0].__profiled=!0)}e.enabled&&h.postMessage({type:"begin",callId:b,time:d,reset:f})},e.end=function(a,b){e.enabled&&h.postMessage({type:"end",callId:a,time:b})},e.start=function(a){return a=a||g(),e.enabled=!0,e.store.push(a),h.postMessage({type:"start",title:a}),a},e.finish=function(a){a||(a=e.store.pop());var b=e.store.indexOf(a);return b>-1&&e.store.splice(b,1),e.enabled=e.store.length>0,h.postMessage({type:"finish",title:a}),a},e.clear=function(){e.enabled=!1,e.store=[],h.postMessage({type:"clear"})},e.load=function(a,b){h.postMessage({type:"load",file:a,table:b})},a.util.forEachProperty(f,function(a,b){e.load(b,a)}),b.__pd=e.load,b.__pb=e.begin,b.__pe=e.end}function d(){function c(a,b){var c=k[a]||["root",0,""];this.id=m(),this.functionName=c[0],this.lineNumber=c[1],this.url=c[2],this.callUID=a,this.startTime=b,this.totalTime=0,this.selfTime=0,this.numberOfCalls=1,this.visible=!0,this.children=[]}function d(a){this.title=a||g(),this.uid=e.store.length+1,this.head=new c(this.uid,Date.now()),this.active=!0,this.depth=0}function h(){return a.util.filter(e.store,function(a){return!!a.active})}function i(){var b;return a.util.every(e.store.reverse(),function(a){return a.active?(b=a,!1):!0}),b}function j(b){var c;return a.util.every(e.store,function(a){return a.active&&a.title===b?(c=a,!1):!0}),c}var k={},l={},m=function(){var a=0;return function(){return++a}}();c.prototype.finish=function(b){this.adjustTime(Date.now()),a.util.async(b)},c.prototype.getNodeByCallerId=function(b){var c;return a.util.every(this.children,function(a){return a.callUID===b?(c=a,!1):!0}),c},c.prototype.getActiveNode=function(){var a=this.children.length;return a>0?this.children[a-1]:null},c.prototype.adjustTime=function(a){if(this.totalTime=a-this.startTime,this.children.length>0){var b=0;util.forEach(this.children,function(a){b+=a.totalTime},this),b>this.totalTime&&(this.totalTime=b),this.selfTime=Math.abs(this.totalTime-b)}else this.selfTime=this.totalTime},c.prototype.begin=function(a,b){var d=this.getNodeByCallerId(a);d?++d.numberOfCalls:(d=new c(a,b),this.children.push(d))},c.prototype.end=function(a,b){var c=this.getNodeByCallerId(a);return c?(c.adjustTime(b),!0):!1},d.prototype.finish=function(a){delete this.active,delete this.depth,this.head.finish(a)},d.prototype.getActiveNode=function(a){var b=0,c=this.head;if(a="undefined"==typeof a?this.depth:a,a>0)do c=c.getActiveNode();while(a>++b);return c},d.prototype.begin=function(a,b,c){c&&(this.depth=0),l[a]||(l[a]=[]),l[a].push(this.depth),this.getActiveNode().begin(a,b),this.depth++},d.prototype.end=function(b,c){if(this.depth--,l[b]){var d=this.getActiveNode(l[b].pop());d.end(b,c)||a.console.log(b+" failed to find node.")}else a.console.log(b+" depth index not mapped.")},e.begin=function(b,c,d,f){if(e.enabled){if(!f){var g=a.util.getType(c[0]).toLowerCase().indexOf("event")>-1;g&&!c[0].__profiled&&(f=g,c[0].__profiled=!0)}a.util.forEach(h(),function(a){a.begin(b,d,f)})}},e.end=function(b,c){e.enabled&&a.util.forEach(h(),function(a){a.end(b,c)})},e.start=function(a){var b=new d(a);return e.store.push(b),e.enabled=!0,b.title},e.finish=function(b){var c;return b&&(c=j(b)),c||(c=i()),e.enabled=h().length>1,c?(c.finish(function(){a.transport.emit("profile",c)}),c.title):void 0},e.clear=function(){e.enabled=!1,e.store=[]},e.load=function(b,c){a.util.forEachProperty(c,function(a){a.push(b)}),a.util.extend(k,c)},a.util.forEachProperty(f,function(a,b){e.load(b,a)}),b.__pd=e.load,b.__pb=e.begin,b.__pe=e.end}var e=a.profiler={},f={},g=function(){var a=0;return function(){return["Profile",++a].join(" ")}}();b.__pb=b.__pe=a.util.noop,b.__pd=function(a,b){f[a]=b},e.enabled=!1,e.store=[],e.setUp=function(){b.Worker?c():d()}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(b,c,g,h){e&&a.getConfig().nativeConsole&&e[b]&&(f.indexOf(b)>-1?e[b](c):e[b].apply(e,c)),c&&c.hasOwnProperty("length")&&c.length>0&&(c=a.util.toArray(c)),d.emit("console",{type:b,message:g||a.stringify.parse(c),stack:h?a.stringify.parse(h):""})}var d=a.console=new a.EventEmitter,e=b.console,f=["dir","dirxml"],g={},h={};d._native=e,d.assert=function(b){if(b)c("assert",arguments);else{var d=["Assertion failed:"];d=d.concat(a.util.toArray(arguments).slice(1)),c("assert",arguments,a.stringify.parse(d),a.stacktrace.get())}},d.count=function(a){var b=a||"_GLOBAL_",d=g[b];d?++d.count:g[b]=d={key:a||"",count:1},c("count",arguments,(a||"")+": "+d.count)},d.time=function(a,b){if(!a)return!1;var d="KEY"+a.toString();return!b&&h[d]?!1:(h[d]=(new Date).getTime(),c("time",arguments),void 0)},d.timeEnd=function(a){if(!a)return!1;var b="KEY"+a.toString(),d=h[b];d&&(delete h[b],c("timeEnd",arguments,a+": "+((new Date).getTime()-d)+"ms"))},d.debug=function(){c("debug",arguments)},d.warn=function(){c("warn",arguments)},d.info=function(){c("info",arguments)},d.log=function(){c("log",arguments)},d.dir=function(a){c("dir",a)},d.dirxml=function(b){var d,e=b.nodeType;9===e&&(b=b.documentElement),d=b?b.outerHTML||b.innerHTML||b.toString()||a.stringify.parse(b):null,d&&(d=d.replace(/</gim,"&lt;"),d=d.replace(/>/gim,"&gt;")),c("dirxml",b,d)},d.group=function(){c("group",arguments)},d.groupCollapsed=function(){c("groupCollapsed",arguments)},d.groupEnd=function(){c("groupEnd")},d.markTimeline=function(){c("markTimeline",arguments)},d.timeStamp=function(){c("timeStamp",arguments)},d.profile=function(b){c("profile",arguments,'Profile "'+a.profiler.start(b)+'" started.')},d.profileEnd=function(b){b=a.profiler.finish(b),b&&c("profileEnd",arguments,'Profile "'+b+'" finished.')},d.error=function(b){c("error",arguments,null,a.stacktrace.get(b))},d.exception=function(){c("error",arguments)},d.trace=function(){c("trace",arguments,null,a.stacktrace.get())},d.clear=function(){g={},h={},c("clear",arguments)},d.command=function(){c("command",arguments)},b.console=d}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(b,c,d){a.name||(a.name=b.name,a.storage.addItem("deviceName",b.name,365)),b.serialNumber===a.serialNumber&&a.transport.showInfoBar(c,d)}function d(){return Function.prototype.bind?!1:(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e},void 0)}function e(){var b=[],c=new RegExp("((http|https)://)?([^/]+)","img");return a.util.forEach(a.util.toArray(document.styleSheets),function(d){try{var e=d.cssRules||d.rules,f=d.href.match(c);f.pop(),e&&a.util.forEach(a.util.toArray(e),function(a){var c=a.cssText,d=f.concat();c&&(c.indexOf("../")>-1&&(d.pop(),c=c.replace("..",d.join("/"))),b.push(c))})}catch(g){}}),b.join(" ")}function f(b,c){return b=b||document.body,c=c||b.cloneNode(!0),a.util.forEach(a.util.toArray(b.children),function(a,b){f(a,c.children[b])}),c.setAttribute("style","none"!==b.style.display?a.util.getAppliedStyles(b):"display:none;"),c}function g(){var a;if(b.XMLHttpRequest){a=new XMLHttpRequest;try{a.withCredentials=!1}catch(c){}}else b.XDomainRequest?a=new XDomainRequest:b.ActiveXObject&&(a=new ActiveXObject("Microsoft.XMLHTTP"));return a}function h(b){b&&a.web.setConfig(b)}function i(b){"undefined"!=typeof b.enabled&&(b.enabled?a.web.enabled():a.web.disabled()),h(b.config)}function j(b){var c;try{return c=new Function([],"return "+b),c()}catch(d){a.console.error(d,c&&c.toString?c.toString():void 0)}}function k(c){var d,e;if(c&&(d=j(c)))for(e in d)d.hasOwnProperty(e)&&!C[e]&&(C[e]=d[e]);C.configure&&C.configure(a,b)}function l(b,c){for(var d=c.content,e=d.length,f=a.getConfig(),g=0;e>g;)m(b,c,d.substr(g,f.maxDataPacketSize),g,e),0===g?g=f.maxDataPacketSize:g+=f.maxDataPacketSize}function m(b,c,d,e,f){var g=function(a,b,c,d,e,f){return function(){var g=a.util.extend({},c);g.content=d,g.start=e,g.length=f,a.transport.emit(b,g)}}(a,b,c,d,e,f);setTimeout(g,100)}function n(b){c(b,"registration"),k(b.client),a.console.log("Registration",a.name)}function o(b){c(b,"ready"),i(b.web),C.configure||k(b.client),a.console.log("Ready",a.name)}function p(b){b.serialNumber===a.serialNumber&&(c(b,"online",!0),i(b.web),C.configure||k(b.client),a.transport.clearPendingQueue(),a.console.log("Online",a.name))}function q(b){b.serialNumber===a.serialNumber&&(c(b,"offline"),a.console.log("Offline",a.name))}function r(b){b.serialNumber===a.serialNumber&&(c(b,"client disconnect"),a.console.log("client disconnected",a.serialNumber),a.transport.forceReconnect())}function s(b){b.name||a.storage.removeItem("deviceName"),a.name=b.name,a.storage.addItem("deviceName",a.name,365),a.transport.showInfoBar("new name",!0)}function t(b){try{var c=g(),d=a.util.getUrl("proxy"),e=b.originalURL||b.url;c?(c.open("GET",b.url,!0),c.onreadystatechange=function(){if(4===c.readyState){var a;a=200===c.status?c.responseText:c.statusText,l("source",{url:e,content:a})}},c.onloadend=function(b){a.console.info("file:onLoadEnd",b)},c.onloadstart=function(b){a.console.info("file:onLoadStart",b)},c.onprogress=function(b){a.console.info("file:onProgress",b)},c.onload=function(b){a.console.info("file:onLoad",b)},c.onerror=function(c){-1===b.url.indexOf(d)?(b.originalURL=b.url,b.url=d+"?url="+encodeURIComponent(b.url),t(b)):(a.console.exception("file:onError",c),a.transport.emit("source",{url:e,content:"XMLHttpRequest Error: Possibally Access-Control-Allow-Origin security issue."}))},c.send(null)):a.transport.emit("source",{url:e,content:"XMLHttpRequest request not supported by the browser."})}catch(f){a.console.error(f)}}function u(){a.console.log("Reloading..."),b.setTimeout(function(a){return function(){b.location.reload?b.location.reload(!0):b.location.assign(a)}}(location.href),100)}function v(){a.web.hide(),l("content",{content:document.documentElement.innerHTML}),a.web.show()}function w(){a.web.hide(),a.transport.emit("previewContent",{content:'<html><head><style type="text/css">'+e()+"</style></head>"+f().outerHTML+"</html>"}),a.web.show()}function x(){d(),a.util.requireScript(a.util.getUrl("html2canvas"),function(){a.web.hide(),b.html2canvas(document.body,{completed:!1,logging:!0,useCORS:!0,proxy:a.util.getUrl("proxy"),onrendered:function(b){if(!this.completed)try{this.completed=!0,a.transport.emit("screenShot",{screen:b.toDataURL()})}catch(c){a.transport.emit("screenShot",{screen:!1}),a.console.exception(c)}a.web.show()}})})}function y(){var b=[],c=[],d=a.util.getOrigin();a.util.forEach(a.util.getScripts(),function(a){a.src&&b.push(a.src.replace(d,""))}),b.length>0&&a.transport.emit("files",{type:"javascript",files:b}),a.util.forEach(a.util.getStyles(),function(a){a.href&&c.push(a.href.replace(d,""))}),c.length>0&&a.transport.emit("files",{type:"style",files:c})}function z(b){b.state?a.console.profile():a.console.profileEnd()}function A(b){a.console.info("executing...");var c=j(b);"undefined"!=typeof c&&a.console.command(c)}function B(a){for(var b,c=0,d={},e=a.length;e>c;)b=a.key(c++),b&&(d[b]=a.getItem(b));return d}var C=a.client={};C.getMore=function(){var c=[{supports:{WebWorker:!!b.Worker,WebSocket:!!b.WebSocket,Storage:!!b.Storage,LocalStorage:!!b.localStorage,SessionStorage:!!b.sessionStorage,IDBFactory:!!b.IDBFactory,ApplicationCache:!!b.applicationCache,Console:!!a.console._native,Object:{create:!!Object.create,keys:!!Object.keys,getPrototypeOf:!!Object.getPrototypeOf,defineProperty:!!Object.defineProperty,defineProperties:!!Object.defineProperties,getOwnPropertyDescriptor:!!Object.getOwnPropertyDescriptor,preventExtensions:!!Object.preventExtensions,isExtensible:!!Object.isExtensible,seal:!!Object.seal,isSealed:!!Object.isSealed,freeze:!!Object.freeze,isFrozen:!!Object.isFrozen},Array:{isArray:!!Array.isArray,"prototype.indexOf":!!Array.prototype.indexOf,"prototype.lastIndexOf":!!Array.prototype.lastIndexOf,"prototype.reduceRight":!!Array.prototype.reduceRight,"prototype.reduce":!!Array.prototype.reduce,"prototype.map":!!Array.prototype.map,"prototype.forEach":!!Array.prototype.forEach,"prototype.some":!!Array.prototype.some,"prototype.every":!!Array.prototype.every,"prototype.filter":!!Array.prototype.filter},Function:{"prototype.bind":!!Function.prototype.bind},Date:{"prototype.toJSON":!!Date.prototype.toJSON},String:{"prototype.trim":!!String.prototype.trim},JSON:{parse:!!JSON.parse,stringify:!!JSON.stringify}}}];return b.localStorage&&b.sessionStorage&&c.push({storage:{localStorage:B(b.localStorage),sessionStorage:B(b.sessionStorage)}}),c},C.jsonify=function(b){var c={},d=["Arguments","Array","String","Number","Boolean","Error","ErrorEvent","Object"];return a.util.forEachProperty(b,function(b,e){c[e]=d.indexOf(a.util.getType(b))>-1?a.stringify.parse(b):typeof b}),c},C.getConfig=function(){var c=b.navigator,d={userAgent:c.userAgent,appVersion:c.appVersion,vendor:c.vendor,platform:c.platform,opera:!!b.opera,params:a.getConfig()};
-return a.serialNumber&&(d.serialNumber=a.serialNumber),a.name&&(d.name=a.name),d},C.register=function(){a.transport.emit("register",C.getConfig())},C.setUp=function(){a.transport.on("device:registration",n),a.transport.on("device:ready",o),a.transport.on("device:online",p),a.transport.on("device:offline",q),a.transport.on("device:disconnect",r),a.transport.on("device:command",A),a.transport.on("device:fileList",y),a.transport.on("device:htmlContent",v),a.transport.on("device:fileSource",t),a.transport.on("device:previewHTML",w),a.transport.on("device:captureScreen",x),a.transport.on("device:reload",u),a.transport.on("device:name",s),a.transport.on("device:profiler",z),a.transport.on("device:web:control",h),a.transport.on("device:web:config",i)}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(){var b=a.config||a.util.queryParams();return b.webOnly=b.webonly||b.webOnly,b.webOnly=b.webOnly===!0||"true"===(b.webOnly||"").toLowerCase(),b.web=b.web===!0||"true"===(b.web||"").toLowerCase(),b.secure=b.secure===!0||"true"===(b.secure||"").toLowerCase(),"undefined"!=typeof b.filters&&(b.filters="string"==typeof b.filters?b.filters.split(","):b.filters),"undefined"!=typeof b.excludes&&(b.excludes="string"==typeof b.excludes?b.excludes.split(","):b.excludes),b}function d(c){a.io=c||b.io,a.transport.setUp(),a.client.setUp(),g.web&&a.web.setUp()}function e(b){var c=!1;return a.util.every(a.getConfig().excludes,function(a){return b.indexOf(a+"/")>-1?(c=!0,!1):!0}),c}function f(){if(a.util.foundRequireJS()){var c=b.requirejs.load,d=a.util.getUrl("profiler");b.requirejs.load=function(f,g,h){c.call(b.requirejs,f,g,e(h)?h:a.util.getProfileUrl(d,h))}}a.profiler.setUp()}var g={url:"",base:"",secure:!1,profile:!1,excludes:[],profileWorker:"plugins/profileWorker.js",html2canvas:"plugins/html2canvas.js","socket.io":"socket.io/socket.io.js",webStyle:"console.css",profiler:"profiler",proxy:"proxy",maxDataPacketSize:5e3,nativeConsole:!0,web:!1,webOnly:!1,consoleId:"consoleioweb",docked:!1,position:"bottom",height:"300px",width:"99%"};a.configure=function(c){if(a.util.extend(g,c),a.util.foundRequireJS()&&(b.requirejs.onError=function(b){a.console.error(b,b.requireModules,b.originalError)}),g.profile&&f(),g.webOnly)a.web.setUp();else if(!a.util.isIFrameChild()){if(b.io)return d(),!1;a.util.foundRequireJS()?b.require(["socket.io"],d):a.util.require(a.util.getUrl("socket.io"),d)}},a.getConfig=function(){return g},a.styleSheet=function(){var a=document.createElement("style");return a.type="text/css",a.id="console.io.style",a.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(a),a.sheet||a.styleSheet}(),a.debug=function(b){var c,d=document.getElementById("log");!d&&document.body&&(d=document.createElement("ul"),d.setAttribute("id","log"),d.style.position="absolute",d.style.background="rgb(48, 46, 46)",d.style.height="200px",d.style.width="800px",d.style.top="20px",d.style.left="50px",d.style.margin="10px",d.style.paddingTop="10px",d.style.zIndex=6e3,d.style.color="white",document.body.insertBefore(d,a.util.getFirstElement(document.body))),d&&(c=document.createElement("li"),c.innerHTML=b,d.insertBefore(c,a.util.getFirstElement(d)))};var h=b.onerror;b.onerror=function(b,c,d){var e=!1;return h&&(e=h(b,c,d)),a.transport.isConnected()?a.transport.emit("console",{type:"error",message:b+";\nfileName: "+c+";\nlineNo: "+d}):a.util.isIFrameChild()?a.console.exception(b+";\nfileName: "+c+";\nlineNo: "+d):a.debug([b,c,d].join("; ")),e},b.navigator.userAgent.search(/Maple/i)>-1&&"function"==typeof HTMLElement.prototype.addEventListener&&"function"==typeof HTMLElement.prototype.attachEvent&&(HTMLElement.prototype.attachEvent=void 0),Function.prototype.bind&&b.console&&"object"==typeof b.console.log&&a.util.forEach(["log","info","warn","error","assert","dir","clear","profile","profileEnd"],function(a){b.console[a]=this.bind(b.console[a],b.console)},Function.prototype.call),a.util.isIFrameChild()&&b.parent.postMessage&&a.console.on("console",function(a){b.parent.postMessage({event:"console",type:a.type,message:escape(a.message),stack:a.stack},"*")}),a.util.foundRequireJS()||a.util.ready(function(){a.configure(c())})}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(){this.store={added:[],queue:[]},this.config=a.util.extend({docked:!1,position:"bottom",height:"300px",width:"99%"},a.getConfig()),this.control={pageSize:this.config.pageSize||50,filters:this.config.filters||[],paused:!1,search:null},this.config.search&&this.applySearch(this.config.search),this.isEnabled=!1,this.view=new d(this)}function d(a){this.ctrl=a,this.elements={},this.target=null,this.container=null}var e=a.web={};c.prototype.setUp=function(){var b=this;a.util.requireCSS(a.util.getUrl("webStyle"),function(){b.enabled()})},c.prototype.enabled=function(){this.isEnabled||(this.isEnabled=!0,this.view.render(document.body),a.console.on("console",a.web.logger),b.addEventListener?b.addEventListener("message",a.web.onMessage,!1):b.detachEvent&&b.detachEvent("onmessage",a.web.onMessage),a.transport.emit("webStatus",{enabled:!0}))},c.prototype.disabled=function(){this.isEnabled&&(this.isEnabled=!1,a.console.removeListener("console",a.web.logger),b.removeEventListener?b.removeEventListener("message",a.web.onMessage,!1):b.attachEvent&&b.attachEvent("onmessage",a.web.onMessage),a.transport.emit("webStatus",{enabled:!1}),this.view.destroy())},c.prototype.setControl=function(a){"undefined"!=typeof a.paused&&(this.control.paused=a.paused),"undefined"!=typeof a.filters&&(this.control.filters=a.filters),a.pageSize!==this.control.pageSize&&(this.control.pageSize=a.pageSize),a.search!==this.control.search&&this.applySearch(a.search),this.view.clear(),a.clear||(this.view.addBatch(this.getData(this.store.added)),this.addBatch())},c.prototype.getData=function(b){var c=0,d=[];return b.length>0&&a.util.every([].concat(b).reverse(),function(a){return this.isFiltered(a)&&this.isSearchFiltered(a)&&(d.push(a),c++),this.control.pageSize>c},this),d},c.prototype.hide=function(){return this.view.hide()},c.prototype.show=function(){return this.view.show()},c.prototype.add=function(a){this.control.paused?this.store.queue.push(a):(this.store.added.push(a),this.view.add(a))},c.prototype.addBatch=function(){this.control.paused||(this.view.addBatch(this.getData(this.store.queue)),this.store.added=this.store.added.concat(this.store.queue),this.store.queue=[])},c.prototype.applySearch=function(a){this.control.search="undefined"!=typeof a?a:null,this.control.search&&(this.control.search="\\"!==this.control.search[0]?new RegExp("\\b"+this.control.search,"img"):new RegExp(this.control.search,"img"))},c.prototype.isSearchFiltered=function(a){return this.control.search?a.message.search(this.control.search)>-1:!0},c.prototype.isFiltered=function(a){return 0===this.control.filters.length||this.control.filters.length>0&&this.control.filters.indexOf(a.type)>-1},d.prototype.render=function(a){this.target=a,this.createContainer()},d.prototype.reload=function(){this.clear(),this.container.parentNode.removeChild(this.container),this.createContainer()},d.prototype.destroy=function(){this.container&&(this.clear(),this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null,this.target=null))},d.prototype.hide=function(){this.target&&this.container&&this.target.removeChild(this.container)},d.prototype.show=function(){this.target&&this.container&&(this.ctrl.config.position&&"top"===this.ctrl.config.position?this.target.insertBefore(this.container,a.util.getFirstElement(this.target)):this.target.appendChild(this.container))},d.prototype.createContainer=function(){if(this.container)return!1;var b=["background-color: rgba(244, 244, 244, 0.9)","color: black","z-index: 5000","overflow: auto","margin: 5px","-o-box-shadow: 0 0 5px 1px #888","-moz-box-shadow: 0 0 5px 1px #888","-webkit-box-shadow: 0 0 5px 1px #888","box-shadow: 0 0 5px 1px #888"];switch(this.ctrl.config.docked||b.push("position:absolute"),this.ctrl.config.height&&b.push("height:"+this.ctrl.config.height),this.ctrl.config.width&&b.push("width:"+this.ctrl.config.width),this.ctrl.config.position.toLowerCase()){case"top":b.push("top: 5px");break;default:b.push("bottom: 5px")}var c=a.getConfig();a.util.deleteCSSRule(a.styleSheet,"#"+c.consoleId),a.util.addCSSRule(a.styleSheet,"#"+c.consoleId,b.join(";")),this.container=this.createElement({attr:{id:c.consoleId,tabindex:1},target:this.target,position:this.ctrl.config.position})},d.prototype.createElement=function(b){b.tag=b.tag||"div",this.elements[b.tag]||(this.elements[b.tag]=document.createElement(b.tag));var c=this.elements[b.tag].cloneNode(!1);return a.util.forEachProperty(b.attr,function(a,b){a&&c.setAttribute(b,a)}),a.util.forEachProperty(b.prop,function(a,b){a&&(c[b]=a)}),b.target&&(b.position&&"top"===b.position?b.target.insertBefore(c,a.util.getFirstElement(b.target)):b.target.appendChild(c)),c},d.prototype.stripBrackets=function(a){var b=a.length-1;return"["===a.charAt(0)&&"]"===a.charAt(b)?a.substring(1,b):a},d.prototype.getElementData=function(b){var c,d,e="code",f=b.type,g=b.origin,h=this.stripBrackets(b.message);if("assert"===b.type){var i=this.stripBrackets(h).split(",");"true"!==i[0].toLowerCase()&&(f="assert-failed")}if(h=h.replace(/%20/gim," "),h.indexOf("{")>-1&&h.indexOf("}")>-1&&(e="pre"),b.stack){var j=b.stack.split(",").join("\n").replace(/"/gim,"").replace(/%20/gim," ");d=this.stripBrackets(j),h+="\n"+d}return["assert","dir","dirxml","error","trace"].indexOf(b.type)>-1&&(e="pre"),g&&(g=b.origin.replace(/(\/|:|\.)/gim,""),c="content: 'iframe:"+b.origin+"'; position: absolute; top: 0px; right: 0px; padding: 2px 8px; "+"font-size: 12px; color: lightgrey !important; "+"background-color: black; "+"font-family: Monaco,Menlo,Consolas,'Courier New',monospace;",a.util.deleteCSSRule(a.styleSheet,"."+g+":before"),a.util.addCSSRule(a.styleSheet,"."+g+":before",c)),{tag:e,className:"console type-"+f+(g?" "+g:""),message:h||"."}},d.prototype.add=function(a){if(!this.ctrl.isFiltered(a)||!this.ctrl.isSearchFiltered(a)||!this.container)return!1;var b=this.getElementData(a);this.createElement({tag:b.tag,attr:{"class":b.className},prop:{innerHTML:b.message},target:this.container,position:"top"}),this.removeOverflowElement()},d.prototype.addBatch=function(b){if(b.length>0&&this.container){var c=document.createDocumentFragment();a.util.forEach(b,function(a){var b=this.getElementData(a);this.createElement({tag:b.tag,attr:{"class":b.className},prop:{innerHTML:b.message},target:c,position:"bottom"})},this),this.container.insertBefore(c,a.util.getFirstElement(this.container)),this.removeOverflowElement()}},d.prototype.clear=function(){if(this.container)for(;this.container.firstChild;)this.container.removeChild(this.container.firstChild)},d.prototype.removeOverflowElement=function(){for(var a=this.container.childElementCount||this.container.children.length;a>this.ctrl.control.pageSize;)this.container.removeChild(this.container.lastElementChild||this.container.lastChild),a--},e.logger=function(b){a.web.console&&a.web.console.add(b)},e.onMessage=function(b){if(a.web.console){var c=b.data;"console"===c.event&&a.web.console.add({type:c.type,message:unescape(c.message),stack:c.stack,origin:b.origin})}},e.setUp=function(){e.console||(e.console=new c),e.console.setUp()},e.enabled=function(){e.console?e.console.enabled():e.setUp()},e.disabled=function(){e.console&&e.console.disabled()},e.setConfig=function(b){e.console&&e.console.setControl(b);var c=[a.name||"",a.serialNumber||"",a.transport.isConnected()?"online":"offline"];b.paused&&c.push("paused"),b.filters&&b.filters.length>0&&c.push("filters:"+b.filters.join(",")),b.pageSize&&c.push("pagesize:"+b.pageSize),b.search&&c.push("search:"+b.search),a.util.showInfo(c.join("|"),a.transport.isConnected())},e.show=function(){return e.console?e.console.show():void 0},e.hide=function(){return e.console?e.console.hide():void 0}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),"function"==typeof define&&define.amd&&define([],function(){return ConsoleIO})}();
+var ConsoleIO="undefined"==typeof module?{}:module.exports;ConsoleIO.version="0.2.2",function(){!function(a,b){var c=a.util={},d=!1,e=[];c.getScripts=function(){return c.toArray(document.scripts||document.getElementsByName("script"))},c.getStyles=function(){return c.toArray(document.getElementsByTagName("link"))},c.getFirstElement=function(a){return a?a.firstElementChild||a.firstChild:!1},c.getOrigin=function(){return b.location.origin||b.location.protocol+"//"+(b.location.host||b.location.hostname+":"+b.location.port)},c.getHashParams=function(){var a={},d=b.location.hash||b.location.href.replace(c.getOrigin()+b.location.pathname,"");return d&&c.forEach(d.split("#"),function(b){var c=b.split("=");a[c[0]]=c[1]}),a},c.getQueryParams=function(a){a=a||b.location.href;var d={},e=a.indexOf("?");return e>-1&&c.forEach(a.substring(e+1,a.length).split("&"),function(a){var b=a.split("=");d[b[0]]=b[1]}),d},c.queryParams=function(){var a={},b=c.getScripts();return c.every(b,function(b){var d=(b.src||b.getAttribute("src")||"").toLowerCase();if(-1===d.indexOf("console.io.js"))return!0;if(a.secure=d.indexOf("https")>-1,c.extend(a,c.getQueryParams(d)),!a.url){var e=new RegExp("^(?:f|ht)tp(?:s)?://([^/]+)","im"),f=d.indexOf("?"),g=f>-1?d.substring(0,f):d;a.url=(a.secure?"https://":"http://")+g.match(e)[1].toString()}return a.base||(a.base=d.indexOf("/console.io/")>-1?"console.io/":""),!1}),c.extend(a,c.getHashParams()),a},c.checkFile=function(a){var b=a.indexOf(".js")>-1,d=a.indexOf(".css")>-1,e=b?c.getScripts():d?c.getStyles():null,f=b?"src":d?"href":null,g=!1;return e&&c.every(e,function(b){var c=b.getAttribute(f)||"";return g=c.indexOf(a)>-1,!g}),g},c.removeFile=function(a){var b,d,e=a.indexOf(".js")>-1?"script":a.indexOf(".css")>-1?"link":null;e&&(d="script"===e?"src":"href",b=document.getElementsByTagName(e),c.forEach(c.toArray(b),function(b){var c=b.getAttribute(d)||"";c.indexOf(a)>-1&&b.parentNode.removeChild(b)}))},c.requireCSS=function(a,d){if(c.checkFile(a))return d&&setTimeout(function(){d(a)},10),!1;var e=document.styleSheets.length,f=document.createElement("link"),g=document.getElementsByTagName("head")[0];if(d)var h=b.setInterval(function(){document.styleSheets.length>e&&(d(a),b.clearInterval(h))},10);f.type="text/css",f.rel="stylesheet",f.media="all",f.href=a,g.appendChild(f)},c.requireScript=function(d,e){function f(){h.removeEventListener?(h.removeEventListener("load",f,!1),e(d)):h.attachEvent&&(b.opera||"complete"!==h.readyState&&"loaded"!==h.readyState||(h.detachEvent("onreadystatechange",f),e(d)))}function g(){j.web?a.console.exception(d,arguments):a.debug("failed to load "+d),h.removeEventListener("error",g,!1)}if(c.checkFile(d))return setTimeout(function(){e(d)},10),!1;var h=document.createElement("script"),i=document.getElementsByTagName("head")[0],j=a.getConfig();h.type="text/javascript",h.charset="utf-8",h.async=!0,b.opera||"complete"!==h.readyState&&"loaded"!==h.readyState||setTimeout(function(){e(d)},1),h.addEventListener?(h.addEventListener("load",f,!1),h.addEventListener("error",g,!1)):!h.attachEvent||h.attachEvent.toString&&h.attachEvent.toString().indexOf("[native code")<0||b.opera||(h.onload=f,h.attachEvent("onreadystatechange",f)),h.src=d,i.appendChild(h)},c.ready=function(a){function f(){d=!0,c.forEach(e,function(a){a()}),e=[]}function g(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",g,!1),f()):document.attachEvent&&"complete"===document.readyState&&(document.detachEvent("onreadystatechange",g),f())}return d?(setTimeout(a,1),!1):(e.push(a),e.length>1?!1:("complete"===document.readyState&&setTimeout(f,1),document.addEventListener?(document.addEventListener("DOMContentLoaded",g,!1),b.addEventListener("load",f,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",g),b.attachEvent("onload",f)),void 0))},c.require=function(a,b){function d(a){var c=!0;i[a]=!0;for(var d in i)i[d]||(c=!1);!g&&c&&(g=!0,b())}"string"==typeof a&&(a=[a]);var e,f,g=!1,h=a.length,i={};for(e=0;h>e;e++)f=a[e],i[f]=!1,f.indexOf(".css")>-1?c.requireCSS(f,d):c.requireScript(f,d)},c.addCSSRule=function(a,b,c,d){try{a.insertRule?a.insertRule(b+"{"+c+"}",d):a.addRule&&a.addRule(b,c,d)}catch(e){}},c.deleteCSSRule=function(a,b){var d=a.cssRules||a.rules;c.forEach(c.toArray(d),function(c,d){c.selectorText&&c.selectorText.replace("::",":")===b.replace("::",":")&&(a.deleteRule?a.deleteRule(d):a.removeRule&&a.removeRule(d))})},c.getAppliedStyles=function(a){var d=document.defaultView||b,e=[];if(d.getComputedStyle){var f=d.getComputedStyle(a,"");c.forEach(c.toArray(f),function(a){e.push(a+":"+f.getPropertyValue(a))})}else a.currentStyle?c.forEachProperty(a.currentStyle,function(a,b){e.push(b+":"+a)}):c.forEach(c.toArray(a.style),function(b){e.push(b+":"+a.style[b])});return e.join("; ")},c.getUrl=function(b){var c=a.getConfig(),d=c.url,e=d.length-1,f=c[b];return"/"===d.charAt(e)&&(d=d.substr(0,e)),d+=(c.base.length>0?"/"+c.base:"/")+f},c.getProfileUrl=function(a,b){return-1===b.indexOf(".js")?b:(-1===b.indexOf("http:")&&-1===b.indexOf("https:")&&(b=0===b.indexOf("/")?[location.origin,b].join("/"):[location.origin,location.pathname,b].join("/")),a+"?url="+b)},c.showInfo=function(b,d){var e="consoleio",f=d?"rgba(0, 130, 30, 0.8)":"rgba(0, 0, 0, 0.8)",g="content: 'Console.IO:"+b+"'; position: fixed; top: 0px; left: 0px; padding: 2px 8px; "+"font-size: 12px; font-weight: bold; color: lightgrey; "+"background-color: "+f+"; border: 1px solid rgb(0, 0, 0); "+"font-family: Monaco,Menlo,Consolas,'Courier New',monospace;";c.deleteCSSRule(a.styleSheet,"."+e+":after"),c.addCSSRule(a.styleSheet,"."+e+":after",g),document.body.setAttribute("class",e)},c.isIFrameChild=function(){return b.location!==b.parent.location},c.foundRequireJS=function(){return"undefined"!=typeof b.requirejs},c.foundDefine=function(){return"function"==typeof define&&define.amd},c.getType=function(a){return Object.prototype.toString.apply(a).replace("[object ","").replace("]","")},c.getFunctionName=function(a){var b;return a&&(b=a.getName instanceof Function?a.getName():a.name,b=b||a.toString().match(/function\s*([_$\w\d]*)/)[1]),b||"anonymous"},c.toArray=function(a){return Array.prototype.slice.call(a)},c.isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)},c.every=function(){return Array.prototype.every?function(a,b,c){return(a||[]).every(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length;if(e)do if(!b.call(c||a,a[d],d,a))return!1;while(++d<e);return!0}}(),c.filter=function(){return Array.prototype.filter?function(a,b,c){return(a||[]).filter(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length,f=[];if(e)do b.call(c||a,a[d],d,a)&&f.push(a[d]);while(++d<e);return f}}(),c.forEach=function(){return Array.prototype.forEach?function(a,b,c){(a||[]).forEach(b,c)}:function(a,b,c){a=a||[];var d=0,e=a.length;if(e)do b.call(c||a,a[d],d,a);while(++d<e)}}(),c.noop=function(){},c.asyncForEach=function(a,b,d,e){a=[].concat(a||[]),c.asyncIteration(a,b||c.noop,d||c.noop,e)},c.asyncIteration=function(a,b,d,e){a.length>0?setTimeout(function(){b.call(e||a,a.shift(),function(){c.asyncIteration(a,b,d,e)})},4):d.call(e)},c.forEachProperty=function(a,b,c){var d;for(d in a)b.call(c||a,a[d],d,a)},c.async=function(a,b){return setTimeout(function(){a.call(b)},4)},c.extend=function(a,b){return c.forEachProperty(b,function(b,c){a[c]=b}),a}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){var b=a.storage={},c={};a.util.ready(function(){var b,d,e,f,g=document.cookie.split("; "),h=g.length;for(b=0;h>b;b++)d=g[b].split("="),e=d[0],f=d[1],c[e]=f;a.util.forEachProperty(c,function(b,c){"serialNumber"===c&&(a.serialNumber=b),"deviceName"===c&&(a.name=b)})}),b.addItem=function(a,b,d){if(b&&"undefined"!==b){var e="";if(d){var f=new Date;f.setTime(f.getTime()+1e3*60*60*24*d),e="; expires="+f.toGMTString()}document.cookie=a+"="+b+e+"; path=/",c[a]=b}},b.removeItem=function(a){b.addItem(a,"",-1),delete c[a]},b.getItem=function(a){return c[a]}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){function b(){}a.EventEmitter=b,b.prototype.on=function(b,c){return this.$events||(this.$events={}),this.$events[b]?a.util.isArray(this.$events[b])?this.$events[b].push(c):this.$events[b]=[this.$events[b],c]:this.$events[b]=c,this},b.prototype.addListener=b.prototype.on,b.prototype.once=function(a,b){function c(){d.removeListener(a,c),b.apply(this,arguments)}var d=this;return c.listener=b,this.on(a,c),this},b.prototype.removeListener=function(b,c){if(this.$events&&this.$events[b]){var d=this.$events[b];if(a.util.isArray(d)){for(var e=-1,f=0,g=d.length;g>f;f++)if(d[f]===c||d[f].listener&&d[f].listener===c){e=f;break}if(0>e)return this;d.splice(e,1),d.length||delete this.$events[b]}else(d===c||d.listener&&d.listener===c)&&delete this.$events[b]}return this},b.prototype.removeAllListeners=function(a){return void 0===a?(this.$events={},this):(this.$events&&this.$events[a]&&(this.$events[a]=null),this)},b.prototype.listeners=function(b){return this.$events||(this.$events={}),this.$events[b]||(this.$events[b]=[]),a.util.isArray(this.$events[b])||(this.$events[b]=[this.$events[b]]),this.$events[b]},b.prototype.emit=function(b){if(!this.$events)return!1;var c=this.$events[b];if(!c)return!1;var d=Array.prototype.slice.call(arguments,1);if("function"==typeof c)c.apply(this,d);else{if(!a.util.isArray(c))return!1;for(var e=c.slice(),f=0,g=e.length;g>f;f++)e[f].apply(this,d)}return!0}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){var b=a.stringify={};b.objects=["Arguments","Array","String","Number","Boolean","Function","Object","Geoposition","Coordinates","CRuntimeObject"],b.events=["Event","KeyboardEvent","MouseEvent","TouchEvent","WheelEvent","UIEvent","CustomEvent","NotifyAudioAvailableEvent","CompositionEvent","CloseEvent","MessageEvent","MessageEvent","XMLHttpRequestProgressEvent","ProgressEvent"],b.errors=["Error","ErrorEvent","DOMException","PositionError"],b.parse=function(c,d,e){var f="",g=a.util.getType(c);if(e="undefined"==typeof e?!0:e,d=d||1,b.objects.indexOf(g)>-1||b.events.indexOf(g)>-1||b.errors.indexOf(g)>-1)switch(g){case"Error":case"ErrorEvent":c=c.message;case"String":f=b.parseString(c);break;case"Arguments":c=a.util.toArray(c);case"Array":f=b.parseArray(c,d);break;case"Number":f=String(c);break;case"Boolean":f=c?"true":"false";break;case"Function":f='"'+a.util.getFunctionName(c)+'"';break;default:f=b.parseObject(g,c,d)}else if(null===c)f='"null"';else if(void 0===c)f='"undefined"';else if(e)f=b.parseObject(g,c,d);else try{f=String(c)}catch(h){a.console.error(h)}return f},b.valueOf=function(c,d,e){var f=a.util.getType(c);return(b.objects.indexOf(f)>-1||b.events.indexOf(f)>-1||b.errors.indexOf(f)>-1)&&!d?this.parse(c,e):("Function"===f?f="[Function "+a.util.getFunctionName(c)+"]":c&&c.constructor&&c.constructor.name&&(f="[object "+c.constructor.name+"]"),f)},b.parseString=function(a){return'"'+a.replace(/"/g,"'").replace(/</g,"&lt;").replace(/>/g,"&gt;")+'"'},b.parseArray=function(c,d){var e,f=[];return a.util.forEach(c,function(a,c){this[c]=b.valueOf(a,!1,d)},f),e=f.length>0?"[ "+f.join(", ")+" ]":"[ "+c.toString()+" ]"},b.parseObject=function(c,d,e){var f,g="",h="[object global]"===c,i=new Array(e).join(" "),j=new Array(++e).join(" "),k=[];return d&&d.constructor&&(g=d.constructor.name),a.util.forEachProperty(d,function(a,c){this.push(j+'"'+c+'": '+b.valueOf(a,h,e))},k),f=k.length>0?(g||c)+": {\n"+k.join(",\n")+"\n"+i+"}":d.toString()+"\n"}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){function b(a){for(var c=[],d=Array.prototype.slice,e=0;e<a.length;++e){var f=a[e];void 0===f?c[e]="undefined":null===f?c[e]="null":f.constructor&&(f.constructor===Array?c[e]=f.length<3?"["+b(f)+"]":"["+b(d.call(f,0,1))+"..."+b(d.call(f,-1))+"]":f.constructor===Object?c[e]="#object":f.constructor===Function?c[e]="#function":f.constructor===String?c[e]='"'+f+'"':f.constructor===Number&&(c[e]=f))}return c.join(",")}var c=a.formatter={};c.chrome=function(a){var b=(a.stack+"\n").replace(/^\S[^\(]+?[\n$]/gm,"").replace(/^\s+(at eval )?at\s+/gm,"").replace(/^([^\(]+?)([\n$])/gm,"{anonymous}()@$1$2").replace(/^Object.<anonymous>\s*\(([^\)]+)\)/gm,"{anonymous}()@$1").split("\n");return b.pop(),b},c.safari=function(a){return a.stack.replace(/\[native code\]\n/m,"").replace(/^(?=\w+Error\:).*$\n/m,"").replace(/^@/gm,"{anonymous}()@").split("\n")},c.ie=function(a){var b=/^.*at (\w+) \(([^\)]+)\)$/gm;return a.stack.replace(/at Anonymous function /gm,"{anonymous}()@").replace(/^(?=\w+Error\:).*$\n/m,"").replace(b,"$1@$2").split("\n")},c.firefox=function(a){return a.stack.replace(/(?:\n@:0)?\s+$/m,"").replace(/^[\(@]/gm,"{anonymous}()@").split("\n")},c.opera11=function(a){for(var b="{anonymous}",c=/^.*line (\d+), column (\d+)(?: in (.+))? in (\S+):$/,d=a.stacktrace.split("\n"),e=[],f=0,g=d.length;g>f;f+=2){var h=c.exec(d[f]);if(h){var i=h[4]+":"+h[1]+":"+h[2],j=h[3]||"global code";j=j.replace(/<anonymous function: (\S+)>/,"$1").replace(/<anonymous function>/,b),e.push(j+"@"+i+" -- "+d[f+1].replace(/^\s+/,""))}}return e},c.opera10b=function(a){for(var b=/^(.*)@(.+):(\d+)$/,c=a.stacktrace.split("\n"),d=[],e=0,f=c.length;f>e;e++){var g=b.exec(c[e]);if(g){var h=g[1]?g[1]+"()":"global code";d.push(h+"@"+g[2]+":"+g[3])}}return d},c.opera10a=function(a){for(var b="{anonymous}",c=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,d=a.stacktrace.split("\n"),e=[],f=0,g=d.length;g>f;f+=2){var h=c.exec(d[f]);if(h){var i=h[3]||b;e.push(i+"()@"+h[2]+":"+h[1]+" -- "+d[f+1].replace(/^\s+/,""))}}return e},c.opera9=function(a){for(var b="{anonymous}",c=/Line (\d+).*script (?:in )?(\S+)/i,d=a.message.split("\n"),e=[],f=2,g=d.length;g>f;f+=2){var h=c.exec(d[f]);h&&e.push(b+"()@"+h[2]+":"+h[1]+" -- "+d[f+1].replace(/^\s+/,""))}return e},c.other=function(a){for(var c,d,e="{anonymous}",f=/function\s*([\w\-$]+)?\s*\(/i,g=[],h=10;a&&a.arguments&&g.length<h;)c=f.test(a.toString())?RegExp.$1||e:e,d=Array.prototype.slice.call(a.arguments||[]),g[g.length]=c+"("+b(d)+")",a=a.caller;return g}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a){function b(){try{void 0()}catch(a){return a}}function c(b){return b.arguments&&b.stack?a.formatter.chrome:b.stack&&b.sourceURL?a.formatter.safari:b.stack&&b.number?a.formatter.ie:"string"==typeof b.message&&"undefined"!=typeof window&&window.opera?b.stacktrace?b.message.indexOf("\n")>-1&&b.message.split("\n").length>b.stacktrace.split("\n").length?a.formatter.opera9:b.stack?b.stacktrace.indexOf("called from line")<0?a.formatter.opera10b:a.formatter.opera11:a.formatter.opera10a:a.formatter.opera9:b.stack?a.formatter.firefox:"other"}var d=a.stacktrace={};d.allowedErrorStackLookUp=["Error","ErrorEvent","DOMException","PositionError"],d.get=function(e){e=e||b();var f=c(e);if("function"==typeof f)return f(e);var g=a.util.getType(e);return-1===d.allowedErrorStackLookUp.indexOf(g)?g+' is missing from "stacktrace.allowedErrorStackLookUp['+d.allowedErrorStackLookUp.join(",")+']";':a.formatter.other(arguments.callee)}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(a){var b=a.data;m.emit(b.event,{type:b.type,message:b.message,stack:b.stack,origin:a.origin})}function d(){m.emit("setUp",a.client.getConfig()),a.console.log("Connected to the Server",arguments)}function e(b){m.connectionMode=b,m.showInfoBar("connecting",!1),a.console.log("Connecting to the Server",b)}function f(b,c){m.connectionMode=b,m.emit("online",a.client.getConfig()),a.console.log("Reconnected to the Server after "+c+" attempts.",b,c)}function g(){m.showInfoBar("reconnecting",!1),a.console.log("Reconnecting to the Server",arguments)}function h(b){m.showInfoBar("disconnect",!1),a.console.log("Disconnected from the Server",b),(!b||b&&"booted"!==b)&&m.forceReconnect()}function i(){m.showInfoBar("connection failed",!1),a.console.warn("Failed to connect to the Server",arguments)}function j(){m.showInfoBar("reconnection failed",!1),a.console.warn("Failed to reconnect to the Server",arguments)}function k(b){m.showInfoBar("connection error",!1),a.console.warn("Socket Error",b)}var l,m=a.transport={},n=[],o=[];m.connectionMode="",m.setUp=function(){!function(a){if(a.Transport["jsonp-polling"]){var b=a.Transport["jsonp-polling"].prototype.post;a.Transport["jsonp-polling"].prototype.requestQueue=[],a.Transport["jsonp-polling"].prototype.isProcessingQueue=!1,a.Transport["jsonp-polling"].prototype.hasOutstandingRequests=!1,a.Transport["jsonp-polling"].prototype.postRequest=function(){var a=this;this.isProcessingQueue=!0,setTimeout(function(){b.call(a,a.requestQueue.shift())},10)},a.Transport["jsonp-polling"].prototype.completePostRequest=function(){var a=this;setTimeout(function(){a.socket.setBuffer(!1),a.hasOutstandingRequests=a.requestQueue.length>0,a.isProcessingQueue=!1,a.processPendingRequests()},250)},a.Transport["jsonp-polling"].prototype.processPendingRequests=function(){this.hasOutstandingRequests&&!this.isProcessingQueue&&(this.postRequest(),this.completePostRequest())},a.Transport["jsonp-polling"].prototype.post=function(a){this.requestQueue.push(a),this.hasOutstandingRequests=!0,this.processPendingRequests()}}}(b.io),l=a.getConfig(),m.io=a.io.connect(l.url,{secure:l.secure,resource:l.base+"socket.io","sync disconnect on unload":!0}),a.console.on("console",function(a){m.emit("console",{type:a.type,message:escape(a.message),stack:a.stack})}),b.addEventListener?b.addEventListener("message",c,!1):b.attachEvent&&b.attachEvent("onmessage",c),m.io.on("connect",d),m.io.on("connecting",e),m.io.on("reconnect",f),m.io.on("reconnecting",g),m.io.on("disconnect",h),m.io.on("connect_failed",i),m.io.on("reconnect_failed",j),m.io.on("error",k),a.util.forEach(o,function(a){m.on(a.name,a.callback,a.scope)}),o=[]},m.emit=function(a,b){return m.isConnected()?(m.io.emit("device:"+a,b||{}),!0):(n.push({name:a,data:b}),!1)},m.on=function(a,b,c){m.io?m.io.on(a,function(){b.apply(c||this,arguments)}):o.push({name:a,callback:b,scope:c})},m.isConnected=function(){return m.io&&m.io.socket?m.io.socket.connected:!1},m.forceReconnect=function(){try{m.io.socket.disconnectSync(),m.io.socket.reconnect()}catch(b){a.console.error(b)}},m.showInfoBar=function(b,c){var d=a.getConfig(),e=[];a.name&&e.push(a.name),a.serialNumber&&e.push(a.serialNumber),d.secure&&e.push("secure"),d.web&&e.push("web"),d.url&&e.push(d.url),d.base&&e.push(d.base),e.push(b),e.push(c?"online":"offline"),a.util.showInfo(e.join("|"),c)},m.clearPendingQueue=function(){var b=[];a.util.forEach(n,function(a){var c=m.emit(a.name,a.data);c||b.push(a)}),n=b}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(){function c(b){"report"===b.data.type?a.transport.emit("profile",b.data.report):a.console.log(b.data)}function d(b){a.console.error(b)}var h=e.worker=new b.Worker(a.util.getUrl("profileWorker"));h.addEventListener("message",c,!1),h.addEventListener("error",d,!1),e.begin=function(b,c,d,f){if(!f){var g=a.util.getType(c[0]).toLowerCase().indexOf("event")>-1;g&&!c[0].__profiled&&(f=g,c[0].__profiled=!0)}e.enabled&&h.postMessage({type:"begin",callId:b,time:d,reset:f})},e.end=function(a,b){e.enabled&&h.postMessage({type:"end",callId:a,time:b})},e.start=function(a){return a=a||g(),e.enabled=!0,e.store.push(a),h.postMessage({type:"start",title:a}),a},e.finish=function(a){a||(a=e.store.pop());var b=e.store.indexOf(a);return b>-1&&e.store.splice(b,1),e.enabled=e.store.length>0,h.postMessage({type:"finish",title:a}),a},e.clear=function(){e.enabled=!1,e.store=[],h.postMessage({type:"clear"})},e.load=function(a,b){h.postMessage({type:"load",file:a,table:b})},a.util.forEachProperty(f,function(a,b){e.load(b,a)}),b.__pd=e.load,b.__pb=e.begin,b.__pe=e.end}function d(){function c(a,b){var c=k[a]||["root",0,""];this.id=m(),this.functionName=c[0],this.lineNumber=c[1],this.url=c[2],this.callUID=a,this.startTime=b,this.totalTime=0,this.selfTime=0,this.numberOfCalls=1,this.visible=!0,this.children=[]}function d(a){this.title=a||g(),this.uid=e.store.length+1,this.head=new c(this.uid,Date.now()),this.active=!0,this.depth=0}function h(){return a.util.filter(e.store,function(a){return!!a.active})}function i(){var b;return a.util.every(e.store.reverse(),function(a){return a.active?(b=a,!1):!0}),b}function j(b){var c;return a.util.every(e.store,function(a){return a.active&&a.title===b?(c=a,!1):!0}),c}var k={},l={},m=function(){var a=0;return function(){return++a}}();c.prototype.finish=function(b){this.adjustTime(Date.now()),a.util.async(b)},c.prototype.getNodeByCallerId=function(b){var c;return a.util.every(this.children,function(a){return a.callUID===b?(c=a,!1):!0}),c},c.prototype.getActiveNode=function(){var a=this.children.length;return a>0?this.children[a-1]:null},c.prototype.adjustTime=function(a){if(this.totalTime=a-this.startTime,this.children.length>0){var b=0;util.forEach(this.children,function(a){b+=a.totalTime},this),b>this.totalTime&&(this.totalTime=b),this.selfTime=Math.abs(this.totalTime-b)}else this.selfTime=this.totalTime},c.prototype.begin=function(a,b){var d=this.getNodeByCallerId(a);d?++d.numberOfCalls:(d=new c(a,b),this.children.push(d))},c.prototype.end=function(a,b){var c=this.getNodeByCallerId(a);return c?(c.adjustTime(b),!0):!1},d.prototype.finish=function(a){delete this.active,delete this.depth,this.head.finish(a)},d.prototype.getActiveNode=function(a){var b=0,c=this.head;if(a="undefined"==typeof a?this.depth:a,a>0)do c=c.getActiveNode();while(a>++b);return c},d.prototype.begin=function(a,b,c){c&&(this.depth=0),l[a]||(l[a]=[]),l[a].push(this.depth),this.getActiveNode().begin(a,b),this.depth++},d.prototype.end=function(b,c){if(this.depth--,l[b]){var d=this.getActiveNode(l[b].pop());d.end(b,c)||a.console.log(b+" failed to find node.")}else a.console.log(b+" depth index not mapped.")},e.begin=function(b,c,d,f){if(e.enabled){if(!f){var g=a.util.getType(c[0]).toLowerCase().indexOf("event")>-1;g&&!c[0].__profiled&&(f=g,c[0].__profiled=!0)}a.util.forEach(h(),function(a){a.begin(b,d,f)})}},e.end=function(b,c){e.enabled&&a.util.forEach(h(),function(a){a.end(b,c)})},e.start=function(a){var b=new d(a);return e.store.push(b),e.enabled=!0,b.title},e.finish=function(b){var c;return b&&(c=j(b)),c||(c=i()),e.enabled=h().length>1,c?(c.finish(function(){a.transport.emit("profile",c)}),c.title):void 0},e.clear=function(){e.enabled=!1,e.store=[]},e.load=function(b,c){a.util.forEachProperty(c,function(a){a.push(b)}),a.util.extend(k,c)},a.util.forEachProperty(f,function(a,b){e.load(b,a)}),b.__pd=e.load,b.__pb=e.begin,b.__pe=e.end}var e=a.profiler={},f={},g=function(){var a=0;return function(){return["Profile",++a].join(" ")}}();b.__pb=b.__pe=a.util.noop,b.__pd=function(a,b){f[a]=b},e.enabled=!1,e.store=[],e.setUp=function(){b.Worker?c():d()}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(b,c,g,h){e&&a.getConfig().nativeConsole&&e[b]&&(f.indexOf(b)>-1?e[b](c):e[b].apply(e,c)),c&&c.hasOwnProperty("length")&&c.length>0&&(c=a.util.toArray(c)),d.emit("console",{type:b,message:g||a.stringify.parse(c),stack:h?a.stringify.parse(h):""})}var d=a.console=new a.EventEmitter,e=b.console,f=["dir","dirxml"],g={},h={};d._native=e,d.assert=function(b){if(b)c("assert",arguments);else{var d=["Assertion failed:"];d=d.concat(a.util.toArray(arguments).slice(1)),c("assert",arguments,a.stringify.parse(d),a.stacktrace.get())}},d.count=function(a){var b=a||"_GLOBAL_",d=g[b];d?++d.count:g[b]=d={key:a||"",count:1},c("count",arguments,(a||"")+": "+d.count)},d.time=function(a,b){if(!a)return!1;var d="KEY"+a.toString();return!b&&h[d]?!1:(h[d]=(new Date).getTime(),c("time",arguments),void 0)},d.timeEnd=function(a){if(!a)return!1;var b="KEY"+a.toString(),d=h[b];d&&(delete h[b],c("timeEnd",arguments,a+": "+((new Date).getTime()-d)+"ms"))},d.debug=function(){c("debug",arguments)},d.warn=function(){c("warn",arguments)},d.info=function(){c("info",arguments)},d.log=function(){c("log",arguments)},d.dir=function(a){c("dir",a)},d.dirxml=function(b){var d,e=b.nodeType;9===e&&(b=b.documentElement),d=b?b.outerHTML||b.innerHTML||b.toString()||a.stringify.parse(b):null,d&&(d=d.replace(/</gim,"&lt;"),d=d.replace(/>/gim,"&gt;")),c("dirxml",b,d)},d.group=function(){c("group",arguments)},d.groupCollapsed=function(){c("groupCollapsed",arguments)},d.groupEnd=function(){c("groupEnd")},d.markTimeline=function(){c("markTimeline",arguments)},d.timeStamp=function(){c("timeStamp",arguments)},d.profile=function(b){c("profile",arguments,'Profile "'+a.profiler.start(b)+'" started.')},d.profileEnd=function(b){b=a.profiler.finish(b),b&&c("profileEnd",arguments,'Profile "'+b+'" finished.')},d.error=function(b){c("error",arguments,null,a.stacktrace.get(b))},d.exception=function(){c("error",arguments)},d.trace=function(){c("trace",arguments,null,a.stacktrace.get())},d.clear=function(){g={},h={},c("clear",arguments)},d.command=function(){c("command",arguments)},b.console=d}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(b,c,d){a.name||(a.name=b.name,a.storage.addItem("deviceName",b.name,365)),b.serialNumber===a.serialNumber&&a.transport.showInfoBar(c,d)}function d(){return Function.prototype.bind?!1:(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d&&a?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e},void 0)}function e(){var b=[],c=new RegExp("((http|https)://)?([^/]+)","img");return a.util.forEach(a.util.toArray(document.styleSheets),function(d){try{var e=d.cssRules||d.rules,f=d.href.match(c);f.pop(),e&&a.util.forEach(a.util.toArray(e),function(a){var c=a.cssText,d=f.concat();c&&(c.indexOf("../")>-1&&(d.pop(),c=c.replace("..",d.join("/"))),b.push(c))})}catch(g){}}),b.join(" ")}function f(b,c){return b=b||document.body,c=c||b.cloneNode(!0),a.util.forEach(a.util.toArray(b.children),function(a,b){f(a,c.children[b])}),c.setAttribute("style","none"!==b.style.display?a.util.getAppliedStyles(b):"display:none;"),c}function g(){var a;if(b.XMLHttpRequest){a=new XMLHttpRequest;try{a.withCredentials=!1}catch(c){}}else b.XDomainRequest?a=new XDomainRequest:b.ActiveXObject&&(a=new ActiveXObject("Microsoft.XMLHTTP"));return a}function h(b){b&&a.web.setConfig(b)}function i(b){"undefined"!=typeof b.enabled&&(b.enabled?a.web.enabled():a.web.disabled()),h(b.config)}function j(b){var c;try{return c=new Function([],"return "+b),c()}catch(d){a.console.error(d,c&&c.toString?c.toString():void 0)}}function k(c){var d,e;if(c&&(d=j(c)))for(e in d)d.hasOwnProperty(e)&&!C[e]&&(C[e]=d[e]);C.configure&&C.configure(a,b)}function l(b,c){for(var d=c.content,e=d.length,f=a.getConfig(),g=0;e>g;)m(b,c,d.substr(g,f.maxDataPacketSize),g,e),0===g?g=f.maxDataPacketSize:g+=f.maxDataPacketSize}function m(b,c,d,e,f){var g=function(a,b,c,d,e,f){return function(){var g=a.util.extend({},c);g.content=d,g.start=e,g.length=f,a.transport.emit(b,g)}}(a,b,c,d,e,f);setTimeout(g,100)}function n(b){c(b,"registration"),k(b.client),a.console.log("Registration",a.name)}function o(b){c(b,"ready"),i(b.web),C.configure||k(b.client),a.console.log("Ready",a.name)}function p(b){b.serialNumber===a.serialNumber&&(c(b,"online",!0),i(b.web),C.configure||k(b.client),a.transport.clearPendingQueue(),a.console.log("Online",a.name))}function q(b){b.serialNumber===a.serialNumber&&(c(b,"offline"),a.console.log("Offline",a.name))}function r(b){b.serialNumber===a.serialNumber&&(c(b,"client disconnect"),a.console.log("client disconnected",a.serialNumber),a.transport.forceReconnect())}function s(b){b.name||a.storage.removeItem("deviceName"),a.name=b.name,a.storage.addItem("deviceName",a.name,365),a.transport.showInfoBar("new name",!0)}function t(b){try{var c=g(),d=a.util.getUrl("proxy"),e=b.originalURL||b.url;c?(c.open("GET",b.url,!0),c.onreadystatechange=function(){if(4===c.readyState){var a;a=200===c.status?c.responseText:c.statusText,l("source",{url:e,content:a})}},c.onloadend=function(b){a.console.info("file:onLoadEnd",b)},c.onloadstart=function(b){a.console.info("file:onLoadStart",b)},c.onprogress=function(b){a.console.info("file:onProgress",b)},c.onload=function(b){a.console.info("file:onLoad",b)},c.onerror=function(c){-1===b.url.indexOf(d)?(b.originalURL=b.url,b.url=d+"?url="+encodeURIComponent(b.url),t(b)):(a.console.exception("file:onError",c),a.transport.emit("source",{url:e,content:"XMLHttpRequest Error: Possibally Access-Control-Allow-Origin security issue."}))},c.send(null)):a.transport.emit("source",{url:e,content:"XMLHttpRequest request not supported by the browser."})}catch(f){a.console.error(f)}}function u(){a.console.log("Reloading..."),b.setTimeout(function(a){return function(){b.location.reload?b.location.reload(!0):b.location.assign(a)}}(location.href),100)}function v(){a.web.hide(),l("content",{content:document.documentElement.innerHTML}),a.web.show()}function w(){a.web.hide(),a.transport.emit("previewContent",{content:'<html><head><style type="text/css">'+e()+"</style></head>"+f().outerHTML+"</html>"}),a.web.show()}function x(){d(),a.util.requireScript(a.util.getUrl("html2canvas"),function(){a.web.hide(),b.html2canvas(document.body,{completed:!1,logging:!0,useCORS:!0,proxy:a.util.getUrl("proxy"),onrendered:function(b){if(!this.completed)try{this.completed=!0,a.transport.emit("screenShot",{screen:b.toDataURL()})}catch(c){a.transport.emit("screenShot",{screen:!1}),a.console.exception(c)}a.web.show()}})})}function y(){var b=[],c=[],d=a.util.getOrigin();a.util.forEach(a.util.getScripts(),function(a){a.src&&b.push(a.src.replace(d,""))}),b.length>0&&a.transport.emit("files",{type:"javascript",files:b}),a.util.forEach(a.util.getStyles(),function(a){a.href&&c.push(a.href.replace(d,""))}),c.length>0&&a.transport.emit("files",{type:"style",files:c})}function z(b){b.state?a.console.profile():a.console.profileEnd()}function A(b){a.console.info("executing...");var c=j(b);"undefined"!=typeof c&&a.console.command(c)}function B(a){for(var b,c=0,d={},e=a.length;e>c;)b=a.key(c++),b&&(d[b]=a.getItem(b));return d}var C=a.client={};C.getMore=function(){var c=[{supports:{WebWorker:!!b.Worker,WebSocket:!!b.WebSocket,Storage:!!b.Storage,LocalStorage:!!b.localStorage,SessionStorage:!!b.sessionStorage,IDBFactory:!!b.IDBFactory,ApplicationCache:!!b.applicationCache,Console:!!a.console._native,Object:{create:!!Object.create,keys:!!Object.keys,getPrototypeOf:!!Object.getPrototypeOf,defineProperty:!!Object.defineProperty,defineProperties:!!Object.defineProperties,getOwnPropertyDescriptor:!!Object.getOwnPropertyDescriptor,preventExtensions:!!Object.preventExtensions,isExtensible:!!Object.isExtensible,seal:!!Object.seal,isSealed:!!Object.isSealed,freeze:!!Object.freeze,isFrozen:!!Object.isFrozen},Array:{isArray:!!Array.isArray,"prototype.indexOf":!!Array.prototype.indexOf,"prototype.lastIndexOf":!!Array.prototype.lastIndexOf,"prototype.reduceRight":!!Array.prototype.reduceRight,"prototype.reduce":!!Array.prototype.reduce,"prototype.map":!!Array.prototype.map,"prototype.forEach":!!Array.prototype.forEach,"prototype.some":!!Array.prototype.some,"prototype.every":!!Array.prototype.every,"prototype.filter":!!Array.prototype.filter},Function:{"prototype.bind":!!Function.prototype.bind},Date:{"prototype.toJSON":!!Date.prototype.toJSON},String:{"prototype.trim":!!String.prototype.trim},JSON:{parse:!!b.JSON&&!!b.JSON.parse,stringify:!!b.JSON&&!!b.JSON.stringify}}}];return b.localStorage&&b.sessionStorage&&c.push({storage:{localStorage:B(b.localStorage),sessionStorage:B(b.sessionStorage)}}),c},C.jsonify=function(b){var c={},d=["Arguments","Array","String","Number","Boolean","Error","ErrorEvent","Object"];return a.util.forEachProperty(b,function(b,e){c[e]=d.indexOf(a.util.getType(b))>-1?a.stringify.parse(b):typeof b}),c},C.getConfig=function(){var c=b.navigator,d={userAgent:c.userAgent,appVersion:c.appVersion,vendor:c.vendor,platform:c.platform,opera:!!b.opera,params:a.getConfig()};
+return a.serialNumber&&(d.serialNumber=a.serialNumber),a.name&&(d.name=a.name),d},C.register=function(){a.transport.emit("register",C.getConfig())},C.setUp=function(){a.transport.on("device:registration",n),a.transport.on("device:ready",o),a.transport.on("device:online",p),a.transport.on("device:offline",q),a.transport.on("device:disconnect",r),a.transport.on("device:command",A),a.transport.on("device:fileList",y),a.transport.on("device:htmlContent",v),a.transport.on("device:fileSource",t),a.transport.on("device:previewHTML",w),a.transport.on("device:captureScreen",x),a.transport.on("device:reload",u),a.transport.on("device:name",s),a.transport.on("device:profiler",z),a.transport.on("device:web:control",h),a.transport.on("device:web:config",i)}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(){var b=a.config||a.util.queryParams();return b.webOnly=b.webonly||b.webOnly,b.webOnly=b.webOnly===!0||"true"===(b.webOnly||"").toLowerCase(),b.web=b.web===!0||"true"===(b.web||"").toLowerCase(),b.secure=b.secure===!0||"true"===(b.secure||"").toLowerCase(),"undefined"!=typeof b.filters&&(b.filters="string"==typeof b.filters?b.filters.split(","):b.filters),"undefined"!=typeof b.excludes&&(b.excludes="string"==typeof b.excludes?b.excludes.split(","):b.excludes),b}function d(c){a.io=c||b.io,a.transport.setUp(),a.client.setUp(),g.web&&a.web.setUp()}function e(b){var c=!1;return a.util.every(a.getConfig().excludes,function(a){return b.indexOf(a+"/")>-1?(c=!0,!1):!0}),c}function f(){if(a.util.foundRequireJS()){var c=b.requirejs.load,d=a.util.getUrl("profiler");b.requirejs.load=function(f,g,h){c.call(b.requirejs,f,g,e(h)?h:a.util.getProfileUrl(d,h))}}a.profiler.setUp()}var g={url:"",base:"",secure:!1,profile:!1,excludes:[],profileWorker:"plugins/profileWorker.js",html2canvas:"plugins/html2canvas.js","socket.io":"socket.io/socket.io.js",webStyle:"console.css",profiler:"profiler",proxy:"proxy",maxDataPacketSize:5e3,nativeConsole:!0,web:!1,webOnly:!1,consoleId:"consoleioweb",docked:!1,position:"bottom",height:"300px",width:"99%"};a.configure=function(c){if(a.util.extend(g,c),a.util.foundRequireJS()&&(b.requirejs.onError=function(b){a.console.error(b,b.requireModules,b.originalError)}),g.profile&&f(),g.webOnly)a.web.setUp();else if(!a.util.isIFrameChild()){if(b.io)return d(),!1;a.util.foundRequireJS()?b.require(["socket.io"],d):a.util.require(a.util.getUrl("socket.io"),d)}},a.getConfig=function(){return g},a.styleSheet=function(){var a=document.createElement("style");return a.type="text/css",a.id="console.io.style",a.appendChild(document.createTextNode("")),document.getElementsByTagName("head")[0].appendChild(a),a.sheet||a.styleSheet}(),a.debug=function(b){var c,d=document.getElementById("log");!d&&document.body&&(d=document.createElement("ul"),d.setAttribute("id","log"),d.style.position="absolute",d.style.background="rgb(48, 46, 46)",d.style.height="200px",d.style.width="800px",d.style.top="20px",d.style.left="50px",d.style.margin="10px",d.style.paddingTop="10px",d.style.zIndex=6e3,d.style.color="white",document.body.insertBefore(d,a.util.getFirstElement(document.body))),d&&(c=document.createElement("li"),c.innerHTML=b,d.insertBefore(c,a.util.getFirstElement(d)))};var h=b.onerror;b.onerror=function(b,c,d){var e=!1;return h&&(e=h(b,c,d)),a.transport.isConnected()?a.transport.emit("console",{type:"error",message:b+";\nfileName: "+c+";\nlineNo: "+d}):a.util.isIFrameChild()?a.console.exception(b+";\nfileName: "+c+";\nlineNo: "+d):a.debug([b,c,d].join("; ")),e},b.navigator.userAgent.search(/Maple/i)>-1&&"function"==typeof HTMLElement.prototype.addEventListener&&"function"==typeof HTMLElement.prototype.attachEvent&&(HTMLElement.prototype.attachEvent=void 0),Function.prototype.bind&&b.console&&"object"==typeof b.console.log&&a.util.forEach(["log","info","warn","error","assert","dir","clear","profile","profileEnd"],function(a){b.console[a]=this.bind(b.console[a],b.console)},Function.prototype.call),a.util.isIFrameChild()&&b.parent.postMessage&&a.console.on("console",function(a){b.parent.postMessage({event:"console",type:a.type,message:escape(a.message),stack:a.stack},"*")}),a.util.foundRequireJS()||a.util.ready(function(){a.configure(c())})}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),function(a,b){function c(){this.store={added:[],queue:[]},this.config=a.util.extend({docked:!1,position:"bottom",height:"300px",width:"99%"},a.getConfig()),this.control={pageSize:this.config.pageSize||50,filters:this.config.filters||[],paused:!1,search:null},this.config.search&&this.applySearch(this.config.search),this.isEnabled=!1,this.view=new d(this)}function d(a){this.ctrl=a,this.elements={},this.target=null,this.container=null}var e=a.web={};c.prototype.setUp=function(){var b=this;a.util.requireCSS(a.util.getUrl("webStyle"),function(){b.enabled()})},c.prototype.enabled=function(){this.isEnabled||(this.isEnabled=!0,this.view.render(document.body),a.console.on("console",a.web.logger),b.addEventListener?b.addEventListener("message",a.web.onMessage,!1):b.detachEvent&&b.detachEvent("onmessage",a.web.onMessage),a.transport.emit("webStatus",{enabled:!0}))},c.prototype.disabled=function(){this.isEnabled&&(this.isEnabled=!1,a.console.removeListener("console",a.web.logger),b.removeEventListener?b.removeEventListener("message",a.web.onMessage,!1):b.attachEvent&&b.attachEvent("onmessage",a.web.onMessage),a.transport.emit("webStatus",{enabled:!1}),this.view.destroy())},c.prototype.setControl=function(a){"undefined"!=typeof a.paused&&(this.control.paused=a.paused),"undefined"!=typeof a.filters&&(this.control.filters=a.filters),a.pageSize!==this.control.pageSize&&(this.control.pageSize=a.pageSize),a.search!==this.control.search&&this.applySearch(a.search),this.view.clear(),a.clear||(this.view.addBatch(this.getData(this.store.added)),this.addBatch())},c.prototype.getData=function(b){var c=0,d=[];return b.length>0&&a.util.every([].concat(b).reverse(),function(a){return this.isFiltered(a)&&this.isSearchFiltered(a)&&(d.push(a),c++),this.control.pageSize>c},this),d},c.prototype.hide=function(){return this.view.hide()},c.prototype.show=function(){return this.view.show()},c.prototype.add=function(a){this.control.paused?this.store.queue.push(a):(this.store.added.push(a),this.view.add(a))},c.prototype.addBatch=function(){this.control.paused||(this.view.addBatch(this.getData(this.store.queue)),this.store.added=this.store.added.concat(this.store.queue),this.store.queue=[])},c.prototype.applySearch=function(a){this.control.search="undefined"!=typeof a?a:null,this.control.search&&(this.control.search="\\"!==this.control.search[0]?new RegExp("\\b"+this.control.search,"img"):new RegExp(this.control.search,"img"))},c.prototype.isSearchFiltered=function(a){return this.control.search?a.message.search(this.control.search)>-1:!0},c.prototype.isFiltered=function(a){return 0===this.control.filters.length||this.control.filters.length>0&&this.control.filters.indexOf(a.type)>-1},d.prototype.render=function(a){this.target=a,this.createContainer()},d.prototype.reload=function(){this.clear(),this.container.parentNode.removeChild(this.container),this.createContainer()},d.prototype.destroy=function(){this.container&&(this.clear(),this.container.parentNode&&(this.container.parentNode.removeChild(this.container),this.container=null,this.target=null))},d.prototype.hide=function(){this.target&&this.container&&this.target.removeChild(this.container)},d.prototype.show=function(){this.target&&this.container&&(this.ctrl.config.position&&"top"===this.ctrl.config.position?this.target.insertBefore(this.container,a.util.getFirstElement(this.target)):this.target.appendChild(this.container))},d.prototype.createContainer=function(){if(this.container)return!1;var b=["background-color: rgba(244, 244, 244, 0.9)","background-color: rgb(244, 244, 244)","color: black","z-index: 5000","overflow: auto","margin: 5px","-o-box-shadow: 0 0 5px 1px #888","-moz-box-shadow: 0 0 5px 1px #888","-webkit-box-shadow: 0 0 5px 1px #888","box-shadow: 0 0 5px 1px #888"];switch(this.ctrl.config.docked||b.push("position:absolute"),this.ctrl.config.height&&b.push("height:"+this.ctrl.config.height),this.ctrl.config.width&&b.push("width:"+this.ctrl.config.width),this.ctrl.config.position.toLowerCase()){case"top":b.push("top: 5px");break;default:b.push("bottom: 5px")}var c=a.getConfig();a.util.deleteCSSRule(a.styleSheet,"#"+c.consoleId),a.util.addCSSRule(a.styleSheet,"#"+c.consoleId,b.join(";")),this.container=this.createElement({attr:{id:c.consoleId,tabindex:1},target:this.target,position:this.ctrl.config.position})},d.prototype.createElement=function(b){b.tag=b.tag||"div",this.elements[b.tag]||(this.elements[b.tag]=document.createElement(b.tag));var c=this.elements[b.tag].cloneNode(!1);return a.util.forEachProperty(b.attr,function(a,b){a&&c.setAttribute(b,a)}),a.util.forEachProperty(b.prop,function(a,b){a&&(c[b]=a)}),b.target&&(b.position&&"top"===b.position?b.target.insertBefore(c,a.util.getFirstElement(b.target)):b.target.appendChild(c)),c},d.prototype.stripBrackets=function(a){var b=a.length-1;return"["===a.charAt(0)&&"]"===a.charAt(b)?a.substring(1,b):a},d.prototype.getElementData=function(b){var c,d,e="code",f=b.type,g=b.origin,h=this.stripBrackets(b.message);if("assert"===b.type){var i=this.stripBrackets(h).split(",");"true"!==i[0].toLowerCase()&&(f="assert-failed")}if(h=h.replace(/%20/gim," "),h.indexOf("{")>-1&&h.indexOf("}")>-1&&(e="pre"),b.stack){var j=b.stack.split(",").join("\n").replace(/"/gim,"").replace(/%20/gim," ");d=this.stripBrackets(j),h+="\n"+d}return["assert","dir","dirxml","error","trace"].indexOf(b.type)>-1&&(e="pre"),g&&(g=b.origin.replace(/(\/|:|\.)/gim,""),c="content: 'iframe:"+b.origin+"'; position: absolute; top: 0px; right: 0px; padding: 2px 8px; "+"font-size: 12px; color: lightgrey !important; "+"background-color: black; "+"font-family: Monaco,Menlo,Consolas,'Courier New',monospace;",a.util.deleteCSSRule(a.styleSheet,"."+g+":before"),a.util.addCSSRule(a.styleSheet,"."+g+":before",c)),{tag:e,className:"console type-"+f+(g?" "+g:""),message:h||"."}},d.prototype.add=function(a){if(!this.ctrl.isFiltered(a)||!this.ctrl.isSearchFiltered(a)||!this.container)return!1;var b=this.getElementData(a);this.createElement({tag:b.tag,attr:{"class":b.className},prop:{innerHTML:b.message},target:this.container,position:"top"}),this.removeOverflowElement()},d.prototype.addBatch=function(b){if(b.length>0&&this.container){var c=document.createDocumentFragment();a.util.forEach(b,function(a){var b=this.getElementData(a);this.createElement({tag:b.tag,attr:{"class":b.className},prop:{innerHTML:b.message},target:c,position:"bottom"})},this),this.container.insertBefore(c,a.util.getFirstElement(this.container)),this.removeOverflowElement()}},d.prototype.clear=function(){if(this.container)for(;this.container.firstChild;)this.container.removeChild(this.container.firstChild)},d.prototype.removeOverflowElement=function(){for(var a=this.container.childElementCount||this.container.children.length;a>this.ctrl.control.pageSize;)this.container.removeChild(this.container.lastElementChild||this.container.lastChild),a--},e.logger=function(b){a.web.console&&a.web.console.add(b)},e.onMessage=function(b){if(a.web.console){var c=b.data;"console"===c.event&&a.web.console.add({type:c.type,message:unescape(c.message),stack:c.stack,origin:b.origin})}},e.setUp=function(){e.console||(e.console=new c),e.console.setUp()},e.enabled=function(){e.console?e.console.enabled():e.setUp()},e.disabled=function(){e.console&&e.console.disabled()},e.setConfig=function(b){e.console&&e.console.setControl(b);var c=[a.name||"",a.serialNumber||"",a.transport.isConnected()?"online":"offline"];b.paused&&c.push("paused"),b.filters&&b.filters.length>0&&c.push("filters:"+b.filters.join(",")),b.pageSize&&c.push("pagesize:"+b.pageSize),b.search&&c.push("search:"+b.search),a.util.showInfo(c.join("|"),a.transport.isConnected())},e.show=function(){return e.console?e.console.show():void 0},e.hide=function(){return e.console?e.console.hide():void 0}}("undefined"!=typeof ConsoleIO?ConsoleIO:module.exports,this),"function"==typeof define&&define.amd&&define([],function(){return ConsoleIO})}();
View
2  dist/client/console.min.css
@@ -5,7 +5,7 @@
* Website: http://nkashyap.github.io/console.io/
* Author: Nisheeth Kashyap
* Email: nisheeth.k.kashyap@gmail.com
- * Date: 2013-10-04
+ * Date: 2013-10-17
*/
View
4 example/index.html
@@ -6,10 +6,9 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Console.IO - HTTP - Test Page</title>
<link rel="stylesheet" href="main.css" type="text/css">
- <script type="text/javascript" src="main.js"></script>
</head>
<body>
-<div id="wrapper" style="background-image: url(https://raw.github.com/nkashyap/console.io/master/resources/images/console.io.png);">
+<div id="wrapper" style="background-image: url(https://raw.github.com/nkashyap/console.io/master/resources/images/console.io.png); background-color:#FFFFFF; height: 400px;">
<h1 id="ConnectionMode">Info: </h1>
<ul id="log"></ul>
<div id="debug"></div>
@@ -19,5 +18,6 @@ <h1 id="ConnectionMode">Info: </h1>
<div>Console.IO</div>
</div>
</div>
+<script type="text/javascript" src="main.js"></script>
</body>
</html>
View
155 server/platforms/samsung/maple/2.5/client.js
@@ -0,0 +1,155 @@
+/**
+ * Created with IntelliJ IDEA.
+ * User: nisheeth
+ * Date: 10/04/13
+ * Time: 21:38
+ * To change this template use File | Settings | File Templates.
+ */
+
+(function client() {
+ return {
+ configure: function configure(exports, global) {
+ var files = ["$MANAGER_WIDGET/Common/webapi/1.0/deviceapis.js"],
+ connectionWatch = {
+ onconnect: function (type) {
+ exports.console.info(type + " is connected successfully");
+ },
+ ondisconnect: function (type) {
+ exports.console.info(type + " is disconnected");
+ }
+ };
+
+ //global.alert = exports.console.info;
+
+ exports.client.CONST = {
+ NETWORK: {
+ '0': 'WIFI',
+ '1': 'LAN'
+ }
+ };
+
+ exports.transport.on('device:status', function () {
+ exports.client.onStatus(exports, global);
+ });
+
+ function errorCallback() {
+ exports.console.exception(arguments);
+ }
+
+ function load() {
+ exports.console.log('deviceapis.js loaded', typeof global.deviceapis);
+ exports.client.api = global.deviceapis;
+
+ if (!exports.serialNumber) {
+ exports.serialNumber = exports.client.api.tv.info.getDeviceID();
+ exports.storage.addItem('serialNumber', exports.serialNumber, 365);
+ }
+
+ try {
+ exports.client.api.network.getAvailableNetworks(function networkSuccess(networks) {
+ exports.util.forEach(networks, function (network) {
+ network.setWatchListener(connectionWatch, errorCallback);
+ });
+ }, errorCallback);
+ } catch (e) {
+ exports.console.exception(e);
+ }
+
+ exports.client.register();
+ }
+
+ if (!global.deviceapis) {
+ exports.util.require(files, load);
+ } else {
+ load();
+ }
+ },
+
+ getDeviceFamily: function getDeviceFamily(exports) {
+ var api = exports.client.api;
+ if (api) {
+ switch (api.tv.info.getProduct()) {
+ case api.tv.info.PRODUCT_TYPE_TV:
+ return 'TV';
+ case api.tv.info.PRODUCT_TYPE_BD:
+ return 'Blue-ray player';
+ case api.tv.info.PRODUCT_TYPE_MONITOR:
+ return 'Monitor';
+ }
+ }
+ },
+
+ onStatus: function onStatus(exports, global) {
+ var api = exports.client.api,
+ info = [],
+ queryParams = exports.util.getQueryParams(),
+ device = {
+ family: exports.client.getDeviceFamily(exports),
+ modelName: api.tv.info.getModel(),
+ serialNumber: api.tv.info.getDeviceID(),
+ platform: api.platform,
+ firmware: api.tv.info.getFirmware(),
+ esnWidevine: api.tv.info.getESN('WIDEVINE'),
+ apiVersion: api.ver,
+ country: api.tv.info.getCountry(),
+ language: api.tv.info.getLanguage()
+ },
+ network = {
+ mode: exports.transport.connectionMode,
+ network: exports.client.CONST.NETWORK[api._plugin("Network", "GetActiveType")]
+ };
+
+ try {
+ device.version = api.tv.info.getVersion();
+ } catch (e) {}
+
+ if (queryParams.totalMemory) {
+ device.totalMemory = queryParams.totalMemory;
+ }
+
+ exports.util.forEachProperty(api.tv.info.getTimeZone(), function (value, property) {
+ device['timeZone.' + property] = value;
+ });
+
+ info.push({ device: device });
+ info.push({ connection: network });
+ info.push({ document: { cookie: global.document.cookie }});
+ info.push({ navigator: exports.client.jsonify(global.navigator) });
+ info.push({ location: exports.client.jsonify(global.location) });
+ info.push({ screen: exports.client.jsonify(global.screen) });
+
+ function callBack() {
+ exports.transport.emit('status', { info: info.concat(exports.client.getMore()) });
+ }
+
+ if (api.network && api.network.getAvailableNetworks) {
+ api.network.getAvailableNetworks(function (networks) {
+
+ network.interfaces = networks.length;
+ exports.util.every(networks, function (net) {
+ if (net.isActive()) {
+ network.mac = net.mac;
+ network.ip = net.ip;
+ network.ipMode = net.ipMode;
+ network.dns = net.dns;
+ network.dnsMode = net.dnsMode;
+ network.gateway = net.gateway;
+ network.netmask = net.subnetMask;
+ return false;
+ }
+
+ return true;
+ });
+
+ callBack();
+
+ }, function errorCallback(e) {
+ exports.console.exception(e);
+ callBack();
+ });
+ } else {
+ callBack();
+ }
+ }
+ };
+}());
View
4 src/client/client.js
@@ -512,8 +512,8 @@
'prototype.trim': !!String.prototype.trim
},
"JSON": {
- 'parse': !!JSON.parse,
- 'stringify': !!JSON.stringify
+ 'parse': !!global.JSON && !!global.JSON.parse,
+ 'stringify': !!global.JSON && !!global.JSON.stringify
}
}
}
View
1  src/client/web.js
@@ -220,6 +220,7 @@
var styles = [
'background-color: rgba(244, 244, 244, 0.9)',
+ 'background-color: rgb(244, 244, 244)',
'color: black',
'z-index: 5000',
'overflow: auto',
Please sign in to comment.
Something went wrong with that request. Please try again.