diff -r 033898178630 -r 37f1a08315f3 www/jqwidgets/jqxlayout.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/www/jqwidgets/jqxlayout.js Sun Aug 05 11:32:13 2018 +0200 @@ -0,0 +1,9 @@ +/* +jQWidgets v6.0.5 (2018-July) +Copyright (c) 2011-2018 jQWidgets. +License: https://jqwidgets.com/license/ +*/ +/* eslint-disable */ + +(function(a){a.jqx.jqxWidget("jqxLayout","",{});a.extend(a.jqx._jqxLayout.prototype,{defineInstance:function(){var b={width:null,height:null,minGroupWidth:100,minGroupHeight:100,layout:[],resizable:true,contextMenu:false,rtl:false,events:["create","resize","pin","unpin","floatGroupClosed"]};if(this===a.jqx._jqxLayout.prototype){return b}a.extend(true,this,b);return b},createInstance:function(){var b=this;b._originalElement=a(b.element.cloneNode(true));b._coordinates=[];b._oldIE=a.jqx.browser.msie&&a.jqx.browser.version<9;b._ie7=a.jqx.browser.msie&&a.jqx.browser.version<8;b._touchDevice=a.jqx.mobile.isTouchDevice();if(b.host.css("display")!=="none"&&document.body.contains(b.element)===true){b._initiallyHidden=false;b._initialization=true;b.render()}else{b._initiallyHidden=true}a.jqx.utilities.resize(this.host,function(){if(b._suppressResizeHandler===true){return}if(b._initiallyHidden===true){b._initialization=true}b.render();if(b._initiallyHidden===true){if(b.dockingLayout){b.dockingLayout._createOverlay();b.dockingLayout._createEdgeOverlays()}b._initiallyHidden=false}})},render:function(){var n=this,m,h,o=[];n._tabbedGroupsList=[];if(n.dockingLayout){n._overlayGroups=[];if(n._initialization===false){m=n.dockingLayout._overlay.detach();h=n.dockingLayout._dropOverlayHelper.detach();for(var f=0;f0){a("."+d.element.id+"FloatGroup").jqxWindow({theme:j})}}break;case"layout":case"resizable":d.render();break;case"contextMenu":if(j===true&&!d._menuInitialized){d.render()}break;case"rtl":var l=j?"rtl":"ltr",f=j?"ltr":"rtl",b=function(w){var B=d._find(w,".jqx-layout-pseudo-window-title-"+f),r=d._find(w,".jqx-layout-pseudo-window-pin-background-"+f),x=d._find(w,".jqx-layout-pseudo-window-close-background-"+f),n=d._find(w,".jqx-layout-ribbon-header"),z=d._find(w,".jqx-ribbon");for(var v=0;v=n.x.from&&l<=n.x.to&&o>=n.y.from&&o<=n.y.to){if(n.orientation==="horizontal"){g.element.style.cursor="col-resize"}else{g.element.style.cursor="row-resize"}g._resize={allowed:true,widget:n.widget,side:n.side};break}else{g.element.style.cursor="default";g._resize.allowed=false}}}function k(l){if(g._resize.allowed===true){var r=g._resize.widget,w=r.current.parent,x=g._percentToPx("width",r.current.minWidth,w),t=g._percentToPx("height",r.current.minHeight,w),n=w.items[r.current.index-1],q=w.items[r.current.index+1];g._resizeStartPosition={x:l.pageX,y:l.pageY};if(!x){x=g._percentToPx("width",g.minGroupWidth,w)}x=Math.min(x,r.width());r.current.minWidth=x;if(!t){t=g._percentToPx("height",g.minGroupHeight,w)}t=Math.min(t,r.height());r.current.minHeight=t;switch(g._resize.side){case"left":var u=g._percentToPx("width",n.minWidth,w);if(!u){u=g._percentToPx("width",g.minGroupWidth,w)}d=n.widget.offset().left+u;j=r.offset().left+r.width()-x;break;case"right":var m=g._percentToPx("width",q.minWidth,w);if(!m){m=g._percentToPx("width",g.minGroupWidth,w)}d=r.offset().left+x;j=q.widget.offset().left+q.widget.width()-m;break;case"top":var v=g._percentToPx("height",n.minHeight,w);if(!v){v=g._percentToPx("height",g.minGroupHeight,w)}d=n.widget.offset().top+v;j=r.offset().top+r.height()-t;break;case"bottom":var o=g._percentToPx("height",q.minHeight,w);if(!o){o=g._percentToPx("height",g.minGroupHeight,w)}d=r.offset().top+t;j=q.widget.offset().top+q.widget.height()-o;break}var p=function(z,A){A=(typeof A==="undefined")?{top:0,left:0}:A;if(z!==top){var y=z.frameElement.getBoundingClientRect();A.left+=y.left;A.top+=y.top;A=p(z.parent,A)}return A},s;g._clickedToResize=true;g._overlay[0].style.display="block";if(g._resize.side==="left"||g._resize.side==="right"){g._verticalFeedback[0].style.height=g._resize.widget.height()+"px";s=g._ie7?p(window).top:0;g._verticalFeedback.offset({top:g._resize.widget.offset().top-g.host.offset().top+document.body.scrollTop-s})}else{g._horizontalFeedback[0].style.width=g._resize.widget.width()+"px";s=g._ie7?p(window).left:0;g._horizontalFeedback.offset({left:g._resize.widget.offset().left-g.host.offset().left+document.body.scrollLeft+1-s})}}}function c(n,o,t,r,m){var p=m.charAt(0).toUpperCase()+m.slice(1),s=o.parent,l,q;if(n){l=g._percentToPx(m,t["min"+p],s);q=parseFloat(t[m])/100*o.parent.widget[m]()-r}else{l=g._percentToPx(m,o["min"+p],s);q=parseFloat(o[m])/100*o.parent.widget[m]()-r}if(!l){l=g._percentToPx(m,g["minGroup"+p],s)}if(q=v}w=Math.abs(p-v);if(w===0){r();return}if(q){s=g._getPercentage(c(true,u,y,w,"width"),u.parent,"width");w=Math.abs(s-parseFloat(y.width));y.width=s+"%";u.width=parseFloat(u.width)+w+"%"}else{s=g._getPercentage(c(false,u,y,w,"width"),u.parent,"width");w=Math.abs(s-parseFloat(u.width));u.width=s+"%";y.width=parseFloat(y.width)+w+"%"}if(u.width===n){r();return}}else{n=u.height;if(g._resize.side==="top"){y=u.parent.items[u.index-1];v=m;q=o=v}w=Math.abs(o-v);if(w===0){r();return}if(q){s=g._getPercentage(c(true,u,y,w,"height"),u.parent,"height");w=Math.abs(s-parseFloat(y.height));y.height=s+"%";u.height=parseFloat(u.height)+w+"%"}else{s=g._getPercentage(c(false,u,y,w,"height"),u.parent,"height");w=Math.abs(s-parseFloat(u.height));u.height=s+"%";y.height=parseFloat(y.height)+w+"%"}if(u.height===n){r();return}}r();g.render();g._raiseEvent("1",{item:u})}}function f(m){if(g._clickedToResize===true){var l=m.pageX,n=m.pageY;if(g._resize.side==="left"||g._resize.side==="right"){g._verticalFeedback[0].style.display="block";if(lj){l=j;g._verticalFeedback.addClass(g.toThemeProperty("jqx-layout-resize-feedback-warning"))}else{g._verticalFeedback.removeClass(g.toThemeProperty("jqx-layout-resize-feedback-warning"))}}g._verticalFeedback.offset({left:l-2})}else{g._horizontalFeedback[0].style.display="block";if(nj){n=j;g._horizontalFeedback.addClass(g.toThemeProperty("jqx-layout-resize-feedback-warning"))}else{g._horizontalFeedback.removeClass(g.toThemeProperty("jqx-layout-resize-feedback-warning"))}}g._horizontalFeedback.offset({top:n-2});g._horizontalFeedback.offset({left:g._resize.widget.offset().left+document.body.scrollLeft+1})}}}g._docUP=e;if(!g._touchDevice){g.addHandler(g.host,"mousemove.jqxLayout"+b,function(m){if(g._clickedToResize===false&&(!g.dockingLayout||g.dockingLayout&&g.dockingLayout._windowDragged!==true)){var l=m.pageX,n=m.pageY;i(l,n)}});g.addHandler(a(document),"mousemove.jqxLayout"+b,function(l){f(l)});g.addHandler(g.host,"mousedown.jqxLayout"+b,function(l){k(l)});g.addHandler(a(document),"mouseup.jqxLayout"+b,function(l){e(l)})}else{g.addHandler(a(document),"touchstart.jqxDockingLayout"+b,function(m){var l=m.originalEvent.touches[0];i(l.pageX,l.pageY);k(l)});g.addHandler(a(document),"touchmove.jqxDockingLayout"+b,function(m){var l=m.originalEvent.touches[0];f(l)});g.addHandler(a(document),"touchend.jqxDockingLayout"+b,function(m){var l=m.originalEvent.changedTouches[0];e(l)})}g.addHandler(a(document),"selectstart.jqxLayout"+b,function(){if(g._clickedToResize===true){return false}});if(g.dockingLayout){try{if(document.referrer!==""||window.frameElement){if(window.top.document.addEventListener){window.top.document.addEventListener("mouseup",g._mouseupHandler,false)}else{if(window.top.document.attachEvent){window.top.document.attachEvent("onmouseup",g._mouseupHandler)}}}}catch(h){}}},_removeHandlers:function(){var e=this,f=e.element.id;if(!e._touchDevice){e.removeHandler(e.host,"mousemove.jqxLayout"+f);e.removeHandler(a(document),"mousemove.jqxLayout"+f);e.removeHandler(e.host,"mousedown.jqxLayout"+f);e.removeHandler(a(document),"mouseup.jqxLayout"+f)}else{e.removeHandler(a(document),"touchstart.jqxLayout"+f);e.removeHandler(a(document),"touchmove.jqxLayout"+f);e.removeHandler(a(document),"touchend.jqxLayout"+f)}e.removeHandler(a(document),"selectstart.jqxLayout"+f);if(e.dockingLayout){try{if(document.referrer!==""||window.frameElement){if(window.top.document.removeEventListener){window.top.document.removeEventListener("mouseup",e._mouseupHandler,false)}else{if(window.top.document.detachEvent){window.top.document.detachEvent("onmouseup",e._mouseupHandler)}}}}catch(b){}}if(!e._oldIE){var d=document.body.querySelectorAll("."+f+"FloatGroup");for(var c=0;c
    ';e[0].appendChild(b);b=a(b);f._addRightClickHandler(f._find(b,".jqx-layout-window-header")[0],b)}else{b=document.createElement("div");b.className="jqx-layout-ribbon";b.innerHTML='
      ';e.children()[1].appendChild(b);b=a(b)}break;case"documentGroup":case"autoHideGroup":m=document.createElement("div");var o="";if(x.type==="documentGroup"){o="jqx-layout-ribbon-header jqx-layout-ribbon-header-"+(f.rtl?"rtl":"ltr")}m.innerHTML='
        ';if(f._ie7&&x.type==="autoHideGroup"){m.style.zIndex=9999-500*E}e[0].appendChild(m);b=a(m);break;case"floatGroup":if(!f._rendered||x.programmaticallyAdded===true){if(!f.dockingLayout){throw new Error("Float groups are only available in the jqxDockingLayout widget. Initialize a jqxDockingLayout (requires jqxdockinglayout.js) instead of a jqxLayout.")}b=document.createElement("div");b.className=f.toThemeProperty("jqx-docking-layout-group-floating");b.innerHTML="
        ";e[0].appendChild(b);b=a(b);if(x.programmaticallyAdded===true){delete x.programmaticallyAdded}}else{continue}break;case"layoutPanel":b={};if(d==="tabbedGroup"){var w=f._find(e,".jqx-layout-window-header")[0];if(w){var G=a(w).text();if(G===""){w.firstChild.innerHTML=x.title}}s=document.createElement("li");s.innerHTML=x.title;f._find(e,".jqx-layout-ribbon-header")[0].appendChild(s);if(!f._rendered&&!x.docked){h=f._find(f._originalElement,'[data-container="'+x.contentContainer+'"]')[0];if(h!==undefined){c=h.innerHTML}else{c=""}}else{c=x.detachedContent}y=document.createElement("div");if(typeof c==="string"){y.innerHTML=c}else{for(var C=0;C
        "+x.title+"
        ";D.appendChild(y);g.appendChild(D);r[1].appendChild(g);f._addRightClickHandler(D,b)}else{if(d==="floatGroup"){t(x)}}}break;case"documentPanel":b={};if(d==="floatGroup"){t(x)}else{r=e.children();s=document.createElement("li");s.innerHTML=x.title;r[0].appendChild(s);if(!f._rendered&&!x.docked){h=f._find(f._originalElement,'[data-container="'+x.contentContainer+'"]')[0];if(h!==undefined){c=h.innerHTML}else{c=""}}else{c=x.detachedContent}y=document.createElement("div");if(typeof c==="string"){y.innerHTML=c}else{for(var A=0;A0){var p=b;f._createLayout(x.items,p,x)}f._createWidget(q,e,x,b,E);if(f.dockingLayout&&(x.type==="documentGroup"||x.type==="tabbedGroup"||(x.type==="layoutGroup"&&x.items.length===0))){var H={element:b,width:b.width(),height:b.height(),offset:b.offset(),settings:x};f._overlayGroups.push(H);if(x.parent.type==="floatGroup"){x.parent._overlayGroup=H}}}},_createWidget:function(m,k,i,e,g){var f=this,b=m.orientation==="horizontal"?i.width:"100%",l=m.orientation==="horizontal"?"100%":i.height,d=false;i.parent=m;i.widget=e;i.index=g;if(i.widget){i.widget.current=i}function h(){var o=0;for(var n=0;n';p[0].appendChild(c);j+=16}if((e==="tabbedGroup"&&d.current.allowPin!==false)||(e==="autoHideGroup"&&d.current.parent.allowUnpin!==false)){var l;switch(e){case"tabbedGroup":l="jqx-layout-pseudo-window-pin-icon";d.pinned=false;break;case"autoHideGroup":l="jqx-layout-pseudo-window-pinned-icon";d.pinned=true;break}h=document.createElement("div");h.className=i.toThemeProperty("jqx-window-close-button-background jqx-layout-pseudo-window-pin-background");h.setAttribute("title","Auto Hide");h.innerHTML='
        ';if(c){h.className+=" "+i.toThemeProperty("jqx-layout-pseudo-window-pin-background-"+f)}else{if(i.rtl===false){h.style.right="0px"}}p[0].appendChild(h);j+=16;if(i.dockingLayout&&e==="autoHideGroup"){i.dockingLayout._addAutoHideGroupHandlers(d.current,p,d.current.title,d.children()[1])}}v[0].style.maxWidth=i._toPx(p.width()-j);var o=d.children()[1];o.style.height=i._toPx(1+d.height()-p.outerHeight());o.style.marginLeft="-1px";o.style.marginRight="-1px";i._addWindowPanelHandlers(c,h,d);return v},_addWindowPanelHandlers:function(g,c,b){var f=this,h=f.element.id,e=b.current,d=e.type;if(g){f.addHandler(g,"click.jqxLayout"+h,function(){if(d==="tabbedGroup"&&e.items.length>1){var i=f._find(b,".jqx-ribbon-item-selected")[0]._index;f._close(e.items[i])}else{if(b.initAnimate){b.initAnimate()}b.fadeOut({complete:function(){f._close(e);b.remove()}})}})}if(c){f.addHandler(c,"click.jqxLayout"+h,function(){if(d==="tabbedGroup"&&e.pinValid===true){f._pin(e)}else{if(d==="layoutPanel"){f._unPin(e.parent)}}})}},_getGroupCoordinates:function(){var d=this;d._coordinates=[];function b(e){return e==="layoutGroup"||e==="tabbedGroup"||e==="documentGroup"}function c(n){for(var j=0;j=0;e--){var l=j[e],k=l.type,g;if(k==="layoutGroup"||k==="tabbedGroup"||k==="documentGroup"||k==="autoHideGroup"||k==="floatGroup"){if(l.items&&l.items.length>0){this._detachContent(l.items)}}else{if(k==="layoutPanel"){if(l.parent.type==="tabbedGroup"){c(l)}else{if(l.parent.type==="autoHideGroup"){if(l.prevent===true){l.prevent=false}else{if(l.parent.alignment==="left"||l.parent.alignment==="right"){var b=f._find(l.parent.widget,".jqx-layout-group-auto-hide-content-vertical")[e];g=f._detachChildNodes(b);a(b).remove()}else{var h=f._find(l.parent.widget,".jqx-layout-group-auto-hide-content-horizontal")[e];g=f._detachChildNodes(h);a(h).remove()}l.detachedContent=g;if(d===true){l.prevent=true}}}}}else{if(k==="documentPanel"){c(l)}}}}},_pxToPercent:function(f,b){function g(k,j){var h,i;k=parseInt(k,10);if(b){i=e.element["offset"+j]}else{i=f["initialPx"+j]}h=(100*k/i).toString()+"%";return h}var e=this;for(var d=0;d0){e._pxToPercent(c,false)}}},_percentToPx:function(d,c,b){if(c===undefined){return undefined}else{if(typeof c!=="string"||(typeof c==="string"&&c.charAt(c.length-1)!=="%")){return parseFloat(c)}else{return parseFloat(c.slice(0,c.length-1))/100*b.widget[d]()}}},_swapPanelsInLayout:function(f,d,c){var e=f[d];f[d]=f[c];f[d].index=d;f[c]=e;f[c].index=c},_initMenu:function(){var c=this;if(!c._menuInitialized){var g=c.element.id,f="",e=function(i,h,j){c._menu.jqxMenu("disable","dockOption"+g,i);c._menu.jqxMenu("disable","autoHideOption"+g,h);c._menu.jqxMenu("disable","closeOption"+g,j)};if(!c.host.jqxMenu){throw new Error("jqxLayout: Missing reference to jqxmenu.js.")}if(c.dockingLayout){f='
      • Float
      • '}var d=document.createElement("div");d.className=c.toThemeProperty("jqx-layout-context-menu jqx-layout-context-menu-"+g);d.innerHTML="
          "+f+'
        • Dock
        • Auto Hide
        • Close
        ';c._menu=a(d);document.body.appendChild(d);c._menu.jqxMenu({theme:c.theme,width:100,height:"auto",autoOpenPopup:false,mode:"popup",popupZIndex:99999,rtl:c.rtl});c._menuInitialized=true;c.addHandler(c._menu,"itemclick.jqxLayout"+g,function(h){c._handleMenuItemClick(a(h.target).text())});var b=function(h){if(c.dockingLayout){return h.allowClose===false}else{return h.allowClose!==true}};c.addHandler(c._menu,"shown.jqxLayout"+g,function(){switch(c._contextMenuTarget.type){case"tabbedGroup":e(true,c._contextMenuTarget.allowPin===false||c._contextMenuTarget.pinValid===false,b(c._contextMenuTarget));break;case"layoutPanel":var h=c._contextMenuTarget.parent;if(h.type==="tabbedGroup"){e(true,h.allowPin===false||c._isMiddleTabbedGroup(h),b(h))}else{if(h.type==="autoHideGroup"){e(h.allowUnpin===false,true,b(c._contextMenuTarget))}}break;case"documentPanel":e(true,true,b(c._contextMenuTarget));break}})}},_addRightClickHandler:function(d,b){var c=this;if(c.contextMenu===true){c.addHandler(d,"mousedown.jqxLayout"+c.element.id,function(e){if(c.contextMenu===true&&((e.which&&e.which===3)||(e.button&&e.button===2))){var f=document.body.scrollTop,g=a(window).scrollLeft();c._contextMenuTarget=b.current;c._menu.jqxMenu("open",parseInt(e.clientX,10)+5+g,parseInt(e.clientY,10)+5+f)}});c.addHandler(d,"contextmenu.jqxLayout"+c.element.id,function(){if(c.contextMenu===true){return false}})}},_handleMenuItemClick:function(f){var e=this,d=e._contextMenuTarget.type,c=e._contextMenuTarget.parent;switch(f){case"Float":switch(d){case"tabbedGroup":e.dockingLayout._floatTabbedGroup(e._contextMenuTarget,e._contextMenuTarget.widget);break;case"layoutPanel":if(c.type==="tabbedGroup"){e.dockingLayout._removeByDragHandler(undefined,c,c.widget,e._contextMenuTarget.index,false)}else{if(c.type==="autoHideGroup"){var b=e._find(a(a(e._find(e._contextMenuTarget.parent.widget,".jqx-ribbon-content")[0]).children()[e._contextMenuTarget.index]),".jqx-layout-window")[0].firstChild;e.dockingLayout._floatAutoHideGroup(e._contextMenuTarget,e._contextMenuTarget.title,b)}}break;case"documentPanel":e.dockingLayout._removeByDragHandler(undefined,c,c.widget,e._contextMenuTarget.index,false);break}break;case"Dock":e._unPin(e._contextMenuTarget.parent);break;case"Auto Hide":switch(d){case"tabbedGroup":e._pin(e._contextMenuTarget);break;case"layoutPanel":e._pin(e._contextMenuTarget.parent);break}break;case"Close":switch(d){case"tabbedGroup":e._close(e._contextMenuTarget);break;case"layoutPanel":if(e._contextMenuTarget.parent.items.length>1){e._close(e._contextMenuTarget)}else{e._close(e._contextMenuTarget.parent)}break;case"documentPanel":e._closeDocumentPanel(e._contextMenuTarget.index,e._contextMenuTarget.parent.items,e._contextMenuTarget.parent,e._contextMenuTarget.parent.widget,false);break}}},_closeDocumentPanel:function(c,f,b,j,e){var g=this;if(e===false){j.jqxRibbon("removeAt",c)}if(f.length>1){var h=false;f[c].removed=true;g._updateLayout(f);for(var d=0;d1;if(d){if(c.parent.items.length===2){var b=c.index===0?1:0;if(c.parent.items[b].type==="autoHideGroup"){d=false}}}if(d){d=d&&!e._isMiddleTabbedGroup(c)}c.pinValid=d;if(d===false){a(e._find(c.widget,".jqx-layout-pseudo-window-pin-background")[0]).addClass("jqx-fill-state-disabled")}},_mouseupHandler:function(d){var c=this;try{if(c.dockingLayout){c._docUP(d);c.dockingLayout._windowCreate=false;c.dockingLayout._hideOverlays()}}catch(b){}},_toPx:function(b){if(typeof b==="number"){return b+"px"}else{return b}},_find:function(c,b){var d=this;if(!d._oldIE){if(c[0]){return c[0].querySelectorAll(b)}else{return c.querySelectorAll(b)}}else{return c.find(b)}},_detachChildNodes:function(c){if(c===undefined){return[]}var b=[],d=c.childNodes;if(d!==undefined){while(d.length>0){b.push(a(d[0]).detach())}}return b}})})(jqxBaseFramework); +