ax5ui-docker
Advanced tools
Comparing version 1.3.91 to 1.3.92
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.91", | ||
"version": "1.3.92", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -16,3 +16,3 @@ "use strict"; | ||
className: "docker", | ||
version: "1.3.91" | ||
version: "1.3.92" | ||
}, function () { | ||
@@ -19,0 +19,0 @@ |
@@ -1,1 +0,1 @@ | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util;e.addClass({className:"docker",version:"1.3.91"},function(){var e=function(){var e=this,n=this,t=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."}},this.xvar={},this.menu=null,this.panels=[],this.panelId=0,this.modules={},t=this.config;var r=function(){return e.panelId++},l={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},o=function(e,a){var n=[];return e&&"undefined"!=typeof e.panelPath&&n.push(e.panelPath),n.push("panels["+(a||0)+"]"),n.join(".")},s=function(n){var t=[],r=a.isArray(n)?[].concat(n):[].concat(n.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&t.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+t.join("")+";").call(e)}catch(l){return}},i=function(n,t){var r=[],l=a.isArray(n)?[].concat(n):[].concat(n.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(e,t)},d=function(e){var a=void 0,n=e.originalEvent?e.originalEvent:e;return a="changedTouches"in n?n.changedTouches[0]:n,{clientX:a.pageX,clientY:a.pageY}},p=function(n,r){var o=jQuery.extend(n.moduleState,{name:n.name}),s={$element:n.$item},d=void 0,p={init:function(){n.builded=!0,d=n.moduleName in e.modules&&"init"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.init(s,o)},active:function(){n.active=!0,n.$label.addClass("active"),n.$item.addClass("active");var a=n.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:n.$label.position().left},300),d=n.moduleName in e.modules&&"active"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.active(s,o),a=null},deactive:function(){n.active=!1,n.$label.removeClass("active"),n.$item.removeClass("active"),d=n.moduleName in e.modules&&"deactive"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.deactive(s,o)},destroy:function(){d=n.moduleName in e.modules&&"destroy"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.destroy(s,o),i(n.panelPath,null),y()}},c={panel:n,controlType:r},u=function(){p[r](),d=null,a.isFunction(t.control.after)&&t.control.after.call(c,c)};p[r]&&(a.isFunction(t.control.before)?t.control.before.call(c,c,function(){u()}):u())},c=function(){var l={stack:function(e,n,r,s){var i=void 0,d=-1;r.panelPath=o(n,s),i=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+r.panelPath+'" style="flex-grow: '+(r.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+t.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),e.append(i),a.isArray(r.panels)&&(r.panels.forEach(function(e,a){e.active&&(d=a)}),d===-1&&(d=0),r.panels[d].active=!0,r.panels.forEach(function(e,a){e.panelIndex=a,l[e.type](i,r,e,a)})),i=null,d=null},panel:function(e,a,n,l){var s=void 0;n.panelPath=o(a,l),n.$label=jQuery('<li data-ax5docker-pane-tab="'+l+'" data-ax5docker-path="'+n.panelPath+'"><div class="title">'+n.name+'</div><div class="close-icon">'+t.icons.close+"</div></li>"),n.$item||(n.$item=jQuery('<div data-ax5docker-pane-item="'+l+'" data-ax5docker-pane-id="'+r()+'" data-ax5docker-path="'+n.panelPath+'"></div>')),a&&"stack"==a.type?(n.active&&(n.builded||p(n,"init"),p(n,"active")),e.find("[data-ax5docker-pane-tabs]").append(n.$label),e.find("[data-ax5docker-pane-item-views]").append(n.$item)):(s=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+n.panelPath+'" style="flex-grow: '+(n.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+t.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),n.builded||p(n,"init"),p(n,"active"),s.find("[data-ax5docker-pane-tabs]").append(n.$label),s.find("[data-ax5docker-pane-item-views]").append(n.$item),e.append(s)),s=null},resizeHandle:function(e,a,n,t){var r=jQuery('<div data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+t+'"></div>');e.append(r),r=null},row:function(e,n,t,r){var s=void 0;if(t.panelPath=o(n,r),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";s=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(s),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(s,t,e,a),e.panelIndex=a,l[e.type](s,t,e,a)}),s=null},column:function(e,n,t,r){var s=void 0;if(t.panelPath=o(n,r),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";s=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(s),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(s,t,e,a),e.panelIndex=a,l[e.type](s,t,e,a)}),s=null}},i=jQuery('<div data-ax5docker-panes=""></div>');e.panels[0]&&l[e.panels[0].type](i,null,e.panels[0],0),e.$target.html(i),e.$target.off("click.ax5docker-pane").on("click.ax5docker-pane","[data-ax5docker-pane-tab] .close-icon",function(e){f($(this).parents("[data-ax5docker-pane-tab]")),a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tab]",function(e){var n=jQuery(this),t=s(n.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=n.attr("data-ax5docker-pane-tab");n.hasClass("active")||u(t,r),n=null,t=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tabs-more]",function(e){h($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),e.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize","[data-ax5docker-pane-tab]",function(e){x.on(this)}).on("mousedown.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){var t=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);n.xvar.mousePosition=d(e),n.xvar.resizerType=t[0],n.xvar.resizerPath=t[1],n.xvar.resizerIndex=t[2],n.xvar.resizer$dom=$(this),n.xvar.resizerParent$dom=n.xvar.resizer$dom.parent(),n.xvar.resizerPrevGrow=a.number(n.xvar.resizer$dom.prev().css("flex-grow")),n.xvar.resizerNextGrow=a.number(n.xvar.resizer$dom.next().css("flex-grow")),"row"==n.xvar.resizerType?n.xvar.resizerCanvasWidth=n.xvar.resizer$dom.prev().innerWidth()+n.xvar.resizer$dom.next().innerWidth()+n.xvar.resizer$dom.width():n.xvar.resizerCanvasHeight=n.xvar.resizer$dom.prev().innerHeight()+n.xvar.resizer$dom.next().innerHeight()+n.xvar.resizer$dom.height(),v.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){return a.stopEvent(e),!1}),g(),i=null},u=function(a,n){for(var t=a.panels[n],r=0,l=a.panels.length;r<l;r++)a.panels[r].active&&p(a.panels[r],"deactive");return t.builded||p(t,"init"),p(t,"active"),a=null,n=null,t=null,e},f=function(a){var n=jQuery(a),t=n.attr("data-ax5docker-path"),r=s(t);return p(r,"destroy"),n=null,t=null,r=null,e},h=function(n,t){var r=jQuery(n),l=r.attr("data-ax5docker-path"),o=s(l);if(!e.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 e.menu.setConfig({items:i,onClick:function(){u(s(this.panePath),this.index)}}),e.menu.popup(t),r=null,l=null,o=null,e},v={on:function(t){var r=$(t);r.offset().left,e.$target.offset().left;jQuery(document.body).on("mousemove.ax5docker-"+e.instanceId,function(e){var t=d(e),r=void 0;n.xvar.resizerLived?"row"==n.xvar.resizerType?(n.xvar.__da=t.clientX-n.xvar.mousePosition.clientX,r=a.number(2*n.xvar.__da/n.xvar.resizerCanvasWidth,{round:6}),n.xvar.resizer$dom.prev().css({"flex-grow":n.xvar.resizerPrevGrow+r}),n.xvar.resizer$dom.next().css({"flex-grow":n.xvar.resizerNextGrow-r})):(n.xvar.__da=t.clientY-n.xvar.mousePosition.clientY,r=a.number(2*n.xvar.__da/n.xvar.resizerCanvasHeight,{round:6}),n.xvar.resizer$dom.prev().css({"flex-grow":n.xvar.resizerPrevGrow+r}),n.xvar.resizer$dom.next().css({"flex-grow":n.xvar.resizerNextGrow-r})):n.xvar.resizerLived=!0,t=null,r=null}).on("mouseup.ax5docker-"+e.instanceId,function(e){v.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+e.instanceId,function(e){v.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(n.xvar.resizerLived=!1,"undefined"==typeof e.xvar.__da);else{var t=n.xvar.resizer$dom.prev(),r=n.xvar.resizer$dom.next(),l=s(t.attr("data-ax5docker-path")),o=s(r.attr("data-ax5docker-path"));l.flexGrow=a.number(t.css("flex-grow")),o.flexGrow=a.number(r.css("flex-grow")),t=null,r=null,l=null,o=null}jQuery(document.body).off("mousemove.ax5docker-"+e.instanceId).off("mouseup.ax5docker-"+e.instanceId).off("mouseleave.ax5docker-"+e.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},x={on:function(){e.panels[0]&&e.panels[0].panels&&e.panels[0].panels.length&&(e.xvar.drager={target:null,dragOverVertical:null,dragOverHorizontal:null},e.$target.on("dragover.ax5docker-"+e.instanceId,"[data-ax5docker-path]",function(e){x.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}).on("dragend.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}))},dragover:function(a,n){var t=jQuery(a);null!=e.xvar.drager.target&&e.xvar.drager.target.get(0)==t.get(0)||(e.xvar.drager.target=t,e.xvar.drager.dragOverVertical=null,e.xvar.drager.dragOverHorizontal=null);var r={};r=t.offset(),r.width=t.width(),r.height=t.height();var l=d(n),o=void 0,s=void 0;if(t.attr("data-ax5docker-pane-tab"));else if(t.attr("data-ax5docker-pane-item")){var i=r.height/3,p=r.width/3;r.top<=l.clientY&&r.top+i>=l.clientY?o="top":r.top+i<=l.clientY&&r.top+2*i>=l.clientY?o="middle":r.top+2*i<=l.clientY&&r.top+3*i>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?s="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?s="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(s="right")}e.xvar.drager.dragOverVertical==o&&e.xvar.drager.dragOverHorizontal==s||(e.xvar.drager.dragOverVertical=o,e.xvar.drager.dragOverHorizontal=s,console.log(e.xvar.drager))},off:function(){e.$target.off("dragover.ax5docker-"+e.instanceId).off("drop.ax5docker-"+e.instanceId).off("dragend.ax5docker-"+e.instanceId)}},m=ax5.util.debounce(function(e){e()},t.animateTime),g=function(){m(function(){this.$target.find("[data-ax5docker-pane-tabs]").each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(e))},y=function(){var n={stack:function(e){if(!a.isArray(e.panels))return!1;var t={type:"stack",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},panel:function(e){return e},row:function(e){if(!a.isArray(e.panels))return!1;var t={type:"row",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},column:function(e){if(!a.isArray(e.panels))return!1;var t={type:"column",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)}};e.panels[0]?e.panels[0]=n[e.panels[0].type](e.panels[0]):e.panels=[],c()};this.init=function(e){return t=jQuery.extend(!0,{},t,e),t.target?(this.$target=jQuery(t.target),this.panels=t.panels||[],this.onStateChanged=t.onStateChanged,this.onClick=t.onClick,this.onLoad=t.onLoad,this.onDataChanged=t.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(){g()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],c(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return c(),this},this.addPanel=function(e,a,n,t){"undefined"==e&&(e="0"),e=e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"});var r=s(e);console.log(r);var l={stack:function(a,n,t){var r=jQuery.extend({},a),l={stack:function(e,a){e.panels.push(a),y()},"row-left":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"row-right":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(r),a.panels.push(t),y())},"column-top":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"column-bottom":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(r),a.panels.push(t),y())}};n in l&&l[n].call(this,a,t),r=null,l=null},row:function(a,n,t,r){var l=jQuery.extend({},a),o={stack:function(e,a){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,n,a)},"row-left":function(a,n,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?(a.panels.splice(t,0,n),y()):(a=i(e,{type:"row",panels:[]}),a.panels.push(n),a.panels.push(l),y())},"row-right":function(a,n,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?(a.panels.splice(t+1,0,n),y()):(a=i(e,{type:"row",panels:[]}),a.panels.push(l),a.panels.push(n),y())},"column-top":function(a,t,r){var o=e.substr(0,e.lastIndexOf(".")),d=s(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(l),y())},"column-bottom":function(a,t,r){var o=e.substr(0,e.lastIndexOf(".")),d=s(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(l),a.panels.push(t),y())}};n in o&&o[n].call(this,a,t,r),o=null,l=null},column:function(a,n,t,r){var l=jQuery.extend({},a),o={stack:function(e,a){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,n,a)},"row-left":function(a,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(l),y())},"row-right":function(a,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(l),a.panels.push(t),y())},"column-top":function(e,a){e.panels.splice(r,0,a),y()},"column-bottom":function(e,a){e.panels.splice(r+1,0,a),y()}};n in o&&o[n].call(this,a,t),o=null,l=null},panel:function(a,n,t){var r=jQuery.extend({},a),l={stack:function(a,n){a=i(e,{type:"stack",panels:[]}),a.panels.push(r),a.panels.push(n),y()},"row-left":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"row-right":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(r),a.panels.push(t),y())},"column-top":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"column-bottom":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(r),a.panels.push(t),y())}};n in l&&l[n].call(this,a,t),r=null,l=null}};return l[r.type].call(this,r,a,n,t),this},this.main=function(){arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)};return e}())}(),function(){var e=ax5.ui.docker;e.tmpl={get:function(a,n,t){return ax5.mustache.render(e.tmpl[a].call(this,t),n)}}}(); | ||
"use strict";!function(){var e=ax5.ui,a=ax5.util;e.addClass({className:"docker",version:"1.3.92"},function(){var e=function(){var e=this,n=this,t=void 0;this.instanceId=ax5.getGuid(),this.config={theme:"default",animateTime:250,columnKeys:{},control:{},icons:{close:"X",more:"..."}},this.xvar={},this.menu=null,this.panels=[],this.panelId=0,this.modules={},t=this.config;var r=function(){return e.panelId++},l={init:function(e,a){e.$element.html(a.name)},active:function(e,a){},deactive:function(e,a){},destroy:function(e,a){}},o=function(e,a){var n=[];return e&&"undefined"!=typeof e.panelPath&&n.push(e.panelPath),n.push("panels["+(a||0)+"]"),n.join(".")},s=function(n){var t=[],r=a.isArray(n)?[].concat(n):[].concat(n.split(/[\.\[\]]/g));r.forEach(function(e){""!==e&&t.push('["'+e.replace(/['\"]/g,"")+'"]')});try{return Function("","return this"+t.join("")+";").call(e)}catch(l){return}},i=function(n,t){var r=[],l=a.isArray(n)?[].concat(n):[].concat(n.split(/[\.\[\]]/g));return l.forEach(function(e){""!==e&&r.push('["'+e.replace(/['\"]/g,"")+'"]')}),Function("val","return this"+r.join("")+" = val;").call(e,t)},d=function(e){var a=void 0,n=e.originalEvent?e.originalEvent:e;return a="changedTouches"in n?n.changedTouches[0]:n,{clientX:a.pageX,clientY:a.pageY}},p=function(n,r){var o=jQuery.extend(n.moduleState,{name:n.name}),s={$element:n.$item},d=void 0,p={init:function(){n.builded=!0,d=n.moduleName in e.modules&&"init"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.init(s,o)},active:function(){n.active=!0,n.$label.addClass("active"),n.$item.addClass("active");var a=n.$label.parent();a.get(0)&&a.get(0).clientWidth!==a.get(0).scrollWidth&&a.animate({scrollLeft:n.$label.position().left},300),d=n.moduleName in e.modules&&"active"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.active(s,o),a=null},deactive:function(){n.active=!1,n.$label.removeClass("active"),n.$item.removeClass("active"),d=n.moduleName in e.modules&&"deactive"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.deactive(s,o)},destroy:function(){d=n.moduleName in e.modules&&"destroy"in e.modules[n.moduleName]?e.modules[n.moduleName]:l,d.destroy(s,o),i(n.panelPath,null),y()}},c={panel:n,controlType:r},u=function(){p[r](),d=null,a.isFunction(t.control.after)&&t.control.after.call(c,c)};p[r]&&(a.isFunction(t.control.before)?t.control.before.call(c,c,function(){u()}):u())},c=function(){var l={stack:function(e,n,r,s){var i=void 0,d=-1;r.panelPath=o(n,s),i=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+r.panelPath+'" style="flex-grow: '+(r.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+t.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),e.append(i),a.isArray(r.panels)&&(r.panels.forEach(function(e,a){e.active&&(d=a)}),d===-1&&(d=0),r.panels[d].active=!0,r.panels.forEach(function(e,a){e.panelIndex=a,l[e.type](i,r,e,a)})),i=null,d=null},panel:function(e,a,n,l){var s=void 0;n.panelPath=o(a,l),n.$label=jQuery('<li data-ax5docker-pane-tab="'+l+'" data-ax5docker-path="'+n.panelPath+'"><div class="title">'+n.name+'</div><div class="close-icon">'+t.icons.close+"</div></li>"),n.$item||(n.$item=jQuery('<div data-ax5docker-pane-item="'+l+'" data-ax5docker-pane-id="'+r()+'" data-ax5docker-path="'+n.panelPath+'"></div>')),a&&"stack"==a.type?(n.active&&(n.builded||p(n,"init"),p(n,"active")),e.find("[data-ax5docker-pane-tabs]").append(n.$label),e.find("[data-ax5docker-pane-item-views]").append(n.$item)):(s=jQuery('<div data-ax5docker-pane="" data-ax5docker-path="'+n.panelPath+'" style="flex-grow: '+(n.flexGrow||1)+';"><ul data-ax5docker-pane-tabs=""></ul><div data-ax5docker-pane-tabs-more="">'+t.icons.more+'</div><div data-ax5docker-pane-item-views=""></div></div>'),n.builded||p(n,"init"),p(n,"active"),s.find("[data-ax5docker-pane-tabs]").append(n.$label),s.find("[data-ax5docker-pane-item-views]").append(n.$item),e.append(s)),s=null},resizeHandle:function(e,a,n,t){var r=jQuery('<div data-ax5docker-resize-handle="'+a.type+"/"+a.panelPath+"/"+t+'"></div>');e.append(r),r=null},row:function(e,n,t,r){var s=void 0;if(t.panelPath=o(n,r),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";s=jQuery('<div data-ax5docker-pane-axis="row" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(s),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(s,t,e,a),e.panelIndex=a,l[e.type](s,t,e,a)}),s=null},column:function(e,n,t,r){var s=void 0;if(t.panelPath=o(n,r),n&&"stack"==n.type)throw"The 'stack' type child nodes are allowed only for the 'panel' type.";s=jQuery('<div data-ax5docker-pane-axis="column" data-ax5docker-path="'+t.panelPath+'" style="flex-grow: '+(t.flexGrow||1)+';"></div>'),e.append(s),a.isArray(t.panels)&&t.panels.forEach(function(e,a){a>0&&l.resizeHandle(s,t,e,a),e.panelIndex=a,l[e.type](s,t,e,a)}),s=null}},i=jQuery('<div data-ax5docker-panes=""></div>');e.panels[0]&&l[e.panels[0].type](i,null,e.panels[0],0),e.$target.html(i),e.$target.off("click.ax5docker-pane").on("click.ax5docker-pane","[data-ax5docker-pane-tab] .close-icon",function(e){f($(this).parents("[data-ax5docker-pane-tab]")),a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tab]",function(e){var n=jQuery(this),t=s(n.parents("[data-ax5docker-pane]").attr("data-ax5docker-path")),r=n.attr("data-ax5docker-pane-tab");n.hasClass("active")||u(t,r),n=null,t=null,r=null,a.stopEvent(e)}).on("click.ax5docker-pane","[data-ax5docker-pane-tabs-more]",function(e){h($(this).parents("[data-ax5docker-pane]"),e),a.stopEvent(e)}),e.$target.off("mousedown.ax5docker-pane-resize").off("dragstart.ax5docker-pane-resize").on("dragstart.ax5docker-pane-resize","[data-ax5docker-pane-tab]",function(e){x.on(this)}).on("mousedown.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){var t=this.getAttribute("data-ax5docker-resize-handle").split(/\//g);n.xvar.mousePosition=d(e),n.xvar.resizerType=t[0],n.xvar.resizerPath=t[1],n.xvar.resizerIndex=t[2],n.xvar.resizer$dom=$(this),n.xvar.resizerParent$dom=n.xvar.resizer$dom.parent(),n.xvar.resizerPrevGrow=a.number(n.xvar.resizer$dom.prev().css("flex-grow")),n.xvar.resizerNextGrow=a.number(n.xvar.resizer$dom.next().css("flex-grow")),"row"==n.xvar.resizerType?n.xvar.resizerCanvasWidth=n.xvar.resizer$dom.prev().innerWidth()+n.xvar.resizer$dom.next().innerWidth()+n.xvar.resizer$dom.width():n.xvar.resizerCanvasHeight=n.xvar.resizer$dom.prev().innerHeight()+n.xvar.resizer$dom.next().innerHeight()+n.xvar.resizer$dom.height(),v.on(this),a.stopEvent(e)}).on("dragstart.ax5docker-pane-resize","[data-ax5docker-resize-handle]",function(e){return a.stopEvent(e),!1}),g(),i=null},u=function(a,n){for(var t=a.panels[n],r=0,l=a.panels.length;r<l;r++)a.panels[r].active&&p(a.panels[r],"deactive");return t.builded||p(t,"init"),p(t,"active"),a=null,n=null,t=null,e},f=function(a){var n=jQuery(a),t=n.attr("data-ax5docker-path"),r=s(t);return p(r,"destroy"),n=null,t=null,r=null,e},h=function(n,t){var r=jQuery(n),l=r.attr("data-ax5docker-path"),o=s(l);if(!e.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 e.menu.setConfig({items:i,onClick:function(){u(s(this.panePath),this.index)}}),e.menu.popup(t),r=null,l=null,o=null,e},v={on:function(t){var r=$(t);r.offset().left,e.$target.offset().left;jQuery(document.body).on("mousemove.ax5docker-"+e.instanceId,function(e){var t=d(e),r=void 0;n.xvar.resizerLived?"row"==n.xvar.resizerType?(n.xvar.__da=t.clientX-n.xvar.mousePosition.clientX,r=a.number(2*n.xvar.__da/n.xvar.resizerCanvasWidth,{round:6}),n.xvar.resizer$dom.prev().css({"flex-grow":n.xvar.resizerPrevGrow+r}),n.xvar.resizer$dom.next().css({"flex-grow":n.xvar.resizerNextGrow-r})):(n.xvar.__da=t.clientY-n.xvar.mousePosition.clientY,r=a.number(2*n.xvar.__da/n.xvar.resizerCanvasHeight,{round:6}),n.xvar.resizer$dom.prev().css({"flex-grow":n.xvar.resizerPrevGrow+r}),n.xvar.resizer$dom.next().css({"flex-grow":n.xvar.resizerNextGrow-r})):n.xvar.resizerLived=!0,t=null,r=null}).on("mouseup.ax5docker-"+e.instanceId,function(e){v.off(),a.stopEvent(e)}).on("mouseleave.ax5docker-"+e.instanceId,function(e){v.off(),a.stopEvent(e)}),jQuery(document.body).attr("unselectable","on").css("user-select","none").on("selectstart",!1)},off:function(){if(n.xvar.resizerLived=!1,"undefined"==typeof e.xvar.__da);else{var t=n.xvar.resizer$dom.prev(),r=n.xvar.resizer$dom.next(),l=s(t.attr("data-ax5docker-path")),o=s(r.attr("data-ax5docker-path"));l.flexGrow=a.number(t.css("flex-grow")),o.flexGrow=a.number(r.css("flex-grow")),t=null,r=null,l=null,o=null}jQuery(document.body).off("mousemove.ax5docker-"+e.instanceId).off("mouseup.ax5docker-"+e.instanceId).off("mouseleave.ax5docker-"+e.instanceId),jQuery(document.body).removeAttr("unselectable").css("user-select","auto").off("selectstart")}},x={on:function(){e.panels[0]&&e.panels[0].panels&&e.panels[0].panels.length&&(e.xvar.drager={target:null,dragOverVertical:null,dragOverHorizontal:null},e.$target.on("dragover.ax5docker-"+e.instanceId,"[data-ax5docker-path]",function(e){x.dragover(this,e),a.stopEvent(e)}).on("drop.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}).on("dragend.ax5docker-"+e.instanceId,function(e){x.off(),a.stopEvent(e)}))},dragover:function(a,n){var t=jQuery(a);null!=e.xvar.drager.target&&e.xvar.drager.target.get(0)==t.get(0)||(e.xvar.drager.target=t,e.xvar.drager.dragOverVertical=null,e.xvar.drager.dragOverHorizontal=null);var r={};r=t.offset(),r.width=t.width(),r.height=t.height();var l=d(n),o=void 0,s=void 0;if(t.attr("data-ax5docker-pane-tab"));else if(t.attr("data-ax5docker-pane-item")){var i=r.height/3,p=r.width/3;r.top<=l.clientY&&r.top+i>=l.clientY?o="top":r.top+i<=l.clientY&&r.top+2*i>=l.clientY?o="middle":r.top+2*i<=l.clientY&&r.top+3*i>=l.clientY&&(o="bottom"),r.left<=l.clientX&&r.left+p>=l.clientX?s="left":r.left+p<=l.clientX&&r.left+2*p>=l.clientX?s="center":r.left+2*p<=l.clientX&&r.left+3*p>=l.clientX&&(s="right")}e.xvar.drager.dragOverVertical==o&&e.xvar.drager.dragOverHorizontal==s||(e.xvar.drager.dragOverVertical=o,e.xvar.drager.dragOverHorizontal=s,console.log(e.xvar.drager))},off:function(){e.$target.off("dragover.ax5docker-"+e.instanceId).off("drop.ax5docker-"+e.instanceId).off("dragend.ax5docker-"+e.instanceId)}},m=ax5.util.debounce(function(e){e()},t.animateTime),g=function(){m(function(){this.$target.find("[data-ax5docker-pane-tabs]").each(function(){var e=jQuery(this).parent();this.scrollWidth>this.clientWidth?e.addClass("tabs-scrolled"):e.removeClass("tabs-scrolled"),e=null})}.bind(e))},y=function(){var n={stack:function(e){if(!a.isArray(e.panels))return!1;var t={type:"stack",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},panel:function(e){return e},row:function(e){if(!a.isArray(e.panels))return!1;var t={type:"row",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)},column:function(e){if(!a.isArray(e.panels))return!1;var t={type:"column",panels:[]};return e.panels.forEach(function(e,a){if(e){var r=n[e.type](e);r&&t.panels.push(r),r=null}}),0==t.panels.length?null:(t.panels.length<2&&(t=t.panels[0]),t)}};e.panels[0]?e.panels[0]=n[e.panels[0].type](e.panels[0]):e.panels=[],c()};this.init=function(e){return t=jQuery.extend(!0,{},t,e),t.target?(this.$target=jQuery(t.target),this.panels=t.panels||[],this.onStateChanged=t.onStateChanged,this.onClick=t.onClick,this.onLoad=t.onLoad,this.onDataChanged=t.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(){g()})):(console.log(ax5.info.getError("ax5docker","401","init")),this)},this.setPanels=function(e){return this.panels=e||[],c(),this},this.addModule=function(e){return a.isObject(e)&&jQuery.extend(!0,this.modules,e),this},this.repaint=function(){return c(),this},this.addPanel=function(e,a,n,t){"undefined"==e&&(e="0"),e=e.replace(/[a-zA-Z\[\]]+/g,"").replace(/(\d+)/g,function(e,a){return"panels["+e+"]"});var r=s(e);console.log(r);var l={stack:function(a,n,t){var r=jQuery.extend({},a),l={stack:function(e,a){e.panels.push(a),y()},"row-left":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"row-right":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(r),a.panels.push(t),y())},"column-top":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"column-bottom":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(r),a.panels.push(t),y())}};n in l&&l[n].call(this,a,t),r=null,l=null},row:function(a,n,t,r){var l=jQuery.extend({},a),o={stack:function(e,a){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,n,a)},"row-left":function(a,n,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?(a.panels.splice(t,0,n),y()):(a=i(e,{type:"row",panels:[]}),a.panels.push(n),a.panels.push(l),y())},"row-right":function(a,n,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?(a.panels.splice(t+1,0,n),y()):(a=i(e,{type:"row",panels:[]}),a.panels.push(l),a.panels.push(n),y())},"column-top":function(a,t,r){var o=e.substr(0,e.lastIndexOf(".")),d=s(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(l),y())},"column-bottom":function(a,t,r){var o=e.substr(0,e.lastIndexOf(".")),d=s(o);"column"==d.type?this.addPanel(d.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(l),a.panels.push(t),y())}};n in o&&o[n].call(this,a,t,r),o=null,l=null},column:function(a,n,t,r){var l=jQuery.extend({},a),o={stack:function(e,a){e.panels[0]&&e.panels[0].panelPath&&this.addPanel(e.panels[0].panelPath,n,a)},"row-left":function(a,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(l),y())},"row-right":function(a,t){var r=e.substr(0,e.lastIndexOf(".")),o=s(r);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(l),a.panels.push(t),y())},"column-top":function(e,a){e.panels.splice(r,0,a),y()},"column-bottom":function(e,a){e.panels.splice(r+1,0,a),y()}};n in o&&o[n].call(this,a,t),o=null,l=null},panel:function(a,n,t){var r=jQuery.extend({},a),l={stack:function(a,n){a=i(e,{type:"stack",panels:[]}),a.panels.push(r),a.panels.push(n),y()},"row-left":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"row-right":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"row"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"row",panels:[]}),a.panels.push(r),a.panels.push(t),y())},"column-top":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(t),a.panels.push(r),y())},"column-bottom":function(a,t){var l=e.substr(0,e.lastIndexOf(".")),o=s(l);"column"==o.type?this.addPanel(o.panelPath,n,t,a.panelIndex):(a=i(e,{type:"column",panels:[]}),a.panels.push(r),a.panels.push(t),y())}};n in l&&l[n].call(this,a,t),r=null,l=null}};return l[r.type].call(this,r,a,n,t),this},this.main=function(){arguments&&a.isObject(arguments[0])&&this.setConfig(arguments[0])}.apply(this,arguments)};return e}())}(),function(){var e=ax5.ui.docker;e.tmpl={get:function(a,n,t){return ax5.mustache.render(e.tmpl[a].call(this,t),n)}}}(); |
{ | ||
"name": "ax5ui-docker", | ||
"version": "1.3.91", | ||
"version": "1.3.92", | ||
"description": "A dashboard plugin that works with Bootstrap & jQuery", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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