diff -r 2da3d3340403 -r 2d1d43c3a2c2 www-thermferm/jqwidgets/jqxdocking.js --- a/www-thermferm/jqwidgets/jqxdocking.js Fri May 19 16:34:21 2017 +0200 +++ b/www-thermferm/jqwidgets/jqxdocking.js Sun May 28 14:19:57 2017 +0200 @@ -1,7 +1,7 @@ /* -jQWidgets v3.8.0 (2015-Apr) -Copyright (c) 2011-2015 jQWidgets. +jQWidgets v4.5.2 (2017-May) +Copyright (c) 2011-2017 jQWidgets. License: http://jqwidgets.com/license/ -*/ - -(function(a){a.jqx.jqxWidget("jqxDocking","",{});a.extend(a.jqx._jqxDocking.prototype,{defineInstance:function(){var b={orientation:"horizontal",mode:"default",floatingWindowOpacity:0.3,panelsRoundedCorners:true,disabled:false,width:"auto",height:"auto",windowsMode:null,cookies:false,cookieOptions:{},windowsOffset:5,rtl:false,keyboardNavigation:false,_windowOptions:{},_draggedFired:false,_dragging:false,_draggingItem:null,_panels:[],_windows:[],_indicator:null,_events:["dragEnd","dragStart"]};a.extend(true,this,b);return b},createInstance:function(){if(!this.host.jqxWindow){throw new Error("jqxDocking: Missing reference to jqxwindow.js.")}this._refresh(true);if(this.disabled){this.disabled=false;this.disable()}},refresh:function(b){if(!b){this._performLayout()}},_refresh:function(c){this._render();this._removeClasses();this._addClasses();this._setWindowsOptions(true);this._performLayout();this._cookieHandler();this._cookieExporter();this._removeEventListeners();this._addEventListeners();var b=a.Event("resize");this.host.trigger(b)},resize:function(){this._refresh()},_addClasses:function(){this.host.addClass("jqx-docking");for(var b=0;b0){this.focusedWindow=a("#"+b)[0]}else{this.focusedWindow=this._windows[0][0]}a(this.focusedWindow).addClass(this.toThemeProperty("jqx-fill-state-focus"));this.host.focus()},_renderWindows:function(b){var f=b.children("div");for(var d=0;d');var e=this;if(this.keyboardNavigation){var c=function(i){if(i.keyCode===13){if(e.focusedWindow&&a(e.focusedWindow).jqxWindow("showCollapseButton")){a(e.focusedWindow).jqxWindow("_collapseButton").trigger("click")}}else{if((e.focusedWindow&&i.keyCode===27&&a(e.focusedWindow).jqxWindow("keyboardCloseKey")==="esc")||(e.focusedWindow&&a(e.focusedWindow).jqxWindow("keyboardCloseKey")==i.keyCode)){a(e.focusedWindow).jqxWindow("closeWindow",i)}}if(i.keyCode===9){if(e.focusedWindow==null){e.focusedWindow=e._windows[0];a(e.focusedWindow).focus();i.stopPropagation()}else{var g=-1;a.each(e._windows,function(j,k){if(this[0]==e.focusedWindow){g=j}});if(i.shiftKey){g--}else{g++}if(g>=e._windows.length||g<0){a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus"));e.focusedWindow=null;i.stopPropagation();return true}var h=e._windows[g];if(!h){h=e._windows[0]}a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus"));e.focusedWindow=h[0];a(e.focusedWindow).focus()}a(e.focusedWindow).addClass(e.toThemeProperty("jqx-fill-state-focus"));if(i.preventDefault){i.preventDefault();i.stopPropagation()}}};a.each(e._windows,function(h,i){var g=a(this);e.removeHandler(g,"focus");e.removeHandler(g,"blur");e.removeHandler(g,"mousedown");e.addHandler(g,"mousedown",function(j){if(e.focusedWindow){a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus"))}e.focusedWindow=g[0];a(e.focusedWindow).addClass(e.toThemeProperty("jqx-fill-state-focus"));a(e.focusedWindow).focus()});e.addHandler(g,"focus",function(j){if(e.focusedWindow){a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus"))}e.focusedWindow=g[0];a(e.focusedWindow).addClass(e.toThemeProperty("jqx-fill-state-focus"))});e.addHandler(g,"blur",function(j){if(a(document.activeElement).ischildof(a(g))){return true}a(g).removeClass(e.toThemeProperty("jqx-fill-state-focus"))});e.removeHandler(g,"keydown");e.addHandler(g,"keydown",function(j){c(j)})});this.removeHandler(this.host,"keydown");this.addHandler(this.host,"keydown",function(g){c(g)});this.removeHandler(this.host,"blur");this.addHandler(this.host,"blur",function(g){if(e.focusedWindow){a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus"));e.focusedWindow=null}})}},_performLayout:function(){this.host.css("width",this.width);this.host.css("height",this.height);this._performWindowsLayout();this._performPanelsLayout();this._performWindowsLayout()},_performPanelsLayout:function(){var b,e=this.host.width(),c=0;for(var d=0;d0){b.css("margin-left",-this.windowsOffset)}}b.css("min-width",b.width())}if(this.orientation==="horizontal"){if(c=g){if(c+ec){return"next"}return"prev"}return"all"},_handleIndicator:function(c,d,e){var b=this._getIndicator(d);if(e==="all"){if(this.orientation==="vertical"){b.insertBefore(c.children(".spacer"))}else{c.append(b)}}else{if(e==="prev"){b.insertBefore(d)}else{b.insertAfter(d)}}this._resizeIndicator(b,c)},_getIndicator:function(){var b=this._indicator;if(!b){b=a('
')}this._indicator=b;this._indicator.css("margin",this.windowsOffset);if(this.orientation==="vertical"){this._indicator.css("float","left")}return b},_resizeIndicator:function(c,b){if(this.orientation==="horizontal"){c.width(b.width()-(c.outerWidth(true)-c.width()));c.height(this._draggingItem.height())}else{c.width(this._draggingItem.width());c.height(this._draggingItem.height())}},_mouseLeavePanel:function(b){if(this._indicator){this._indicator.remove();this._indicator=null}},_itemDrop:function(d){var b=d.data.self,c=a(d.currentTarget);b._dragging=false;if(b._indicator){c.detach();c.insertAfter(b._indicator);b._indicator.remove();b._dropFixer(c)}else{b._dropHandler(c)}c.fadeTo(0,1);c.focus();b._indicator=null;b._cookieExporter();b._draggedFired=false;b._raiseEvent(0,{window:c.attr("id")})},_dropFixer:function(b){b.css("position","static");b.addClass(this.toThemeProperty("jqx-docking-window"));b.css("margin",this.windowsOffset);b.jqxWindow("enableResize",false);if(this.orientation==="horizontal"){this._fixWindowSize(b)}},_dropHandler:function(c){var b=this._getWindowOptions(c);if(this.mode==="docked"){this._dropDocked(c)}else{this._dropFloating(c)}},_dropDocked:function(d){var c=this._getWindowOptions(d),b=c.lastPosition;d.detach();if(b.next[0]){d.insertBefore(b.next)}else{if(b.prev[0]){d.insertAfter(b.prev)}else{b.parent.append(d)}}this._dropFixer(d)},_fixWindowSize:function(b){a(b).jqxWindow({width:b.parent().width()-(b.outerWidth()-b.width())-2*parseInt(this.windowsOffset,10)})},_itemResized:function(d){var b=d.data.self,c=a(d.currentTarget);b._setWindowOption(c,"size",{width:d.args.width,height:d.args.height});b._cookieExporter()},_dropFloating:function(c){var b;if(!a(c).jqxWindow("collapsed")){b=this._getWindowOptions(c);a(c).jqxWindow("enableResize",b.resizable)}a(document.body).append(c);this._restoreWindowSize(c)},_restoreWindowSize:function(c){var b=this._getWindowOptions(c);a(c).jqxWindow({width:b.size.width})},_isMouseOverItem:function(i,e,d){if(!i){return false}var j=i.outerWidth(true),g=i.outerHeight(true),b=i.width(),h=i.height(),f=i.offset().top,c=i.offset().left;if(d){f-=(g-h)/2;c-=(j-b)/2;b=j;h=g}if((c<=e.x&&c+b>=e.x)&&(f<=e.y&&f+h+2*this._draggingItem.height()/3>=e.y)){return true}return false},_cookieHandler:function(){if(this.cookies){var b=a.jqx.cookie.cookie("jqxDocking"+this.element.id);if(b!==null){this.importLayout(b);layoutImported=true}}},_cookieExporter:function(){if(this.cookies){a.jqx.cookie.cookie("jqxDocking"+this.element.id,this.exportLayout(),this.cookieOptions)}},_indexOf:function(c,d){for(var b=0;b1){g=g.substring(0,g.length-1)}g+="},"}g=g.substring(0,g.length-1);return{JSON:g,children:e}},_exportFloating:function(c){var e="",d;e+='"floating":{';for(var b=0;b0){b=b.attr("id")}else{b=b.id}}return this._windowOptions[b]},_setWindowOption:function(c,b,d){if(typeof c==="object"&&c!==null){if(c.length>0){c=c.attr("id")}else{c=c.id}}if(typeof this._windowOptions[c]==="undefined"){this._windowOptions[c]={}}this._windowOptions[c][b]=d;if(b==="mode"){this.setWindowMode(c,d)}},_expanded:function(c){var b=c.data.self;b._cookieExporter()},_collapsed:function(c){var b=c.data.self;b._cookieExporter()},_raiseEvent:function(b){var c=a.Event(this._events[b]);c.args=arguments[1];return this.host.trigger(c)},_moveWindow:function(e,c,b){var d=c.children();var g=null;var f=0;a.each(d,function(h){if(a(this).css("position")=="static"){if(f==b&&this!=e[0]){g=this}f++}});if(f<=b){e.appendTo(c)}else{if(g!=null){e.insertBefore(g)}}e.css("position","static")},propertyChangedHandler:function(b,c,e,d){switch(c){case"rtl":a.each(b._windows,function(){this.jqxWindow({rtl:d})});break;case"theme":a.each(b._windows,function(){this.jqxWindow({theme:d})});break;case"orientation":case"height":case"width":b._performLayout();b._cookieExporter();break;case"panelsRoundedCorners":b._removeClasses();b._addClasses();break;case"disabled":if(d){b.disabled=false;b.disable()}else{b.disabled=true;b.enable()}break;case"windowsMode":case"mode":b._setWindowsOptions(false);break;case"cookies":b._cookieExporter();break;case"windowsOffset":b._performLayout();break}},destroy:function(){this._removeEventListeners();this.host.remove();this.windowsMode=null;this.cookieOptions=null;this._windowOptions=null;this._panels=null;this._windows=null;this._events=null},disable:function(){if(!this.disabled){this.disabled=true;this._removeEventListeners();for(var b=0;b0?this.focusedWindow=a("#"+b)[0]:this.focusedWindow=this._windows[0][0],a(this.focusedWindow).addClass(this.toThemeProperty("jqx-fill-state-focus")),this.host.focus()},_renderWindows:function(b){for(var c=b.children("div"),d=0;d');var e=this;if(this.keyboardNavigation){var f=function(b){if(13===b.keyCode?e.focusedWindow&&a(e.focusedWindow).jqxWindow("showCollapseButton")&&a(e.focusedWindow).jqxWindow("_collapseButton").trigger("click"):(e.focusedWindow&&27===b.keyCode&&"esc"===a(e.focusedWindow).jqxWindow("keyboardCloseKey")||e.focusedWindow&&a(e.focusedWindow).jqxWindow("keyboardCloseKey")==b.keyCode)&&a(e.focusedWindow).jqxWindow("closeWindow",b),9===b.keyCode){if(null==e.focusedWindow)e.focusedWindow=e._windows[0],a(e.focusedWindow).focus(),b.stopPropagation();else{var c=-1;if(a.each(e._windows,function(a,b){this[0]==e.focusedWindow&&(c=a)}),b.shiftKey?c--:c++,c>=e._windows.length||c<0)return a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus")),e.focusedWindow=null,b.stopPropagation(),!0;var d=e._windows[c];d||(d=e._windows[0]),a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus")),e.focusedWindow=d[0],a(e.focusedWindow).focus()}a(e.focusedWindow).addClass(e.toThemeProperty("jqx-fill-state-focus")),b.preventDefault&&(b.preventDefault(),b.stopPropagation())}};a.each(e._windows,function(b,c){var d=a(this);e.removeHandler(d,"focus"),e.removeHandler(d,"blur"),e.removeHandler(d,"mousedown"),e.addHandler(d,"mousedown",function(b){e.focusedWindow&&a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus")),e.focusedWindow=d[0],a(e.focusedWindow).addClass(e.toThemeProperty("jqx-fill-state-focus")),a(e.focusedWindow).focus()}),e.addHandler(d,"focus",function(b){e.focusedWindow&&a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus")),e.focusedWindow=d[0],a(e.focusedWindow).addClass(e.toThemeProperty("jqx-fill-state-focus"))}),e.addHandler(d,"blur",function(b){return!!a(document.activeElement).ischildof(a(d))||void a(d).removeClass(e.toThemeProperty("jqx-fill-state-focus"))}),e.removeHandler(d,"keydown"),e.addHandler(d,"keydown",function(a){f(a)})}),this.removeHandler(this.host,"keydown"),this.addHandler(this.host,"keydown",function(a){f(a)}),this.removeHandler(this.host,"blur"),this.addHandler(this.host,"blur",function(b){e.focusedWindow&&(a(e.focusedWindow).removeClass(e.toThemeProperty("jqx-fill-state-focus")),e.focusedWindow=null)})}},_performLayout:function(){this.host.css("width",this.width),this.host.css("height",this.height),this._performWindowsLayout(),this._performPanelsLayout(),this._performWindowsLayout()},_performPanelsLayout:function(){this.host.css("overflow","hidden");for(var a,b=this.host.width(),c=0,d=0;d0&&a.css("margin-left",-this.windowsOffset));"horizontal"===this.orientation&&c=c&&(b+ec?"next":"prev"}return"all"},_handleIndicator:function(a,b,c){var d=this._getIndicator(b);"all"===c?"vertical"===this.orientation?d.insertBefore(a.children(".spacer")):a.append(d):"prev"===c?d.insertBefore(b):d.insertAfter(b),this._resizeIndicator(d,a)},_getIndicator:function(){var b=this._indicator;return b||(b=a('
')),this._indicator=b,this._indicator.css("margin",this.windowsOffset),"vertical"===this.orientation&&this._indicator.css("float","left"),b},_resizeIndicator:function(a,b){"horizontal"===this.orientation?(a.width(b.width()-(a.outerWidth(!0)-a.width())),a.height(this._draggingItem.height())):(a.width(this._draggingItem.width()),a.height(this._draggingItem.height()))},_mouseLeavePanel:function(a){this._indicator&&(this._indicator.remove(),this._indicator=null)},_itemDrop:function(b){var c=b.data.self,d=a(b.currentTarget);c._dragging=!1,c._indicator?(d.detach(),d.insertAfter(c._indicator),c._indicator.remove(),c._dropFixer(d)):c._dropHandler(d),d.fadeTo(0,1),d.focus(),c._indicator=null,c._cookieExporter(),c._draggedFired=!1,c._raiseEvent(0,{window:d.attr("id")})},_dropFixer:function(a){a.css("position","static"),a.addClass(this.toThemeProperty("jqx-docking-window")),a.css("margin",this.windowsOffset),a.jqxWindow("enableResize",!1),"horizontal"===this.orientation&&this._fixWindowSize(a)},_dropHandler:function(a){this._getWindowOptions(a);"docked"===this.mode?this._dropDocked(a):this._dropFloating(a)},_dropDocked:function(a){var b=this._getWindowOptions(a),c=b.lastPosition;a.detach(),c.next[0]?a.insertBefore(c.next):c.prev[0]?a.insertAfter(c.prev):c.parent.append(a),this._dropFixer(a)},_fixWindowSize:function(b){a(b).jqxWindow({width:b.parent().width()-(b.outerWidth()-b.width())-2*parseInt(this.windowsOffset,10)})},_itemResized:function(b){var c=b.data.self,d=a(b.currentTarget);c._setWindowOption(d,"size",{width:b.args.width,height:b.args.height}),c._cookieExporter()},_dropFloating:function(b){var c;a(b).jqxWindow("collapsed")||(c=this._getWindowOptions(b),a(b).jqxWindow("enableResize",c.resizable)),a(document.body).append(b),this._restoreWindowSize(b)},_restoreWindowSize:function(b){var c=this._getWindowOptions(b);a(b).jqxWindow({width:c.size.width})},_isMouseOverItem:function(a,b,c){if(!a)return!1;var d=a.outerWidth(!0),e=a.outerHeight(!0),f=a.width(),g=a.height(),h=a.offset().top,i=a.offset().left;return c&&(h-=(e-g)/2,i-=(d-f)/2,f=d,g=e),i<=b.x&&i+f>=b.x&&h<=b.y&&h+g+2*this._draggingItem.height()/3>=b.y},_cookieHandler:function(){if(this.cookies){var b=a.jqx.cookie.cookie("jqxDocking"+this.element.id);null!==b&&(this.importLayout(b),layoutImported=!0)}},_cookieExporter:function(){this.cookies&&a.jqx.cookie.cookie("jqxDocking"+this.element.id,this.exportLayout(),this.cookieOptions)},_indexOf:function(a,b){for(var c=0;c1&&(e=e.substring(0,e.length-1)),e+="},"}return e=e.substring(0,e.length-1),{JSON:e,children:d}},_exportFloating:function(b){var c,d="";d+='"floating":{';for(var e=0;e0?a.attr("id"):a.id),this._windowOptions[a]},_setWindowOption:function(a,b,c){"object"==typeof a&&null!==a&&(a=a.length>0?a.attr("id"):a.id),"undefined"==typeof this._windowOptions[a]&&(this._windowOptions[a]={}),this._windowOptions[a][b]=c,"mode"===b&&this.setWindowMode(a,c)},_expanded:function(a){var b=a.data.self;b._cookieExporter()},_collapsed:function(a){var b=a.data.self;b._cookieExporter()},_raiseEvent:function(b){var c=a.Event(this._events[b]);return c.args=arguments[1],this.host.trigger(c)},_moveWindow:function(b,c,d){var e=c.children(),f=null,g=0;a.each(e,function(c){"static"==a(this).css("position")&&(g==d&&this!=b[0]&&(f=this),g++)}),g<=d?b.appendTo(c):null!=f&&b.insertBefore(f),b.css("position","static")},propertyChangedHandler:function(b,c,d,e){switch(c){case"rtl":a.each(b._windows,function(){this.jqxWindow({rtl:e})});break;case"theme":a.each(b._windows,function(){this.jqxWindow({theme:e})});break;case"orientation":case"height":case"width":b._performLayout(),b._cookieExporter();break;case"panelsRoundedCorners":b._removeClasses(),b._addClasses();break;case"disabled":e?(b.disabled=!1,b.disable()):(b.disabled=!0,b.enable());break;case"windowsMode":case"mode":b._setWindowsOptions(!1);break;case"cookies":b._cookieExporter();break;case"windowsOffset":b._performLayout()}},destroy:function(){this._removeEventListeners(),this.host.remove(),this.windowsMode=null,this.cookieOptions=null,this._windowOptions=null,this._panels=null,this._windows=null,this._events=null},disable:function(){if(!this.disabled){this.disabled=!0,this._removeEventListeners();for(var b=0;b