ax5ui-docker
Advanced tools
Comparing version 1.4.20 to 1.4.21
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.4.20", | ||
"version": "1.4.21", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util,t=void 0;e.addClass({className:"docker",version:"1.4.20"},function(){return function(){var n=this,r=this,l=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."},labelDirection:"top",disableClosePanel:!1,disableDragPanel:!1,resizeDebounceTime:100,panelDebounceTime:300},this.xvar={},this.menu=null,this.onResize=null,this.panels=[],this.panelId=0,this.modules={},l=this.config;var o={resizeDebounceFn:ax5.util.debounce(function(e){e()},l.resizeDebounceTime),panelDebounceFn:ax5.util.debounce(function(e){e()},l.panelDebounceTime)},i=function(e){var a={resize:function(e){this.onResize&&o.resizeDebounceFn(function(){var a={self:this,resizer:e.target,resizedDom:[e.target.prev(),e.target.next()]};this.onResize.call(a,a)}.bind(this))}};return e.eventName in a&&a[e.eventName].call(n,e),n},s=function(){return n.panelId++},d={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},c=function(e,a){var t=[];return e&&"undefined"!=typeof e.panelPath&&t.push(e.panelPath),t.push("panels["+(a||0)+"]"),t.join(".")},p=function(e){var t=[],r=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&t.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+t.join("")+";").call(n)}catch(l){return}},u=function(e){try{var a=e.panelPath.substr(0,e.panelPath.lastIndexOf("."));return Function("","return this."+a+";").call(n)}catch(t){return}},h=function(e,t){var r=[],l=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(n,t)},v=function(e){var a=void 0,t=e.originalEvent?e.originalEvent:e;return a="changedTouches"in t?t.changedTouches[0]:t,{clientX:a.pageX,clientY:a.pageY}},f=function(e,t){var r=jQuery.extend(e.moduleState,{name:e.name}),o={$element:e.$item},i=void 0,s={init:function(){e.builded=!0,i=e.moduleName in n.modules&&"init"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.init(o,r)},active:function(){e.active=!0,e.$label.addClass("active"),e.$item.addClass("active");var a=e.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:e.$label.position().left},300),i=e.moduleName in n.modules&&"active"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.active(o,r),a=null},deactive:function(){e.active=!1,e.$label.removeClass("active"),e.$item.removeClass("active"),i=e.moduleName in n.modules&&"deactive"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.deactive(o,r)},destroy:function(){i=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.destroy(o,r),h(e.panelPath,null),w()},remove:function(){i=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.destroy(o,r),h(e.panelPath,null),w()}},c={panel:e,controlType:t},p=function(){s[t](),i=null,a.isFunction(l.control.after)&&l.control.after.call(c,c)};s[t]&&(a.isFunction(l.control.before)?l.control.before.call(c,c,function(){p()}):p())},x=function(){var e={stack:function(n,o,i,s){var d=void 0,p=-1;i.panelPath=c(o,s),d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:i.name,hasLabelColor:!a.isNothing(i.color),color:i.color,borderColor:i.borderColor,panelPath:i.panelPath,icons:l.icons,labelDirection:i.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.append(d),a.isArray(i.panels)&&(i.panels.forEach(function(e,a){e.active&&(p=a)}),p===-1&&(p=0),i.panels[p].active=!0,i.panels.forEach(function(a,t){a.panelIndex=t,e[a.type](d,i,a,t)})),d=null,p=null},panel:function(e,n,o,i){var d=void 0;o.panelPath=c(n,i),o.$label=jQuery(t.tmpl.get.call(this,"panel-label",{id:r.instanceId,pIndex:i,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,icons:l.icons,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),o.$item?(o.$item.attr("data-ax5docker-path",o.panelPath),o.$item.attr("data-ax5docker-pane-item",i)):o.$item=jQuery('<div data-ax5docker-pane-item="'+i+'" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-pane-id="'+s()+'" data-ax5docker-path="'+o.panelPath+'"></div>'),n&&"stack"==n.type?(o.active&&(o.builded||f(o,"init"),f(o,"active")),e.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(o.$label),e.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(o.$item)):(d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,flexGrow:o.flexGrow,icons:l.icons,labelDirection:o.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),o.builded||f(o,"init"),f(o,"active"),d.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(o.$label),d.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(o.$item),e.append(d)),d=null},resizeHandle:function(e,a,t,n){var l=jQuery('<div data-ax5docker-id="'+r.instanceId+'" data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+n+'"></div>');e.append(l),l=null},row:function(t,n,l,o){var i=void 0;if(l.panelPath=c(n,o),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),t.append(i),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(i,l,a,t),a.panelIndex=t,e[a.type](i,l,a,t)}),i=null},column:function(t,n,l,o){var i=void 0;if(l.panelPath=c(n,o),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),t.append(i),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(i,l,a,t),a.panelIndex=t,e[a.type](i,l,a,t)}),i=null}},o=jQuery('<div data-ax5docker-panes="'+n.instanceId+'"></div>');n.panels[0]&&e[n.panels[0].type](o,null,n.panels[0],0),n.$target.html(o),n.$target.off("click.ax5docker-pane").on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab] .close-icon',function(e){r.removePanel($(this).parents("[data-ax5docker-pane-tab]").attr("data-ax5docker-path")),a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){var t=jQuery(this),n=p(t.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=t.attr("data-ax5docker-pane-tab");t.hasClass("active")||b(n,r),t=null,n=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-pane-tabs-more="'+n.instanceId+'"]',function(e){k($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),n.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){l.disableDragPanel||m.on(this)}).on("mousedown.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){var t=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);r.xvar.mousePosition=v(e),r.xvar.resizerType=t[0],r.xvar.resizerPath=t[1],r.xvar.resizerIndex=t[2],r.xvar.resizer$dom=$(this),r.xvar.resizerParent$dom=r.xvar.resizer$dom.parent(),r.xvar.resizerPrevGrow=a.number(r.xvar.resizer$dom.prev().css("flex-grow")),r.xvar.resizerNextGrow=a.number(r.xvar.resizer$dom.next().css("flex-grow")),"row"==r.xvar.resizerType?r.xvar.resizerCanvasWidth=r.xvar.resizer$dom.prev().innerWidth()+r.xvar.resizer$dom.next().innerWidth()+r.xvar.resizer$dom.width():r.xvar.resizerCanvasHeight=r.xvar.resizer$dom.prev().innerHeight()+r.xvar.resizer$dom.next().innerHeight()+r.xvar.resizer$dom.height(),g.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){return a.stopEvent(e),!1}),y(),o=null},m={on:function(e){n.panels[0]&&n.panels[0].panels&&n.panels[0].panels.length&&(n.xvar.dragger={dragPanel:e,target:null,dragOverVertical:null,dragOverHorizontal:null},n.$target.on("dragover.ax5docker-"+n.instanceId,'[data-ax5docker-id="'+n.instanceId+'"][data-ax5docker-path]',function(e){m.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+n.instanceId,function(e){m.off("drop"),a.stopEvent(e)}).on("dragend.ax5docker-"+n.instanceId,function(e){m.off(),a.stopEvent(e)}))},dragover:function(e,a){var t=jQuery(e),r={},l=v(a),o=void 0,i=void 0;if(null!=n.xvar.dragger.target&&n.xvar.dragger.target.get(0)==t.get(0)||(n.xvar.dragger.target&&n.xvar.dragger.target.removeAttr("data-dropper"),n.xvar.dragger.target=t,n.xvar.dragger.dragOverVertical=null,n.xvar.dragger.dragOverHorizontal=null),r=t.offset(),r.width=t.width(),r.height=t.height(),t.attr("data-ax5docker-pane-tab")){var s=r.width/2;if(r.left<=l.clientX&&r.left+s>=l.clientX?i="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(i="right"),n.xvar.dragger.dragOverHorizontal!=i&&"undefined"!=typeof i){n.xvar.dragger.dragOverHorizontal=i;var d={left:function(e){e.attr("data-dropper","left")},right:function(e){e.attr("data-dropper","right")}};n.xvar.dragger.dragOverHorizontal in d&&d[n.xvar.dragger.dragOverHorizontal](n.xvar.dragger.target)}s=null}else if(t.attr("data-ax5docker-pane-tabs"))n.xvar.dragger.dragOverHorizontal="last-child",n.xvar.dragger.target.attr("data-dropper","true");else if(t.attr("data-ax5docker-pane-item")){var c=r.height/3,p=r.width/3;if(r.top<=l.clientY&&r.top+c>=l.clientY?o="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?o="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?i="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?i="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(i="right"),n.xvar.dragger.dragOverVertical!=o||n.xvar.dragger.dragOverHorizontal!=i){n.xvar.dragger.dragOverVertical=o,n.xvar.dragger.dragOverHorizontal=i;var u={"left-top":function(e){e.attr("data-dropper","left")},"right-top":function(e){e.attr("data-dropper","right")},"center-top":function(e){e.attr("data-dropper","top")},"left-middle":function(e){e.attr("data-dropper","left")},"right-middle":function(e){e.attr("data-dropper","right")},"center-middle":function(e){e.attr("data-dropper","center")},"left-bottom":function(e){e.attr("data-dropper","left")},"right-bottom":function(e){e.attr("data-dropper","right")},"center-bottom":function(e){e.attr("data-dropper","bottom")}};n.xvar.dragger.dragOverHorizontal+"-"+n.xvar.dragger.dragOverVertical in u&&u[n.xvar.dragger.dragOverHorizontal+"-"+n.xvar.dragger.dragOverVertical](n.xvar.dragger.target)}c=null,p=null}},off:function(e){if(e){var a=p(n.xvar.dragger.dragPanel.getAttribute("data-ax5docker-path")),t=[];n.xvar.dragger.dragOverHorizontal&&t.push(n.xvar.dragger.dragOverHorizontal),n.xvar.dragger.dragOverVertical&&t.push(n.xvar.dragger.dragOverVertical),n.appendPanel(a,n.xvar.dragger.target.attr("data-ax5docker-path"),t),a=null,t=null}y(),n.$target.off("dragover.ax5docker-"+n.instanceId).off("drop.ax5docker-"+n.instanceId).off("dragend.ax5docker-"+n.instanceId),n.xvar.dragger.target.removeAttr("data-dropper")}},g={on:function(e){jQuery(document.body).on("mousemove.ax5docker-"+n.instanceId,function(e){var t=v(e),n=void 0;r.xvar.resizerLived?("row"==r.xvar.resizerType?(r.xvar.__da=t.clientX-r.xvar.mousePosition.clientX,n=a.number(2*r.xvar.__da/r.xvar.resizerCanvasWidth,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+n}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-n})):(r.xvar.__da=t.clientY-r.xvar.mousePosition.clientY,n=a.number(2*r.xvar.__da/r.xvar.resizerCanvasHeight,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+n}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-n})),i({eventName:"resize",target:r.xvar.resizer$dom})):r.xvar.resizerLived=!0,t=null,n=null}).on("mouseup.ax5docker-"+n.instanceId,function(e){g.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+n.instanceId,function(e){g.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(r.xvar.resizerLived=!1,"undefined"==typeof n.xvar.__da);else{var e=r.xvar.resizer$dom.prev(),t=r.xvar.resizer$dom.next(),l=p(e.attr("data-ax5docker-path")),o=p(t.attr("data-ax5docker-path"));l.flexGrow=a.number(e.css("flex-grow")),o.flexGrow=a.number(t.css("flex-grow")),e=null,t=null,l=null,o=null}y(),jQuery(document.body).off("mousemove.ax5docker-"+n.instanceId).off("mouseup.ax5docker-"+n.instanceId).off("mouseleave.ax5docker-"+n.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},b=function(e,a){for(var t=e.panels[a],r=0,l=e.panels.length;r<l;r++)e.panels[r].active&&f(e.panels[r],"deactive");return t.builded||f(t,"init"),f(t,"active"),e=null,a=null,t=null,n},k=function(e,t){var r=jQuery(e),l=r.attr("data-ax5docker-path"),o=p(l);if(!n.menu)throw console.log(o.panels),"'ax5ui-menu' is required to implement the function.";var i=a.map(o.panels,function(e){return{label:this.name,index:e,panePath:l}});return n.menu.setConfig({items:i,onClick:function(){b(p(this.panePath),this.index)}}),n.menu.popup(t),r=null,l=null,o=null,n},y=function(){o.panelDebounceFn(function(){this.$target.find('[data-ax5docker-pane-tabs="'+this.instanceId+'"]').each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(n))},P=function(e){a.isArray(e)?e.forEach(function(e){f(e,"deactive")}):f(e,"deactive")},w=function(){var e={stack:function(t){if(!a.isArray(t.panels))return!1;var n={type:"stack",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},panel:function(e){return e},row:function(t){if(!a.isArray(t.panels))return!1;var n={type:"row",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},column:function(t){if(!a.isArray(t.panels))return!1;var n={type:"column",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)}};n.panels[0]?n.panels[0]=e[n.panels[0].type](n.panels[0]):n.panels=[],"panel"===n.panels[0].type&&(n.panels[0]={type:"stack",panels:[n.panels[0]]}),x()};this.init=function(e){return l=jQuery.extend(!0,{},l,e),l.target?(this.onResize=l.onResize,this.$target=jQuery(l.target),this.panels=l.panels||[],this.onStateChanged=l.onStateChanged,this.onClick=l.onClick,this.onLoad=l.onLoad,this.onDataChanged=l.onDataChanged,ax5.ui.menu&&(this.menu=new ax5.ui.menu({theme:"default",position:"absolute",icons:{arrow:"▸"}})),void jQuery(window).bind("resize.ax5docker-"+this.id,function(){y()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],x(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return x(),this},this.addPanel=function(e,a,t,n){var r="",l=void 0,o=void 0;if(0===this.panels.length||!this.panels[0])return this.setPanels([{type:"stack",panels:[t]}]);r="undefined"==e?"0":e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"}),l=p(r),o=u(l),o&&"stack"==o.type&&(l=o,r=l.panelPath);var i={stack:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,a){a.active&&P(e.panels),e.panels.push(a),w()},"stack-left":function(e,a){a.active&&P(e.panels),e.panels.splice(n,0,a),w()},"stack-right":function(e,a){a.active&&P(e.panels),e.panels.splice(Number(n)+1,0,a),w()},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),w())},"column-top":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"column-bottom":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),w())}};a in o&&o[a].call(this,e,t),l=null,o=null},row:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,a,t){e.panels.splice(t,0,a),w()},"row-right":function(e,a,t){e.panels.splice(t+1,0,a),w()},"column-top":function(e,t,n){var o=r.substr(0,r.lastIndexOf(".")),i=p(o);i&&"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"column-bottom":function(e,t,n){var o=r.substr(0,r.lastIndexOf(".")),i=p(o);i&&"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),w())}};a in o&&o[a].call(this,e,t,n),o=null,l=null},column:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),w())},"column-top":function(e,a){e.panels.splice(n,0,a),w()},"column-bottom":function(e,a){e.panels.splice(n+1,0,a),w()}};a in o&&o[a].call(this,e,t),o=null,l=null},panel:function(e,a,t){var n=jQuery.extend({},e),l={stack:function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(n),e.panels.push(a),w()},"stack-left":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(a),e.panels.push(n),w()},"stack-right":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(n),e.panels.push(a),w()},"row-left":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"row"==o.type||"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"row-right":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"row"==o.type||"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(t),w())},"column-top":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"column"==o.type||"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"column-bottom":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"column"==o.type||"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(t),w())}};a in l&&l[a].call(this,e,t),n=null,l=null}};return(l?l.type:"stack"in i)&&i[l?l.type:"stack"].call(this,l,a,t,n),this},this.removePanel=function(e){var a=p(e);return f(a,"destroy"),a=null,this},this.appendPanel=function(e,t,n){var r=$.extend({},e,{panelPath:""}),l=void 0,o=e.panelPath,i=a.right(t,".").replace(/\D/g,"");if(0==n.length)return this;if(e.panelPath===t){var s=t.substr(0,t.lastIndexOf(".")),d=p(s);if("stack"!=d.type)return this}if(1==n.length)l="last-child"==n[0]?"stack":"stack-"+n[0],r.active=!1,r.$item.removeClass("active"),f(r,"deactive");else switch(n[0]+"-"+n[1]){case"left-top":l="row-left";break;case"left-middle":l="row-left";break;case"left-bottom":l="row-left";break;case"center-top":l="column-top";break;case"center-middle":l="stack",r.active=!1,r.$item.removeClass("active"),i=void 0,f(r,"deactive");break;case"center-bottom":l="column-bottom";break;case"right-top":l="row-right";break;case"right-middle":l="row-right";break;case"right-bottom":l="row-right"}return e.panelPath===t&&(t=a.left(t,".")),h(o,null),this.addPanel(t,l,r,i),r=null,this},this.align=function(){return y(),this},this.main=function(){e.docker_instance=e.docker_instance||[],e.docker_instance.push(this),arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)}}()),t=ax5.ui.docker}(),function(){var e=ax5.ui.docker,a=function(e,a){return"bottom"===a.labelDirection?'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n</div>':'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n</div>'},t=function(){return'<li data-ax5docker-pane-tab="{{pIndex}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}" class="{{#hasLabelColor}}hasLabelColor{{/hasLabelColor}}">\n <div class="label-icon" style="{{#color}}background: {{color}};{{/color}}{{#borderColor}}border-color: {{borderColor}};{{/borderColor}}"></div>\n <div class="title">{{{name}}}</div>\n {{^disableClosePanel}}<div class="close-icon">{{{icons.close}}}</div>{{/disableClosePanel}}\n</li><li class="pane-tab-margin"></li>'};e.tmpl={"stack-panel":a,"panel-label":t,get:function(a,t,n){return ax5.mustache.render(e.tmpl[a].call(this,n,t),t)}}}(); | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util,t=void 0;e.addClass({className:"docker",version:"1.4.21"},function(){return function(){var n=this,r=this,l=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."},labelDirection:"top",disableClosePanel:!1,disableDragPanel:!1,resizeDebounceTime:100,panelDebounceTime:300},this.xvar={},this.menu=null,this.onResize=null,this.panels=[],this.panelId=0,this.modules={},l=this.config;var o={resizeDebounceFn:ax5.util.debounce(function(e){e()},l.resizeDebounceTime),panelDebounceFn:ax5.util.debounce(function(e){e()},l.panelDebounceTime)},i=function(e){var a={resize:function(e){this.onResize&&o.resizeDebounceFn(function(){var a={self:this,resizer:e.target,resizedDom:[e.target.prev(),e.target.next()]};this.onResize.call(a,a)}.bind(this))}};return e.eventName in a&&a[e.eventName].call(n,e),n},s=function(){return n.panelId++},d={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},c=function(e,a){var t=[];return e&&"undefined"!=typeof e.panelPath&&t.push(e.panelPath),t.push("panels["+(a||0)+"]"),t.join(".")},p=function(e){var t=[],r=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&t.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+t.join("")+";").call(n)}catch(l){return}},u=function(e){try{var a=e.panelPath.substr(0,e.panelPath.lastIndexOf("."));return Function("","return this."+a+";").call(n)}catch(t){return}},h=function(e,t){var r=[],l=a.isArray(e)?[].concat(e):[].concat(e.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(n,t)},v=function(e){var a=void 0,t=e.originalEvent?e.originalEvent:e;return a="changedTouches"in t?t.changedTouches[0]:t,{clientX:a.pageX,clientY:a.pageY}},f=function(e,t){var r=jQuery.extend(e.moduleState,{name:e.name}),o={$element:e.$item},i=void 0,s={init:function(){e.builded=!0,i=e.moduleName in n.modules&&"init"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.init(o,r)},active:function(){e.active=!0,e.$label.addClass("active"),e.$item.addClass("active");var a=e.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:e.$label.position().left},300),i=e.moduleName in n.modules&&"active"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.active(o,r),a=null},deactive:function(){e.active=!1,e.$label.removeClass("active"),e.$item.removeClass("active"),i=e.moduleName in n.modules&&"deactive"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.deactive(o,r)},destroy:function(){i=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.destroy(o,r),h(e.panelPath,null),w()},remove:function(){i=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,i.destroy(o,r),h(e.panelPath,null),w()}},c={panel:e,controlType:t},p=function(){s[t](),i=null,a.isFunction(l.control.after)&&l.control.after.call(c,c)};s[t]&&(a.isFunction(l.control.before)?l.control.before.call(c,c,function(){p()}):p())},x=function(){var e={stack:function(n,o,i,s){var d=void 0,p=-1;i.panelPath=c(o,s),d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:i.name,hasLabelColor:!a.isNothing(i.color),color:i.color,borderColor:i.borderColor,panelPath:i.panelPath,icons:l.icons,labelDirection:i.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.append(d),a.isArray(i.panels)&&(i.panels.forEach(function(e,a){e.active&&(p=a)}),p===-1&&(p=0),i.panels[p].active=!0,i.panels.forEach(function(a,t){a.panelIndex=t,e[a.type](d,i,a,t)})),d=null,p=null},panel:function(e,n,o,i){var d=void 0;o.panelPath=c(n,i),o.$label=jQuery(t.tmpl.get.call(this,"panel-label",{id:r.instanceId,pIndex:i,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,icons:l.icons,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),o.$item?(o.$item.attr("data-ax5docker-path",o.panelPath),o.$item.attr("data-ax5docker-pane-item",i)):o.$item=jQuery('<div data-ax5docker-pane-item="'+i+'" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-pane-id="'+s()+'" data-ax5docker-path="'+o.panelPath+'"></div>'),n&&"stack"==n.type?(o.active&&(o.builded||f(o,"init"),f(o,"active")),e.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(o.$label),e.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(o.$item)):(d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:o.name,hasLabelColor:!a.isNothing(o.color),color:o.color,borderColor:o.borderColor,panelPath:o.panelPath,flexGrow:o.flexGrow,icons:l.icons,labelDirection:o.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),o.builded||f(o,"init"),f(o,"active"),d.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(o.$label),d.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(o.$item),e.append(d)),d=null},resizeHandle:function(e,a,t,n){var l=jQuery('<div data-ax5docker-id="'+r.instanceId+'" data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+n+'"></div>');e.append(l),l=null},row:function(t,n,l,o){var i=void 0;if(l.panelPath=c(n,o),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),t.append(i),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(i,l,a,t),a.panelIndex=t,e[a.type](i,l,a,t)}),i=null},column:function(t,n,l,o){var i=void 0;if(l.panelPath=c(n,o),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";i=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-path="'+l.panelPath+'" style="flex-grow: '+(l.flexGrow||1)+';"></div>'),t.append(i),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(i,l,a,t),a.panelIndex=t,e[a.type](i,l,a,t)}),i=null}},o=jQuery('<div data-ax5docker-panes="'+n.instanceId+'"></div>');n.panels[0]&&e[n.panels[0].type](o,null,n.panels[0],0),n.$target.html(o),n.$target.off("click.ax5docker-pane").on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab] .close-icon',function(e){r.removePanel($(this).parents("[data-ax5docker-pane-tab]").attr("data-ax5docker-path")),a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){var t=jQuery(this),n=p(t.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=t.attr("data-ax5docker-pane-tab");t.hasClass("active")||b(n,r),t=null,n=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-pane-tabs-more="'+n.instanceId+'"]',function(e){k($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),n.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-pane-tab]',function(e){l.disableDragPanel||m.on(this)}).on("mousedown.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){var t=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);r.xvar.mousePosition=v(e),r.xvar.resizerType=t[0],r.xvar.resizerPath=t[1],r.xvar.resizerIndex=t[2],r.xvar.resizer$dom=$(this),r.xvar.resizerParent$dom=r.xvar.resizer$dom.parent(),r.xvar.resizerPrevGrow=a.number(r.xvar.resizer$dom.prev().css("flex-grow")),r.xvar.resizerNextGrow=a.number(r.xvar.resizer$dom.next().css("flex-grow")),"row"==r.xvar.resizerType?r.xvar.resizerCanvasWidth=r.xvar.resizer$dom.prev().innerWidth()+r.xvar.resizer$dom.next().innerWidth()+r.xvar.resizer$dom.width():r.xvar.resizerCanvasHeight=r.xvar.resizer$dom.prev().innerHeight()+r.xvar.resizer$dom.next().innerHeight()+r.xvar.resizer$dom.height(),g.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize",'[data-ax5docker-id="'+r.instanceId+'"][data-ax5docker-resize-handle]',function(e){return a.stopEvent(e),!1}),y(),o=null},m={on:function(e){n.panels[0]&&n.panels[0].panels&&n.panels[0].panels.length&&(n.xvar.dragger={dragPanel:e,target:null,dragOverVertical:null,dragOverHorizontal:null},n.$target.on("dragover.ax5docker-"+n.instanceId,'[data-ax5docker-id="'+n.instanceId+'"][data-ax5docker-path]',function(e){m.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+n.instanceId,function(e){m.off("drop"),a.stopEvent(e)}).on("dragend.ax5docker-"+n.instanceId,function(e){m.off(),a.stopEvent(e)}))},dragover:function(e,a){var t=jQuery(e),r={},l=v(a),o=void 0,i=void 0;if(null!=n.xvar.dragger.target&&n.xvar.dragger.target.get(0)==t.get(0)||(n.xvar.dragger.target&&n.xvar.dragger.target.removeAttr("data-dropper"),n.xvar.dragger.target=t,n.xvar.dragger.dragOverVertical=null,n.xvar.dragger.dragOverHorizontal=null),r=t.offset(),r.width=t.width(),r.height=t.height(),t.attr("data-ax5docker-pane-tab")){var s=r.width/2;if(r.left<=l.clientX&&r.left+s>=l.clientX?i="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(i="right"),n.xvar.dragger.dragOverHorizontal!=i&&"undefined"!=typeof i){n.xvar.dragger.dragOverHorizontal=i;var d={left:function(e){e.attr("data-dropper","left")},right:function(e){e.attr("data-dropper","right")}};n.xvar.dragger.dragOverHorizontal in d&&d[n.xvar.dragger.dragOverHorizontal](n.xvar.dragger.target)}s=null}else if(t.attr("data-ax5docker-pane-tabs"))n.xvar.dragger.dragOverHorizontal="last-child",n.xvar.dragger.target.attr("data-dropper","true");else if(t.attr("data-ax5docker-pane-item")){var c=r.height/3,p=r.width/3;if(r.top<=l.clientY&&r.top+c>=l.clientY?o="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?o="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?i="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?i="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(i="right"),n.xvar.dragger.dragOverVertical!=o||n.xvar.dragger.dragOverHorizontal!=i){n.xvar.dragger.dragOverVertical=o,n.xvar.dragger.dragOverHorizontal=i;var u={"left-top":function(e){e.attr("data-dropper","left")},"right-top":function(e){e.attr("data-dropper","right")},"center-top":function(e){e.attr("data-dropper","top")},"left-middle":function(e){e.attr("data-dropper","left")},"right-middle":function(e){e.attr("data-dropper","right")},"center-middle":function(e){e.attr("data-dropper","center")},"left-bottom":function(e){e.attr("data-dropper","left")},"right-bottom":function(e){e.attr("data-dropper","right")},"center-bottom":function(e){e.attr("data-dropper","bottom")}};n.xvar.dragger.dragOverHorizontal+"-"+n.xvar.dragger.dragOverVertical in u&&u[n.xvar.dragger.dragOverHorizontal+"-"+n.xvar.dragger.dragOverVertical](n.xvar.dragger.target)}c=null,p=null}},off:function(e){if(e){var a=p(n.xvar.dragger.dragPanel.getAttribute("data-ax5docker-path")),t=[];n.xvar.dragger.dragOverHorizontal&&t.push(n.xvar.dragger.dragOverHorizontal),n.xvar.dragger.dragOverVertical&&t.push(n.xvar.dragger.dragOverVertical),n.appendPanel(a,n.xvar.dragger.target.attr("data-ax5docker-path"),t),a=null,t=null}y(),n.$target.off("dragover.ax5docker-"+n.instanceId).off("drop.ax5docker-"+n.instanceId).off("dragend.ax5docker-"+n.instanceId),n.xvar.dragger.target.removeAttr("data-dropper")}},g={on:function(e){jQuery(document.body).on("mousemove.ax5docker-"+n.instanceId,function(e){var t=v(e),n=void 0;r.xvar.resizerLived?("row"==r.xvar.resizerType?(r.xvar.__da=t.clientX-r.xvar.mousePosition.clientX,n=a.number(2*r.xvar.__da/r.xvar.resizerCanvasWidth,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+n}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-n})):(r.xvar.__da=t.clientY-r.xvar.mousePosition.clientY,n=a.number(2*r.xvar.__da/r.xvar.resizerCanvasHeight,{round:6}),r.xvar.resizer$dom.prev().css({"flex-grow":r.xvar.resizerPrevGrow+n}),r.xvar.resizer$dom.next().css({"flex-grow":r.xvar.resizerNextGrow-n})),i({eventName:"resize",target:r.xvar.resizer$dom})):r.xvar.resizerLived=!0,t=null,n=null}).on("mouseup.ax5docker-"+n.instanceId,function(e){g.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+n.instanceId,function(e){g.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(r.xvar.resizerLived=!1,"undefined"==typeof n.xvar.__da);else{var e=r.xvar.resizer$dom.prev(),t=r.xvar.resizer$dom.next(),l=p(e.attr("data-ax5docker-path")),o=p(t.attr("data-ax5docker-path"));l.flexGrow=a.number(e.css("flex-grow")),o.flexGrow=a.number(t.css("flex-grow")),e=null,t=null,l=null,o=null}y(),jQuery(document.body).off("mousemove.ax5docker-"+n.instanceId).off("mouseup.ax5docker-"+n.instanceId).off("mouseleave.ax5docker-"+n.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},b=function(e,a){for(var t=e.panels[a],r=0,l=e.panels.length;r<l;r++)e.panels[r].active&&f(e.panels[r],"deactive");return t.builded||f(t,"init"),f(t,"active"),e=null,a=null,t=null,n},k=function(e,t){var r=jQuery(e),l=r.attr("data-ax5docker-path"),o=p(l);if(!n.menu)throw console.log(o.panels),"'ax5ui-menu' is required to implement the function.";var i=a.map(o.panels,function(e){return{label:this.name,index:e,panePath:l}});return n.menu.setConfig({items:i,onClick:function(){b(p(this.panePath),this.index)}}),n.menu.popup(t),r=null,l=null,o=null,n},y=function(){o.panelDebounceFn(function(){this.$target.find('[data-ax5docker-pane-tabs="'+this.instanceId+'"]').each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(n))},P=function(e){a.isArray(e)?e.forEach(function(e){f(e,"deactive")}):f(e,"deactive")},w=function(){var e={stack:function(t){if(!a.isArray(t.panels))return!1;var n={type:"stack",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},panel:function(e){return e},row:function(t){if(!a.isArray(t.panels))return!1;var n={type:"row",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)},column:function(t){if(!a.isArray(t.panels))return!1;var n={type:"column",panels:[]};return t.panels.forEach(function(a,t){if(a){var r=e[a.type](a);r&&n.panels.push(r),r=null}}),0==n.panels.length?null:(n.panels.length<2&&(n=n.panels[0]),n)}};n.panels[0]?n.panels[0]=e[n.panels[0].type](n.panels[0]):n.panels=[],"panel"===n.panels[0].type&&(n.panels[0]={type:"stack",panels:[n.panels[0]]}),x()};this.init=function(e){return l=jQuery.extend(!0,{},l,e),l.target?(this.onResize=l.onResize,this.$target=jQuery(l.target),this.panels=l.panels||[],this.onStateChanged=l.onStateChanged,this.onClick=l.onClick,this.onLoad=l.onLoad,this.onDataChanged=l.onDataChanged,ax5.ui.menu&&(this.menu=new ax5.ui.menu({theme:"default",position:"absolute",icons:{arrow:"▸"}})),void jQuery(window).bind("resize.ax5docker-"+this.id,function(){y()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],x(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return x(),this},this.addPanel=function(e,a,t,n){var r="",l=void 0,o=void 0;if(0===this.panels.length||!this.panels[0])return this.setPanels([{type:"stack",panels:[t]}]);r="undefined"==e?"0":e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"}),l=p(r),o=u(l),o&&"stack"==o.type&&(l=o,r=l.panelPath);var i={stack:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,a){a.active&&P(e.panels),e.panels.push(a),w()},"stack-left":function(e,a){a.active&&P(e.panels),e.panels.splice(n,0,a),w()},"stack-right":function(e,a){a.active&&P(e.panels),e.panels.splice(Number(n)+1,0,a),w()},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),w())},"column-top":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"column-bottom":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),w())}};a in o&&o[a].call(this,e,t),l=null,o=null},row:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,a,t){e.panels.splice(t,0,a),w()},"row-right":function(e,a,t){e.panels.splice(t+1,0,a),w()},"column-top":function(e,t,n){var o=r.substr(0,r.lastIndexOf(".")),i=p(o);i&&"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"column-bottom":function(e,t,n){var o=r.substr(0,r.lastIndexOf(".")),i=p(o);i&&"column"==i.type?this.addPanel(i.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(l),e.panels.push(t),w())}};a in o&&o[a].call(this,e,t,n),o=null,l=null},column:function(e,a,t,n){var l=jQuery.extend({},e),o={stack:function(e,t){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,a,t)},"row-left":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(l),w())},"row-right":function(e,t){var n=r.substr(0,r.lastIndexOf(".")),o=p(n);o&&"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(l),e.panels.push(t),w())},"column-top":function(e,a){e.panels.splice(n,0,a),w()},"column-bottom":function(e,a){e.panels.splice(n+1,0,a),w()}};a in o&&o[a].call(this,e,t),o=null,l=null},panel:function(e,a,t){var n=jQuery.extend({},e),l={stack:function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(n),e.panels.push(a),w()},"stack-left":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(a),e.panels.push(n),w()},"stack-right":function(e,a){e=h(r,{type:"stack",panels:[]}),a.active&&P(n),e.panels.push(n),e.panels.push(a),w()},"row-left":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"row"==o.type||"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"row-right":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"row"==o.type||"column"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"row",panels:[]}),e.panels.push(n),e.panels.push(t),w())},"column-top":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"column"==o.type||"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(t),e.panels.push(n),w())},"column-bottom":function(e,t){var l=r.substr(0,r.lastIndexOf(".")),o=p(l);o&&"column"==o.type||"row"==o.type?this.addPanel(o.panelPath,a,t,e.panelIndex):(e=h(r,{type:"column",panels:[]}),e.panels.push(n),e.panels.push(t),w())}};a in l&&l[a].call(this,e,t),n=null,l=null}};return(l?l.type:"stack"in i)&&i[l?l.type:"stack"].call(this,l,a,t,n),this},this.removePanel=function(e){var a=p(e);return f(a,"destroy"),a=null,this},this.appendPanel=function(e,t,n){var r=$.extend({},e,{panelPath:""}),l=void 0,o=e.panelPath,i=a.right(t,".").replace(/\D/g,"");if(0==n.length)return this;if(e.panelPath===t){var s=t.substr(0,t.lastIndexOf(".")),d=p(s);if("stack"!=d.type)return this}if(1==n.length)l="last-child"==n[0]?"stack":"stack-"+n[0],r.active=!1,r.$item.removeClass("active"),f(r,"deactive");else switch(n[0]+"-"+n[1]){case"left-top":l="row-left";break;case"left-middle":l="row-left";break;case"left-bottom":l="row-left";break;case"center-top":l="column-top";break;case"center-middle":l="stack",r.active=!1,r.$item.removeClass("active"),i=void 0,f(r,"deactive");break;case"center-bottom":l="column-bottom";break;case"right-top":l="row-right";break;case"right-middle":l="row-right";break;case"right-bottom":l="row-right"}return e.panelPath===t&&(t=a.left(t,".")),h(o,null),this.addPanel(t,l,r,i),r=null,this},this.align=function(){return y(),this},this.main=function(){e.docker_instance=e.docker_instance||[],e.docker_instance.push(this),arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)}}()),t=ax5.ui.docker}(),function(){var e=ax5.ui.docker,a=function(e,a){return"bottom"===a.labelDirection?'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n</div>':'<div data-ax5docker-pane="{{id}}" data-ax5docker-label-direction="{{labelDirection}}" data-ax5docker-path="{{panelPath}}" style="flex-grow: {{#flexGrow}}{{.}}{{/flexGrow}}{{^flexGrow}}1{{/flexGrow}};">\n <ul data-ax5docker-pane-tabs="{{id}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}"></ul>\n <div data-ax5docker-pane-tabs-more="{{id}}">{{{icons.more}}}</div>\n <div data-ax5docker-pane-item-views="{{id}}"></div>\n</div>'},t=function(){return'<li data-ax5docker-pane-tab="{{pIndex}}" data-ax5docker-id="{{id}}" data-ax5docker-path="{{panelPath}}" class="{{#hasLabelColor}}hasLabelColor{{/hasLabelColor}}">\n <div class="label-icon" style="{{#color}}background: {{color}};{{/color}}{{#borderColor}}border-color: {{borderColor}};{{/borderColor}}"></div>\n <div class="title">{{{name}}}</div>\n {{^disableClosePanel}}<div class="close-icon">{{{icons.close}}}</div>{{/disableClosePanel}}\n</li><li class="pane-tab-margin"></li>'};e.tmpl={"stack-panel":a,"panel-label":t,get:function(a,t,n){return ax5.mustache.render(e.tmpl[a].call(this,n,t),t)}}}(); |
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.4.20", | ||
"version": "1.4.21", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15