"),p.$tab.find("#currentHost").html(this.main.currentHost),1'+s+"")}else"outputCount"===i?p.$tab.find('.instance-out[data-instance-id="'+e+'"]').html('↦'+t.val+""):"inputCount"===i&&p.$tab.find('.instance-in[data-instance-id="'+e+'"]').html('⇥'+t.val+"");if(-1!==this.list.indexOf(e))return void("alive"!==i&&"connected"!==i||f(e));e="system.adapter."+n[0]+"."+n[1],-1!==this.list.indexOf(e)&&"connection"===i&&f(e)}}},this.objectChange=function(e,t,n){if(e.match(/^system\.adapter\.[-\w]+\.[0-9]+$/))if(t)-1===this.list.indexOf(e)?(this.list.push(e),this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){p.updateTimer=null,p.init(!0)},200),t.common.noConfig||setTimeout(function(){-1===window.location.hash.indexOf("/config/")&&p.main.navigate({tab:"instances",dialog:"config",params:e})},2e3)):-1!==e.indexOf(".web.")?(this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){p.updateTimer=null,p.init(!0)},200)):this.$grid.find('.instance-adapter[data-instance-id="'+e+'"]').html(d(this.$grid,e,this.main.config.instanceForm,!0));else{var i=this.list.indexOf(e);-1!==i&&(this.list.splice(i,1),this.$grid.find('.instance-adapter[data-instance-id="'+e+'"]').remove())}else e.match(/^system\.host\.[-\w]+$/)&&(this.updateTimer&&clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){p.updateTimer=null,p.init(!0)},200))},this.initButtons=function(e,t){e=e?'[data-instance-id="'+e+'"]':"";var n=p.$grid.find(".instance-edit"+e).off("click").on("click",function(){p.onEdit($(this).attr("data-instance-id"))});n.find(".ui-button-icon-primary").length||n.attr("title",_("edit")),(n=p.$grid.find(".instance-settings"+e).off("click").on("click",function(){p.main.navigate({tab:"instances",dialog:"config",params:$(this).data("instance-id")})})).each(function(){var e=$(this).attr("data-instance-id");i.objects[e]&&i.objects[e].common&&i.objects[e].common.noConfig&&$(this).addClass("disabled")}),n=p.$grid.find(".instance-reload"+e).off("click").on("click",function(){p.main.socket.emit("extendObject",$(this).attr("data-instance-id"),{},function(e){e&&p.main.showError(e)})}),n=p.$grid.find(".instance-del"+e).off("click").on("click",function(){var t=$(this).attr("data-instance-id");if(p.main.objects[t]&&p.main.objects[t].common&&p.main.objects[t].common.host){var e=t.replace(/^system\.adapter\./,"");p.main.confirmMessage(_("Are you sure you want to delete the instance %s?",e),null,"help",function(e){e&&p.main.cmdExec(p.main.objects[t].common.host,"del "+t.replace("system.adapter.",""),function(e){e||p.main.tabs.adapters.init(!0)})})}}),n=p.$grid.find(".instance-issue"+e).off("click").on("click",function(){p.main.navigate({tab:"instances",dialog:"issue",params:$(this).data("instance-id")})}),p.$grid.find(".instance-image"+e).each(function(){$(this).data("installed")||($(this).data("installed",!0),$(this).hover(function(){var e='
',t=$(e);t.insertAfter($(this)),$(this).data("big",t[0]);var n=parseFloat(t.height()),i=Math.round($(this).position().top-(n-parseFloat($(this).height()))/2);n+i>(window.innerHeight||document.documentElement.clientHeight)&&(i=(window.innerHeight||document.documentElement.clientHeight)-n),i<0&&(i=0),t.css({top:i})},function(){var e=$(this).data("big");$(e).remove(),$(this).data("big",void 0)}))}),(n=p.$grid.find(".instance-stop-run"+e).off("click").on("click",function(){var e=$(this).attr("data-instance-id");$(this).addClass("disabled"),p.main.socket.emit("extendObject",e,{common:{enabled:!p.main.objects[e].common.enabled}},function(e){e&&p.main.showError(e)})})).find(".ui-button-icon-primary").length||n.each(function(){var e=$(this).attr("data-instance-id");p.main.objects[e].common.enabled?n.addClass("instance-running").attr("title",_("Activated. Click to stop.")).find("i").html("pause"):n.removeClass("instance-running").attr("title",_("Deactivated. Click to start.")).find("i").html("play_arrow")}),n=p.$grid.find(".instance-web"+e).off("click").on("click",function(){var e=$(this).data("link");if("object"==typeof e){var t="";for(var n in e)if(e.hasOwnProperty(n)&&"__first"!==n){var i=e[n].match(/^https?:\/\/[-.\w]+:(\d+)\/?/),a=e[n].match(/^https:\/\//);t+='
"))}).done(a.$dialogIssue.find(".collapsible").collapsible())}a.$dialogIssue.data("name",t),a.$dialogIssue.find(".title").html(_("Known bugs for")+": "+t),a.$dialogIssue.find(".dialog-system-buttons .btn-add").attr("href","https://github.com/"+i[3]+"/"+i[4]+"/issues/new"),a.$dialogIssue.find(".dialog-system-buttons .btn-cancel").off("click").on("click",function(e){e.stopPropagation(),e.preventDefault(),a.main.navigate()})}},this.destroy=function(){this.inited&&(this.$dialogIssue.find(".collapsible").collapsible("destroy"),this.inited=!1)}}function Logs(t){var c=this;this.main=t,this.$tab=$("#tab-logs");var s,l,o,d,r={count:0,start:0,limit:2e3},u={host:"",severity:"",message:""},m={list:[],mode:!1,counter:0,overflow:!1,$counterSpan:null};this.prepare=function(){l=this.$tab.find("#log-outer"),s=this.$tab.find("#log-table"),o=this.$tab.find("#log-pause"),(d=new IobListHeader("log-outer-header",{list:l,colWidthOffset:1,prefix:"log-filter"})).doFilter=c.filter,d.add("combobox","from","host"),d.add("text","Time"),d.add("combobox","","severity",[{val:"",name:"debug"},{val:"silly",name:"silly"},{val:"info",name:"info"},{val:"warn",name:"warn"},{val:"error",name:"error"}]).$filter.attr("title",_("severity")),d.add("edit","Message","message"),this.$tab.find("#log-clear-on-disk").on("click",function(){c.main.confirmMessage(_("Log file will be deleted. Are you sure?"),null,null,function(e){e&&c.main.socket.emit("sendToHost",t.currentHost,"delLogs",null,function(e){e?c.main.showError(e):c.clear()})})}).addClass("ui-state-error"),this.$tab.find("#log-refresh").on("click",function(){c.clear()}),o.attr("title",_("Pause output")).on("click",function(){c.pause()}),m.$counterSpan=o.find("ui-button-text"),this.$tab.find("#log-clear").on("click",function(){c.clear(!1)}),$("#log-copy-text").on("click",function(){$(this).hide().html("")}),this.$tab.find("#log-copy").on("click",function(){var e=''+_("copy note")+"";$("#log-copy-text").show().html(e+'
",g.$gridUsers.html(e),g.$grid.find("#tab-users-btn-new-user").on("click",function(){y(!1)}),g.$gridUsers.find(".tab-users-enabled-user").on("click",function(){var e=$(this).data("user");if("system.user.admin"===e)return h(_("Cannot disable admin!"),!0),!1;var t=$(this),n=g.main.objects[e]&&g.main.objects[e].common&&g.main.objects[e].common.enabled;n=!n,g.main.socket.emit("extendObject",e,{common:{enabled:n}},function(e){e?h(_("Cannot modify user!")+e,!0):(h(_("Updated")),t.find("i").text(n?"check_box":"check_box_outline_blank"))})}),g.$gridUsers.find(".delete-content").off("click").on("click",function(){var t=$(this).data("user");$(this).hasClass("disabled")||(g.main.objects[t]&&"user"===g.main.objects[t].type?g.main.confirmMessage(_("Are you sure to delete %s?",t),null,"help",function(e){e&&p(t)}):h(_('Object "%s" does not exists. Update the page.',t),!0))}),g.$gridUsers.find(".edit-content").on("click",function(){y($(this).data("user"))}),g.$gridUsers.find(".tab-users-remove-group").on("click",function(){var i=$(this).data("user"),e=$(this).data("group");g.main.socket.emit("getObject",e,function(e,t){if(t&&t.common&&t.common.members){var n=t.common.members.indexOf(i);-1!==n?(t.common.members.splice(n,1),g.main.socket.emit("setObject",t._id,t,function(e){e?h(_("Error: %s",e),!0):h(_("Removed"))})):h(_("%s is not in the list"),!0)}})})}function n(){var e="";e+='
",g.$gridGroups.html(e),g.$grid.find("#tab-users-btn-new-group").on("click",function(){y(!0)}),g.$gridGroups.find(".delete-content").on("click",function(){var n=$(this).data("group");$(this).hasClass("disabled")||(g.main.objects[n]&&"group"===g.main.objects[n].type?g.main.confirmMessage(_("Are you sure to delete %s?",n),null,"help",function(e){var t;e&&(t=n,g.main.objects[t]&&"group"===g.main.objects[t].type?g.main.objects[t].common&&g.main.objects[t].common.dontDelete?h(_("Object may not be deleted"),!0):g.main.socket.emit("delObject",t,function(e){e?h(_("Group may not be deleted: %s",e),!0):h(_("Group deleted"))}):h(_("Invalid object: %s",t),!0))}):h(_('Object "%s" does not exists. Update the page.',n),!0))}),g.$gridGroups.find(".edit-content").on("click",function(){y($(this).data("group"))}),g.$gridGroups.find(".tab-users-remove-user").on("click",function(){var i=$(this).data("user"),e=$(this).data("group");g.main.socket.emit("getObject",e,function(e,t){if(t&&t.common&&t.common.members){var n=t.common.members.indexOf(i);if(-1!==n){if(t.common.members.splice(n,1),!t._id)return void console.error("INVLAID ID");g.main.socket.emit("setObject",t._id,t,function(e){e?h(_("Error: %s",e),!0):h(_("Removed"))})}else h(_("%s is not in the list"),!0)}})})}this.groups=[],this.list=[],this.$grid=$("#tab-users"),this.$gridUsers=this.$grid.find(".tab-users-list-users .tab-users-body"),this.$gridGroups=this.$grid.find(".tab-users-list-groups .tab-users-body"),this.main=e,this.aclGroups=null,this.prepare=function(){},this._postInit=function(){var e;t(),g.$gridUsers.find("ul").sortable({connectWith:"#tab-users .tab-users-list-groups .treetable",items:".users-type-draggable",appendTo:g.$gridUsers,refreshPositions:!0,helper:function(e,t){return $('
'+t.find(".treetable-icon-empty+span").text()+"
")},zIndex:999990,revert:!1,scroll:!1,start:function(e,t){var n=t.item.prev();t.item.data("prev",n),g.$grid.addClass("dragging")},stop:function(e,t){g.$grid.removeClass("dragging")},update:function(e,t){var n=t.item.data("prev");n&&n.length?$(n).after(t.item):$(this).prepend(t.item)}}).disableSelection(),n(),(e=g.$gridGroups.find("ul>li")).droppable("instance")&&e.droppable("destroy"),e.droppable({accept:".users-type-draggable",over:function(e,t){if($(this).addClass("tab-accept-item"),$(this).hasClass("not-empty")&&!$(this).hasClass("expanded")){var n,i=$(this).data("tt-id");(n=$(this).data("timer"))&&clearTimeout(n),$(this).data("timer",setTimeout(function(){g.$gridGroups.treeTable("expand",i)},1e3))}},out:function(e,t){var n;$(this).removeClass("tab-accept-item"),(n=$(this).data("timer"))&&(clearTimeout(n),$(this).data("timer",null))},tolerance:"pointer",drop:function(e,t){$(this).removeClass("tab-accept-item");var n=t.draggable.data("tt-id"),i=$(this).data("tt-id");g.main.socket.emit("getObject",i,function(e,t){t&&t.common&&(t.common.members=t.common.members||[],-1===t.common.members.indexOf(n)?(t.common.members.push(n),t.common.members.sort(),g.main.socket.emit("setObject",t._id,t,function(e){e?h(_("Error: %s",e),!0):h(_("%s added to %s",n,t._id))})):h(_("Is yet in the list")))})}})},this.init=function(e){this.inited&&!e||(void 0!==this.$gridUsers&&this._postInit(),this.inited||(h(_("You can drag&drop users to groups"),5e3),this.inited=!0,this.main.subscribeObjects("system.user.*"),this.main.subscribeObjects("system.group.*")))},this.destroy=function(){this.inited&&(this.inited=!1,this.main.unsubscribeObjects("system.user.*"),this.main.unsubscribeObjects("system.group.*"))},this.objectChange=function(e,t,n){if(e.match(/^system\.user\./)){if(t)-1===this.list.indexOf(e)&&this.list.push(e);else{var i=this.list.indexOf(e);-1!==i&&this.list.splice(i,1)}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){g.timer=null,g._postInit()},200)}else if(e.match(/^system\.group\./)){if(t)-1===this.groups.indexOf(e)&&this.groups.push(e);else{var a=this.groups.indexOf(e);-1!==a&&this.groups.splice(a,1)}this.timer&&clearTimeout(this.timer),this.timer=setTimeout(function(){g.timer=null,g._postInit()},200)}}}!function(C){C(document).ready(function(){var e=location.pathname+"socket.io";location.pathname.match(/^\/admin\//)&&(e="/socket.io");var s,y={},v={objects:{},states:{},currentHost:"",currentTab:null,currentDialog:null,currentUser:"",subscribesStates:{},subscribesObjects:{},subscribesLogs:0,socket:io.connect("/",{path:e}),systemConfig:null,instances:null,objectsLoaded:!1,waitForRestart:!1,tabs:null,dialogs:{},selectId:null,config:{},ignoreJSupdate:!1,addEventMessage:function(e,t,n,i){g.events.add(e,t,n,i)},saveConfig:function(e,t){e&&(v.config[e]=t),"undefined"!=typeof storage&&storage.set("adminConfig",JSON.stringify(v.config))},saveTabs:function(){this.socket.emit("setObject","system.config",this.systemConfig,function(e){e&&this.showError(e)})},upToDate:function(e,t){return e=e.split("."),t=t.split("."),e[0]=parseInt(e[0],10),t[0]=parseInt(t[0],10),!(e[0]>t[0])&&(e[0]!==t[0]||(e[1]=parseInt(e[1],10),t[1]=parseInt(t[1],10),!(e[1]>t[1])&&(e[1]!==t[1]||(e[2]=parseInt(e[2],10),t[2]=parseInt(t[2],10),e[2]<=t[2]))))},cmdExec:function(e,t,n){e=e||v.currentHost,c.val(""),l.modal("open"),s="$ ./yunkong2 "+t,l.data("finished",!1).find(".btn").html(_("In background")),l.find(".command").html(s),l.find(".progress-dont-close").removeClass("disabled"),p.find(".button-command").removeClass("error").addClass("in-progress"),l.data("max",null),l.data("error",""),h.addClass("indeterminate").removeClass("determinate"),t.match(/^upload /)?l.find(".progress-text").html(_("Upload started...")).removeClass("error"):t.match(/^del [-_\w\d]+\.[\d]+$/)?l.find(".progress-text").html(_("Removing of instance...")).removeClass("error"):t.match(/^del /)?l.find(".progress-text").html(_("Removing of adapter...")).removeClass("error"):t.match(/^url /)?l.find(".progress-text").html(_("Install or update from URL...")).removeClass("error"):t.match(/^add /)?l.find(".progress-text").html(_("Add instance...")).removeClass("error"):l.find(".progress-text").html(_("Started...")).removeClass("error"),c.val(s),r=Math.floor(268435454*Math.random())+1,o=n,v.socket.emit("cmdExec",e,r,t,function(e){e?(s+="\n"+_(e),c.val(s),o=null,n(e)):n&&n()})},confirmMessage:function(e,t,n,i,a){if("function"==typeof i)a=i,m.find(".modal-footer").html(''+_("Ok")+''+_("Cancel")+""),m.find(".modal-footer .modal-action").on("click",function(){var e=m.data("callback");e&&e(C(this).data("result"))});else if("object"==typeof i){for(var s="",o=i.length-1;0<=o;o--)s+=''+i[o]+"";m.find(".modal-footer").html(s),m.find(".modal-footer .modal-action").on("click",function(){var e=m.data("callback");e&&e(C(this).data("id"))})}m.find(".dialog-title").text(t||_("Please confirm")),n?m.find(".dialog-icon").show().html(n):m.find(".dialog-icon").hide(),m.find(".dialog-text").html(e),m.data("callback",a),m.modal("open")},showMessage:function(e,t,n){u.find(".dialog-title").text(t||_("Message")),n?u.find(".dialog-icon").show().html(n):u.find(".dialog-icon").hide(),u.find(".dialog-text").html(e),u.modal("open")},showError:function(e){v.showMessage(_(e),_("Error"),"error_outline")},showToast:function(e,t,n,i,a,s){e&&e instanceof jQuery&&(e=e[0]),"string"==typeof(s=s||[])&&(s=[s]),a&&s.push("dropZone-error"),M.toast({parentSelector:e||C("body")[0],html:t+(n?''+n+"":""),displayLength:i||3e3,classes:s})},formatDate:function(e,t){if(!e)return"";var n,i=typeof e;return"string"===i?t?e.substring(8):e:("object"!==i&&(e=e<9466812e5?new Date(1e3*e):new Date(e)),t?i=(n=e.getDate())<10?"0"+n:n:(i=e.getFullYear(),i+=(n=e.getMonth()+1)<10?"-0"+n:"-"+n,i+=(n=e.getDate())<10?"-0"+n:"-"+n),i+=(n=e.getHours())<10?" 0"+n:" "+n,i+=(n=e.getMinutes())<10?":0"+n:":"+n,i+=(n=e.getSeconds())<10?":0"+n:":"+n,i+=(n=e.getMilliseconds())<10?".00"+n:n<100?".0"+n:"."+n)},updateWizard:function(){var e=C("#button-wizard");v.objects["system.adapter.discovery.0"]?(e.data("inited")||(e.data("inited",!0),e.on("click",function(){v.navigate({tab:"instances",dialog:"config",params:"system.adapter.discovery.0"})}).attr("title",_("Device discovery"))),e.show(),!v.systemConfig.common.wizard&&v.systemConfig.common.licenseConfirmed&&e.trigger("click")):e.hide()},getUser:function(){if(v.currentUser){if(v.objects[v.currentUser]){var e=v.objects[v.currentUser],t="";if(t=e&&e.common&&e.common.name?translateName(e.common.name):(t=v.currentUser.replace(/^system\.user\./))[0].toUpperCase()+t.substring(1).toLowerCase(),e&&e.common&&e.common.icon){var n={};n[v.currentUser]=e,C("#current-user-icon").html(v.getIcon(v.currentUser,null,n))}else C("#current-user-icon").html('account_circle');C("#current-user").html(t);for(var i=[],a=0;aone object or all children of %s too?',t),null,"help_outline",[_("_All"),_("Only one"),_("Cancel")],function(e){0===e?v._delObjects(t,!0,n):1===e&&v._delObjects(t,!1,n)}):v.confirmMessage(_("Are you sure to delete %s?",t),null,"help_outline",function(e){e&&v._delObjects(t,!0,n)}):i&&i.children?v.confirmMessage(_("Are you sure to delete all children of %s?",t),null,"help_outline",function(e){e&&v._delObjects(t,!0,n)}):v.showMessage(_('Object "%s" does not exists. Update the page.',t),_("Error"),"help_outline",function(e){e&&v._delObjects(t,!0,n)})}},g={hosts:new Hosts(gMain=v),objects:new Objects(v),adapters:new Adapters(v),instances:new Instances(v),users:new Users(v),enums:new Enums(v),events:new Events(v),logs:new Logs(v),states:null,intro:new Intro(v)};"undefined"!=typeof States&&(g.states=new States(v)),v.instances=g.instances.list,v.tabs=g,v.dialogs={system:new System(v),customs:new Customs(v),config:new Config(v),editobject:new EditObject(v),issue:new Issue(v),readme:new Readme(v)};var o=null,r=null,c=C("#stdout"),l=C("#dialog-command"),d=C("#dialog-license-main"),u=C("#dialog-message"),m=C("#dialog-confirm"),h=l.find(".progress div"),f=C("#admin_sidemenu_menu"),p=C("#admin_sidemenu_main"),t=!0;if("ontouchstart"in window||navigator.maxTouchPoints||C("body").addClass("desktop-screen"),-1!==navigator.userAgent.indexOf("Safari")&&-1===navigator.userAgent.indexOf("Chrome")&&-1===navigator.userAgent.indexOf("Android")?(C("body").addClass("safari"),v.browser="safari",v.noSelect=!0):detectIE()&&(C("body").addClass("ie"),v.browser="ie",v.browserVersion=detectIE(),v.noSelect=!0,C("#host-adapters-btn").css("margin-top","10px")),"undefined"!=typeof storage)try{v.config=storage.get("adminConfig"),v.config?v.config=JSON.parse(v.config):v.config={}}catch(e){console.log("Cannot load edit config"),v.config={}}function b(e){C("#admin_sidemenu_dialog").html(""),C("html").off("click",b)}function w(){if(function(){var e="",i=[];C(".admin-tab").each(function(){var e=C(this).attr("id");v.systemConfig.common.tabs&&-1===v.systemConfig.common.tabs.indexOf(e)||i.push({line:'
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ',cn:'The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. '},addAll2FilterCombobox=!1;function IobListHeader(e,h){if(!(this instanceof IobListHeader))return new IobListHeader(e,h);var f,a,p;void 0===h&&(h={}),void 0===h.colWidthOffset&&(h.colWidthOffset=0),"TABLE"===(p="object"==typeof e?$(e):$("#"+e))[0].tagName&&(p=p.find("tr:first")),e=p[0];var n,b=this;b.selectIdOffset=[],p.html(""),this.setList=function(e){var t;(t="string"==typeof e?("#"!==e[0]&&(e="#"+e),$(e)):e)&&t.length&&("TD"!==t[0].tagName&&"TH"!==t[0].tagName&&((t=t.find(">thead>tr:first>th,>thead>tr:first>td")).length||(t=e.find(">tbody>tr:first>th,>tr:first>th,>tbody>tr:first>td, >tr:first>td"))),a=t)},h.list&&this.setList(h.list),this.syncHeader=function(){if("object"==typeof a){var e=function(){a.each(function(e,t){if(!(e>=a.length-1)){var n=$(t).width(),i=b.selectIdOffset[e]||0;n+i&&$(f[e]).width(Math.round(n+i))}}),a.length&&!b.selectIdOffset.length&&(b.selectIdOffset[0]=0,a.each(function(e,t){var n=$(a[e]).offset().left;n&&(b.selectIdOffset[e]=n-$(f[e]).offset().left)}),e())};e()}},$(window).on("resize",function(e,t){n&&clearTimeout(n),n=setTimeout(b.syncHeader.bind(b),100)}),this.doFilter=function(){},b.ids=[],b.add=function(t,m,e,n){void 0===e&&(e=m);var i,a,s=!(i=e)||a&&"#"===i[0]?i:(h.prefix&&i.substr(0,h.prefix.length)!==h.prefix&&(i=h.prefix+"-"+i),(a?"#":"")+i);m=_(m);var o="";switch(t){case"combobox":o=' ';break;case"edit":o=' ';break;case"text":o=''+m+""}p.append("
';for(var n=0;n",window.M&&window.M.toast&&(e+=''+(i.panelButtons[n].icon||"")+""),e+=""+t+">";i.moveId&&(e+="<"+t+' class="btn-floating waves-effect waves-light blue treetable-sort" title="'+_("reorder")+'">',window.M&&window.M.toast&&(e+='import_export'),e+=""+t+">"),e+="
"}e+='
',e+=" ",e+='
';for(var a=0;a",e+=' ',e+=' ',e+=" "):e+="
"+_(i.columns[a])+"
";i.buttons&&(e+="
"),e+="
",e+="",e+="";var s=[],o=i.root?new RegExp("^"+i.root.replace(/\./g,"\\.")+"\\."):null,r=-1!==i.columns.indexOf("instance")?[]:null;for(var c in i.objects){var l;if(i.objects.hasOwnProperty(c))if(r&&"instance"===i.objects[c].type&&(l=c.match(/^system\.adapter\.javascript\.(\d+)$/))&&r.push(l[1]),!o||o.test(c)){var d=i.objects[c].common,u={id:c,parent:null,_class:"treetable-"+i.objects[c].type};"channel"===i.objects[c].type&&(u.folder=!0);for(var m=0;mt.id?1:e.id';for(var x=0;x',s[z].children&&s[z].children.length&&(e+=''+s[z].children.length+"")):e+='