www-thermferm/jqwidgets/jqxwindow.js

changeset 617
b216f9d4b917
parent 511
2d1d43c3a2c2
equal deleted inserted replaced
616:e2b82881c13e 617:b216f9d4b917
1 /* 1 /*
2 jQWidgets v4.5.2 (2017-May) 2 jQWidgets v12.0.1 (2021-Mar)
3 Copyright (c) 2011-2017 jQWidgets. 3 Copyright (c) 2011-2021 jQWidgets.
4 License: http://jqwidgets.com/license/ 4 License: https://jqwidgets.com/license/
5 */ 5 */
6 !function(a){"use strict";function b(b,d){var e=b.nodeName.toLowerCase();if("area"===e){var f,g=b.parentNode,h=g.name;return!(!b.href||!h||"map"!==g.nodeName.toLowerCase())&&(f=a("img[usemap=#"+h+"]")[0],!!f&&c(f))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||d:d)&&c(b)}function c(b){var c=a(b);return"none"!==c.css("display")&&"hidden"!==c.css("visibility")}function d(a){var c=a.getAttribute("tabindex"),d=null===c;return(d||c>=0)&&b(a,!d)}a.jqx.jqxWidget("jqxWindow","",{}),a.extend(a.jqx._jqxWindow.prototype,{defineInstance:function(){var b={height:"auto",width:200,minHeight:50,maxHeight:600,minWidth:50,maxWidth:800,showCloseButton:!0,disabled:!1,autoOpen:!0,keyboardCloseKey:"esc",title:"",content:"",draggable:!0,resizable:!0,animationType:"fade",closeAnimationDuration:250,showAnimationDuration:250,isModal:!1,position:"center",closeButtonSize:16,closeButtonAction:"hide",modalOpacity:.3,dragArea:null,okButton:null,cancelButton:null,dialogResult:{OK:!1,Cancel:!1,None:!0},collapsed:!1,showCollapseButton:!1,collapseAnimationDuration:150,collapseButtonSize:16,rtl:!1,keyboardNavigation:!0,headerHeight:null,_events:["created","closed","moving","moved","open","collapse","expand","open","close","resize"],initContent:null,enableResize:!0,restricter:null,autoFocus:!0,closing:null,_invalidArgumentExceptions:{invalidHeight:"Invalid height!",invalidWidth:"Invalid width!",invalidMinHeight:"Invalid minHeight!",invalidMaxHeight:"Invalid maxHeight!",invalidMinWidth:"Invalid minWidth!",invalidMaxWidth:"Invalid maxWidth",invalidKeyCode:"Invalid keyCode!",invalidAnimationType:"Invalid animationType!",invalidCloseAnimationDuration:"Invalid closeAnimationDuration!",invalidShowAnimationDuration:"Invalid showAnimationDuration!",invalidPosition:"Invalid position!",invalidCloseButtonSize:"Invalid closeButtonSize!",invalidCollapseButtonSize:"Invalid collapseButtonSize!",invalidCloseButtonAction:"Invalid cluseButtonAction!",invalidModalOpacity:"Invalid modalOpacity!",invalidDragArea:"Invalid dragArea!",invalidDialogResult:"Invalid dialogResult!",invalidIsModal:"You can have just one modal window!"},_enableResizeCollapseBackup:null,_enableResizeBackup:void 0,_heightBeforeCollapse:null,_minHeightBeforeCollapse:null,_mouseDown:!1,_isDragging:!1,_rightContentWrapper:null,_leftContentWrapper:null,_headerContentWrapper:null,_closeButton:null,_collapseButton:null,_title:null,_content:null,_mousePosition:{},_windowPosition:{},_modalBackground:null,_SCROLL_WIDTH:21,_visible:!0,modalBackgroundZIndex:12990,modalZIndex:18e3,zIndex:9001,_touchEvents:{mousedown:a.jqx.mobile.getTouchEventName("touchstart"),mouseup:a.jqx.mobile.getTouchEventName("touchend"),mousemove:a.jqx.mobile.getTouchEventName("touchmove"),mouseenter:"mouseenter",mouseleave:"mouseleave",click:a.jqx.mobile.getTouchEventName("touchstart")}};return this===a.jqx._jqxWindow.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(){this.host.initAnimate&&this.host.initAnimate(),this.host.attr("role","dialog"),this.host.removeAttr("data-bind"),this.host.appendTo(document.body);var b=this,c=function(a){for(var c=0;c<a.length;c++){var d=a[c];b[d]&&b[d].toString().indexOf("px")>=0&&(b[d]=parseInt(b[d],10))}};c(["minWidth","minHeight","maxWidth","maxHeight","width","height"]);var d=function(){var c=parseInt(a(b.restricter).css("padding-top"),10),d=parseInt(a(b.restricter).css("padding-left"),10),e=parseInt(a(b.restricter).css("padding-bottom"),10),f=parseInt(a(b.restricter).css("padding-right"),10),g=a(b.restricter).coord();b.dragArea={left:d+g.left,top:c+g.top,width:1+f+a(b.restricter).width(),height:1+e+a(b.restricter).height()}};if(this.restricter&&d(),this.restricter&&(this.addHandler(a(window),"resize."+this.element.id,function(){d()}),this.addHandler(a(window),"orientationchanged."+this.element.id,function(){d()}),this.addHandler(a(window),"orientationchange."+this.element.id,function(){d()})),this._isTouchDevice=a.jqx.mobile.isTouchDevice(),this._validateProperties(),this._createStructure(),this._refresh(),this.autoOpen||(this.element.style.display="none"),a.jqx.browser.msie&&this.host.addClass(this.toThemeProperty("jqx-noshadow")),this.isModal||this._fixWindowZIndex(),this._setStartupSettings(),this._positionWindow(),this._raiseEvent(0),this.autoOpen){this._performLayout();var e=this;this.isModal&&this._fixWindowZIndex("modal-show"),e.initContent&&(e.initContent(),e._contentInitialized=!0),this._raiseEvent(7),this._raiseEvent(9)}},refresh:function(){this._performLayout()},_setStartupSettings:function(){this.disabled&&this.disable(),this.collapsed&&(this.collapsed=!1,this.collapse(0)),this.autoOpen||(this.hide(null,.001,!0),this._visible=!1),null!==this.title&&""!==this.title&&this.setTitle(this.title),null!==this.content&&""!==this.content&&this.setContent(this.content),this.title=this._headerContentWrapper.html(),this.content=this._content.html()},_fixWindowZIndex:function(b){var c=a.data(document.body,"jqxwindows-list")||[],d=this.zIndex;if(this.isModal){c&&(c=this._removeFromArray(this.host,c),a.data(document.body,"jqxwindows-list",c));var e=a.data(document.body,"jqxwindows-modallist");if(e)if("modal-show"==b)e.push(this.host);else{var f=e.indexOf(this.host);f!=-1&&e.splice(f,1)}else if("modal-show"==b){var g=[];g.push(this.host),a.data(document.body,"jqxwindows-modallist",g),e=g}else a.data(document.body,"jqxwindows-modallist",[]),e=[];return d=this.modalZIndex,a.each(e,function(){if(this.data()&&this.data().jqxWindow){var a=this.data().jqxWindow.instance;a._modalBackground.style.zIndex=d,a.element.style.zIndex=d+1,d+=2}}),void a.data(document.body,"jqxwindow-modal",this.host)}if(this._indexOf(this.host,c)<0&&c.push(this.host),a.data(document.body,"jqxwindows-list",c),c.length>1){var h=c[c.length-2];if("auto"==h.css("z-index"))d=this.zIndex+c.length+1;else{var i=this.zIndex;d=parseInt(h.css("z-index"),10)+1,d<i&&(d=i)}}this.element.style.zIndex=d,this._sortByStyle("z-index",c)},_validateProperties:function(){try{if(this._validateSize(),this._validateAnimationProperties(),this._validateInteractionProperties(),this._validateModalProperties(),!this.position)throw new Error(this._invalidArgumentExceptions.invalidPosition);if(isNaN(this.closeButtonSize)||parseInt(this.closeButtonSize,10)<0)throw new Error(this._invalidArgumentExceptions.invalidCloseButtonSize);if(isNaN(this.collapseButtonSize)||parseInt(this.collapseButtonSize,10)<0)throw new Error(this._invalidArgumentExceptions.invalidCollapseButtonSize)}catch(a){throw new Error(a)}},_validateModalProperties:function(){if(this.modalOpacity<0||this.modalOpacity>1)throw new Error(this._invalidArgumentExceptions.invalidModalOpacity);if(this.isModal&&!this._singleModalCheck())throw new Error(this._invalidArgumentExceptions.invalidIsModal)},_validateSize:function(){if(this._validateSizeLimits(),"auto"!==this.height&&isNaN(parseInt(this.height,10)))throw new Error(this._invalidArgumentExceptions.invalidHeight);if("auto"!==this.width&&isNaN(parseInt(this.width,10)))throw new Error(this._invalidArgumentExceptions.invalidWidth);"auto"!==this.height&&this.height<this.minHeight&&(this.height=this.minHeight),this.width<this.minWidth&&(this.width=this.minWidth),"auto"!==this.height&&this.height>this.maxHeight&&(this.height=this.maxHeight),this.width>this.maxWidth&&(this.width=this.maxWidth),null!==this.dragArea&&(this.dragArea&&(null!==this.dragArea.height&&this.host.height()>this.dragArea.height||parseInt(this.height,10)>this.dragArea.height)||null!==this.dragArea.width&&this.width>this.dragArea.width||this.maxHeight>this.dragArea.height||this.maxWidth>this.dragArea.width)},_validateSizeLimits:function(){if(null==this.maxHeight&&(this.maxHeight=9999),null==this.minWidth&&(this.minWidth=0),null==this.maxWidth&&(this.maxWidth=9999),null==this.minHeight&&(this.minHeight=0),isNaN(parseInt(this.minHeight,10)))throw new Error(this._invalidArgumentExceptions.invalidMinHeight);if(isNaN(parseInt(this.maxHeight,10)))throw new Error(this._invalidArgumentExceptions.invalidMaxHeight);if(isNaN(parseInt(this.minWidth,10)))throw new Error(this._invalidArgumentExceptions.invalidMinWidth);if(isNaN(parseInt(this.maxWidth,10)))throw new Error(this._invalidArgumentExceptions.invalidMaxWidth);if(this.minHeight&&this.maxHeight&&parseInt(this.minHeight,10)>parseInt(this.maxHeight,10)&&this.maxHeight!=Number.MAX_VALUE)throw new Error(this._invalidArgumentExceptions.invalidMinHeight);if(this.minWidth&&this.maxWidth&&parseInt(this.minWidth,10)>parseInt(this.maxWidth,10)&&this.maxWidth!=Number.MAX_VALUE)throw new Error(this._invalidArgumentExceptions.invalidMinWidth)},_validateAnimationProperties:function(){if("fade"!==this.animationType&&"slide"!==this.animationType&&"combined"!==this.animationType&&"none"!==this.animationType)throw new Error(this._invalidArgumentExceptions.invalidAnimationType);if(isNaN(parseInt(this.closeAnimationDuration,10))||this.closeAnimationDuration<0)throw new Error(this._invalidArgumentExceptions.invalidCloseAnimationDuration);if(isNaN(parseInt(this.showAnimationDuration,10))||this.showAnimationDuration<0)throw new Error(this._invalidArgumentExceptions.invalidShowAnimationDuration)},_validateInteractionProperties:function(){if(parseInt(this.keyCode,10)<0||parseInt(this.keyCode,10)>130&&"esc"!==this.keyCode)throw new Error(this._invalidArgumentExceptions.invalidKeyCode);if(null!==this.dragArea&&("undefined"==typeof this.dragArea.width||"undefined"==typeof this.dragArea.height||"undefined"==typeof this.dragArea.left||"undefined"==typeof this.dragArea.top))throw new Error(this._invalidArgumentExceptions.invalidDragArea);if(!this.dialogResult||!this.dialogResult.OK&&!this.dialogResult.Cancel&&!this.dialogResult.None)throw new Error(this._invalidArgumentExceptions.invalidDialogResult);if("hide"!==this.closeButtonAction&&"close"!==this.closeButtonAction)throw new Error(this._invalidArgumentExceptions.invalidCloseButtonAction)},_singleModalCheck:function(){for(var b=a.data(document.body,"jqxwindows-list")||[],c=b.length;c;)if(c-=1,a(b[c].attr("id")).length>0&&a(b[c].attr("id")).jqxWindow("isModal"))return!1;return!0},_createStructure:function(){var b=this.host.children();if(1===b.length)this._content=b[0],this._header=document.createElement("div"),this._header.innerHTML=this.host.attr("caption"),this.element.insertBefore(this._header,this._content),this.host.attr("caption",""),this._header=a(this._header),this._content=a(this._content);else{if(2!==b.length)throw new Error("Invalid structure!");this._header=a(b[0]),this._content=a(b[1])}},_refresh:function(){this._render(),this._addStyles(),this._performLayout(),this._removeEventHandlers(),this._addEventHandlers(),this._initializeResize()},_render:function(){this._addHeaderWrapper(),this._addCloseButton(),this._addCollapseButton(),this._removeModal(),this._makeModal()},_addHeaderWrapper:function(){this._headerContentWrapper||(this._header[0].innerHTML='<div style="float:left;">'+this._header[0].innerHTML+"</div>",this._headerContentWrapper=a(this._header.children()[0]),null!==this.headerHeight&&this._header.height(this.headerHeight))},_addCloseButton:function(){this._closeButton||(this._closeButtonWrapper=document.createElement("div"),this._closeButtonWrapper.className=this.toThemeProperty("jqx-window-close-button-background"),this._closeButton=document.createElement("div"),this._closeButton.className=this.toThemeProperty("jqx-window-close-button jqx-icon-close"),this._closeButton.style.width="100%",this._closeButton.style.height="100%",this._closeButtonWrapper.appendChild(this._closeButton),this._header[0].appendChild(this._closeButtonWrapper),this._closeButtonWrapper=a(this._closeButtonWrapper),this._closeButton=a(this._closeButton))},_addCollapseButton:function(){this._collapseButton||(this._collapseButtonWrapper=document.createElement("div"),this._collapseButtonWrapper.className=this.toThemeProperty("jqx-window-collapse-button-background"),this._collapseButton=document.createElement("div"),this._collapseButton.className=this.toThemeProperty("jqx-window-collapse-button jqx-icon-arrow-up"),this._collapseButton.style.width="100%",this._collapseButton.style.height="100%",this._collapseButtonWrapper.appendChild(this._collapseButton),this._header[0].appendChild(this._collapseButtonWrapper),this._collapseButtonWrapper=a(this._collapseButtonWrapper),this._collapseButton=a(this._collapseButton))},_removeModal:function(){this.isModal||"object"!=typeof this._modalBackground||null===this._modalBackground||(a("."+this.toThemeProperty("jqx-window-modal")).remove(),this._modalBackground=null)},focus:function(){try{this.host.focus();var a=this;setTimeout(function(){a.host.focus()},10)}catch(a){}},_makeModal:function(){if(this.isModal&&!this._modalBackground){var b=a.data(document.body,"jqxwindows-list");b&&(this._removeFromArray(this.host,b),a.data(document.body,"jqxwindows-list",b)),this._modalBackground=document.createElement("div"),this._modalBackground.className=this.toThemeProperty("jqx-window-modal"),this._setModalBackgroundStyles(),document.body.appendChild(this._modalBackground),this.addHandler(this._modalBackground,this._getEvent("click"),function(){return!1});var c=this,d=function(a,b){return b.contains(a)};this.addHandler(this._modalBackground,"mouseup",function(a){c._stopResizing(c),a.preventDefault()}),this.addHandler(this._modalBackground,"mousedown",function(a){var b=c._getTabbables();return b.length>0&&(b[0].focus(1),setTimeout(function(){b[0].focus(1)},100)),a.preventDefault(),!1}),this.addHandler(a(document),"keydown.window"+this.element.id,function(b){if(9===b.keyCode){var e=a.data(document.body,"jqxwindows-modallist");if(!(e.length>1&&e[e.length-1][0]!=c.element)){var f=c._getTabbables(),g=null,h=null;if(0!==c.element.offsetWidth&&0!==c.element.offsetHeight&&(f.length>0&&(g=f[0],h=f[f.length-1]),b.target!=c.element&&null!=g))return d(b.target,c.element)&&(b.target!==h||b.shiftKey)?b.target===g&&b.shiftKey?(h.focus(1),!1):void 0:(g.focus(1),!1)}}})}},_addStyles:function(){this.host.addClass(this.toThemeProperty("jqx-rc-all")),this.host.addClass(this.toThemeProperty("jqx-window")),this.host.addClass(this.toThemeProperty("jqx-popup")),a.jqx.browser.msie&&this.host.addClass(this.toThemeProperty("jqx-noshadow")),this.host.addClass(this.toThemeProperty("jqx-widget")),this.host.addClass(this.toThemeProperty("jqx-widget-content")),this._header.addClass(this.toThemeProperty("jqx-window-header")),this._content.addClass(this.toThemeProperty("jqx-window-content")),this._header.addClass(this.toThemeProperty("jqx-widget-header")),this._content.addClass(this.toThemeProperty("jqx-widget-content")),this._header.addClass(this.toThemeProperty("jqx-disableselect")),this._header.addClass(this.toThemeProperty("jqx-rc-t")),this._content.addClass(this.toThemeProperty("jqx-rc-b")),this.host.attr("tabindex")||(this.element.tabIndex=0,this._header[0].tabIndex=0,this._content[0].tabIndex=0),this.element.setAttribute("hideFocus","true"),this.element.style.outline="none"},_performHeaderLayout:function(){this._handleHeaderButtons(),this._header[0].style.position="relative",this.rtl?(this._headerContentWrapper[0].style.direction="rtl",this._headerContentWrapper[0].style.float="right"):(this._headerContentWrapper[0].style.direction="ltr",this._headerContentWrapper[0].style.float="left"),this._performHeaderCloseButtonLayout(),this._performHeaderCollapseButtonLayout(),this._centerElement(this._headerContentWrapper,this._header,"y","margin"),this.headerHeight&&(this._centerElement(this._closeButtonWrapper,this._header,"y","margin"),this._centerElement(this._collapseButtonWrapper,this._header,"y","margin"))},_handleHeaderButtons:function(){if(this._closeButtonWrapper){if(this.showCloseButton){this._closeButtonWrapper[0].style.visibility="visible";var a=this._toPx(this.closeButtonSize);this._closeButtonWrapper[0].style.width=a,this._closeButtonWrapper[0].style.height=a}else this._closeButtonWrapper[0].style.visibility="hidden";if(this.showCollapseButton){this._collapseButtonWrapper[0].style.visibility="visible";var b=this._toPx(this.collapseButtonSize);this._collapseButtonWrapper[0].style.width=b,this._collapseButtonWrapper[0].style.height=b}else this._collapseButtonWrapper[0].style.visibility="hidden"}},_performHeaderCloseButtonLayout:function(){if(this._closeButtonWrapper){var a=parseInt(this._header.css("padding-right"),10);isNaN(a)||(this._closeButtonWrapper.width(this._closeButton.width()),this.rtl?(this._closeButtonWrapper[0].style.marginRight="0px",this._closeButtonWrapper[0].style.marginLeft=this._toPx(a)):(this._closeButtonWrapper[0].style.marginRight=this._toPx(a),this._closeButtonWrapper[0].style.marginLeft="0px")),this._closeButtonWrapper[0].style.position="absolute",this.rtl?(this._closeButtonWrapper[0].style.right="",this._closeButtonWrapper[0].style.left="0px"):(this._closeButtonWrapper[0].style.right="0px",this._closeButtonWrapper[0].style.left="")}},_performHeaderCollapseButtonLayout:function(){if(this._closeButtonWrapper){var b=parseInt(this._header.css("padding-right"),10);if(!isNaN(b)){var c=this._toPx(this.collapseButtonSize);this._collapseButtonWrapper[0].style.width=c,this._collapseButtonWrapper[0].style.height=c,this.rtl?(this._collapseButtonWrapper[0].style.marginRight="0px",this._collapseButtonWrapper[0].style.marginLeft=this._toPx(b)):(this._collapseButtonWrapper[0].style.marginRight=this._toPx(b),this._collapseButtonWrapper[0].style.marginLeft="0px")}this._collapseButtonWrapper[0].style.position="absolute";var d=this._toPx(this.showCloseButton?this._closeButton.outerWidth(!0):0);this.rtl?(this._collapseButtonWrapper[0].style.right="",this._collapseButtonWrapper[0].style.left=d):(this._collapseButtonWrapper[0].style.right=d,this._collapseButtonWrapper[0].style.left=""),this._centerElement(this._collapseButton,a(this._collapseButton[0].parentElement),"y")}},_performWidgetLayout:function(){var a;"auto"!==this.width&&(this.element.style.width=this._toPx(this.width)),this.collapsed||("auto"!==this.height?this.element.style.height=this._toPx(this.height):this.element.style.height=this.host.height()+"px",this.element.style.minHeight=this._toPx(this.minHeight)),this._setChildrenLayout(),a=this._validateMinSize(),this.element.style.maxHeight=this._toPx(this.maxHeight),this.element.style.minWidth=this._toPx(this.minWidth),this.element.style.maxWidth=this._toPx(this.maxWidth),a||this._setChildrenLayout()},_setChildrenLayout:function(){this._header.width(this.host.width()-(this._header.outerWidth(!0)-this._header.width())),this._content.width(this.host.width()-(this._content.outerWidth(!0)-this._content.width())),this._content.height(this.host.height()-this._header.outerHeight(!0)-(this._content.outerHeight(!0)-this._content.height()))},_validateMinSize:function(){var b=!0;this.minHeight<this._header.height()&&(this.minHeight=this._header.height(),b=!1);var c=a(this._header.children()[0]).outerWidth(),d=this._header.children()[1]?a(this._header.children()[1]).outerWidth():0,e=c+d;return this.minWidth<100&&(this.minWidth=Math.min(e,100),b=!1),b},_centerElement:function(a,b,c,d){"number"==typeof b.left&&"number"==typeof b.top&&"number"==typeof b.height&&"number"==typeof b.width?this._centerElementInArea(a,b,c):this._centerElementInParent(a,b,c,d)},_centerElementInParent:function(a,b,c,d){var e,f,g="none"===a.css("display");if(c=c.toLowerCase(),d?(e=d+"Top",f=d+"Left"):(e="top",f="left"),c.indexOf("y")>=0){g&&(a[0].style.display="block");var h,i=a.outerHeight(!0);g&&(a[0].style.display="none"),h=b.height();var j=Math.max(0,h-i)/2;a[0].style[e]=j+"px"}if(c.indexOf("x")>=0){g&&(a[0].style.display="block");var k,l=a.outerWidth(!0);g&&(a[0].style.display="none"),k=b.width();var m=Math.max(0,k-l)/2;a[0].style[f]=m+"px"}},_centerElementInArea:function(a,b,c){if(c=c.toLowerCase(),c.indexOf("y")>=0){var d=a.outerHeight(!0),e=b.height,f=(e-d)/2;a[0].style.top=f+b.top+"px"}if(c.indexOf("x")>=0){var g=a.outerWidth(!0),h=b.width,i=(h-g)/2;a[0].style.left=i+b.left+"px"}},_removeEventHandlers:function(){this.removeHandler(this._header,this._getEvent("mousedown")),this.removeHandler(this._header,this._getEvent("mousemove")),this.removeHandler(this._header,"focus"),this.removeHandler(a(document),this._getEvent("mousemove")+"."+this.host.attr("id")),this.removeHandler(a(document),this._getEvent("mouseup")+"."+this.host.attr("id")),this.removeHandler(this.host,"keydown"),this.removeHandler(this._closeButton,this._getEvent("click")),this.removeHandler(this._closeButton,this._getEvent("mouseenter")),this.removeHandler(this._closeButton,this._getEvent("mouseleave")),this.removeHandler(this._collapseButton,this._getEvent("click")),this.removeHandler(this._collapseButton,this._getEvent("mouseenter")),this.removeHandler(this._collapseButton,this._getEvent("mouseleave")),this.removeHandler(this.host,this._getEvent("mousedown")),this.okButton&&this.removeHandler(a(this.okButton),this._getEvent("click"),this._setDialogResultHandler),this.cancelButton&&this.removeHandler(a(this.cancelButton),this._getEvent("click"),this._setDialogResultHandler),this.removeHandler(this._header,this._getEvent("mouseenter")),this.removeHandler(this._header,this._getEvent("mouseleave")),this.removeHandler(this.host,"resizing",this._windowResizeHandler)},_removeFromArray:function(a,b){var c=this._indexOf(a,b);return c>=0?b.splice(this._indexOf(a,b),1):b},_sortByStyle:function(a,b){for(var c=0;c<b.length;c++)for(var d=b.length-1;d>c;d--){var e,f=b[d],g=b[d-1];parseInt(f.css(a),10)<parseInt(g.css(a),10)&&(e=f,b[d]=g,b[d-1]=e)}},_initializeResize:function(){if(this.resizable){var a=this;this.initResize({target:this.host,alsoResize:a._content,maxWidth:a.maxWidth,minWidth:a.minWidth,maxHeight:a.maxHeight,minHeight:a.minHeight,indicatorSize:10,resizeParent:a.dragArea})}},_removeResize:function(){this.removeResize()},_getEvent:function(a){return this._isTouchDevice?this._touchEvents[a]:a},_addEventHandlers:function(){this._addDragDropHandlers(),this._addCloseHandlers(),this._addCollapseHandlers(),this._addFocusHandlers(),this._documentResizeHandlers(),this._closeButtonHover(),this._collapseButtonHover(),this._addDialogButtonsHandlers(),this._addHeaderHoverEffect(),this._addResizeHandlers();var a=this;this.addHandler(this._header,this._getEvent("mousemove"),function(){a._addHeaderCursorHandlers(a)})},_addResizeHandlers:function(){var a=this;a.addHandler(a.host,"resizing",a._windowResizeHandler,{self:a})},_windowResizeHandler:function(a){var b=a.data.self;b._header.width(b.host.width()-(b._header.outerWidth(!0)-b._header.width())),b.width=a.args.width,b.height=a.args.height},_addHeaderHoverEffect:function(){var b=this;this.addHandler(this._header,this._getEvent("mouseenter"),function(){a(this).addClass(b.toThemeProperty("jqx-window-header-hover"))}),this.addHandler(this._header,this._getEvent("mouseleave"),function(){a(this).removeClass(b.toThemeProperty("jqx-window-header-hover"))})},_addDialogButtonsHandlers:function(){this.okButton&&this.addHandler(a(this.okButton),this._getEvent("click"),this._setDialogResultHandler,{self:this,result:"ok"}),this.cancelButton&&this.addHandler(a(this.cancelButton),this._getEvent("click"),this._setDialogResultHandler,{self:this,result:"cancel"})},_documentResizeHandlers:function(){var b=this;this.isModal&&this.addHandler(a(window),"resize.window"+this.element.id,function(){if("object"==typeof b._modalBackground&&null!==b._modalBackground){if(b.isOpen()&&(b._modalBackground.style.display="none"),b.restricter)b._modalBackground.style.left=b._toPx(b.dragArea.left),b._modalBackground.style.top=b._toPx(b.dragArea.top),b._modalBackground.style.width=b._toPx(b.dragArea.width),b._modalBackground.style.height=b._toPx(b.dragArea.height);else{var a=b._getDocumentSize();b._modalBackground.style.width=a.width+"px",b._modalBackground.style.height=a.height+"px"}b.isOpen()&&(b._modalBackground.style.display="block")}})},_setDialogResultHandler:function(a){var b=a.data.self;b._setDialogResult(a.data.result),b.closeWindow()},_setDialogResult:function(a){switch(this.dialogResult.OK=!1,this.dialogResult.None=!1,this.dialogResult.Cancel=!1,a=a.toLowerCase()){case"ok":this.dialogResult.OK=!0;break;case"cancel":this.dialogResult.Cancel=!0;break;default:this.dialogResult.None=!0}},_getDocumentSize:function(){var b=a.jqx.browser.msie&&a.jqx.browser.version<9,c=b?4:0,d=c;return document.body.scrollHeight>document.body.clientHeight&&b&&(c=this._SCROLL_WIDTH),document.body.scrollWidth>document.body.clientWidth&&b&&(d=this._SCROLL_WIDTH),{width:a(document).width()-c,height:a(document).height()-d}},_closeButtonHover:function(){var a=this;this.addHandler(this._closeButton,this._getEvent("mouseenter"),function(){a._closeButton.addClass(a.toThemeProperty("jqx-window-close-button-hover"))}),this.addHandler(this._closeButton,this._getEvent("mouseleave"),function(){a._closeButton.removeClass(a.toThemeProperty("jqx-window-close-button-hover"))})},_collapseButtonHover:function(){var a=this;this.addHandler(this._collapseButton,this._getEvent("mouseenter"),function(){a._collapseButton.addClass(a.toThemeProperty("jqx-window-collapse-button-hover"))}),this.addHandler(this._collapseButton,this._getEvent("mouseleave"),function(){a._collapseButton.removeClass(a.toThemeProperty("jqx-window-collapse-button-hover"))})},_setModalBackgroundStyles:function(){if(this.isModal){var b=this._getDocumentSize();a.jqx.browser.msie&&a.jqx.browser.version<9?this._modalBackground.style.filter="alpha(opacity="+100*this.modalOpacity+")":this._modalBackground.style.opacity=this.modalOpacity,this._modalBackground.style.position="absolute",this._modalBackground.style.top="0px",this._modalBackground.style.left="0px",this._modalBackground.style.width=b.width,this._modalBackground.style.height=b.height,this._modalBackground.style.zIndex=this.modalBackgroundZIndex,this.autoOpen||(this._modalBackground.style.display="none")}},_addFocusHandlers:function(){var a=this;this.addHandler(this.host,this._getEvent("mousedown"),function(){a.isModal||a.bringToFront()})},_indexOf:function(a,b){for(var c=0;c<b.length;c++)if(b[c][0]===a[0])return c;return-1},_addCloseHandlers:function(){var a=this;this.addHandler(this._closeButton,this._getEvent("click"),function(b){return a._closeWindow(b)}),"none"!==this.keyboardCloseKey&&"number"!=typeof this.keyboardCloseKey&&"esc"===this.keyboardCloseKey.toLowerCase()&&(this.keyboardCloseKey=27),this.addHandler(this.host,"keydown",function(b){b.keyCode===a.keyboardCloseKey&&null!=a.keyboardCloseKey&&"none"!=a.keyboardCloseKey?a._closeWindow(b):a._handleKeys(b)},{self:this}),this.addHandler(this.host,"keyup",function(){if(a.keyboardNavigation&&a._moved){var b=a.host.coord(),c=b.left,d=b.top;a._raiseEvent(3,c,d,c,d),a._moved=!1}})},_handleKeys:function(b){if(this.keyboardNavigation&&this._headerFocused&&!a(document.activeElement).ischildof(this._content)){var c=b.ctrlKey,d=b.keyCode,e=this.host.coord(),f=e.left,g=e.top,h=this._getDraggingArea(),i=this.host.width(),j=this.host.height(),k=!0,l=10;switch(d){case 37:c?this.resizable&&this.resize(i-l,j):this.draggable&&f-l>=0&&this.move(f-l,g),k=!1;break;case 38:c?this.resizable&&this.resize(i,j-l):this.draggable&&g-l>=0&&this.move(f,g-l),k=!1;break;case 39:c?this.resizable&&this.resize(i+l,j):this.draggable&&f+i+l<=h.width&&this.move(f+l,g),k=!1;break;case 40:c?this.resizable&&this.resize(i,j+l):this.draggable&&g+j+l<=h.height&&this.move(f,g+l),k=!1}return k||(b.preventDefault&&b.preventDefault(),b.stopPropagation&&b.stopPropagation()),k}},_addCollapseHandlers:function(){var a=this;this.addHandler(this._collapseButton,this._getEvent("click"),function(){a.collapsed?a.expand():a.collapse()})},_closeWindow:function(){return this.closeWindow(),!1},_addHeaderCursorHandlers:function(a){return a.resizeArea&&a.resizable&&!a.collapsed?void(a._header[0].style.cursor=a._resizeWrapper.style.cursor):a.draggable?void(a._header[0].style.cursor="move"):(a._header[0].style.cursor="default",void(a._resizeWrapper&&(a._resizeWrapper.style.cursor="default")))},_addDragDropHandlers:function(){if(this.draggable){var b=this;this.addHandler(this.host,"focus",function(){b._headerFocused=!0}),this.addHandler(this.host,"blur",function(){b._headerFocused=!1}),this.addHandler(this._header,"focus",function(){return b._headerFocused=!0,!1}),this.addHandler(this._header,this._getEvent("mousedown"),function(a,c,d){return c&&(a.pageX=c),d&&(a.pageY=d),b._headerMouseDownHandler(b,a),!0}),this.addHandler(this._header,"dragstart",function(a){return a.preventDefault&&a.preventDefault(),!1}),this.addHandler(this._header,this._getEvent("mousemove"),function(a){return b._headerMouseMoveHandler(b,a)}),this.addHandler(a(document),this._getEvent("mousemove")+"."+this.host.attr("id"),function(a){return b._dragHandler(b,a)}),this.addHandler(a(document),this._getEvent("mouseup")+"."+this.host.attr("id"),function(a){return b._dropHandler(b,a)});try{if(""!==document.referrer||window.frameElement){var c=null;if(null!=window.top&&window.top!=window.self&&window.parent&&document.referrer&&(c=document.referrer),c&&c.indexOf(document.location.host)!=-1){var d=function(a){b._dropHandler(b,a)};window.top.document.addEventListener?window.top.document.addEventListener("mouseup",d,!1):window.top.document.attachEvent&&window.top.document.attachEvent("onmouseup",d)}}}catch(a){}}},_headerMouseDownHandler:function(b,c){if(b.isModal||b.bringToFront(),null==b._resizeDirection){var d=a.jqx.position(c);b._mousePosition.x=d.left,b._mousePosition.y=d.top,b._mouseDown=!0,b._isDragging=!1}},_headerMouseMoveHandler:function(b,c){if(b._mouseDown&&!b._isDragging){var d=a.jqx.mobile.getTouches(c),e=d[0],f=e.pageX,g=e.pageY,h=a.jqx.position(c);return f=h.left,g=h.top,(f+3<b._mousePosition.x||f-3>b._mousePosition.x||g+3<b._mousePosition.y||g-3>b._mousePosition.y)&&(b._isDragging=!0,b._mousePosition={x:f,y:g},b._windowPosition={x:b.host.coord().left,y:b.host.coord().top},a(document.body).addClass(b.toThemeProperty("jqx-disableselect"))),!!b._isTouchDevice&&(c.preventDefault(),!0)}return!b._isDragging||!!b._isTouchDevice&&(c.preventDefault(),!0)},_dropHandler:function(b,c){var d=!0;if(b._isDragging&&!b.isResizing&&!b._resizeDirection){var e=parseInt(b.host.css("left"),10),f=parseInt(b.host.css("top"),10),g=b._isTouchDevice?0:c.pageX,h=b._isTouchDevice?0:c.pageY;b.enableResize=b._enableResizeBackup,b._enableResizeBackup="undefined",b._raiseEvent(3,e,f,g,h),d=!1,"undefined"!=c.preventDefault&&c.preventDefault(),null!=c.originalEvent&&(c.originalEvent.mouseHandled=!0),"undefined"!=c.stopPropagation&&c.stopPropagation()}return b._isDragging=!1,b._mouseDown=!1,a(document.body).removeClass(b.toThemeProperty("jqx-disableselect")),d},_dragHandler:function(b,c){if(b._isDragging&&!b.isResizing&&!b._resizeDirection){var d=b._isTouchDevice?c.originalEvent.which:c.which;if("undefined"==typeof b._enableResizeBackup&&(b._enableResizeBackup=b.enableResize),b.enableResize=!1,0===d&&a.jqx.browser.msie&&a.jqx.browser.version<8)return b._dropHandler(b,c);var e=a.jqx.position(c),f=e.left,g=e.top,h=f-b._mousePosition.x,i=g-b._mousePosition.y,j=b._windowPosition.x+h,k=b._windowPosition.y+i;return b.move(j,k,c),c.preventDefault(),!1}return!0},_validateCoordinates:function(a,b,c,d){var e=this._getDraggingArea();a=a<e.left?e.left:a,b=b<e.top?e.top:b;var f=this.host.outerWidth(!0),g=this.host.outerHeight(!0);return a+f>=e.width+e.left-2*d&&(a=e.width+e.left-f-d),b+g>=e.height+e.top-c&&(b=e.height+e.top-g-c),{x:a,y:b}},_performLayout:function(){this._performHeaderLayout(),this._performWidgetLayout()},_parseDragAreaAttributes:function(){null!==this.dragArea&&(this.dragArea.height=parseInt(this.dragArea.height,10),this.dragArea.width=parseInt(this.dragArea.width,10),this.dragArea.top=parseInt(this.dragArea.top,10),this.dragArea.left=parseInt(this.dragArea.left,10))},_positionWindow:function(){if(this._parseDragAreaAttributes(),this.position instanceof Array&&2===this.position.length&&"number"==typeof this.position[0]&&"number"==typeof this.position[1])this.element.style.left=this._toPx(this.position[0]), 6 /* eslint-disable */
7 this.element.style.top=this._toPx(this.position[1]);else if(this.position instanceof Object){if(this.position.left)this.host.offset(this.position);else if(void 0!==this.position.x&&void 0!==this.position.y)this.element.style.left=this._toPx(this.position.x),this.element.style.top=this._toPx(this.position.y);else if(this.position.center){this._centerElement(this.host,this.position.center,"xy");var a=this.position.center.coord(),b=parseInt(this.host.css("left"),10),c=parseInt(this.host.css("top"),10);this.element.style.left=this._toPx(b+a.left),this.element.style.top=this._toPx(c+a.top)}}else this._positionFromLiteral()},_getDraggingArea:function(){var a={};return a.left=this.dragArea&&this.dragArea.left?this.dragArea.left:0,a.top=this.dragArea&&this.dragArea.top?this.dragArea.top:0,a.width=this.dragArea&&this.dragArea.width?this.dragArea.width:this._getDocumentSize().width,a.height=this.dragArea&&this.dragArea.height?this.dragArea.height:this._getDocumentSize().height,a},_positionFromLiteral:function(){this.position instanceof Array||(this.position=this.position.split(","));for(var b=this.position.length,c=this._getDraggingArea();b;)switch(b-=1,this.position[b]=this.position[b].replace(/ /g,""),this.position[b]){case"top":this.element.style.top=this._toPx(c.top);break;case"left":this.element.style.left=this._toPx(c.left);break;case"bottom":this.element.style.top=this._toPx(c.height-this.host.height()+c.top);break;case"right":this.element.style.left=this._toPx(c.left+c.width-this.host.width());break;default:this.dragArea||(c=a(window)),this._centerElement(this.host,c,"xy")}},_raiseEvent:function(b){var c=this._events[b],d=a.Event(c),e={};return 2!==b&&3!==b||(e.x=arguments[1],e.y=arguments[2],e.pageX=arguments[3],e.pageY=arguments[4]),"closed"!==c&&"close"!==c||(e.dialogResult=this.dialogResult),d.args=e,this.host.trigger(d)},destroy:function(){this.removeHandler(a(window),"resize.window"+this.element.id),this._removeEventHandlers(),this._destroy()},_destroy:function(){this.isModal&&(null!==this._modalBackground&&a(this._modalBackground).remove(),this.host.jqxWindow({isModal:!1})),this.restricter&&(this.removeHandler(a(window),"resize."+this.element.id),this.removeHandler(a(window),"orientationchanged."+this.element.id),this.removeHandler(a(window),"orientationchange."+this.element.id)),this.host.remove(),null!==this._modalBackground&&a(this._modalBackground).remove()},_toClose:function(a,b){return a&&b[0]===this.element||b[0]!==this.element&&"object"==typeof b[0]},propertyChangedHandler:function(b,c,d,e){switch(this._validateProperties(),c){case"rtl":this._performLayout();break;case"dragArea":this._positionWindow();break;case"collapseButtonSize":this._performLayout();break;case"closeButtonSize":this._performLayout();break;case"isModal":if(this._refresh(),this._fixWindowZIndex(),e===!1)for(var f=a.data(document.body,"jqxwindows-modallist"),g=[],h=0;h<f.length;h++){var i=f[h][0];i!==this.element&&g.push(f[h])}a.data(document.body,"jqxwindows-modallist",g);break;case"keyboardCloseKey":this._removeEventHandlers(),this._addEventHandlers();break;case"disabled":e?this.disable():(this.disabled=!0,this.enable());break;case"showCloseButton":case"showCollapseButton":this._performLayout();break;case"height":this._performLayout();break;case"width":this._performLayout();break;case"title":this.setTitle(e),this.title=e;break;case"content":this.setContent(e);break;case"draggable":this._removeEventHandlers(),this._addEventHandlers(),this._removeResize(),this._initializeResize();break;case"resizable":this.enableResize=e,e?this._initializeResize():this._removeResize();break;case"position":this._positionWindow();break;case"modalOpacity":this._setModalBackgroundStyles();break;case"okButton":e?this._addDialogButtonsHandlers():this.removeHandler(this.okButton);break;case"cancelButton":e?this._addDialogButtonsHandlers():this.removeHandler(this.cancelButton);break;case"collapsed":e?d||(this.collapsed=!1,this.collapse(0)):d&&(this.collapsed=!0,this.expand(0));break;case"theme":a.jqx.utilities.setTheme(d,e,this.host);break;case"enableResize":return;case"maxWidth":case"maxHeight":case"minWidth":case"minHeight":return b._performLayout(),b._removeResize(),void b._initializeResize();default:return}},collapse:function(b){if(!this.collapsed&&this._animationInProgress!==!0){if("none"==this.host.css("display"))return;var c=this,d=this._header.outerHeight(!0),e=parseInt(this._header.css("border-bottom-width"),10),f=parseInt(this._header.css("margin-bottom"),10);b=isNaN(parseInt(b,10))?this.collapseAnimationDuration:b,isNaN(e)||(d-=2*e),isNaN(f)||(d+=f),this._heightBeforeCollapse=this.host.height(),this._minHeightBeforeCollapse=this.host.css("min-height"),this.element.style.minHeight=this._toPx(d),c._animationInProgress=!0,this.host.animate({height:d},{duration:b,complete:function(){c._animationInProgress=!1,c.collapsed=!0,c._collapseButton.addClass(c.toThemeProperty("jqx-window-collapse-button-collapsed")),c._collapseButton.addClass(c.toThemeProperty("jqx-icon-arrow-down")),c._content[0].style.display="none",c._raiseEvent(5),c._raiseEvent(9),a.jqx.aria(c,"aria-expanded",!1)}})}},expand:function(b){if(this.collapsed&&this._animationInProgress!==!0){var c=this;b=isNaN(parseInt(b,10))?this.collapseAnimationDuration:b,c._animationInProgress=!0,this.host.animate({height:this._heightBeforeCollapse},{duration:b,complete:function(){c._animationInProgress=!1,c.collapsed=!1,c.element.style.minHeight=c._toPx(c._minHeightBeforeCollapse),c._collapseButton.removeClass(c.toThemeProperty("jqx-window-collapse-button-collapsed")),c._collapseButton.removeClass(c.toThemeProperty("jqx-icon-arrow-down")),c._content[0].style.display="block",c._raiseEvent(6),c._performWidgetLayout(),c._raiseEvent(9),a.jqx.aria(c,"aria-expanded",!0)}})}},closeAll:function(b){b=!0;for(var c=a.data(document.body,"jqxwindows-list"),d=c.length,e=a.data(document.body,"jqxwindow-modal")||[];d;)d-=1,this._toClose(b,c[d])&&(c[d].jqxWindow("closeWindow","close"),c.splice(d,1));this._toClose(b,e)&&(e.jqxWindow("closeWindow","close"),a.data(document.body,"jqxwindow-modal",[])),a.data(document.body,"jqxwindows-list",c)},setTitle:function(a){if("string"==typeof a)this._headerContentWrapper.html(a);else if("object"==typeof a)try{this._headerContentWrapper[0].innerHTML="",a instanceof HTMLElement?this._headerContentWrapper[0].appendChild(a):a.appendTo&&a.appendTo(this._headerContentWrapper)}catch(a){throw new Error(a)}this.title=a,this._performLayout()},setContent:function(b){this._contentInitialized=!1;for(var c=this._content,d=!1;!d;)c[0].style.width="auto",c[0].style.height="auto",c.hasClass("jqx-window")?d=!0:c=a(c[0].parentNode);if(a.isArray(b))for(var e=0;e<b.length;e++)b[e].appendTo(this._content);else if("string"==typeof b)a(this._content[0]).html(b);else if("object"==typeof b)try{this._content[0].innerHTML="",b instanceof HTMLElement?this._content[0].appendChild(b):b.appendTo&&b.appendTo(this._content)}catch(a){throw new Error(a)}this.content=b,this._performLayout()},disable:function(){this.disabled=!0,this._removeEventHandlers(),this._header.addClass(this.toThemeProperty("jqx-window-header-disabled")),this._closeButton.addClass(this.toThemeProperty("jqx-window-close-button-disabled")),this._collapseButton.addClass(this.toThemeProperty("jqx-window-collapse-button-disabled")),this._content.addClass(this.toThemeProperty("jqx-window-content-disabled")),this.host.addClass(this.toThemeProperty("jqx-window-disabled")),this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled")),this._removeResize()},enable:function(){this.disabled&&(this._addEventHandlers(),this._header.removeClass(this.toThemeProperty("jqx-window-header-disabled")),this._content.removeClass(this.toThemeProperty("jqx-window-content-disabled")),this._closeButton.removeClass(this.toThemeProperty("jqx-window-close-button-disabled")),this._collapseButton.removeClass(this.toThemeProperty("jqx-window-collapse-button-disabled")),this.host.removeClass(this.toThemeProperty("jqx-window-disabled")),this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled")),this.disabled=!1,this._initializeResize())},isOpen:function(){return this._visible},closeWindow:function(a){var b=this;a="undefined"==typeof a?this.closeButtonAction:a,this.hide(function(){"close"===a&&b._destroy()})},bringToFront:function(){var b=a.data(document.body,"jqxwindows-list");if(this.isModal)return b=a.data(document.body,"jqxwindows-modallist"),this._fixWindowZIndex("modal-hide"),void this._fixWindowZIndex("modal-show");for(var c=b[b.length-1],d=parseInt(c.css("z-index"),10),e=this._indexOf(this.host,b),f=b.length-1;f>e;f-=1){var g=parseInt(b[f].css("z-index"),10)-1;b[f][0].style.zIndex=g}this.element.style.zIndex=d,this._sortByStyle("z-index",b)},hide:function(b,c,d){var e=this;if(this.closing){var f=this.closing();if(f===!1)return}switch(c=c||this.closeAnimationDuration,this.animationType){case"none":this.element.style.display="none";break;case"fade":e._animationInProgress=!0,this.host.fadeOut({duration:c,callback:function(){e._animationInProgress=!1,b instanceof Function&&b()}});break;case"slide":e._animationInProgress=!0,this.host.slideUp({duration:c,callback:function(){e._animationInProgress=!1,b instanceof Function&&b()}});break;case"combined":e._animationInProgress=!0,this.host.animate({opacity:0,width:"0px",height:"0px"},{duration:c,complete:function(){e._animationInProgress=!1,e.element.style.display="none",b instanceof Function&&b()}})}this._visible=!1,this.isModal&&(a(this._modalBackground).hide(),this._fixWindowZIndex("modal-hide")),d!==!0&&(this._raiseEvent(1),this._raiseEvent(8))},open:function(a,b){this.show(a,b)},close:function(a,b,c){this.hide(a,b,c)},show:function(b,c){var d=this;switch(this._setDialogResult("none"),c=c||this.showAnimationDuration,this.animationType){case"none":this.element.style.display="block";break;case"fade":d._animationInProgress=!0,this.host.fadeIn({duration:c,complete:function(){d._animationInProgress=!1,b instanceof Function&&b()}});break;case"slide":d._animationInProgress=!0,this.host.slideDown({duration:c,callback:function(){d._animationInProgress=!1,b instanceof Function&&b()}});break;case"combined":this.element.style.display="block";var e=d.host.width(),f=d.host.height();this.element.style.minWidth="0px",this.element.style.minHeight="0px",this.element.style.opacity=0,this.element.style.width="0px",this.element.style.height="0px",d._animationInProgress=!0,this.host.animate({opacity:1,width:e+"px",height:f+"px"},{duration:c,complete:function(){d._animationInProgress=!1,d._performLayout(),b instanceof Function&&b()}})}this.isModal&&(a(this._modalBackground).show(),this._fixWindowZIndex("modal-show"));var g=this;if(this._visible||(c>150&&"none"!=this.animationType?setTimeout(function(){g._contentInitialized||g.initContent&&(g.initContent(),g._contentInitialized=!0),g._raiseEvent(7),g._raiseEvent(9)},c-150):(g._contentInitialized||g.initContent&&(g.initContent(),g._contentInitialized=!0),this._raiseEvent(7),g._raiseEvent(9))),this._visible=!0,"combined"!==d.animationType&&this._performLayout(),this.autoFocus){var h=function(){g._isTouchDevice||g._content[0].focus()};h(),setTimeout(function(){h()},100)}},_getTabbables:function(){var b;b=a.jqx.browser.msie&&a.jqx.browser.version<9?this._content.find("*"):this._content[0].querySelectorAll("*");var c=[];return a.each(b,function(){d(this)&&(c[c.length]=this)}),c},move:function(b,c,d,e){var f,g,h,i=0,j=0;if(b=parseInt(b,10),c=parseInt(c,10),a.jqx.browser.msie&&(a(window).width()>a(document).width()&&!this.dragArea&&(j=this._SCROLL_WIDTH),a(window).height()<a(document).height()&&document.documentElement.clientWidth>document.documentElement.scrollWidth&&!this.dragArea&&(i=this._SCROLL_WIDTH)),f=this._validateCoordinates(b,c,j,i),parseInt(this.host.css("left"),10)!==f.x||parseInt(this.host.css("top"),10)!==f.y){if(d){var k=a.jqx.position(d);g=k.left,h=k.top}void 0===g&&(g=b),void 0===h&&(h=c),e!==!1&&this._raiseEvent(2,f.x,f.y,g,h)}this.element.style.left=f.x+"px",this.element.style.top=f.y+"px",this._moved=!0},_toPx:function(a){return"number"==typeof a?a+"px":a}})}(jqxBaseFramework),function(a){"use strict";var b=function(a){return{resizeConfig:function(){this.resizeTarget=null,this.resizeIndicatorSize=5,this.resizeTargetChildren=null,this.isResizing=!1,this.resizeArea=!1,this.minWidth=1,this.maxWidth=100,this.minHeight=1,this.maxHeight=100,this.resizeParent=null,this.enableResize=!0,this._resizeEvents=["resizing","resized","resize"],this._resizeMouseDown=!1,this._resizeCurrentMode=null,this._mouseResizePosition={},this._resizeMethods=null,this._SCROLL_WIDTH=21},_resizeExceptions:{invalidTarget:"Invalid target!",invalidMinHeight:"Invalid minimal height!",invalidMaxHeight:"Invalid maximum height!",invalidMinWidth:"Invalid minimum width!",invalidMaxWidth:"Invalid maximum width!",invalidIndicatorSize:"Invalid indicator size!",invalidSize:"Invalid size!"},removeResize:function(){if(this.resizeTarget){var b=a(this.resizeTarget.children(".jqx-resize"));b.detach();var c=b.children();this._removeResizeEventListeners();for(var d=0;d<c.length;d+=1)a(c[d]).detach(),this.resizeTarget.append(c[d]);b.remove()}this._resizeDirection=null},initResize:function(b){this.resizeConfig(),this.resizeTarget=a(b.target),this.resizeIndicatorSize=b.indicatorSize||10,this.maxWidth=b.maxWidth||100,this.minWidth=b.minWidth||1,this.maxHeight=b.maxHeight||100,this.minHeight=b.minHeight||1,this.resizeParent=b.resizeParent,this._parseResizeParentProperties(),this._validateResizeProperties(),this._validateResizeTargetDimensions(),this._getChildren(this.resizeTarget.maxWidth,this.resizeTarget.minWidth,this.resizeTarget.maxHeight,this.resizeTarget.minHeight,b.alsoResize),this._refreshResize(),this._cursorBackup=this.resizeTarget.css("cursor"),"auto"===this._cursorBackup&&(this._cursorBackup="default")},_validateResizeTargetDimensions:function(){this.resizeTarget.maxWidth=this.maxWidth,this.resizeTarget.minWidth=3*this.resizeIndicatorSize>this.minWidth?3*this.resizeIndicatorSize:this.minWidth,this.resizeTarget.maxHeight=this.maxHeight,this.resizeTarget.minHeight=3*this.resizeIndicatorSize>this.minHeight?3*this.resizeIndicatorSize:this.minHeight},_parseResizeParentProperties:function(){this.resizeParent&&(this.resizeParent.left=parseInt(this.resizeParent.left,10),this.resizeParent.top=parseInt(this.resizeParent.top,10),this.resizeParent.width=parseInt(this.resizeParent.width,10),this.resizeParent.height=parseInt(this.resizeParent.height,10))},_getChildren:function(b,c,d,e,f){this.resizeTargetChildren=a(f),this.resizeTargetChildren=this.resizeTargetChildren.toArray();for(var g=this.resizeTargetChildren.length;g;)g-=1,this.resizeTargetChildren[g]=a(this.resizeTargetChildren[g])},_refreshResize:function(){this._renderResize(),this._performResizeLayout(),this._removeResizeEventListeners(),this._addResizeEventHandlers()},_renderResize:function(){var b=this;if(!(void 0!==b._resizeWrapper&&a(b._resizeWrapper).parents().length>0)){var c=document.createElement("div");c.className="jqx-resize jqx-rc-all",c.style.zIndex=8e3,c.appendChild(b._header[0]),c.appendChild(b._content[0]),b.resizeTarget[0].appendChild(c),b._resizeWrapper=c}},_performResizeLayout:function(){this._resizeWrapper.style.height=this.resizeTarget.height()+"px",this._resizeWrapper.style.width=this.resizeTarget.width()+"px"},_removeResizeEventListeners:function(){var b=this.resizeTarget.attr("id");this.removeHandler(this._resizeWrapper,"mousemove.resize"+b),this.removeHandler(this._resizeWrapper,"mousedown.resize"+b),this.removeHandler(a(document),"mousemove.resize"+b),this.removeHandler(a(document),"mouseup.resize"+b)},_addResizeEventHandlers:function(){var b=this.resizeTarget.attr("id"),c=this;this.addHandler(this._resizeWrapper,"mousemove.resize."+b,function(a){c._resizeCursorChangeHandler(c,a)}),this.addHandler(this._resizeWrapper,"mousedown.resize."+b,function(a){c._resizeMouseDownHandler(c,a)}),this.addHandler(a(document),"mousemove.resize."+b,function(a){return c._resizeHandler(c,a)}),this.addHandler(a(document),"mouseup.resize."+b,function(a){c._stopResizing(c,a)});try{if(""!==document.referrer||window.frameElement){var d=function(a){c._stopResizing(c,a)};window.top.document.addEventListener?window.top.document.addEventListener("mouseup",d,!1):window.top.document.attachEvent&&window.top.document.attachEvent("onmouseup",d)}}catch(a){}},_stopResizing:function(a){a.enableResize&&(a.isResizing&&a._raiseResizeEvent(1),a._resizeMouseDown=!1,a.isResizing=!1,a._resizeDirection=null,a.resizeTarget&&a.resizeTarget.removeClass("jqx-disableselect")),"undefined"==a._cursorBackup&&(a._cursorBackup="default"),a._resizeWrapper&&(a._resizeWrapper.style.cursor=a._cursorBackup)},_resizeHandler:function(b,c){if(b.enableResize&&!b.collapsed)return b.isResizing&&b._resizeDirection?(0===c.which&&a.jqx.browser.msie&&a.jqx.browser.version<9&&b._stopResizing(c),b._performResize(c.pageX,c.pageY),!1):b._resizeCaptureCursor(c.pageX,c.pageY)},_resizeCaptureCursor:function(a,b){if(this._resizeMouseDown&&!this.isResizing&&this._resizeDirection&&(a+3<this._mouseResizePosition.x||a-3>this._mouseResizePosition.x||b+3<this._mouseResizePosition.y||b-3>this._mouseResizePosition.y))return this._changeCursor(a-parseInt(this.resizeTarget.css("left"),10),b-parseInt(this.resizeTarget.css("top"),10)),this._mouseResizePosition={x:a,y:b},this._prepareResizeMethods(this._resizeDirection),this._resizeBackupData(),this.isResizing=!0,this.resizeTarget.addClass("jqx-disableselect"),!1},_resizeBackupData:function(){this.resizeTarget.lastWidth=this.resizeTarget.width(),this.resizeTarget.lastHeight=this.resizeTarget.height(),this.resizeTarget.x=parseInt(this.resizeTarget.css("left"),10),this.resizeTarget.y=parseInt(this.resizeTarget.css("top"),10),this._resizeBackupChildrenSize()},_resizeBackupChildrenSize:function(){for(var a,b=this.resizeTargetChildren.length;b;)b-=1,a=this.resizeTargetChildren[b],this.resizeTargetChildren[b].lastWidth=a.width(),this.resizeTargetChildren[b].lastHeight=a.height()},_performResize:function(a,b){var c=a-this._mouseResizePosition.x,d=b-this._mouseResizePosition.y;this._resizeDirection&&this._resize(this.resizeTarget,c,d)},_resizeCursorChangeHandler:function(a,b){a.enableResize&&!a.collapsed&&(a.isResizing||a._changeCursor(b.pageX-parseInt(a.resizeTarget.css("left"),10),b.pageY-parseInt(a.resizeTarget.css("top"),10)))},_resizeMouseDownHandler:function(a,b){a.enableResize&&null!==a._resizeDirection&&(a._resizeMouseDown=!0,a._mouseResizePosition.x=b.pageX,a._mouseResizePosition.y=b.pageY,b.preventDefault())},_validateResizeProperties:function(){try{if(!this.resizeTarget||1!==this.resizeTarget.length)throw new Error(this._resizeExceptions.invalidTarget);if(this.minHeight<0||isNaN(parseInt(this.minHeight,10)))throw new Error(this._resizeExceptions.invalidMinHeight);if(this.maxHeight<=0||isNaN(parseInt(this.maxHeight,10)))throw new Error(this._resizeExceptions.invalidMaxHeight);if(this.minWidth<0||isNaN(parseInt(this.minWidth,10)))throw new Error(this._resizeExceptions.invalidMinWidth);if(this.maxWidth<0||isNaN(parseInt(this.maxWidth,10)))throw new Error(this._resizeExceptions.invalidMaxWidth);if(this.resizeIndicatorSize<0||isNaN(parseInt(this.resizeIndicatorSize,10)))throw new Error(this._resizeExceptions.invalidIndicatorSize);if(this.minHeight>this.maxHeight||this.minWidth>this.maxWidth)throw new Error(this._resizeExceptions.invalidSize)}catch(a){throw new Error(a)}},_changeCursor:function(a,b){this.isResizing||this._resizeMouseDown||(this.resizeArea=!0,a<=this.resizeIndicatorSize&&a>=0&&b<=this.resizeIndicatorSize&&b>0?(this._resizeWrapper.style.cursor="nw-resize",this._resizeDirection="topleft"):b<=this.resizeIndicatorSize&&b>0&&a>=this.resizeTarget.width()-this.resizeIndicatorSize?(this._resizeWrapper.style.cursor="ne-resize",this._resizeDirection="topright"):b>=this.resizeTarget.height()-this.resizeIndicatorSize&&b<this.resizeTarget.height()&&a<=this.resizeIndicatorSize&&a>=0?(this._resizeWrapper.style.cursor="sw-resize",this._resizeDirection="bottomleft"):b>=this.resizeTarget.height()-this.resizeIndicatorSize&&b<this.resizeTarget.height()&&a>=this.resizeTarget.width()-this.resizeIndicatorSize&&a<this.resizeTarget.width()?(this._resizeWrapper.style.cursor="se-resize",this._resizeDirection="bottomright"):a<=this.resizeIndicatorSize&&a>=0?(this._resizeWrapper.style.cursor="e-resize",this._resizeDirection="left"):b<=this.resizeIndicatorSize&&b>0?(this._resizeWrapper.style.cursor="n-resize",this._resizeDirection="top"):b>=this.resizeTarget.height()-this.resizeIndicatorSize&&b<this.resizeTarget.height()?(this._resizeWrapper.style.cursor="n-resize",this._resizeDirection="bottom"):a>=this.resizeTarget.width()-this.resizeIndicatorSize&&a<this.resizeTarget.width()?(this._resizeWrapper.style.cursor="e-resize",this._resizeDirection="right"):(this._resizeWrapper.style.cursor=this._cursorBackup,this._resizeDirection=null,this.resizeArea=!1))},_prepareResizeMethods:function(a){this._resizeMethods=[],a.indexOf("left")>=0&&this._resizeMethods.push(this._resizeLeft),a.indexOf("top")>=0&&this._resizeMethods.push(this._resizeTop),a.indexOf("right")>=0&&this._resizeMethods.push(this._resizeRight),a.indexOf("bottom")>=0&&this._resizeMethods.push(this._resizeBottom)},_validateResize:function(a,b,c,d,e){return"horizontal"===c||"both"===c?this._validateWidth(a,d,e):"vertical"===c||"both"===c?this._validateHeight(b,d,e):{result:!1,fix:0}},_getParent:function(){return null!==this.resizeParent&&"undefined"!==this.resizeParent&&this.resizeParent.height&&this.resizeParent.width&&this.resizeParent.top&&this.resizeParent.left?this.resizeParent:{left:0,top:0,width:a(document).width(),height:a(document).height()}},_validateHeight:function(b,c,d){var e=0,f=2,g=this._getParent();return a(window).width()>a(document).width()&&a.jqx.browser.msie&&g.height===a(document).height()&&(e=this._SCROLL_WIDTH),"bottom"===d&&b+c.position().top+e+f>g.height+g.top?{fix:g.height-c.position().top-e-f+g.top,result:!1}:"top"===d&&c.lastHeight-b+c.y<g.top?{fix:b+(c.lastHeight-b+c.y)-g.top,result:!1}:b<c.minHeight?{fix:c.minHeight,result:!1}:b>c.maxHeight?{fix:c.maxHeight,result:!1}:{result:!0,fix:b}},_validateWidth:function(b,c,d){var e=0,f=2,g=this._getParent();return a(window).height()<a(document).height()&&a.jqx.browser.msie&&document.documentElement.clientWidth>=document.documentElement.scrollWidth&&g.width===a(document).width()&&(e=this._SCROLL_WIDTH),"right"===d&&b+c.position().left+e+f>g.width+g.left?{fix:g.width-c.position().left-e-f+g.left,result:!1}:"left"===d&&c.lastWidth-b+c.x<g.left?{fix:b+(c.lastWidth-b+c.x)-g.left,result:!1}:b<c.minWidth?{fix:c.minWidth,result:!1}:b>c.maxWidth?{fix:c.maxWidth,result:!1}:{result:!0,fix:b}},_resize:function(a,b,c){for(var d=this._resizeMethods.length,e=0;e<d;e++)if(this._resizeMethods[e]instanceof Function){var f={element:a,x:b,y:c,self:this};this._resizeMethods[e](f)}this._performResizeLayout()},resize:function(a,b){if(this.resizable){var c=a-this.host.width(),d=b-this.host.height(),e="right";0!==d&&(e="bottom"),this._resizeDirection=e,this._prepareResizeMethods(this._resizeDirection),this._resizeBackupData(),this.isResizing=!0,this._resize(this.resizeTarget,c,d),this.isResizing=!1}},_setResizeChildrenSize:function(a,b){for(var c=this.resizeTargetChildren.length;c;)if(c--,"width"===b){var d=this.resizeTargetChildren[c].lastWidth-(this.resizeTarget.lastWidth-a);d<this.resizeTarget.maxWidth&&d>0&&this.resizeTargetChildren[c].width(d)}else{var e=this.resizeTargetChildren[c].lastHeight-(this.resizeTarget.lastHeight-a);e<this.resizeTarget.maxHeight&&e>0&&this.resizeTargetChildren[c].height(e)}},_resizeRight:function(a){var b=a.element.lastWidth+a.x,c=a.self._validateResize(b,0,"horizontal",a.element,"right");return c.result||(b=c.fix),a.element.width()!==b&&(a.self._setResizeChildrenSize(b,"width"),a.element.width(b),a.self._raiseResizeEvent(0)),b},_resizeLeft:function(a){var b=a.element.lastWidth-a.x,c=a.self._validateResize(b,0,"horizontal",a.element,"left"),d=a.element.x+a.x;return c.result?(a.element.width()!==b&&(a.self._setResizeChildrenSize(b,"width"),a.element.width(b),a.element[0].style.left=a.self._toPx(d),a.self._raiseResizeEvent(0)),b):(d=a.element.x+(a.element.lastWidth-c.fix),void(b=c.fix))},_resizeBottom:function(a){var b=a.element.lastHeight+a.y,c=a.self._validateResize(0,b,"vertical",a.element,"bottom");return c.result||(b=c.fix),a.element.height()!==b&&(a.self._setResizeChildrenSize(b,"height"),a.element.height(b),a.self._raiseResizeEvent(0)),b},_resizeTop:function(a){var b=a.element.lastHeight-a.y,c=a.self._validateResize(0,b,"vertical",a.element,"top"),d=a.element.y+a.y;return c.result?(a.element.height()!==b&&(a.self._setResizeChildrenSize(b,"height"),a.element.height(b),a.element[0].style.top=a.self._toPx(d),a.self._raiseResizeEvent(0)),b):(d=a.element.y+(a.element.lastHeight-c.fix),void(b=c.fix))},_raiseResizeEvent:function(b){var c=this._resizeEvents[b],d=a.Event(c),e={};if(e.width=parseInt(this.resizeTarget[0].style.width,10),e.height=parseInt(this.resizeTarget[0].style.height,10),d.args=e,0===b){c=this._resizeEvents[2];var f=a.Event(c);f.args=e,this.resizeTarget.trigger(f)}return this.resizeTarget.trigger(d)}}}(jqxBaseFramework);a.extend(a.jqx._jqxWindow.prototype,b)}(jqxBaseFramework);
8 7
8 (function(a){a.jqx.jqxWidget("jqxWindow","",{});a.extend(a.jqx._jqxWindow.prototype,{defineInstance:function(){var e={height:"auto",width:200,minHeight:50,maxHeight:1200,minWidth:50,maxWidth:1200,showCloseButton:true,disabled:false,autoOpen:true,keyboardCloseKey:"esc",title:"",content:"",draggable:true,resizable:true,animationType:"fade",closeAnimationDuration:250,showAnimationDuration:250,isModal:false,position:"center",closeButtonSize:16,closeButtonAction:"hide",modalOpacity:0.3,dragArea:null,okButton:null,cancelButton:null,dialogResult:{OK:false,Cancel:false,None:true},collapsed:false,showCollapseButton:false,collapseAnimationDuration:150,collapseButtonSize:16,rtl:false,keyboardNavigation:true,headerHeight:null,_events:["created","closed","moving","moved","open","collapse","expand","open","close","resize"],initContent:null,enableResize:true,restricter:null,autoFocus:true,closing:null,_invalidArgumentExceptions:{invalidHeight:"Invalid height!",invalidWidth:"Invalid width!",invalidMinHeight:"Invalid minHeight!",invalidMaxHeight:"Invalid maxHeight!",invalidMinWidth:"Invalid minWidth!",invalidMaxWidth:"Invalid maxWidth",invalidKeyCode:"Invalid keyCode!",invalidAnimationType:"Invalid animationType!",invalidCloseAnimationDuration:"Invalid closeAnimationDuration!",invalidShowAnimationDuration:"Invalid showAnimationDuration!",invalidPosition:"Invalid position!",invalidCloseButtonSize:"Invalid closeButtonSize!",invalidCollapseButtonSize:"Invalid collapseButtonSize!",invalidCloseButtonAction:"Invalid cluseButtonAction!",invalidModalOpacity:"Invalid modalOpacity!",invalidDragArea:"Invalid dragArea!",invalidDialogResult:"Invalid dialogResult!",invalidIsModal:"You can have just one modal window!"},_enableResizeCollapseBackup:null,_enableResizeBackup:undefined,_heightBeforeCollapse:null,_minHeightBeforeCollapse:null,_mouseDown:false,_isDragging:false,_rightContentWrapper:null,_leftContentWrapper:null,_headerContentWrapper:null,_closeButton:null,_collapseButton:null,_title:null,_content:null,_mousePosition:{},_windowPosition:{},_modalBackground:null,_SCROLL_WIDTH:21,_visible:true,modalBackgroundZIndex:1299,modalZIndex:1800,zIndex:1000,_touchEvents:{mousedown:a.jqx.mobile.getTouchEventName("touchstart"),mouseup:a.jqx.mobile.getTouchEventName("touchend"),mousemove:a.jqx.mobile.getTouchEventName("touchmove"),mouseenter:"mouseenter",mouseleave:"mouseleave",click:a.jqx.mobile.getTouchEventName("touchstart")}};if(this===a.jqx._jqxWindow.prototype){return e}a.extend(true,this,e);return e},createInstance:function(){if(this.host.initAnimate){this.host.initAnimate()}this.host.attr("role","dialog");this.host.removeAttr("data-bind");this.host.appendTo(document.body);var g=this;var f=function(l){for(var k=0;k<l.length;k++){var j=l[k];if(g[j]&&g[j].toString().indexOf("px")>=0){g[j]=parseInt(g[j],10)}}};f(["minWidth","minHeight","maxWidth","maxHeight","width","height"]);var h=function(){var j=parseInt(a(g.restricter).css("padding-top"),10);var i=parseInt(a(g.restricter).css("padding-left"),10);var k=parseInt(a(g.restricter).css("padding-bottom"),10);var m=parseInt(a(g.restricter).css("padding-right"),10);var l=a(g.restricter).coord();g.dragArea={left:i+l.left,top:j+l.top,width:1+m+a(g.restricter).width(),height:1+k+a(g.restricter).height()}};if(this.restricter){h()}if(this.restricter){this.addHandler(a(window),"resize."+this.element.id,function(){h()});this.addHandler(a(window),"orientationchanged."+this.element.id,function(){h()});this.addHandler(a(window),"orientationchange."+this.element.id,function(){h()})}this._isTouchDevice=a.jqx.mobile.isTouchDevice();this._validateProperties();this._createStructure();this._refresh();if(!this.autoOpen){this.element.style.display="none"}if(a.jqx.browser.msie){this.host.addClass(this.toThemeProperty("jqx-noshadow"))}if(!this.isModal){this._fixWindowZIndex()}this._setStartupSettings();this._positionWindow();this._raiseEvent(0);if(this.autoOpen){this._performLayout();var e=this;if(this.isModal){this._fixWindowZIndex("modal-show")}if(e.initContent){e.initContent();e._contentInitialized=true}this._raiseEvent(7);this._raiseEvent(9)}},refresh:function(){this._performLayout()},_setStartupSettings:function(){if(this.disabled){this.disable()}if(this.collapsed){this.collapsed=false;this.collapse(0)}if(!this.autoOpen){this.hide(null,0.001,true);this._visible=false}if(this.title!==null&&this.title!==""){this.setTitle(this.title)}if(this.content!==null&&this.content!==""){this.setContent(this.content)}this.title=this._headerContentWrapper.html();this.content=this._content.html()},_fixWindowZIndex:function(h){var g=a.data(document.body,"jqxwindows-list")||[],l=this.zIndex;if(!this.isModal){if(this._indexOf(this.host,g)<0){g.push(this.host)}a.data(document.body,"jqxwindows-list",g);if(g.length>1){var k=g[g.length-2];if(k.css("z-index")=="auto"){l=this.zIndex+g.length+1}else{var i=this.zIndex;l=parseInt(k.css("z-index"),10)+1;if(l<i){l=i}}}}else{if(g){g=this._removeFromArray(this.host,g);a.data(document.body,"jqxwindows-list",g)}var f=a.data(document.body,"jqxwindows-modallist");if(!f){if(h=="modal-show"){var j=[];j.push(this.host);a.data(document.body,"jqxwindows-modallist",j);f=j}else{a.data(document.body,"jqxwindows-modallist",[]);f=[]}}else{if(h=="modal-show"){f.push(this.host)}else{var e=f.indexOf(this.host);if(e!=-1){f.splice(e,1)}}}l=this.modalZIndex;a.each(f,function(){if(this.data()){if(this.data().jqxWindow){var m=this.data().jqxWindow.instance;m._modalBackground.style.zIndex=l;m.element.style.zIndex=l+1;l+=2}}});a.data(document.body,"jqxwindow-modal",this.host);return}this.element.style.zIndex=l;this._sortByStyle("z-index",g)},_validateProperties:function(){try{this._validateSize();this._validateAnimationProperties();this._validateInteractionProperties();this._validateModalProperties();if(!this.position){throw new Error(this._invalidArgumentExceptions.invalidPosition)}if(isNaN(this.closeButtonSize)||parseInt(this.closeButtonSize,10)<0){throw new Error(this._invalidArgumentExceptions.invalidCloseButtonSize)}if(isNaN(this.collapseButtonSize)||parseInt(this.collapseButtonSize,10)<0){throw new Error(this._invalidArgumentExceptions.invalidCollapseButtonSize)}}catch(e){throw new Error(e)}},_validateModalProperties:function(){if(this.modalOpacity<0||this.modalOpacity>1){throw new Error(this._invalidArgumentExceptions.invalidModalOpacity)}if(this.isModal&&!this._singleModalCheck()){throw new Error(this._invalidArgumentExceptions.invalidIsModal)}},_validateSize:function(){this._validateSizeLimits();if(this.height!=="auto"&&isNaN(parseInt(this.height,10))){throw new Error(this._invalidArgumentExceptions.invalidHeight)}if(this.width!=="auto"&&isNaN(parseInt(this.width,10))){throw new Error(this._invalidArgumentExceptions.invalidWidth)}if(this.height!=="auto"&&this.height<this.minHeight){this.height=this.minHeight}if(this.width<this.minWidth){this.width=this.minWidth}if(this.height!=="auto"&&this.height>this.maxHeight){this.height=this.maxHeight}if(this.width>this.maxWidth){this.width=this.maxWidth}if(this.dragArea===null){return}if(this.dragArea&&((this.dragArea.height!==null&&this.host.height()>this.dragArea.height)||(parseInt(this.height,10)>this.dragArea.height))||(this.dragArea.width!==null&&this.width>this.dragArea.width)||(this.maxHeight>this.dragArea.height||this.maxWidth>this.dragArea.width)){}},_validateSizeLimits:function(){if(this.maxHeight==null){this.maxHeight=9999}if(this.minWidth==null){this.minWidth=0}if(this.maxWidth==null){this.maxWidth=9999}if(this.minHeight==null){this.minHeight=0}if(isNaN(parseInt(this.minHeight,10))){throw new Error(this._invalidArgumentExceptions.invalidMinHeight)}if(isNaN(parseInt(this.maxHeight,10))){throw new Error(this._invalidArgumentExceptions.invalidMaxHeight)}if(isNaN(parseInt(this.minWidth,10))){throw new Error(this._invalidArgumentExceptions.invalidMinWidth)}if(isNaN(parseInt(this.maxWidth,10))){throw new Error(this._invalidArgumentExceptions.invalidMaxWidth)}if(this.minHeight&&this.maxHeight){if(parseInt(this.minHeight,10)>parseInt(this.maxHeight,10)&&this.maxHeight!=Number.MAX_VALUE){throw new Error(this._invalidArgumentExceptions.invalidMinHeight)}}if(this.minWidth&&this.maxWidth){if(parseInt(this.minWidth,10)>parseInt(this.maxWidth,10)&&this.maxWidth!=Number.MAX_VALUE){throw new Error(this._invalidArgumentExceptions.invalidMinWidth)}}},_validateAnimationProperties:function(){if(this.animationType!=="fade"&&this.animationType!=="slide"&&this.animationType!=="combined"&&this.animationType!=="none"){throw new Error(this._invalidArgumentExceptions.invalidAnimationType)}if(isNaN(parseInt(this.closeAnimationDuration,10))||this.closeAnimationDuration<0){throw new Error(this._invalidArgumentExceptions.invalidCloseAnimationDuration)}if(isNaN(parseInt(this.showAnimationDuration,10))||this.showAnimationDuration<0){throw new Error(this._invalidArgumentExceptions.invalidShowAnimationDuration)}},_validateInteractionProperties:function(){if(parseInt(this.keyCode,10)<0||parseInt(this.keyCode,10)>130&&this.keyCode!=="esc"){throw new Error(this._invalidArgumentExceptions.invalidKeyCode)}if(this.dragArea!==null&&(typeof this.dragArea.width==="undefined"||typeof this.dragArea.height==="undefined"||typeof this.dragArea.left==="undefined"||typeof this.dragArea.top==="undefined")){throw new Error(this._invalidArgumentExceptions.invalidDragArea)}if(!this.dialogResult||(!this.dialogResult.OK&&!this.dialogResult.Cancel&&!this.dialogResult.None)){throw new Error(this._invalidArgumentExceptions.invalidDialogResult)}if(this.closeButtonAction!=="hide"&&this.closeButtonAction!=="close"){throw new Error(this._invalidArgumentExceptions.invalidCloseButtonAction)}},_singleModalCheck:function(){var e=a.data(document.body,"jqxwindows-list")||[],f=e.length;while(f){f-=1;if(a(e[f].attr("id")).length>0){if(a(e[f].attr("id")).jqxWindow("isModal")){return false}}}return true},_createStructure:function(){var e=this.host.children();if(e.length===1){this._content=e[0];this._header=document.createElement("div");this._header.innerHTML=this.host.attr("caption");this.element.insertBefore(this._header,this._content);this.host.attr("caption","");this._header=a(this._header);this._content=a(this._content)}else{if(e.length===2){this._header=a(e[0]);this._content=a(e[1])}else{throw new Error("Invalid structure!")}}},_refresh:function(){this._render();this._addStyles();this._performLayout();this._removeEventHandlers();this._addEventHandlers();this._initializeResize()},_render:function(){this._addHeaderWrapper();this._addCloseButton();this._addCollapseButton();this._removeModal();this._makeModal()},_addHeaderWrapper:function(){if(!this._headerContentWrapper){this._header[0].innerHTML='<div style="float:left;">'+this._header[0].innerHTML+"</div>";this._headerContentWrapper=a(this._header.children()[0]);if(this.headerHeight!==null){this._header.height(this.headerHeight)}}},_addCloseButton:function(){if(!this._closeButton){this._closeButtonWrapper=document.createElement("div");this._closeButtonWrapper.className=this.toThemeProperty("jqx-window-close-button-background");this._closeButton=document.createElement("div");this._closeButton.className=this.toThemeProperty("jqx-window-close-button jqx-icon-close");this._closeButton.style.width="100%";this._closeButton.style.height="100%";this._closeButtonWrapper.appendChild(this._closeButton);this._header[0].appendChild(this._closeButtonWrapper);this._closeButtonWrapper=a(this._closeButtonWrapper);this._closeButton=a(this._closeButton)}},_addCollapseButton:function(){if(!this._collapseButton){this._collapseButtonWrapper=document.createElement("div");this._collapseButtonWrapper.className=this.toThemeProperty("jqx-window-collapse-button-background");this._collapseButton=document.createElement("div");this._collapseButton.className=this.toThemeProperty("jqx-window-collapse-button jqx-icon-arrow-up");this._collapseButton.style.width="100%";this._collapseButton.style.height="100%";this._collapseButtonWrapper.appendChild(this._collapseButton);this._header[0].appendChild(this._collapseButtonWrapper);this._collapseButtonWrapper=a(this._collapseButtonWrapper);this._collapseButton=a(this._collapseButton)}},_removeModal:function(){if(!this.isModal&&typeof this._modalBackground==="object"&&this._modalBackground!==null){a("."+this.toThemeProperty("jqx-window-modal")).remove();this._modalBackground=null}},focus:function(){try{this.host.focus();var f=this;setTimeout(function(){f.host.focus()},10)}catch(e){}},_makeModal:function(){if(this.isModal&&!this._modalBackground){var g=a.data(document.body,"jqxwindows-list");if(g){this._removeFromArray(this.host,g);a.data(document.body,"jqxwindows-list",g)}this._modalBackground=document.createElement("div");this._modalBackground.className=this.toThemeProperty("jqx-window-modal");this._setModalBackgroundStyles();document.body.appendChild(this._modalBackground);this.addHandler(this._modalBackground,this._getEvent("click"),function(){return false});var f=this;var e=function(h,i){return i.contains(h)};this.addHandler(this._modalBackground,"mouseup",function(h){f._stopResizing(f);h.preventDefault()});this.addHandler(this._modalBackground,"mousedown",function(i){var h=f._getTabbables();if(h.length>0){h[0].focus();setTimeout(function(){h[0].focus()},100)}i.preventDefault();return false});this.addHandler(a(document),"keydown.window"+this.element.id,function(k){if(k.keyCode!==9){return}var h=a.data(document.body,"jqxwindows-modallist");if(h.length>1){if(h[h.length-1][0]!=f.element){return}}var j=f._getTabbables();var l=null;var i=null;if(f.element.offsetWidth===0||f.element.offsetHeight===0){return}if(j.length>0){l=j[0];i=j[j.length-1]}if(k.target==f.element){return}if(l==null){return}if(!e(k.target,f.element)){l.focus();return false}if(k.target===i&&!k.shiftKey){l.focus();return false}else{if(k.target===l&&k.shiftKey){i.focus();return false}}})}},_addStyles:function(){this.host.addClass(this.toThemeProperty("jqx-rc-all"));this.host.addClass(this.toThemeProperty("jqx-window"));this.host.addClass(this.toThemeProperty("jqx-popup"));if(a.jqx.browser.msie){this.host.addClass(this.toThemeProperty("jqx-noshadow"))}this.host.addClass(this.toThemeProperty("jqx-widget"));this.host.addClass(this.toThemeProperty("jqx-widget-content"));this._header.addClass(this.toThemeProperty("jqx-window-header"));this._content.addClass(this.toThemeProperty("jqx-window-content"));this._header.addClass(this.toThemeProperty("jqx-widget-header"));this._content.addClass(this.toThemeProperty("jqx-widget-content"));this._header.addClass(this.toThemeProperty("jqx-disableselect"));this._header.addClass(this.toThemeProperty("jqx-rc-t"));this._content.addClass(this.toThemeProperty("jqx-rc-b"));if(!this.host.attr("tabindex")){this.element.tabIndex=0;this._header[0].tabIndex=0;this._content[0].tabIndex=0}this.element.setAttribute("hideFocus","true");this.element.style.outline="none"},_performHeaderLayout:function(){this._handleHeaderButtons();this._header[0].style.position="relative";if(this.rtl){this._headerContentWrapper[0].style.direction="rtl";this._headerContentWrapper[0].style["float"]="right"}else{this._headerContentWrapper[0].style.direction="ltr";this._headerContentWrapper[0].style["float"]="left"}this._performHeaderCloseButtonLayout();this._performHeaderCollapseButtonLayout();this._centerElement(this._headerContentWrapper,this._header,"y","margin");if(this.headerHeight){this._centerElement(this._closeButtonWrapper,this._header,"y","margin");this._centerElement(this._collapseButtonWrapper,this._header,"y","margin")}},_handleHeaderButtons:function(){if(!this._closeButtonWrapper){return}if(!this.showCloseButton){this._closeButtonWrapper[0].style.visibility="hidden"}else{this._closeButtonWrapper[0].style.visibility="visible";var e=this._toPx(this.closeButtonSize);this._closeButtonWrapper[0].style.width=e;this._closeButtonWrapper[0].style.height=e}if(!this.showCollapseButton){this._collapseButtonWrapper[0].style.visibility="hidden"}else{this._collapseButtonWrapper[0].style.visibility="visible";var f=this._toPx(this.collapseButtonSize);this._collapseButtonWrapper[0].style.width=f;this._collapseButtonWrapper[0].style.height=f}},_performHeaderCloseButtonLayout:function(){if(!this._closeButtonWrapper){return}var e=parseInt(this._header.css("padding-right"),10);if(!isNaN(e)){this._closeButtonWrapper.width(this._closeButton.width());if(!this.rtl){this._closeButtonWrapper[0].style.marginRight=this._toPx(e);this._closeButtonWrapper[0].style.marginLeft="0px"}else{this._closeButtonWrapper[0].style.marginRight="0px";this._closeButtonWrapper[0].style.marginLeft=this._toPx(e)}}this._closeButtonWrapper[0].style.position="absolute";if(!this.rtl){this._closeButtonWrapper[0].style.right="0px";this._closeButtonWrapper[0].style.left=""}else{this._closeButtonWrapper[0].style.right="";this._closeButtonWrapper[0].style.left="0px"}},_performHeaderCollapseButtonLayout:function(){if(!this._closeButtonWrapper){return}var g=parseInt(this._header.css("padding-right"),10);if(!isNaN(g)){var f=this._toPx(this.collapseButtonSize);this._collapseButtonWrapper[0].style.width=f;this._collapseButtonWrapper[0].style.height=f;if(!this.rtl){this._collapseButtonWrapper[0].style.marginRight=this._toPx(g);this._collapseButtonWrapper[0].style.marginLeft="0px"}else{this._collapseButtonWrapper[0].style.marginRight="0px";this._collapseButtonWrapper[0].style.marginLeft=this._toPx(g)}}this._collapseButtonWrapper[0].style.position="absolute";var e=this._toPx(this.showCloseButton?this._closeButton.outerWidth(true):0);if(!this.rtl){this._collapseButtonWrapper[0].style.right=e;this._collapseButtonWrapper[0].style.left=""}else{this._collapseButtonWrapper[0].style.right="";this._collapseButtonWrapper[0].style.left=e}this._centerElement(this._collapseButton,a(this._collapseButton[0].parentElement),"y")},_performWidgetLayout:function(){var e;if(this.width!=="auto"){if(this.width&&this.width.toString().indexOf("%")>=0){this.element.style.width=this.width}else{this.element.style.width=this._toPx(this.width)}}if(!this.collapsed){if(this.height!=="auto"){if(this.height&&this.height.toString().indexOf("%")>=0){this.element.style.height=this.height}else{this.element.style.height=this._toPx(this.height)}}else{this.element.style.height=this.host.height()+"px"}this.element.style.minHeight=this._toPx(this.minHeight)}this._setChildrenLayout();e=this._validateMinSize();this.element.style.maxHeight=this._toPx(this.maxHeight);this.element.style.minWidth=this._toPx(this.minWidth);this.element.style.maxWidth=this._toPx(this.maxWidth);if(!e){this._setChildrenLayout()}},_setChildrenLayout:function(){this._header.width(this.host.width()-(this._header.outerWidth(true)-this._header.width()));this._content.width(this.host.width()-(this._content.outerWidth(true)-this._content.width()));this._content.height(this.host.height()-this._header.outerHeight(true)-(this._content.outerHeight(true)-this._content.height()))},_validateMinSize:function(){var f=true;if(this.minHeight<this._header.height()){this.minHeight=this._header.height();f=false}var h=a(this._header.children()[0]).outerWidth(),e=this._header.children()[1]?a(this._header.children()[1]).outerWidth():0,g=h+e;if(this.minWidth<100){this.minWidth=Math.min(g,100);f=false}return f},_centerElement:function(h,f,e,g){if(typeof f.left==="number"&&typeof f.top==="number"&&typeof f.height==="number"&&typeof f.width==="number"){this._centerElementInArea(h,f,e)}else{this._centerElementInParent(h,f,e,g)}},_centerElementInParent:function(e,o,j,g){var n=e.css("display")==="none";var f,h;j=j.toLowerCase();if(g){f=g+"Top";h=g+"Left"}else{f="top";h="left"}if(j.indexOf("y")>=0){if(n){e[0].style.display="block"}var i=e.outerHeight(true),l;if(n){e[0].style.display="none"}l=o.height();var k=(Math.max(0,l-i))/2;e[0].style[f]=k+"px"}if(j.indexOf("x")>=0){if(n){e[0].style.display="block"}var q=e.outerWidth(true),p;if(n){e[0].style.display="none"}p=o.width();var m=(Math.max(0,p-q))/2;e[0].style[h]=m+"px"}},_centerElementInArea:function(f,e,h){h=h.toLowerCase();if(h.indexOf("y")>=0){var g=f.outerHeight(true);var j=e.height;var i=(j-g)/2;f[0].style.top=i+e.top+"px"}if(h.indexOf("x")>=0){var m=f.outerWidth(true);var l=e.width;var k=(l-m)/2;f[0].style.left=k+e.left+"px"}},_removeEventHandlers:function(){this.removeHandler(this._header,this._getEvent("mousedown"));this.removeHandler(this._header,this._getEvent("mousemove"));this.removeHandler(this._header,"focus");this.removeHandler(a(document),this._getEvent("mousemove")+"."+this.host.attr("id"));this.removeHandler(a(document),this._getEvent("mouseup")+"."+this.host.attr("id"));this.removeHandler(this.host,"keydown");this.removeHandler(this._closeButton,this._getEvent("click"));this.removeHandler(this._closeButton,this._getEvent("mouseenter"));this.removeHandler(this._closeButton,this._getEvent("mouseleave"));this.removeHandler(this._collapseButton,this._getEvent("click"));this.removeHandler(this._collapseButton,this._getEvent("mouseenter"));this.removeHandler(this._collapseButton,this._getEvent("mouseleave"));this.removeHandler(this.host,this._getEvent("mousedown"));if(this.okButton){this.removeHandler(a(this.okButton),this._getEvent("click"),this._setDialogResultHandler)}if(this.cancelButton){this.removeHandler(a(this.cancelButton),this._getEvent("click"),this._setDialogResultHandler)}this.removeHandler(this._header,this._getEvent("mouseenter"));this.removeHandler(this._header,this._getEvent("mouseleave"));this.removeHandler(this.host,"resizing",this._windowResizeHandler)},_removeFromArray:function(e,g){var f=this._indexOf(e,g);if(f>=0){return g.splice(this._indexOf(e,g),1)}else{return g}},_sortByStyle:function(e,l){for(var h=0;h<l.length;h++){for(var f=l.length-1;f>h;f--){var m=l[f],k=l[f-1],g;if(parseInt(m.css(e),10)<parseInt(k.css(e),10)){g=m;l[f]=k;l[f-1]=g}}}},_initializeResize:function(){if(this.resizable){var e=this;this.initResize({target:this.host,alsoResize:e._content,maxWidth:e.maxWidth,minWidth:e.minWidth,maxHeight:e.maxHeight,minHeight:e.minHeight,indicatorSize:10,resizeParent:e.dragArea})}},_removeResize:function(){this.removeResize()},_getEvent:function(e){if(this._isTouchDevice){return this._touchEvents[e]}else{return e}},_addEventHandlers:function(){this._addDragDropHandlers();this._addCloseHandlers();this._addCollapseHandlers();this._addFocusHandlers();this._documentResizeHandlers();this._closeButtonHover();this._collapseButtonHover();this._addDialogButtonsHandlers();this._addHeaderHoverEffect();this._addResizeHandlers();var e=this;this.addHandler(this._header,this._getEvent("mousemove"),function(){e._addHeaderCursorHandlers(e)})},_addResizeHandlers:function(){var e=this;e.addHandler(e.host,"resizing",e._windowResizeHandler,{self:e});this.addHandler(a(window),"orientationchanged."+this.element.id,function(){e._performLayout()});this.addHandler(a(window),"orientationchange."+this.element.id,function(){e._performLayout()})},_windowResizeHandler:function(h){var e=h.data.self;e._header.width(e.host.width()-(e._header.outerWidth(true)-e._header.width()));if(e.width&&e.width.toString().indexOf("%")>=0){var g=a(document.body).width()/100;var f=1/g;e.width=(f*h.args.width)+"%"}else{e.width=h.args.width}if(e.height&&e.height.toString().indexOf("%")>=0){var g=a(document.body).height()/100;var f=1/g;e.height=(f*h.args.height)+"%"}else{e.height=h.args.height}},_addHeaderHoverEffect:function(){var e=this;this.addHandler(this._header,this._getEvent("mouseenter"),function(){a(this).addClass(e.toThemeProperty("jqx-window-header-hover"))});this.addHandler(this._header,this._getEvent("mouseleave"),function(){a(this).removeClass(e.toThemeProperty("jqx-window-header-hover"))})},_addDialogButtonsHandlers:function(){if(this.okButton){this.addHandler(a(this.okButton),this._getEvent("click"),this._setDialogResultHandler,{self:this,result:"ok"})}if(this.cancelButton){this.addHandler(a(this.cancelButton),this._getEvent("click"),this._setDialogResultHandler,{self:this,result:"cancel"})}},_documentResizeHandlers:function(){var e=this;if(this.isModal){this.addHandler(a(window),"resize.window"+this.element.id,function(){if(typeof e._modalBackground==="object"&&e._modalBackground!==null){if(e.isOpen()){e._modalBackground.style.display="none"}if(!e.restricter){var f=e._getDocumentSize();e._modalBackground.style.width=f.width+"px";e._modalBackground.style.height=f.height+"px"}else{e._modalBackground.style.left=e._toPx(e.dragArea.left);e._modalBackground.style.top=e._toPx(e.dragArea.top);e._modalBackground.style.width=e._toPx(e.dragArea.width);e._modalBackground.style.height=e._toPx(e.dragArea.height)}if(e.isOpen()){e._modalBackground.style.display="block"}}})}},_setDialogResultHandler:function(f){var e=f.data.self;e._setDialogResult(f.data.result);e.closeWindow()},_setDialogResult:function(e){this.dialogResult.OK=false;this.dialogResult.None=false;this.dialogResult.Cancel=false;e=e.toLowerCase();switch(e){case"ok":this.dialogResult.OK=true;break;case"cancel":this.dialogResult.Cancel=true;break;default:this.dialogResult.None=true}},_getDocumentSize:function(){var e=a.jqx.browser.msie&&a.jqx.browser.version<9;var f=e?4:0;var g=f;if(document.body.scrollHeight>document.body.clientHeight&&e){f=this._SCROLL_WIDTH}if(document.body.scrollWidth>document.body.clientWidth&&e){g=this._SCROLL_WIDTH}return{width:a(document).width()-f,height:a(document).height()-g}},_closeButtonHover:function(){var e=this;this.addHandler(this._closeButton,this._getEvent("mouseenter"),function(){e._closeButton.addClass(e.toThemeProperty("jqx-window-close-button-hover"))});this.addHandler(this._closeButton,this._getEvent("mouseleave"),function(){e._closeButton.removeClass(e.toThemeProperty("jqx-window-close-button-hover"))})},_collapseButtonHover:function(){var e=this;this.addHandler(this._collapseButton,this._getEvent("mouseenter"),function(){e._collapseButton.addClass(e.toThemeProperty("jqx-window-collapse-button-hover"))});this.addHandler(this._collapseButton,this._getEvent("mouseleave"),function(){e._collapseButton.removeClass(e.toThemeProperty("jqx-window-collapse-button-hover"))})},_setModalBackgroundStyles:function(){if(this.isModal){var e=this._getDocumentSize();if(!(a.jqx.browser.msie&&a.jqx.browser.version<9)){this._modalBackground.style.opacity=this.modalOpacity}else{this._modalBackground.style.filter="alpha(opacity="+(this.modalOpacity*100)+")"}this._modalBackground.style.position="absolute";this._modalBackground.style.top="0px";this._modalBackground.style.left="0px";this._modalBackground.style.width=e.width;this._modalBackground.style.height=e.height;this._modalBackground.style.zIndex=this.modalBackgroundZIndex;if(!this.autoOpen){this._modalBackground.style.display="none"}}},_addFocusHandlers:function(){var e=this;this.addHandler(this.host,this._getEvent("mousedown"),function(){if(!e.isModal){e.bringToFront()}})},_indexOf:function(f,g){for(var e=0;e<g.length;e++){if(g[e][0]===f[0]){return e}}return -1},_addCloseHandlers:function(){var e=this;this.addHandler(this._closeButton,this._getEvent("click"),function(f){return e._closeWindow(f)});if(this.keyboardCloseKey!=="none"){if(typeof this.keyboardCloseKey!=="number"&&this.keyboardCloseKey.toLowerCase()==="esc"){this.keyboardCloseKey=27}}this.addHandler(this.host,"keydown",function(f){if(f.keyCode===e.keyboardCloseKey&&e.keyboardCloseKey!=null&&e.keyboardCloseKey!="none"){e._closeWindow(f)}else{e._handleKeys(f)}},{self:this});this.addHandler(this.host,"keyup",function(){if(!e.keyboardNavigation){return}if(e._moved){var h=e.host.coord();var g=h.left;var f=h.top;e._raiseEvent(3,g,f,g,f);e._moved=false}})},_handleKeys:function(f){if(!this.keyboardNavigation){return}if(!this._headerFocused){return}if(a(document.activeElement).ischildof(this._content)){return}var e=f.ctrlKey;var m=f.keyCode;var k=this.host.coord();var j=k.left;var l=k.top;var g=this._getDraggingArea();var h=this.host.width();var n=this.host.height();var o=true;var i=10;switch(m){case 37:if(!e){if(this.draggable){if(j-i>=0){this.move(j-i,l)}}}else{if(this.resizable){this.resize(h-i,n)}}o=false;break;case 38:if(!e){if(this.draggable){if(l-i>=0){this.move(j,l-i)}}}else{if(this.resizable){this.resize(h,n-i)}}o=false;break;case 39:if(!e){if(this.draggable){if(j+h+i<=g.width){this.move(j+i,l)}}}else{if(this.resizable){this.resize(h+i,n)}}o=false;break;case 40:if(!e){if(this.draggable){if(l+n+i<=g.height){this.move(j,l+i)}}}else{if(this.resizable){this.resize(h,n+i)}}o=false;break}if(!o){if(f.preventDefault){f.preventDefault()}if(f.stopPropagation){f.stopPropagation()}}return o},_addCollapseHandlers:function(){var e=this;this.addHandler(this._collapseButton,this._getEvent("click"),function(){if(!e.collapsed){e.collapse()}else{e.expand()}})},_closeWindow:function(){this.closeWindow();return false},_addHeaderCursorHandlers:function(e){if(e.resizeArea&&e.resizable&&!e.collapsed){e._header[0].style.cursor=e._resizeWrapper.style.cursor;return}else{if(e.draggable){e._header[0].style.cursor="move";return}}e._header[0].style.cursor="default";if(e._resizeWrapper){e._resizeWrapper.style.cursor="default"}},_addDragDropHandlers:function(){if(this.draggable){var e=this;this.addHandler(this.host,"focus",function(){e._headerFocused=true});this.addHandler(this.host,"blur",function(){e._headerFocused=false});this.addHandler(this._header,"focus",function(){e._headerFocused=true;return false});this.addHandler(this._header,this._getEvent("mousedown"),function(j,i,k){if(i){j.pageX=i}if(k){j.pageY=k}e._headerMouseDownHandler(e,j);return true});this.addHandler(this._header,"dragstart",function(i){if(i.preventDefault){i.preventDefault()}return false});this.addHandler(this._header,this._getEvent("mousemove"),function(i){return e._headerMouseMoveHandler(e,i)});this.addHandler(a(document),this._getEvent("mousemove")+"."+this.host.attr("id"),function(i){return e._dragHandler(e,i)});this.addHandler(a(document),this._getEvent("mouseup")+"."+this.host.attr("id"),function(i){return e._dropHandler(e,i)});try{if(document.referrer!==""||window.frameElement){var h=null;if(window.top!=null&&window.top!=window.self){if(window.parent&&document.referrer){h=document.referrer}}if(h&&h.indexOf(document.location.host)!=-1){var g=function(i){e._dropHandler(e,i)};if(window.top.document.addEventListener){window.top.document.addEventListener("mouseup",g,false)}else{if(window.top.document.attachEvent){window.top.document.attachEvent("onmouseup",g)}}}}}catch(f){}}},_headerMouseDownHandler:function(f,g){if(!f.isModal){f.bringToFront()}if(f._resizeDirection==null){var e=a.jqx.position(g);f._mousePosition.x=e.left;f._mousePosition.y=e.top;f._mouseDown=true;f._isDragging=false}},_headerMouseMoveHandler:function(f,i){if(f._mouseDown&&!f._isDragging){var j=a.jqx.mobile.getTouches(i);var k=j[0];var h=k.pageX,g=k.pageY;var e=a.jqx.position(i);h=e.left;g=e.top;if((h+3<f._mousePosition.x||h-3>f._mousePosition.x)||(g+3<f._mousePosition.y||g-3>f._mousePosition.y)){f._isDragging=true;f._mousePosition={x:h,y:g};f._windowPosition={x:f.host.coord().left,y:f.host.coord().top};a(document.body).addClass(f.toThemeProperty("jqx-disableselect"))}if(f._isTouchDevice){i.preventDefault();return true}return false}if(f._isDragging){if(f._isTouchDevice){i.preventDefault();return true}return false}return true},_dropHandler:function(g,j){var f=true;if(g._isDragging&&!g.isResizing&&!g._resizeDirection){var e=parseInt(g.host.css("left"),10),k=parseInt(g.host.css("top"),10),i=(g._isTouchDevice)?0:j.pageX,h=(g._isTouchDevice)?0:j.pageY;g.enableResize=g._enableResizeBackup;g._enableResizeBackup="undefined";g._raiseEvent(3,e,k,i,h);f=false;if(j.preventDefault!="undefined"){j.preventDefault()}if(j.originalEvent!=null){j.originalEvent.mouseHandled=true}if(j.stopPropagation!="undefined"){j.stopPropagation()}}g._isDragging=false;g._mouseDown=false;a(document.body).removeClass(g.toThemeProperty("jqx-disableselect"));return f},_dragHandler:function(m,h){if(m._isDragging&&!m.isResizing&&!m._resizeDirection){var l=(m._isTouchDevice)?h.originalEvent.which:h.which;if(typeof m._enableResizeBackup==="undefined"){m._enableResizeBackup=m.enableResize}m.enableResize=false;if(l===0&&a.jqx.browser.msie&&a.jqx.browser.version<8){return m._dropHandler(m,h)}var k=a.jqx.position(h);var j=k.left,i=k.top,g=j-m._mousePosition.x,f=i-m._mousePosition.y,e=m._windowPosition.x+g,n=m._windowPosition.y+f;m.move(e,n,h);h.preventDefault();return false}return true},_validateCoordinates:function(e,k,i,j){var h=this._getDraggingArea();e=(e<h.left)?h.left:e;k=(k<h.top)?h.top:k;var f=this.host.outerWidth(true);var g=this.host.outerHeight(true);if(e+f>=h.width+h.left-2*j){e=h.width+h.left-f-j}if(k+g>=h.height+h.top-i){k=h.height+h.top-g-i}return{x:e,y:k}},_performLayout:function(){this._performHeaderLayout();this._performWidgetLayout()},_parseDragAreaAttributes:function(){if(this.dragArea!==null){this.dragArea.height=parseInt(this.dragArea.height,10);this.dragArea.width=parseInt(this.dragArea.width,10);this.dragArea.top=parseInt(this.dragArea.top,10);this.dragArea.left=parseInt(this.dragArea.left,10)}},_positionWindow:function(){this._parseDragAreaAttributes();if(this.position instanceof Array&&this.position.length===2&&typeof this.position[0]==="number"&&typeof this.position[1]==="number"){this.element.style.left=this._toPx(this.position[0]);this.element.style.top=this._toPx(this.position[1])}else{if(this.position instanceof Object){if(this.position.left){this.host.offset(this.position)}else{if(this.position.x!==undefined&&this.position.y!==undefined){this.element.style.left=this._toPx(this.position.x);this.element.style.top=this._toPx(this.position.y)}else{if(this.position.center){this._centerElement(this.host,this.position.center,"xy");var g=this.position.center.coord();var f=parseInt(this.host.css("left"),10);var e=parseInt(this.host.css("top"),10);this.element.style.left=this._toPx(f+g.left);this.element.style.top=this._toPx(e+g.top)}}}}else{this._positionFromLiteral()}}},_getDraggingArea:function(){var e={};e.left=((this.dragArea&&this.dragArea.left)?this.dragArea.left:0);e.top=((this.dragArea&&this.dragArea.top)?this.dragArea.top:0);e.width=((this.dragArea&&this.dragArea.width)?this.dragArea.width:this._getDocumentSize().width);e.height=((this.dragArea&&this.dragArea.height)?this.dragArea.height:this._getDocumentSize().height);return e},_positionFromLiteral:function(){if(!(this.position instanceof Array)){this.position=this.position.split(",")}var e=this.position.length,f=this._getDraggingArea();while(e){e-=1;this.position[e]=this.position[e].replace(/ /g,"");switch(this.position[e]){case"top":this.element.style.top=this._toPx(f.top);break;case"left":this.element.style.left=this._toPx(f.left);break;case"bottom":this.element.style.top=this._toPx(f.height-this.host.height()+f.top);break;case"right":this.element.style.left=this._toPx(f.left+f.width-this.host.width());break;default:if(!this.dragArea){f=a(window)}this._centerElement(this.host,f,"xy");break}}},_raiseEvent:function(g){var f=this._events[g],h=a.Event(f),e={};if(g===2||g===3){e.x=arguments[1];e.y=arguments[2];e.pageX=arguments[3];e.pageY=arguments[4]}if(f==="closed"||f==="close"){e.dialogResult=this.dialogResult}h.args=e;return this.host.trigger(h)},destroy:function(){this.removeHandler(a(window),"resize.window"+this.element.id);this._removeEventHandlers();this._destroy()},_destroy:function(){if(this.isModal){if(this._modalBackground!==null){a(this._modalBackground).remove()}this.host.jqxWindow({isModal:false})}if(this.restricter){this.removeHandler(a(window),"resize."+this.element.id);this.removeHandler(a(window),"orientationchanged."+this.element.id);this.removeHandler(a(window),"orientationchange."+this.element.id)}this.host.remove();if(this._modalBackground!==null){a(this._modalBackground).remove()}},_toClose:function(f,e){return((f&&e[0]===this.element)||(e[0]!==this.element&&typeof e[0]==="object"))},propertyChangedHandler:function(e,g,m,k){this._validateProperties();switch(g){case"rtl":this._performLayout();break;case"dragArea":this._positionWindow();break;case"collapseButtonSize":this._performLayout();break;case"closeButtonSize":this._performLayout();break;case"isModal":this._refresh();this._fixWindowZIndex();if(k===false){var h=a.data(document.body,"jqxwindows-modallist");var l=[];for(var f=0;f<h.length;f++){var j=h[f][0];if(j!==this.element){l.push(h[f])}}}a.data(document.body,"jqxwindows-modallist",l);break;case"keyboardCloseKey":this._removeEventHandlers();this._addEventHandlers();break;case"disabled":if(k){this.disable()}else{this.disabled=true;this.enable()}break;case"showCloseButton":case"showCollapseButton":this._performLayout();break;case"height":this._performLayout();break;case"width":this._performLayout();break;case"title":this.setTitle(k);this.title=k;break;case"content":this.setContent(k);break;case"draggable":this._removeEventHandlers();this._addEventHandlers();this._removeResize();this._initializeResize();break;case"resizable":this.enableResize=k;if(k){this._initializeResize()}else{this._removeResize()}break;case"position":this._positionWindow();break;case"modalOpacity":this._setModalBackgroundStyles();break;case"okButton":if(k){this._addDialogButtonsHandlers()}else{this.removeHandler(this.okButton)}break;case"cancelButton":if(k){this._addDialogButtonsHandlers()}else{this.removeHandler(this.cancelButton)}break;case"collapsed":if(k){if(!m){this.collapsed=false;this.collapse(0)}}else{if(m){this.collapsed=true;this.expand(0)}}break;case"theme":a.jqx.utilities.setTheme(m,k,this.host);break;case"enableResize":return;case"maxWidth":case"maxHeight":case"minWidth":case"minHeight":e._performLayout();e._removeResize();e._initializeResize();return;default:return}},collapse:function(g){if(!this.collapsed&&this._animationInProgress!==true){if(this.host.css("display")=="none"){return}var e=this,h=this._header.outerHeight(true),i=parseInt(this._header.css("border-bottom-width"),10),f=parseInt(this._header.css("margin-bottom"),10);g=!isNaN(parseInt(g,10))?g:this.collapseAnimationDuration;if(!isNaN(i)){h-=2*i}if(!isNaN(f)){h+=f}this._heightBeforeCollapse=this.host.height();this._minHeightBeforeCollapse=this.host.css("min-height");this.element.style.minHeight=this._toPx(h);e._animationInProgress=true;this.host.animate({height:h},{duration:g,complete:function(){e._animationInProgress=false;e.collapsed=true;e._collapseButton.addClass(e.toThemeProperty("jqx-window-collapse-button-collapsed"));e._collapseButton.addClass(e.toThemeProperty("jqx-icon-arrow-down"));e._content[0].style.display="none";e._raiseEvent(5);e._raiseEvent(9);a.jqx.aria(e,"aria-expanded",false)}})}},expand:function(f){if(this.collapsed&&this._animationInProgress!==true){var e=this;f=!isNaN(parseInt(f,10))?f:this.collapseAnimationDuration;e._animationInProgress=true;this.host.animate({height:this._heightBeforeCollapse},{duration:f,complete:function(){e._animationInProgress=false;e.collapsed=false;e.element.style.minHeight=e._toPx(e._minHeightBeforeCollapse);e._collapseButton.removeClass(e.toThemeProperty("jqx-window-collapse-button-collapsed"));e._collapseButton.removeClass(e.toThemeProperty("jqx-icon-arrow-down"));e._content[0].style.display="block";e._raiseEvent(6);e._performWidgetLayout();e._raiseEvent(9);a.jqx.aria(e,"aria-expanded",true)}})}},closeAll:function(h){h=true;var g=a.data(document.body,"jqxwindows-list"),f=g.length,e=a.data(document.body,"jqxwindow-modal")||[];while(f){f-=1;if(this._toClose(h,g[f])){g[f].jqxWindow("closeWindow","close");g.splice(f,1)}}if(this._toClose(h,e)){e.jqxWindow("closeWindow","close");a.data(document.body,"jqxwindow-modal",[])}a.data(document.body,"jqxwindows-list",g)},setTitle:function(f){if(typeof f==="string"){this._headerContentWrapper.html(f)}else{if(typeof f==="object"){try{this._headerContentWrapper[0].innerHTML="";if(f instanceof HTMLElement){this._headerContentWrapper[0].appendChild(f)}else{if(f.appendTo){f.appendTo(this._headerContentWrapper)}}}catch(e){throw new Error(e)}}}this.title=f;this._performLayout()},setContent:function(h){this._contentInitialized=false;var g=this._content,j=false;while(!j){g[0].style.width="auto";g[0].style.height="auto";if(g.hasClass("jqx-window")){j=true}else{g=a(g[0].parentNode)}}if(a.isArray(h)){for(var f=0;f<h.length;f++){h[f].appendTo(this._content)}}else{if(typeof h==="string"){a(this._content[0]).html(h)}else{if(typeof h==="object"){try{this._content[0].innerHTML="";if(h instanceof HTMLElement){this._content[0].appendChild(h)}else{if(h.appendTo){h.appendTo(this._content)}}}catch(e){throw new Error(e)}}}}this.content=h;this._performLayout()},disable:function(){this.disabled=true;this._removeEventHandlers();this._header.addClass(this.toThemeProperty("jqx-window-header-disabled"));this._closeButton.addClass(this.toThemeProperty("jqx-window-close-button-disabled"));this._collapseButton.addClass(this.toThemeProperty("jqx-window-collapse-button-disabled"));this._content.addClass(this.toThemeProperty("jqx-window-content-disabled"));this.host.addClass(this.toThemeProperty("jqx-window-disabled"));this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled"));this._removeResize()},enable:function(){if(this.disabled){this._addEventHandlers();this._header.removeClass(this.toThemeProperty("jqx-window-header-disabled"));this._content.removeClass(this.toThemeProperty("jqx-window-content-disabled"));this._closeButton.removeClass(this.toThemeProperty("jqx-window-close-button-disabled"));this._collapseButton.removeClass(this.toThemeProperty("jqx-window-collapse-button-disabled"));this.host.removeClass(this.toThemeProperty("jqx-window-disabled"));this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled"));this.disabled=false;this._initializeResize()}},isOpen:function(){return this._visible},closeWindow:function(f){var e=this;f=(typeof f==="undefined")?this.closeButtonAction:f;this.hide(function(){if(f==="close"){e._destroy()}})},bringToFront:function(){var f=a.data(document.body,"jqxwindows-list");if(this.isModal){f=a.data(document.body,"jqxwindows-modallist");this._fixWindowZIndex("modal-hide");this._fixWindowZIndex("modal-show");return}var k=f[f.length-1],j=parseInt(k.css("z-index"),10),g=this._indexOf(this.host,f);for(var e=f.length-1;e>g;e-=1){var h=parseInt(f[e].css("z-index"),10)-1;f[e][0].style.zIndex=h}this.element.style.zIndex=j;this._sortByStyle("z-index",f)},hide:function(i,h,e){var g=this;if(this.closing){var f=this.closing();if(f===false){return}}h=h||this.closeAnimationDuration;switch(this.animationType){case"none":this.element.style.display="none";break;case"fade":g._animationInProgress=true;this.host.fadeOut({duration:h,callback:function(){g._animationInProgress=false;if(i instanceof Function){i()}}});break;case"slide":g._animationInProgress=true;this.host.slideUp({duration:h,callback:function(){g._animationInProgress=false;if(i instanceof Function){i()}}});break;case"combined":g._animationInProgress=true;this.host.animate({opacity:0,width:"0px",height:"0px"},{duration:h,complete:function(){g._animationInProgress=false;g.element.style.display="none";if(i instanceof Function){i()}}});break}this._visible=false;if(this.isModal){a(this._modalBackground).hide();this._fixWindowZIndex("modal-hide")}if(e!==true){this._raiseEvent(1);this._raiseEvent(8)}},open:function(f,e){this.show(f,e)},close:function(g,f,e){this.hide(g,f,e)},show:function(k,j){var i=this;this._setDialogResult("none");j=j||this.showAnimationDuration;switch(this.animationType){case"none":this.element.style.display="block";break;case"fade":i._animationInProgress=true;this.host.fadeIn({duration:j,complete:function(){i._animationInProgress=false;if(k instanceof Function){k()}}});break;case"slide":i._animationInProgress=true;this.host.slideDown({duration:j,callback:function(){i._animationInProgress=false;if(k instanceof Function){k()}}});break;case"combined":this.element.style.display="block";var g=i.host.width();var e=i.host.height();this.element.style.minWidth="0px";this.element.style.minHeight="0px";this.element.style.opacity=0;this.element.style.width="0px";this.element.style.height="0px";i._animationInProgress=true;this.host.animate({opacity:1,width:g+"px",height:e+"px"},{duration:j,complete:function(){i._animationInProgress=false;i._performLayout();if(k instanceof Function){k()}}});break}if(this.isModal){a(this._modalBackground).show();this._fixWindowZIndex("modal-show")}var h=this;if(!this._visible){if(j>150&&this.animationType!="none"){setTimeout(function(){if(!h._contentInitialized){if(h.initContent){h.initContent();h._contentInitialized=true}}h._raiseEvent(7);h._raiseEvent(9)},j-150)}else{if(!h._contentInitialized){if(h.initContent){h.initContent();h._contentInitialized=true}}this._raiseEvent(7);h._raiseEvent(9)}}this._visible=true;if(i.animationType!=="combined"){this._performLayout()}if(this.autoFocus){var f=function(){if(!h._isTouchDevice){h._content[0].focus()}};f();setTimeout(function(){f()},100)}},_getTabbables:function(){var f;if(a.jqx.browser.msie&&a.jqx.browser.version<9){f=this._content.find("*")}else{f=this._content[0].querySelectorAll("*")}var e=[];a.each(f,function(){if(d(this)){e[e.length]=this}});return e},move:function(n,m,e,h){var g=0,f=0,k,j,i;n=parseInt(n,10);m=parseInt(m,10);if(a.jqx.browser.msie){if(a(window).width()>a(document).width()&&!this.dragArea){f=this._SCROLL_WIDTH}if(a(window).height()<a(document).height()&&document.documentElement.clientWidth>document.documentElement.scrollWidth&&!this.dragArea){g=this._SCROLL_WIDTH}}k=this._validateCoordinates(n,m,f,g);if(parseInt(this.host.css("left"),10)!==k.x||parseInt(this.host.css("top"),10)!==k.y){if(e){var l=a.jqx.position(e);j=l.left;i=l.top}if(j===undefined){j=n}if(i===undefined){i=m}if(h!==false){this._raiseEvent(2,k.x,k.y,j,i)}}this.element.style.left=k.x+"px";this.element.style.top=k.y+"px";this._moved=true},_toPx:function(e){if(typeof e==="number"){return e+"px"}else{return e}}});function c(g,e){var j=g.nodeName.toLowerCase();if("area"===j){var i=g.parentNode,h=i.name,f;if(!g.href||!h||i.nodeName.toLowerCase()!=="map"){return false}f=a("img[usemap=#"+h+"]")[0];return !!f&&b(f)}return(/input|select|textarea|button|object/.test(j)?!g.disabled:"a"==j?g.href||e:e)&&b(g)}function b(f){var e=a(f);return e.css("display")!=="none"&&e.css("visibility")!=="hidden"}function d(g){var e=g.getAttribute("tabindex"),f=e===null;return(f||e>=0)&&c(g,!f)}}(jqxBaseFramework));(function(b){var a=(function(c){return{resizeConfig:function(){this.resizeTarget=null;this.resizeIndicatorSize=5;this.resizeTargetChildren=null;this.isResizing=false;this.resizeArea=false;this.minWidth=1;this.maxWidth=100;this.minHeight=1;this.maxHeight=100;this.resizeParent=null;this.enableResize=true;this._resizeEvents=["resizing","resized","resize"];this._resizeMouseDown=false;this._resizeCurrentMode=null;this._mouseResizePosition={};this._resizeMethods=null;this._SCROLL_WIDTH=21},_resizeExceptions:{invalidTarget:"Invalid target!",invalidMinHeight:"Invalid minimal height!",invalidMaxHeight:"Invalid maximum height!",invalidMinWidth:"Invalid minimum width!",invalidMaxWidth:"Invalid maximum width!",invalidIndicatorSize:"Invalid indicator size!",invalidSize:"Invalid size!"},removeResize:function(){if(this.resizeTarget){var f=c(this.resizeTarget.children(".jqx-resize"));f.detach();var e=f.children();this._removeResizeEventListeners();for(var d=0;d<e.length;d+=1){c(e[d]).detach();this.resizeTarget.append(e[d])}f.remove()}this._resizeDirection=null},initResize:function(d){this.resizeConfig();this.resizeTarget=c(d.target);this.resizeIndicatorSize=d.indicatorSize||10;this.maxWidth=d.maxWidth||100;this.minWidth=d.minWidth||1;this.maxHeight=d.maxHeight||100;this.minHeight=d.minHeight||1;this.resizeParent=d.resizeParent;this._parseResizeParentProperties();this._validateResizeProperties();this._validateResizeTargetDimensions();this._getChildren(this.resizeTarget.maxWidth,this.resizeTarget.minWidth,this.resizeTarget.maxHeight,this.resizeTarget.minHeight,d.alsoResize);this._refreshResize();this._cursorBackup=this.resizeTarget.css("cursor");if(this._cursorBackup==="auto"){this._cursorBackup="default"}},_validateResizeTargetDimensions:function(){this.resizeTarget.maxWidth=this.maxWidth;this.resizeTarget.minWidth=((3*this.resizeIndicatorSize>this.minWidth)?3*this.resizeIndicatorSize:this.minWidth);this.resizeTarget.maxHeight=this.maxHeight;this.resizeTarget.minHeight=((3*this.resizeIndicatorSize>this.minHeight)?3*this.resizeIndicatorSize:this.minHeight)},_parseResizeParentProperties:function(){if(this.resizeParent){this.resizeParent.left=parseInt(this.resizeParent.left,10);this.resizeParent.top=parseInt(this.resizeParent.top,10);this.resizeParent.width=parseInt(this.resizeParent.width,10);this.resizeParent.height=parseInt(this.resizeParent.height,10)}},_getChildren:function(h,e,g,i,d){this.resizeTargetChildren=c(d);this.resizeTargetChildren=this.resizeTargetChildren.toArray();var f=this.resizeTargetChildren.length;while(f){f-=1;this.resizeTargetChildren[f]=c(this.resizeTargetChildren[f])}},_refreshResize:function(){this._renderResize();this._performResizeLayout();this._removeResizeEventListeners();this._addResizeEventHandlers()},_renderResize:function(){var d=this;if(d._resizeWrapper!==undefined&&c(d._resizeWrapper).parents().length>0){return}var e=document.createElement("div");e.className="jqx-resize jqx-rc-all";e.style.zIndex=8000;e.appendChild(d._header[0]);e.appendChild(d._content[0]);d.resizeTarget[0].appendChild(e);d._resizeWrapper=e},_performResizeLayout:function(){this._resizeWrapper.style.height=this.resizeTarget.height()+"px";this._resizeWrapper.style.width=this.resizeTarget.width()+"px"},_removeResizeEventListeners:function(){var d=this.resizeTarget.attr("id");this.removeHandler(this._resizeWrapper,"mousemove.resize"+d);this.removeHandler(this._resizeWrapper,"mousedown.resize"+d);this.removeHandler(c(document),"mousemove.resize"+d);this.removeHandler(c(document),"mouseup.resize"+d)},_addResizeEventHandlers:function(){var g=this.resizeTarget.attr("id");var d=this;if(d._isTouchDevice){this.addHandler(this._resizeWrapper,"touchmove.resize."+g,function(h){d._resizeCursorChangeHandler(d,h)});this.addHandler(this._resizeWrapper,"touchstart.resize."+g,function(h){d._resizeCursorChangeHandler(d,h);d._resizeMouseDownHandler(d,h)});this.addHandler(c(document),"touchmove.resize."+g,function(h){return d._resizeHandler(d,h)});this.addHandler(c(document),"touchend.resize."+g,function(h){d._stopResizing(d,h)})}else{this.addHandler(this._resizeWrapper,"mousemove.resize."+g,function(h){d._resizeCursorChangeHandler(d,h)});this.addHandler(this._resizeWrapper,"mousedown.resize."+g,function(h){d._resizeMouseDownHandler(d,h)});this.addHandler(c(document),"mousemove.resize."+g,function(h){return d._resizeHandler(d,h)});this.addHandler(c(document),"mouseup.resize."+g,function(h){d._stopResizing(d,h)})}try{if(document.referrer!==""||window.frameElement){var f=function(h){d._stopResizing(d,h)};if(window.top.document.addEventListener){window.top.document.addEventListener("mouseup",f,false)}else{if(window.top.document.attachEvent){window.top.document.attachEvent("onmouseup",f)}}}}catch(e){}},_stopResizing:function(d){if(d.enableResize){if(d.isResizing){d._raiseResizeEvent(1)}d._resizeMouseDown=false;d.isResizing=false;d._resizeDirection=null;if(d.resizeTarget){d.resizeTarget.removeClass("jqx-disableselect")}}if(d._cursorBackup=="undefined"){d._cursorBackup="default"}if(d._resizeWrapper){d._resizeWrapper.style.cursor=d._cursorBackup}},_resizeHandler:function(e,f){if(e.enableResize&&!e.collapsed){if(e.isResizing&&e._resizeDirection){if(f.which===0&&c.jqx.browser.msie&&c.jqx.browser.version<9){e._stopResizing(f)}if(e._isTouchDevice){var d=c.jqx.position(f);e._performResize(d.left,d.top);return false}e._performResize(f.pageX,f.pageY);return false}else{if(e._isTouchDevice){var d=c.jqx.position(f);return e._resizeCaptureCursor(d.left,d.top)}return e._resizeCaptureCursor(f.pageX,f.pageY)}}},_resizeCaptureCursor:function(e,d){if(this._resizeMouseDown&&!this.isResizing&&this._resizeDirection){var f=3;if(this._isTouchDevice){this._changeCursor(e-parseInt(this.resizeTarget.css("left"),10),d-parseInt(this.resizeTarget.css("top"),10));this._mouseResizePosition={x:e,y:d};this._prepareResizeMethods(this._resizeDirection);this._resizeBackupData();this.isResizing=true;this.resizeTarget.addClass("jqx-disableselect");return false}if((e+f<this._mouseResizePosition.x||e-f>this._mouseResizePosition.x)||(d+f<this._mouseResizePosition.y||d-f>this._mouseResizePosition.y)){this._changeCursor(e-parseInt(this.resizeTarget.css("left"),10),d-parseInt(this.resizeTarget.css("top"),10));this._mouseResizePosition={x:e,y:d};this._prepareResizeMethods(this._resizeDirection);this._resizeBackupData();this.isResizing=true;this.resizeTarget.addClass("jqx-disableselect");return false}}},_resizeBackupData:function(){this.resizeTarget.lastWidth=this.resizeTarget.width();this.resizeTarget.lastHeight=this.resizeTarget.height();this.resizeTarget.x=parseInt(this.resizeTarget.css("left"),10);this.resizeTarget.y=parseInt(this.resizeTarget.css("top"),10);this._resizeBackupChildrenSize()},_resizeBackupChildrenSize:function(){var d=this.resizeTargetChildren.length,e;while(d){d-=1;e=this.resizeTargetChildren[d];this.resizeTargetChildren[d].lastWidth=e.width();this.resizeTargetChildren[d].lastHeight=e.height()}},_performResize:function(g,f){var e=g-this._mouseResizePosition.x,d=f-this._mouseResizePosition.y;if(this._resizeDirection){this._resize(this.resizeTarget,e,d)}},_resizeCursorChangeHandler:function(e,f){if(e.enableResize&&!e.collapsed){if(!e.isResizing){if(e._isTouchDevice){var d=c.jqx.position(f);e._changeCursor(d.left-parseInt(e.resizeTarget.css("left"),10),d.top-parseInt(e.resizeTarget.css("top"),10));return}e._changeCursor(f.pageX-parseInt(e.resizeTarget.css("left"),10),f.pageY-parseInt(e.resizeTarget.css("top"),10))}}},_resizeMouseDownHandler:function(e,f){if(e.enableResize){if(e._resizeDirection!==null){e._resizeMouseDown=true;if(e._isTouchDevice){var d=c.jqx.position(f);e._mouseResizePosition.x=d.left;e._mouseResizePosition.y=d.top}else{e._mouseResizePosition.x=f.pageX;e._mouseResizePosition.y=f.pageY}f.preventDefault()}}},_validateResizeProperties:function(){try{if(!this.resizeTarget||this.resizeTarget.length!==1){throw new Error(this._resizeExceptions.invalidTarget)}if(this.minHeight<0||isNaN(parseInt(this.minHeight,10))){throw new Error(this._resizeExceptions.invalidMinHeight)}if(this.maxHeight<=0||isNaN(parseInt(this.maxHeight,10))){throw new Error(this._resizeExceptions.invalidMaxHeight)}if(this.minWidth<0||isNaN(parseInt(this.minWidth,10))){throw new Error(this._resizeExceptions.invalidMinWidth)}if(this.maxWidth<0||isNaN(parseInt(this.maxWidth,10))){throw new Error(this._resizeExceptions.invalidMaxWidth)}if(this.resizeIndicatorSize<0||isNaN(parseInt(this.resizeIndicatorSize,10))){throw new Error(this._resizeExceptions.invalidIndicatorSize)}if(this.minHeight>this.maxHeight||this.minWidth>this.maxWidth){throw new Error(this._resizeExceptions.invalidSize)}}catch(d){throw new Error(d)}},_changeCursor:function(d,e){if(this.isResizing||this._resizeMouseDown){return}this.resizeArea=true;if(d<=this.resizeIndicatorSize&&d>=0&&e<=this.resizeIndicatorSize&&e>0){this._resizeWrapper.style.cursor="nw-resize";this._resizeDirection="topleft"}else{if(e<=this.resizeIndicatorSize&&e>0&&d>=this.resizeTarget.width()-this.resizeIndicatorSize){this._resizeWrapper.style.cursor="ne-resize";this._resizeDirection="topright"}else{if(e>=this.resizeTarget.height()-this.resizeIndicatorSize&&e<this.resizeTarget.height()&&d<=this.resizeIndicatorSize&&d>=0){this._resizeWrapper.style.cursor="sw-resize";this._resizeDirection="bottomleft"}else{if(e>=this.resizeTarget.height()-this.resizeIndicatorSize&&e<this.resizeTarget.height()&&d>=this.resizeTarget.width()-this.resizeIndicatorSize&&d<this.resizeTarget.width()){this._resizeWrapper.style.cursor="se-resize";this._resizeDirection="bottomright"}else{if(d<=this.resizeIndicatorSize&&d>=0){this._resizeWrapper.style.cursor="e-resize";this._resizeDirection="left"}else{if(e<=this.resizeIndicatorSize&&e>0){this._resizeWrapper.style.cursor="n-resize";this._resizeDirection="top"}else{if(e>=this.resizeTarget.height()-this.resizeIndicatorSize&&e<this.resizeTarget.height()){this._resizeWrapper.style.cursor="n-resize";this._resizeDirection="bottom"}else{if(d>=this.resizeTarget.width()-this.resizeIndicatorSize&&d<this.resizeTarget.width()){this._resizeWrapper.style.cursor="e-resize";this._resizeDirection="right"}else{this._resizeWrapper.style.cursor=this._cursorBackup;this._resizeDirection=null;this.resizeArea=false}}}}}}}}},_prepareResizeMethods:function(d){this._resizeMethods=[];if(d.indexOf("left")>=0){this._resizeMethods.push(this._resizeLeft)}if(d.indexOf("top")>=0){this._resizeMethods.push(this._resizeTop)}if(d.indexOf("right")>=0){this._resizeMethods.push(this._resizeRight)}if(d.indexOf("bottom")>=0){this._resizeMethods.push(this._resizeBottom)}},_validateResize:function(g,d,h,f,e){if(h==="horizontal"||h==="both"){return this._validateWidth(g,f,e)}else{if(h==="vertical"||h==="both"){return this._validateHeight(d,f,e)}}return{result:false,fix:0}},_getParent:function(){if(this.resizeParent!==null&&this.resizeParent!=="undefined"&&this.resizeParent.height&&this.resizeParent.width&&this.resizeParent.top&&this.resizeParent.left){return this.resizeParent}return{left:0,top:0,width:c(document).width(),height:c(document).height()}},_validateHeight:function(e,h,g){var i=0,d=2,f=this._getParent();if(c(window).width()>c(document).width()&&c.jqx.browser.msie&&f.height===c(document).height()){i=this._SCROLL_WIDTH}if(g==="bottom"&&(e+h.position().top+i+d>f.height+f.top)){return{fix:f.height-h.position().top-i-d+f.top,result:false}}if(g==="top"&&h.lastHeight-e+h.y<f.top){return{fix:e+(h.lastHeight-e+h.y)-f.top,result:false}}if(e<h.minHeight){return{fix:h.minHeight,result:false}}if(e>h.maxHeight){return{fix:h.maxHeight,result:false}}return{result:true,fix:e}},_validateWidth:function(h,g,f){var i=0,d=2,e=this._getParent();if(c(window).height()<c(document).height()&&c.jqx.browser.msie&&document.documentElement.clientWidth>=document.documentElement.scrollWidth&&e.width===c(document).width()){i=this._SCROLL_WIDTH}if(f==="right"&&(h+g.position().left+i+d>e.width+e.left)){return{fix:e.width-g.position().left-i-d+e.left,result:false}}if(f==="left"&&(g.lastWidth-h+g.x<e.left)){return{fix:h+(g.lastWidth-h+g.x)-e.left,result:false}}if(h<g.minWidth){return{fix:g.minWidth,result:false}}if(h>g.maxWidth){return{fix:g.maxWidth,result:false}}return{result:true,fix:h}},_resize:function(h,e,d){var j=this._resizeMethods.length;for(var g=0;g<j;g++){if(this._resizeMethods[g] instanceof Function){var f={element:h,x:e,y:d,self:this};this._resizeMethods[g](f)}}this._performResizeLayout()},resize:function(g,d){if(this.resizable){var f=g-this.host.width();var e=d-this.host.height();var h="right";if(e!==0){h="bottom"}this._resizeDirection=h;this._prepareResizeMethods(this._resizeDirection);this._resizeBackupData();this.isResizing=true;this._resize(this.resizeTarget,f,e);this.isResizing=false;if(f>0&&e>0){this._resizeDirection="right";this._prepareResizeMethods(this._resizeDirection);this._resizeBackupData();this.isResizing=true;this._resize(this.resizeTarget,f,e);this.isResizing=false}}},_setResizeChildrenSize:function(e,f){var h=this.resizeTargetChildren.length;while(h){h--;if(f==="width"){var g=this.resizeTargetChildren[h].lastWidth-(this.resizeTarget.lastWidth-e);if(g<this.resizeTarget.maxWidth&&g>0){this.resizeTargetChildren[h].width(g)}}else{var d=this.resizeTargetChildren[h].lastHeight-(this.resizeTarget.lastHeight-e);if(d<this.resizeTarget.maxHeight&&d>0){this.resizeTargetChildren[h].height(d)}}}},_resizeRight:function(g){var h=g.element.lastWidth+g.x,d=g.self._validateResize(h,0,"horizontal",g.element,"right");if(!d.result){h=d.fix}if(g.element.width()!==h){g.self._setResizeChildrenSize(h,"width");g.element.width(h);if(g.self.width.toString().indexOf("%")>=0){var f=c(document.body).width()/100;var e=1/f;g.element[0].style.width=(e*h)+"%";g.self._setChildrenLayout()}g.self._raiseResizeEvent(0)}return h},_resizeLeft:function(h){var i=h.element.lastWidth-h.x,e=h.self._validateResize(i,0,"horizontal",h.element,"left"),d=h.element.x+h.x;if(!e.result){d=h.element.x+(h.element.lastWidth-e.fix);i=e.fix;return}if(h.element.width()!==i){h.self._setResizeChildrenSize(i,"width");h.element.width(i);if(h.self.width.toString().indexOf("%")>=0){var g=c(document.body).width()/100;var f=1/g;h.element[0].style.width=(f*i)+"%";h.self._setChildrenLayout()}h.element[0].style.left=h.self._toPx(d);h.self._raiseResizeEvent(0)}return i},_resizeBottom:function(h){var e=h.element.lastHeight+h.y,d=h.self._validateResize(0,e,"vertical",h.element,"bottom");if(!d.result){e=d.fix}if(h.element.height()!==e){h.self._setResizeChildrenSize(e,"height");h.element.height(e);if(h.self.height.toString().indexOf("%")>=0){var g=c(document.body).height()/100;var f=1/g;h.element[0].style.height=(f*e)+"%";h.self._setChildrenLayout()}h.self._raiseResizeEvent(0)}return e},_resizeTop:function(h){var e=h.element.lastHeight-h.y,d=h.self._validateResize(0,e,"vertical",h.element,"top"),i=h.element.y+h.y;if(!d.result){i=h.element.y+(h.element.lastHeight-d.fix);e=d.fix;return}if(h.element.height()!==e){h.self._setResizeChildrenSize(e,"height");h.element.height(e);if(h.self.height.toString().indexOf("%")>=0){var g=c(document.body).height()/100;var f=1/g;h.element[0].style.height=(f*e)+"%";h.self._setChildrenLayout()}h.element[0].style.top=h.self._toPx(i);h.self._raiseResizeEvent(0)}return e},_raiseResizeEvent:function(f){var e=this._resizeEvents[f],g=c.Event(e),d={};d.width=parseInt(this.resizeTarget[0].style.width,10);d.height=parseInt(this.resizeTarget[0].style.height,10);g.args=d;if(f===0){e=this._resizeEvents[2];var h=c.Event(e);h.args=d;this.resizeTarget.trigger(h)}return this.resizeTarget.trigger(g)}}}(jqxBaseFramework));b.extend(b.jqx._jqxWindow.prototype,a)}(jqxBaseFramework));
9

mercurial