ax5ui-docker
Advanced tools
Comparing version 1.3.124 to 1.3.125
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.124", | ||
"version": "1.3.125", | ||
"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.3.124"},function(){var n=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 i={resizeDebounceFn:ax5.util.debounce(function(e){e()},l.resizeDebounceTime),panelDebounceFn:ax5.util.debounce(function(e){e()},l.panelDebounceTime)},o=function(e){var a={resize:function(e){this.onResize&&i.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}),i={$element:e.$item},o=void 0,s={init:function(){e.builded=!0,o=e.moduleName in n.modules&&"init"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.init(i,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),o=e.moduleName in n.modules&&"active"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.active(i,r),a=null},deactive:function(){e.active=!1,e.$label.removeClass("active"),e.$item.removeClass("active"),o=e.moduleName in n.modules&&"deactive"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.deactive(i,r)},destroy:function(){o=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.destroy(i,r),h(e.panelPath,null),w()},remove:function(){o=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.destroy(i,r),h(e.panelPath,null),w()}},c={panel:e,controlType:t},p=function(){s[t](),o=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,i,o,s){var d=void 0,p=-1;o.panelPath=c(i,s),d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:o.name,panelPath:o.panelPath,icons:l.icons,labelDirection:o.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.append(d),a.isArray(o.panels)&&(o.panels.forEach(function(e,a){e.active&&(p=a)}),p===-1&&(p=0),o.panels[p].active=!0,o.panels.forEach(function(a,t){a.panelIndex=t,e[a.type](d,o,a,t)})),d=null,p=null},panel:function(e,a,n,i){var o=void 0;n.panelPath=c(a,i),n.$label=jQuery(t.tmpl.get.call(this,"panel-label",{id:r.instanceId,pIndex:i,name:n.name,panelPath:n.panelPath,icons:l.icons,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.$item?(n.$item.attr("data-ax5docker-path",n.panelPath),n.$item.attr("data-ax5docker-pane-item",i)):n.$item=jQuery('<div data-ax5docker-pane-item="'+i+'" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-pane-id="'+s()+'" data-ax5docker-path="'+n.panelPath+'"></div>'),a&&"stack"==a.type?(n.active&&(n.builded||f(n,"init"),f(n,"active")),e.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(n.$label),e.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(n.$item)):(o=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:n.name,panelPath:n.panelPath,flexGrow:n.flexGrow,icons:l.icons,labelDirection:n.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.builded||f(n,"init"),f(n,"active"),o.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(n.$label),o.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(n.$item),e.append(o)),o=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,i){var o=void 0;if(l.panelPath=c(n,i),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";o=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(o),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(o,l,a,t),a.panelIndex=t,e[a.type](o,l,a,t)}),o=null},column:function(t,n,l,i){var o=void 0;if(l.panelPath=c(n,i),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";o=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(o),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(o,l,a,t),a.panelIndex=t,e[a.type](o,l,a,t)}),o=null}},i=jQuery('<div data-ax5docker-panes="'+n.instanceId+'"></div>');n.panels[0]&&e[n.panels[0].type](i,null,n.panels[0],0),n.$target.html(i),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")||k(n,r),t=null,n=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-pane-tabs-more="'+n.instanceId+'"]',function(e){b($(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(),i=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),i=void 0,o=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?o="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(o="right"),n.xvar.dragger.dragOverHorizontal!=o&&"undefined"!=typeof o){n.xvar.dragger.dragOverHorizontal=o;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="right",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?i="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?i="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(i="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?o="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?o="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(o="right"),n.xvar.dragger.dragOverVertical!=i||n.xvar.dragger.dragOverHorizontal!=o){n.xvar.dragger.dragOverVertical=i,n.xvar.dragger.dragOverHorizontal=o;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})),o({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")),i=p(t.attr("data-ax5docker-path"));l.flexGrow=a.number(e.css("flex-grow")),i.flexGrow=a.number(t.css("flex-grow")),e=null,t=null,l=null,i=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")}},k=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},b=function(e,t){var r=jQuery(e),l=r.attr("data-ax5docker-path"),i=p(l);if(!n.menu)throw console.log(i.panels),"'ax5ui-menu' is required to implement the function.";var o=a.map(i.panels,function(e){return{label:this.name,index:e,panePath:l}});return n.menu.setConfig({items:o,onClick:function(){k(p(this.panePath),this.index)}}),n.menu.popup(t),r=null,l=null,i=null,n},y=function(){i.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=[],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,i=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),i=u(l),i&&"stack"==i.type&&(l=i,r=l.panelPath);var o={stack:function(e,a,t,n){var l=jQuery.extend({},e),i={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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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(".")),i=p(n);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){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);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 i&&i[a].call(this,e,t),l=null,i=null},row:function(e,a,t,n){var l=jQuery.extend({},e),i={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 i=r.substr(0,r.lastIndexOf(".")),o=p(i);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,n){var i=r.substr(0,r.lastIndexOf(".")),o=p(i);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 i&&i[a].call(this,e,t,n),i=null,l=null},column:function(e,a,t,n){var l=jQuery.extend({},e),i={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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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 i&&i[a].call(this,e,t),i=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(".")),i=p(l);i&&"row"==i.type||"column"==i.type?this.addPanel(i.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(".")),i=p(l);i&&"row"==i.type||"column"==i.type?this.addPanel(i.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(".")),i=p(l);i&&"column"==i.type||"row"==i.type?this.addPanel(i.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(".")),i=p(l);i&&"column"==i.type||"row"==i.type?this.addPanel(i.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 o)&&o[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,i=e.panelPath,o=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="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"),o=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(i,null),this.addPanel(t,l,r,o),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)};return n}()),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}}">\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.3.125"},function(){var n=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 i={resizeDebounceFn:ax5.util.debounce(function(e){e()},l.resizeDebounceTime),panelDebounceFn:ax5.util.debounce(function(e){e()},l.panelDebounceTime)},o=function(e){var a={resize:function(e){this.onResize&&i.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}),i={$element:e.$item},o=void 0,s={init:function(){e.builded=!0,o=e.moduleName in n.modules&&"init"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.init(i,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),o=e.moduleName in n.modules&&"active"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.active(i,r),a=null},deactive:function(){e.active=!1,e.$label.removeClass("active"),e.$item.removeClass("active"),o=e.moduleName in n.modules&&"deactive"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.deactive(i,r)},destroy:function(){o=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.destroy(i,r),h(e.panelPath,null),w()},remove:function(){o=e.moduleName in n.modules&&"destroy"in n.modules[e.moduleName]?n.modules[e.moduleName]:d,o.destroy(i,r),h(e.panelPath,null),w()}},c={panel:e,controlType:t},p=function(){s[t](),o=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,i,o,s){var d=void 0,p=-1;o.panelPath=c(i,s),d=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:o.name,panelPath:o.panelPath,icons:l.icons,labelDirection:o.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.append(d),a.isArray(o.panels)&&(o.panels.forEach(function(e,a){e.active&&(p=a)}),p===-1&&(p=0),o.panels[p].active=!0,o.panels.forEach(function(a,t){a.panelIndex=t,e[a.type](d,o,a,t)})),d=null,p=null},panel:function(e,a,n,i){var o=void 0;n.panelPath=c(a,i),n.$label=jQuery(t.tmpl.get.call(this,"panel-label",{id:r.instanceId,pIndex:i,name:n.name,panelPath:n.panelPath,icons:l.icons,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.$item?(n.$item.attr("data-ax5docker-path",n.panelPath),n.$item.attr("data-ax5docker-pane-item",i)):n.$item=jQuery('<div data-ax5docker-pane-item="'+i+'" data-ax5docker-id="'+r.instanceId+'" data-ax5docker-pane-id="'+s()+'" data-ax5docker-path="'+n.panelPath+'"></div>'),a&&"stack"==a.type?(n.active&&(n.builded||f(n,"init"),f(n,"active")),e.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(n.$label),e.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(n.$item)):(o=jQuery(t.tmpl.get.call(this,"stack-panel",{id:r.instanceId,name:n.name,panelPath:n.panelPath,flexGrow:n.flexGrow,icons:l.icons,labelDirection:n.labelDirection||l.labelDirection,disableClosePanel:l.disableClosePanel,disableDragPanel:l.disableDragPanel},{})),n.builded||f(n,"init"),f(n,"active"),o.find('[data-ax5docker-pane-tabs="'+r.instanceId+'"]').append(n.$label),o.find('[data-ax5docker-pane-item-views="'+r.instanceId+'"]').append(n.$item),e.append(o)),o=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,i){var o=void 0;if(l.panelPath=c(n,i),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";o=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(o),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(o,l,a,t),a.panelIndex=t,e[a.type](o,l,a,t)}),o=null},column:function(t,n,l,i){var o=void 0;if(l.panelPath=c(n,i),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";o=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(o),a.isArray(l.panels)&&l.panels.forEach(function(a,t){t>0&&e.resizeHandle(o,l,a,t),a.panelIndex=t,e[a.type](o,l,a,t)}),o=null}},i=jQuery('<div data-ax5docker-panes="'+n.instanceId+'"></div>');n.panels[0]&&e[n.panels[0].type](i,null,n.panels[0],0),n.$target.html(i),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")||k(n,r),t=null,n=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane",'[data-ax5docker-pane-tabs-more="'+n.instanceId+'"]',function(e){b($(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(),i=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),i=void 0,o=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?o="left":r.left+s<=l.clientX&&r.left+2*s>=l.clientX&&(o="right"),n.xvar.dragger.dragOverHorizontal!=o&&"undefined"!=typeof o){n.xvar.dragger.dragOverHorizontal=o;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?i="top":r.top+c<=l.clientY&&r.top+2*c>=l.clientY?i="middle":r.top+2*c<=l.clientY&&r.top+3*c>=l.clientY&&(i="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?o="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?o="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(o="right"),n.xvar.dragger.dragOverVertical!=i||n.xvar.dragger.dragOverHorizontal!=o){n.xvar.dragger.dragOverVertical=i,n.xvar.dragger.dragOverHorizontal=o;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})),o({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")),i=p(t.attr("data-ax5docker-path"));l.flexGrow=a.number(e.css("flex-grow")),i.flexGrow=a.number(t.css("flex-grow")),e=null,t=null,l=null,i=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")}},k=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},b=function(e,t){var r=jQuery(e),l=r.attr("data-ax5docker-path"),i=p(l);if(!n.menu)throw console.log(i.panels),"'ax5ui-menu' is required to implement the function.";var o=a.map(i.panels,function(e){return{label:this.name,index:e,panePath:l}});return n.menu.setConfig({items:o,onClick:function(){k(p(this.panePath),this.index)}}),n.menu.popup(t),r=null,l=null,i=null,n},y=function(){i.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=[],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,i=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),i=u(l),i&&"stack"==i.type&&(l=i,r=l.panelPath);var o={stack:function(e,a,t,n){var l=jQuery.extend({},e),i={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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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(".")),i=p(n);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){var n=r.substr(0,r.lastIndexOf(".")),i=p(n);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 i&&i[a].call(this,e,t),l=null,i=null},row:function(e,a,t,n){var l=jQuery.extend({},e),i={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 i=r.substr(0,r.lastIndexOf(".")),o=p(i);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,n){var i=r.substr(0,r.lastIndexOf(".")),o=p(i);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 i&&i[a].call(this,e,t,n),i=null,l=null},column:function(e,a,t,n){var l=jQuery.extend({},e),i={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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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(".")),i=p(n);i&&"row"==i.type?this.addPanel(i.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 i&&i[a].call(this,e,t),i=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(".")),i=p(l);i&&"row"==i.type||"column"==i.type?this.addPanel(i.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(".")),i=p(l);i&&"row"==i.type||"column"==i.type?this.addPanel(i.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(".")),i=p(l);i&&"column"==i.type||"row"==i.type?this.addPanel(i.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(".")),i=p(l);i&&"column"==i.type||"row"==i.type?this.addPanel(i.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 o)&&o[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,i=e.panelPath,o=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"),o=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(i,null),this.addPanel(t,l,r,o),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)};return n}()),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}}">\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.3.124", | ||
"version": "1.3.125", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
102
README.md
@@ -50,4 +50,6 @@ [![Build Status](https://travis-ci.org/ax5ui/ax5ui-docker.svg?branch=master)](https://travis-ci.org/ax5ui/ax5ui-docker) | ||
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.css" /> | ||
<link rel="stylesheet" type="text/css" href="https://cdn.rawgit.com/ax5ui/ax5ui-menu/master/dist/ax5menu.css" /> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5core/master/dist/ax5core.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5menu/master/dist/ax5menu.min.js"></script> | ||
<script type="text/javascript" src="https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.min.js"></script> | ||
@@ -60,3 +62,2 @@ ``` | ||
https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.css | ||
https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.js | ||
https://cdn.rawgit.com/ax5ui/ax5ui-docker/master/dist/ax5docker.min.js | ||
@@ -67,3 +68,3 @@ ``` | ||
```html | ||
<div data-ax5docker="docker1" style="height: 500px;background: #eee;padding: 5px;"></div> | ||
``` | ||
@@ -73,3 +74,100 @@ | ||
$(function () { | ||
var myDocker = new ax5.ui.docker(); | ||
myDocker.setConfig({ | ||
target: $('[data-ax5docker="docker1"]'), | ||
icons: { | ||
close: '<i class="fa fa-times" aria-hidden="true"></i>', | ||
more: '<i class="fa fa-chevron-circle-down" aria-hidden="true"></i>' | ||
}, | ||
panels: [ | ||
{ | ||
type: "row", // type : row, column, stack | ||
panels: [ | ||
{ | ||
type: "column", | ||
panels: [ | ||
{ | ||
type: "panel", | ||
name: "my name 1", | ||
moduleName: "content", | ||
moduleState: { | ||
data1: "data1" | ||
} | ||
}, | ||
{ | ||
type: "panel", | ||
name: "my name 1", | ||
moduleName: "content", | ||
moduleState: { | ||
data1: "data1" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
type: "stack", | ||
panels: [ | ||
{ | ||
type: "panel", | ||
name: "my name 3", | ||
moduleName: "content", | ||
moduleState: { | ||
data1: "data1" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
], | ||
disableClosePanel: false, | ||
disableDragPanel: false, | ||
control: { | ||
before: function (that, callback) { | ||
if (that.controlType === "destroy") { | ||
if (confirm("Do you want to Delete?")) { | ||
setTimeout(function () { | ||
callback(); | ||
}, 300); | ||
return; | ||
} | ||
} else { | ||
callback(); | ||
return; | ||
} | ||
} | ||
}, | ||
menu: { | ||
theme: 'default', | ||
position: "absolute", | ||
icons: { | ||
'arrow': '▸' | ||
} | ||
} | ||
}); | ||
myDocker.onResize = function (e) { | ||
console.log(e); | ||
}; | ||
myDocker.addModule({ | ||
"content": { | ||
init: function (container, state) { | ||
container["$element"].html(JSON.stringify(state)); | ||
}, | ||
active: function (container, state) { | ||
// console.log(state, "active"); | ||
}, | ||
deactive: function (container, state) { | ||
// console.log(state, "deactive"); | ||
}, | ||
destroy: function (container, state) { | ||
// console.log(state, "destroy"); | ||
} | ||
} | ||
}); | ||
myDocker.repaint(); // play docker | ||
}); | ||
@@ -76,0 +174,0 @@ ``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
1312695
22
180