From 8f6af35b3dc7d987df8b38c0371c43d4e01baabf Mon Sep 17 00:00:00 2001 From: jQWidgets Date: Tue, 14 Feb 2017 14:18:52 +0200 Subject: [PATCH] Add files via upload --- jqwidgets/jqxtouch.js | 10 +++++----- jqwidgets/jqxtree.js | 11 ++++++----- jqwidgets/jqxtreegrid.js | 10 +++++----- jqwidgets/jqxtreemap.js | 10 +++++----- jqwidgets/jqxvalidator.js | 10 +++++----- jqwidgets/jqxwindow.js | 11 ++++++----- 6 files changed, 32 insertions(+), 30 deletions(-) diff --git a/jqwidgets/jqxtouch.js b/jqwidgets/jqxtouch.js index 97203c68e..07a38641d 100644 --- a/jqwidgets/jqxtouch.js +++ b/jqwidgets/jqxtouch.js @@ -1,7 +1,7 @@ -/* -jQWidgets v4.4.0 (2016-Nov) -Copyright (c) 2011-2016 jQWidgets. -License: http://jqwidgets.com/license/ +/* +jQWidgets v4.5.1 (2017-Feb) +Copyright (c) 2011-2017 jQWidgets. +License: http://jqwidgets.com/license/ */ +!function(a){var b=0;a.jqx.jqxWidget("jqxTouch","",{}),a.extend(a.jqx._jqxTouch.prototype,{defineInstance:function(){this.swipeMin=50,this.swipeMax=500,this.swipeDelay=1e3,this.tapHoldDelay=750,this.swipeMaxVerticalDisance=100,this.swipeMaxHorizontalDisance=100,this.orientationChangeEnabled=!0,this._eventsMap={mousedown:a.jqx.mobile.getTouchEventName("touchstart"),mouseup:a.jqx.mobile.getTouchEventName("touchend"),mousemove:a.jqx.mobile.getTouchEventName("touchmove")},this._swipeLocked=!1,this._rotationInterval=200,this._events=["tap","taphold","swipe","swipeleft","swiperight","swipetop","swipebottom","orientationchange"],this._instanceId=-1},createInstance:function(){b+=1,this._instanceId=b,this._isTouchDevice=a.jqx.mobile.isTouchDevice(),this._defineRotateHandler()},refresh:function(){this._removeEventListeners(),this._addEventListeners()},_defineRotateHandler:function(){var a=this;this._rotateHandler||(this._rotateHandler=function(){a._checkOrientation()})},_getEvent:function(a){return this._isTouchDevice&&(a=this._eventsMap[a]),a+this._getEventNamespace()},_getEventNamespace:function(){return".swipe"+this._instanceId},_removeEventListeners:function(){clearInterval(this._rotateInterval),this.removeHandler(a(document),this._getEvent("mouseup")),this.removeHandler(this.host,this._getEvent("mousedown")),this.removeHandler(this.host,this._getEvent("mousemove")),window.removeEventListener&&(window.removeEventListener("resize",this._rotateHandler),window.removeEventListener("orientationchange",this._rotateHandler))},_addEventListeners:function(){var a=this;this.addHandler(this.host,this._getEvent("mouseup"),function(b){a._resetSwipe(),a._resetTap()}),this.addHandler(this.host,this._getEvent("mousedown"),function(b){a._initSwipe(b),a._initTap(b)}),this.addHandler(this.host,this._getEvent("mousemove"),function(b){return a._maxSwipeVerticalDistance=Math.max(a._maxSwipeVerticalDistance,Math.abs(a._startY-a._getCoordinates(b).y)),a._maxSwipeHorizontalDistance=Math.max(a._maxSwipeHorizontalDistance,Math.abs(a._startX-a._getCoordinates(b).x)),a._mouseMoved=!0,a._handleSwipeEvents(b)}),this._rotationListeners()},_handleSwipeEvents:function(a){var b=!0;return this._mouseDown&&!this._tapHoldFired&&(b=this._handleVerticalSwipeEvents(a),b=this._handleHorizontalSwipeEvents(a)),this._lastPosition=this._getCoordinates(a),b},_handleVerticalSwipeEvents:function(a){var b,c;return b=this._getCoordinates(a).y,c=b-this._startY,!(this._maxSwipeHorizontalDistance=this.swipeMin&&!this._swipeEvent&&!this._swipeLocked&&(this._swipeEvent=this._getSwipeEvent(b,c)),!(Math.abs(b)<=this.swipeMax)||(a.stopImmediatePropagation(),!1)},_getSwipeEvent:function(a,b){var c;return c=a<0?{eventId:3+b,data:{target:this.host}}:{eventId:4+b,data:{target:this.host}}},_resetSwipe:function(){this._swipeEvent&&!this._swipeLocked&&(this._raiseEvent(2,this._swipeEvent.data),this._raiseEvent(this._swipeEvent.eventId,this._swipeEvent.data)),clearTimeout(this._swipeTimeout),this._mouseDown=!1},_resetTap:function(){clearTimeout(this._tapHoldTimeout),this._tapHoldFired||this._mouseMoved||this._raiseEvent(0,{target:this.host})},_initTap:function(a){var b=this;this._mouseMoved=!1,this._tapHoldFired=!1,this._tapHoldTimeout=setTimeout(function(){b._mouseMoved||(b._raiseEvent(1,{target:this.host}),b._tapHoldFired=!0)},this.tapHoldDelay)},_initSwipe:function(a){var b=this;this._mouseDown=!0,this._maxSwipeVerticalDistance=0,this._maxSwipeHorizontalDistance=0,this._startX=this._getCoordinates(a).x,this._startY=this._getCoordinates(a).y,this._swipeLocked=!1,this._swipeEvent=null,this._swipeTimeout=setTimeout(function(){b._swipeLocked=!0},this.swipeDelay)},_rotationListeners:function(){var a=this;this._previousOrientation=window.orientation,this._previousWidth=screen.width,this.orientationChangeEnabled&&(window.addEventListener&&(window.addEventListener("resize",this._rotateHandler,!1),window.addEventListener("orientationchange",this._rotateHandler,!1)),this._rotateInterval=setInterval(function(){a._checkOrientation()},this._rotationInterval))},_checkOrientation:function(){var a="vertical";window.orientation===this._previousOrientation&&this._previousWidth===screen.width||((90===window.orientation||screen.width>screen.height)&&(a="horizontal"),this._raiseEvent(7,{orientation:a})),this._previousOrientation=window.orientation,this._previousWidth=screen.width},_raiseEvent:function(b,c){var d=a.Event(this._events[b]);return d.args=c,this.host.trigger(d)},_getCoordinates:function(b){var c=a.jqx.position(b);return c.x=c.left,c.y=c.top,c},propertyChangedHandler:function(a,b,c,d){"orientationChangeEnabled"===b&&this.refresh()},isTouchDevice:function(){return this._isTouchDevice}})}(jqxBaseFramework); -(function(b){var a=0;b.jqx.jqxWidget("jqxTouch","",{});b.extend(b.jqx._jqxTouch.prototype,{defineInstance:function(){this.swipeMin=50;this.swipeMax=500;this.swipeDelay=1000;this.tapHoldDelay=750;this.swipeMaxVerticalDisance=100;this.swipeMaxHorizontalDisance=100;this.orientationChangeEnabled=true;this._eventsMap={mousedown:b.jqx.mobile.getTouchEventName("touchstart"),mouseup:b.jqx.mobile.getTouchEventName("touchend"),mousemove:b.jqx.mobile.getTouchEventName("touchmove")};this._swipeLocked=false;this._rotationInterval=200;this._events=["tap","taphold","swipe","swipeleft","swiperight","swipetop","swipebottom","orientationchange"];this._instanceId=-1},createInstance:function(){a+=1;this._instanceId=a;this._isTouchDevice=b.jqx.mobile.isTouchDevice();this._defineRotateHandler()},refresh:function(){this._removeEventListeners();this._addEventListeners()},_defineRotateHandler:function(){var c=this;if(!this._rotateHandler){this._rotateHandler=function(){c._checkOrientation()}}},_getEvent:function(c){if(this._isTouchDevice){c=this._eventsMap[c]}return c+this._getEventNamespace()},_getEventNamespace:function(){return".swipe"+this._instanceId},_removeEventListeners:function(){clearInterval(this._rotateInterval);this.removeHandler(b(document),this._getEvent("mouseup"));this.removeHandler(this.host,this._getEvent("mousedown"));this.removeHandler(this.host,this._getEvent("mousemove"));if(window.removeEventListener){window.removeEventListener("resize",this._rotateHandler);window.removeEventListener("orientationchange",this._rotateHandler)}},_addEventListeners:function(){var c=this;this.addHandler(this.host,this._getEvent("mouseup"),function(d){c._resetSwipe();c._resetTap()});this.addHandler(this.host,this._getEvent("mousedown"),function(d){c._initSwipe(d);c._initTap(d)});this.addHandler(this.host,this._getEvent("mousemove"),function(d){c._maxSwipeVerticalDistance=Math.max(c._maxSwipeVerticalDistance,Math.abs(c._startY-c._getCoordinates(d).y));c._maxSwipeHorizontalDistance=Math.max(c._maxSwipeHorizontalDistance,Math.abs(c._startX-c._getCoordinates(d).x));c._mouseMoved=true;return c._handleSwipeEvents(d)});this._rotationListeners()},_handleSwipeEvents:function(d){var c=true;if(this._mouseDown&&!this._tapHoldFired){c=this._handleVerticalSwipeEvents(d);c=this._handleHorizontalSwipeEvents(d)}this._lastPosition=this._getCoordinates(d);return c},_handleVerticalSwipeEvents:function(f){var d,c;d=this._getCoordinates(f).y;c=d-this._startY;if(this._maxSwipeHorizontalDistance=this.swipeMin&&!this._swipeEvent&&!this._swipeLocked){this._swipeEvent=this._getSwipeEvent(d,c)}if(Math.abs(d)<=this.swipeMax){f.stopImmediatePropagation();return false}return true},_getSwipeEvent:function(e,d){var c;if(e<0){c={eventId:3+d,data:{target:this.host}}}else{c={eventId:4+d,data:{target:this.host}}}return c},_resetSwipe:function(){if(this._swipeEvent&&!this._swipeLocked){this._raiseEvent(2,this._swipeEvent.data);this._raiseEvent(this._swipeEvent.eventId,this._swipeEvent.data)}clearTimeout(this._swipeTimeout);this._mouseDown=false},_resetTap:function(){clearTimeout(this._tapHoldTimeout);if(!this._tapHoldFired&&!this._mouseMoved){this._raiseEvent(0,{target:this.host})}},_initTap:function(d){var c=this;this._mouseMoved=false;this._tapHoldFired=false;this._tapHoldTimeout=setTimeout(function(){if(!c._mouseMoved){c._raiseEvent(1,{target:this.host});c._tapHoldFired=true}},this.tapHoldDelay)},_initSwipe:function(d){var c=this;this._mouseDown=true;this._maxSwipeVerticalDistance=0;this._maxSwipeHorizontalDistance=0;this._startX=this._getCoordinates(d).x;this._startY=this._getCoordinates(d).y;this._swipeLocked=false;this._swipeEvent=null;this._swipeTimeout=setTimeout(function(){c._swipeLocked=true},this.swipeDelay)},_rotationListeners:function(){var c=this;this._previousOrientation=window.orientation;this._previousWidth=screen.width;if(this.orientationChangeEnabled){if(window.addEventListener){window.addEventListener("resize",this._rotateHandler,false);window.addEventListener("orientationchange",this._rotateHandler,false)}this._rotateInterval=setInterval(function(){c._checkOrientation()},this._rotationInterval)}},_checkOrientation:function(){var c="vertical";if(window.orientation!==this._previousOrientation||this._previousWidth!==screen.width){if(window.orientation===90||screen.width>screen.height){c="horizontal"}this._raiseEvent(7,{orientation:c})}this._previousOrientation=window.orientation;this._previousWidth=screen.width},_raiseEvent:function(d,c){var e=b.Event(this._events[d]);e.args=c;return this.host.trigger(e)},_getCoordinates:function(d){var f=b.jqx.position(d);f.x=f.left;f.y=f.top;return f},propertyChangedHandler:function(c,d,f,e){if(d==="orientationChangeEnabled"){this.refresh()}else{return}},isTouchDevice:function(){return this._isTouchDevice}})}(jqxBaseFramework)); \ No newline at end of file diff --git a/jqwidgets/jqxtree.js b/jqwidgets/jqxtree.js index fc11e4bc4..a991e1209 100644 --- a/jqwidgets/jqxtree.js +++ b/jqwidgets/jqxtree.js @@ -1,7 +1,8 @@ -/* -jQWidgets v4.4.0 (2016-Nov) -Copyright (c) 2011-2016 jQWidgets. -License: http://jqwidgets.com/license/ +/* +jQWidgets v4.5.1 (2017-Feb) +Copyright (c) 2011-2017 jQWidgets. +License: http://jqwidgets.com/license/ */ +!function(a){a.jqx.jqxWidget("jqxTree","",{}),a.extend(a.jqx._jqxTree.prototype,{defineInstance:function(){var b={items:new Array,width:null,height:null,easing:"easeInOutCirc",animationShowDuration:"fast",animationHideDuration:"fast",treeElements:new Array,disabled:!1,itemsMember:"",displayMember:"",valueMember:"",enableHover:!0,keyboardNavigation:!0,enableKeyboardNavigation:!0,toggleMode:"dblclick",source:null,checkboxes:!1,checkSize:13,toggleIndicatorSize:16,hasThreeStates:!1,selectedItem:null,touchMode:"auto",allowDrag:!0,allowDrop:!0,searchMode:"startswithignorecase",incrementalSearch:!0,incrementalSearchDelay:700,animationHideDelay:0,submitCheckedItems:!1,dragStart:null,dragEnd:null,rtl:!1,dropAction:"default",events:["expand","collapse","select","initialized","added","removed","checkChange","dragEnd","dragStart","itemClick"],aria:{"aria-activedescendant":{name:"getActiveDescendant",type:"string"},"aria-disabled":{name:"disabled",type:"boolean"}}};return this===a.jqx._jqxTree.prototype?b:(a.extend(!0,this,b),b)},createInstance:function(b){var c=this;if(this.host.attr("role","tree"),this.host.attr("data-role","treeview"),this.enableKeyboardNavigation=this.keyboardNavigation,this.propertyChangeMap.disabled=function(b,d,e,f){c.disabled?c.host.addClass(c.toThemeProperty("jqx-tree-disabled")):c.host.removeClass(c.toThemeProperty("jqx-tree-disabled")),a.jqx.aria(c,"aria-disabled",f)},null!=this.width&&this.width.toString().indexOf("px")!=-1?this.host.width(this.width):void 0==this.width||isNaN(this.width)||this.host.width(this.width),null!=this.height&&this.height.toString().indexOf("px")!=-1?this.host.height(this.height):void 0==this.height||isNaN(this.height)||this.host.height(this.height),null!=this.width&&this.width.toString().indexOf("%")!=-1&&this.host.width(this.width),null!=this.height&&this.height.toString().indexOf("%")!=-1&&this.host.height(this.height),this.host.attr("tabindex")||this.host.attr("tabIndex",1),this.disabled&&(this.host.addClass(this.toThemeProperty("jqx-tree-disabled")),a.jqx.aria(this,"aria-disabled",!0)),this.host.jqxDragDrop&&jqxTreeDragDrop(),this.originalInnerHTML=this.element.innerHTML,this.createdTree=!1,this.element.innerHTML.indexOf("UL")){var d=this.host.find("ul:first");d.length>0&&(this.createTree(d[0]),this.createdTree=!0)}if(null!=this.source){var e=this.loadItems(this.source);this.element.innerHTML=e;var d=this.host.find("ul:first");d.length>0&&(this.createTree(d[0]),this.createdTree=!0)}if(this._itemslength=this.items.length,!this.createdTree&&0==this.host.find("ul").length){this.host.append(a("
    "));var d=this.host.find("ul:first");d.length>0&&(this.createTree(d[0]),this.createdTree=!0),this.createdTree=!0}1==this.createdTree&&(this._render(),this._handleKeys()),this._updateCheckLayout()},checkItems:function(b,c){var d=this;if(null!=b){var e=0,f=!1,g=0,h=a(b.element).find("li");if(g=h.length,a.each(h,function(a){var b=d.itemMapping["id"+this.id].item;0!=b.checked&&(null==b.checked&&(f=!0),e++)}),b!=c)e==g?this.checkItem(b.element,!0,"tree"):e>0?this.checkItem(b.element,null,"tree"):this.checkItem(b.element,!1,"tree");else{var i=c.checked,h=a(c.element).find("li");a.each(h,function(){d.itemMapping["id"+this.id].item;d.checkItem(this,i,"tree")})}this.checkItems(this._parentItem(b),c)}else{var i=c.checked,h=a(c.element).find("li");a.each(h,function(){d.itemMapping["id"+this.id].item;d.checkItem(this,i,"tree")})}},_getMatches:function(b,c){if(void 0==b||0==b.length)return-1;for(var d=this.items,e=new Array,f=0;f=33&&d<=40)){var f=-1;b._searchString||(b._searchString=""),(8==d||46==d)&&b._searchString.length>=1&&(b._searchString=b._searchString.substr(0,b._searchString.length-1));var g=String.fromCharCode(d),h=!isNaN(parseInt(g)),i=!1;if(d>=65&&d<=97||h||8==d||32==d||46==d){c.shiftKey||(g=g.toLocaleLowerCase()),8!=d&&32!=d&&46!=d&&(b._searchString.length>0&&b._searchString.substr(0,1)==g||(b._searchString+=g)),32==d&&(b._searchString+=" "),b._searchTime=new Date;var j=b.selectedItem;if(j){for(var k=j.id,l=-1,m=0;m0&&n[0].id==k)var n=b._getMatches(b._searchString)}else var n=b._getMatches(b._searchString);if(n.length>0){var j=b.selectedItem;b.selectedItem&&b.selectedItem.id!=n[0].id&&(b.clearSelection(),b.selectItem(n[0].element,"keyboard")),b._lastSearchString=b._searchString}}if(void 0!=b._searchTimer&&clearTimeout(b._searchTimer),27!=d&&13!=d||(b._searchString="",b._lastSearchString=""),b._searchTimer=setTimeout(function(){b._searchString="",b._lastSearchString=""},500),f>=0)return;if(i)return!1}switch(d){case 32:if(b.checkboxes){b.fromKey=!0;var o=a(b.selectedItem.checkBoxElement).jqxCheckBox("checked");return b.checkItem(b.selectedItem.element,!o,"tree"),b.hasThreeStates&&b.checkItems(b.selectedItem,b.selectedItem),!1}return!0;case 33:for(var p=b._getItemsOnPage(),q=b.selectedItem,m=0;m=0;i--){var f=e[i];if(b=this.itemMapping["id"+f.id].item,c._isVisible(b))return b}return null},_parentItem:function(b){if(null==b||void 0==b)return null;var c=b.parentElement;if(!c)return null;var d=null;return a.each(this.items,function(){if(this.element==c)return d=this,!1}),d},_nextVisibleItem:function(a){if(null==a||void 0==a)return null;for(var b=a;null!=b;)if(b=b.nextItem,this._isVisible(b)&&!b.disabled)return b;return null},_prevVisibleItem:function(a){if(null==a||void 0==a)return null;for(var b=a;null!=b;)if(b=b.prevItem,this._isVisible(b)&&!b.disabled)return b;return null},_isVisible:function(a){if(null==a||void 0==a)return!1;if(!this._isElementVisible(a.element))return!1;var b=this._parentItem(a);if(null==b)return!0;if(null!=b){if(!this._isElementVisible(b.element))return!1;if(!b.isExpanded)return!1;for(;null!=b;){if(b=this._parentItem(b),null!=b&&!this._isElementVisible(b.element))return!1;if(null!=b&&!b.isExpanded)return!1}}return!0},_getItemsOnPage:function(){var b=0,c=(this.panel.jqxPanel("getVScrollPosition"),parseInt(this.host.height())),d=0,e=this._firstItem();if(parseInt(a(e.element).height())>0)for(;d<=c;)d+=parseInt(a(e.element).outerHeight()),b++;return b},_isElementVisible:function(b){return null!=b&&("none"!=a(b).css("display")&&"hidden"!=a(b).css("visibility"))},refresh:function(b){if(null!=this.width&&this.width.toString().indexOf("px")!=-1?this.host.width(this.width):void 0==this.width||isNaN(this.width)||this.host.width(this.width),null!=this.height&&this.height.toString().indexOf("px")!=-1?this.host.height(this.height):void 0==this.height||isNaN(this.height)||this.host.height(this.height),this.panel){if(null!=this.width&&this.width.toString().indexOf("%")!=-1){var c=this;this.panel.jqxPanel("width","100%"),c.removeHandler(a(window),"resize.jqxtree"+c.element.id),c.addHandler(a(window),"resize.jqxtree"+c.element.id,function(){c._calculateWidth()})}else this.panel.jqxPanel("width",this.host.width());this.panel.jqxPanel("_arrange")}if(this._calculateWidth(),a.jqx.isHidden(this.host)){var c=this;this._hiddenTimer&&clearInterval(this._hiddenTimer),this._hiddenTimer=setInterval(function(){a.jqx.isHidden(c.host)||(clearInterval(c._hiddenTimer),c._calculateWidth())},100)}1!=b&&this.checkboxes&&this._updateCheckLayout(null)},resize:function(a,b){this.width=a,this.height=b,this.refresh()},loadItems:function(b){if(null!=b){var c=this;this.items=new Array;var d="
      ";return a.map(b,function(a){return void 0==a?null:void(d+=c._parseItem(a))}),d+="
    "}},_parseItem:function(a){var b="";if(void 0==a)return null;var c=a.label,d=a.value;!a.label&&a.html&&(c=a.html),void 0!=this.displayMember&&""!=this.displayMember&&(c=a[this.displayMember]),void 0!=this.valueMember&&""!=this.valueMember&&(d=a[this.valueMember]),c||(c="Item"),"string"==typeof a&&(c=a);var e=!1;void 0!=a.expanded&&a.expanded&&(e=!0);var f=!1;void 0!=a.locked&&a.locked&&(f=!0);var g=!1;void 0!=a.selected&&a.selected&&(g=!0);var h=!1;void 0!=a.disabled&&a.disabled&&(h=!0);var i=!1;void 0!=a.checked&&a.checked&&(i=!0);var j=a.icon,k=a.iconsize;b+=""},ensureVisible:function(b){if(null!=b&&void 0!=b&&this.panel){var c=this.panel.jqxPanel("getVScrollPosition"),d=this.panel.jqxPanel("getHScrollPosition"),e=parseInt(this.host.height()),f=a(b).position().top;(f<=c||f>=e+c)&&this.panel.jqxPanel("scrollTo",d,f-e+a(b).outerHeight())}},_syncItems:function(b){this._visibleItems=new Array;var c=this;a.each(b,function(){var b=a(this);if("none"!=b.css("display")){var d=b.outerHeight();if(b.height()>0){var e=parseInt(b.offset().top);c._visibleItems[c._visibleItems.length]={element:this,top:e,height:d,bottom:e+d}}}})},hitTest:function(b,c){var d=this,e=null,f=this.host.find(".jqx-item");if(this._syncItems(f),d._visibleItems){var g=parseInt(d.host.offset().left),h=d.host.outerWidth();a.each(d._visibleItems,function(f){if(b>=g&&b0&&(e=d.getItem(i[0]),null!=e))return e.height=this.height,e.top=this.top,!1}})}return e},addBefore:function(a,b,c){return this.addBeforeAfter(a,b,!0,c)},addAfter:function(a,b,c){return this.addBeforeAfter(a,b,!1,c)},addBeforeAfter:function(b,c,d,e){var f=this,g=new Array;c&&void 0!=c.treeInstance&&(c=c.element),a.isArray(b)?g=b:g[0]=b;var h="",i=this;a.each(g,function(){h+=i._parseItem(this)});var j=a(h);if(f.element.innerHTML.indexOf("UL"))var k=f.host.find("ul:first");void 0==c&&null==c?k.append(j):d?a(c).before(j):a(c).after(j);for(var l=j,m=0;m0)for(var o=0;o"),a(c).append(ulElement),k=c.find("ul:first");var l=e.itemMapping["id"+c[0].id].item;l.subtreeElement=k[0],l.hasItems=!0,k.addClass(e.toThemeProperty("jqx-tree-dropdown")),h.rtl&&k.addClass(e.toThemeProperty("jqx-tree-dropdown-rtl")),k.append(i);var m=k.find("li:first");l.parentElement=m}else k.append(i)}for(var n=i,o=0;o0)for(var q=0;q0&&(g+=20),a(d.titleElement).css("max-width",g+"px"),this._measureItem.remove()}}if(c.icon)if(a(d.element).children(".itemicon").length>0)a(d.element).find(".itemicon")[0].src=c.icon;else{var h=c.iconsize;h||(h=16);var i=a('');a(d.titleElement).prepend(i),i.css("margin-right","4px"),this.rtl&&(i.css("margin-right","0px"),i.css("margin-left","4px"),i.css("float","right"))}return c.expanded&&this.expandItem(d),c.disabled&&this.disableItem(d),c.selected&&this.selectItem(d),!0}return!1},removeItem:function(b,c){if(void 0!=b&&null!=b){void 0!=b.treeInstance&&(b=b.element);var d=this,e=(b.id,-1),f=this.getItem(b);if(f&&(e=this.items.indexOf(f),e!=-1&&function b(c){var d=-1;d=this.items.indexOf(c),d!=-1&&this.items.splice(d,1);var e=a(c.element).find("li"),f=e.length,g=this,h=new Array;if(f>0){a.each(e,function(a){var b=g.itemMapping["id"+this.id].item;h.push(b)});for(var i=0;i0&&a(b).remove(),0==c)return void this._raiseEvent("5");d._updateItemsNavigation(),d.allowDrag&&d._enableDragDrop?d._render(!0,!1):d._render(),null!=d.selectedItem&&d.selectedItem.element==b&&(a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-fill-state-pressed")),a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-tree-item-selected")),d.selectedItem=null),this._raiseEvent("5"),d.checkboxes&&d._updateCheckLayout(null)}},clear:function(){this.items=new Array,this.itemMapping=new Array;var a=this.host.find("ul:first");a.length>0&&(a[0].innerHTML=""),this.selectedItem=null},disableItem:function(b){if(null==b)return!1;void 0!=b.treeInstance&&(b=b.element);var c=this;a.each(c.items,function(){var d=this;if(d.element==b)return d.disabled=!0,a(d.titleElement).addClass(c.toThemeProperty("jqx-fill-state-disabled")),a(d.titleElement).addClass(c.toThemeProperty("jqx-tree-item-disabled")),c.checkboxes&&d.checkBoxElement&&a(d.checkBoxElement).jqxCheckBox({disabled:!0}),!1})},_updateInputSelection:function(){if(this.input){if(null==this.selectedItem)this.input.val("");else{var a=this.selectItem.value;null==a&&(a=this.selectedItem.label),this.input.val(a)}if(this.checkboxes){var b=this.getCheckedItems();if(this.submitCheckedItems){for(var c="",d=0;d0){var c=this.getItem(b[0]);this.selectItem(c)}}else{var c=this.getItem(a);this.selectItem(c)}},getActiveDescendant:function(){return this.selectedItem?this.selectedItem.element.id:""},clearSelection:function(){this.selectItem(null)},selectItem:function(b,c){if(!this.disabled){var d=this;if(b&&void 0!=b.treeInstance&&(b=b.element),null==b||void 0==b)return void(null!=d.selectedItem&&(a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-fill-state-pressed")),a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-tree-item-selected")),d.selectedItem=null));if(null==this.selectedItem||this.selectedItem.element!=b){var e=null!=this.selectedItem?this.selectedItem.element:null;e&&a(e).removeAttr("aria-selected"),a.each(d.items,function(){var c=this;this.selected=!1,c.disabled||c.element==b&&(null==d.selectedItem||null!=d.selectedItem&&d.selectedItem.titleElement!=c.titleElement)&&(null!=d.selectedItem&&(a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-fill-state-pressed")),a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-tree-item-selected"))),a(c.titleElement).addClass(d.toThemeProperty("jqx-fill-state-pressed")),a(c.titleElement).addClass(d.toThemeProperty("jqx-tree-item-selected")),d.selectedItem=c,this.selected=!0,a(c.element).attr("aria-selected","true"),a.jqx.aria(d,"aria-activedescendant",c.element.id))}),this._updateInputSelection(),c||(c=null),this._raiseEvent("2",{element:b,prevElement:e,type:c})}}},collapseAll:function(){this.isUpdating=!0;var b=this,c=b.items,d=this.animationHideDuration;this.animationHideDuration=0,a.each(c,function(){var a=this;1==a.isExpanded&&b._collapseItem(b,a)}),setTimeout(function(){b.isUpdating=!1,b._calculateWidth()},this.animationHideDuration),this.animationHideDuration=d},expandAll:function(){var b=this;this.isUpdating=!0;var c=this.animationShowDuration;this.animationShowDuration=0,a.each(this.items,function(){var a=this;a.hasItems&&b._expandItem(b,a)}),setTimeout(function(){b.isUpdating=!1,b._calculateWidth()},this.animationShowDuration),this.animationShowDuration=c},collapseItem:function(b){if(null==b)return!1;void 0!=b.treeInstance&&(b=b.element);var c=this;return a.each(this.items,function(){var a=this;if(1==a.isExpanded&&a.element==b)return c._collapseItem(c,a),!1}),!0},expandItem:function(b){if(null==b)return!1;void 0!=b.treeInstance&&(b=b.element);var c=this;return a.each(c.items,function(){var a=this;0!=a.isExpanded||a.element!=b||a.disabled||a.locked||(c._expandItem(c,a),a.parentElement&&c.expandItem(a.parentElement))}),!0},_getClosedSubtreeOffset:function(b){var c=a(b.subtreeElement),d=-c.outerHeight(),e=-c.outerWidth();return e=0,{left:e,top:d}},_collapseItem:function(b,c,d,e){if(null==b||null==c)return!1;if(c.disabled)return!1;if(b.disabled)return!1;if(b.locked)return!1;var f=a(c.subtreeElement),g=this._getClosedSubtreeOffset(c);g.top,g.left;$treeElement=a(c.element);var h=b.animationHideDelay;h=0,null!=f.data("timer").show&&(clearTimeout(f.data("timer").show),f.data("timer").show=null);var i=function(){if(c.isExpanded=!1,b.checkboxes){var d=f.find(".chkbox");d.stop(),d.css("opacity",1),f.find(".chkbox").animate({opacity:0},50)}var e=a(c.arrow);b._arrowStyle(e,"",c.isExpanded),f.slideUp(b.animationHideDuration,function(){c.isCollapsing=!1,b._calculateWidth();var d=a(c.arrow);b._arrowStyle(d,"",c.isExpanded),f.hide(),b._raiseEvent("1",{element:c.element})})};h>0?f.data("timer").hide=setTimeout(function(){i()},h):i()},_expandItem:function(b,c){if(null==b||null==c)return!1;if(c.isExpanded)return!1;if(c.locked)return!1;if(c.disabled)return!1;if(b.disabled)return!1;var d=a(c.subtreeElement);null!=d.data("timer")&&null!=d.data("timer").hide&&clearTimeout(d.data("timer").hide);var e=(a(c.element),0);if(parseInt(d.css("top"))==e)return void(c.isExpanded=!0);var f=a(c.arrow);if(b._arrowStyle(f,"",c.isExpanded),b.checkboxes){var g=d.find(".chkbox");g.stop(),g.css("opacity",0),g.animate({opacity:1},b.animationShowDuration)}if(d.slideDown(b.animationShowDuration,b.easing,function(){var d=a(c.arrow);c.isExpanded=!0,b._arrowStyle(d,"",c.isExpanded),c.isExpanding=!1,b._raiseEvent("0",{element:c.element}),b._calculateWidth()}),b.checkboxes&&(b._updateCheckItemLayout(c),c.subtreeElement)){var h=a(c.subtreeElement).find("li");a.each(h,function(){var a=b.getItem(this);null!=a&&b._updateCheckItemLayout(a)})}},_calculateWidth:function(){var b=this,c=this.checkboxes?20:0,d=0;if(!this.isUpdating){if(a.each(this.items,function(){var b=a(this.element).height();if(0!=b){var e=a(this.titleElement).outerWidth()+10+c+20*(1+this.level);if(d=Math.max(d,e),this.hasItems){var f=parseInt(a(this.titleElement).css("padding-top"));isNaN(f)&&(f=0),f*=2,f+=2;var g=(f+a(this.titleElement).height())/2-8.5;a.jqx.browser.msie&&a.jqx.browser.version<9?a(this.arrow).css("margin-top","3px"):parseInt(g)>=0&&a(this.arrow).css("margin-top",parseInt(g)+"px")}}}),this.toggleIndicatorSize>16&&(d=d+this.toggleIndicatorSize-16),b.panel)if(d>this.host.width()){var e=d-this.host.width(),f="hidden"!==b.panel.jqxPanel("vScrollBar").css("visibility")?10:0;e+=f,b.panel.jqxPanel({horizontalScrollBarMax:e})}else b.panel.jqxPanel({horizontalScrollBarMax:0});this.host.find("ul:first").width(d);var g=this.host.width()-30;g>0&&this.host.find("ul:first").css("min-width",g),b.panel&&b.panel.jqxPanel("_arrange")}},_arrowStyle:function(a,b,c){var d=this;if(a.length>0){a.removeClass();var e="";"hover"==b&&(e="-"+b);var f=c?"-expand":"-collapse",g="jqx-tree-item-arrow"+f+e;if(a.addClass(d.toThemeProperty(g)),!this.rtl){var f=c?"-down":"-right";a.addClass(d.toThemeProperty("jqx-icon-arrow"+f))}if(this.rtl){a.addClass(d.toThemeProperty(g+"-rtl"));var f=c?"-down":"-left";a.addClass(d.toThemeProperty("jqx-icon-arrow"+f))}}},_initialize:function(b,c){var d=this;this.host.addClass(d.toThemeProperty("jqx-widget")),this.host.addClass(d.toThemeProperty("jqx-widget-content")),this.host.addClass(d.toThemeProperty("jqx-tree")),this._updateDisabledState();var e=a.jqx.browser.msie&&a.jqx.browser.version<8;a.each(this.items,function(){var b=this;$element=a(b.element);var c=null;if(d.checkboxes&&!b.hasItems&&b.checkBoxElement&&a(b.checkBoxElement).css("margin-left","0px"),e)!b.hasItems&&a(b.element).find("ul").length>0&&a(b.element).find("ul").remove();else{if(!b.hasItems){d.rtl?b.element.style.marginRight=parseInt(d.toggleIndicatorSize)+"px":b.element.style.marginLeft=parseInt(d.toggleIndicatorSize)+"px";var f=a(b.arrow);return f.length>0&&(f.remove(),b.arrow=null),!0}d.rtl?b.element.style.marginRight="0px":b.element.style.marginLeft="0px"}var f=a(b.arrow);f.length>0&&f.remove(),c=a(''),c.prependTo($element),d.rtl?c.css("float","right"):c.css("float","left"),c.css("clear","both"),c.width(d.toggleIndicatorSize),d._arrowStyle(c,"",b.isExpanded);var g=parseInt(a(this.titleElement).css("padding-top"));isNaN(g)&&(g=0),g*=2,g+=2;var h=(g+a(this.titleElement).height())/2-8.5;a.jqx.browser.msie&&a.jqx.browser.version<9?c.css("margin-top","3px"):parseInt(h)>=0&&c.css("margin-top",parseInt(h)+"px"),$element.addClass(d.toThemeProperty("jqx-disableselect")),c.addClass(d.toThemeProperty("jqx-disableselect"));var i="click",j=d.isTouchDevice();j&&(i=a.jqx.mobile.getTouchEventName("touchend")),d.addHandler(c,i,function(){return b.isExpanded?d._collapseItem(d,b):d._expandItem(d,b),!1}),d.addHandler(c,"selectstart",function(){return!1}),d.addHandler(c,"mouseup",function(){if(!j)return!1}),b.hasItems=a(b.element).find("li").length>0,b.arrow=c[0],b.hasItems||c.css("visibility","hidden"),$element.css("float","none")})},_getOffset:function(b){var c=a(window).scrollTop(),d=a(window).scrollLeft(),e=a.jqx.mobile.isSafariMobileBrowser(),f=a(b).offset(),g=f.top,h=f.left;return null!=e&&e?{left:h-d,top:g-c}:a(b).offset()},_renderHover:function(b,c,d){var e=this;if(!d){var f=a(c.titleElement);e.addHandler(f,"mouseenter",function(){c.disabled||!e.enableHover||e.disabled||(f.addClass(e.toThemeProperty("jqx-fill-state-hover")),f.addClass(e.toThemeProperty("jqx-tree-item-hover")))}),e.addHandler(f,"mouseleave",function(){c.disabled||!e.enableHover||e.disabled||(f.removeClass(e.toThemeProperty("jqx-fill-state-hover")),f.removeClass(e.toThemeProperty("jqx-tree-item-hover")))})}},_updateDisabledState:function(){this.disabled?this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled")):this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled"))},_addInput:function(){if(null==this.input){var b=this.host.attr("name");b&&this.host.attr("name",""),this.input=a(""),this.host.append(this.input),this.input.attr("name",b),this._updateInputSelection()}},render:function(){this._updateItemsNavigation(),this._render()},_render:function(b,c){if(a.jqx.browser.msie&&a.jqx.browser.version<8){var d=this;a.each(this.items,function(){var b=a(this.element),c=b.parent(),d=parseInt(this.titleElement.css("margin-left"))+this.titleElement[0].scrollWidth+13;b.css("min-width",d);var e=parseInt(c.css("min-width"));isNaN(e)&&(e=0);var f=b.css("min-width");e0)return this.panel.jqxPanel({touchMode:this.touchMode}),void this.panel.jqxPanel("refresh");this.host.find("ul:first").wrap('
    ');var f=this.host.find("div:first"),g="fixed";null!=this.height&&"auto"!=this.height||(g="verticalwrap"),null!=this.width&&"auto"!=this.width||(g="fixed"==g?"horizontalwrap":"wrap"),f.jqxPanel({rtl:this.rtl,theme:this.theme,width:"100%",height:"100%",touchMode:this.touchMode,sizeMode:g}),a.jqx.browser.msie&&a.jqx.browser.version<8&&f.jqxPanel("content").css("left","0px"),f.data({nestedWidget:!0}),(null==this.height||null!=this.height&&this.height.toString().indexOf("%")!=-1)&&this.isTouchDevice()&&(this.removeHandler(f,a.jqx.mobile.getTouchEventName("touchend")+".touchScroll touchcancel.touchScroll"),this.removeHandler(f,a.jqx.mobile.getTouchEventName("touchmove")+".touchScroll"),this.removeHandler(f,a.jqx.mobile.getTouchEventName("touchstart")+".touchScroll"));var h=a.data(f[0],"jqxPanel").instance;null!=h&&(this.vScrollInstance=h.vScrollInstance,this.hScrollInstance=h.hScrollInstance),this.panelInstance=h,a.jqx.browser.msie&&a.jqx.browser.version<8&&(this.host.attr("hideFocus",!0),this.host.find("div").attr("hideFocus",!0),this.host.find("ul").attr("hideFocus",!0)),f[0].className="",this.panel=f}this._raiseEvent("3",this)},focus:function(){try{this.host.focus()}catch(a){}},_updateItemEvents:function(b,c){var d=this.isTouchDevice();d&&(this.toggleMode=a.jqx.mobile.getTouchEventName("touchend"));var e=a(c.element);b.enableRoundedCorners&&e.addClass(b.toThemeProperty("jqx-rc-all"));var f=d?a.jqx.mobile.getTouchEventName("touchend"):"mousedown";b.touchMode===!0&&b.removeHandler(a(c.checkBoxElement),"mousedown"),b.removeHandler(a(c.checkBoxElement),f),b.addHandler(a(c.checkBoxElement),f,function(a){return b.disabled||this.treeItem.disabled||(this.treeItem.checked=!this.treeItem.checked,b.checkItem(this.treeItem.element,this.treeItem.checked,"tree"), +b.hasThreeStates&&b.checkItems(this.treeItem,this.treeItem)),!1});var g=a(c.titleElement);b.removeHandler(e);var h=this.allowDrag&&this._enableDragDrop;h?(b.removeHandler(g,"mousedown.item"),b.removeHandler(g,"click"),b.removeHandler(g,"dblclick"),b.removeHandler(g,"mouseenter"),b.removeHandler(g,"mouseleave")):b.removeHandler(g),b._renderHover(e,c,d);var i=a(c.subtreeElement);if(i.length>0){var j=c.isExpanded?"block":"none";i.css({overflow:"hidden",display:j}),i.data("timer",{})}b.addHandler(g,"selectstart",function(a){return!1}),a.jqx.browser.opera&&b.addHandler(g,"mousedown.item",function(a){return!1}),"click"!=b.toggleMode&&b.addHandler(g,"click",function(a){b.selectItem(c.element,"mouse"),null!=b.panel&&b.panel.jqxPanel({focused:!0}),g.focus(),b._raiseEvent("9",{element:c.element})}),b.addHandler(g,b.toggleMode,function(a){if(i.length>0&&clearTimeout(i.data("timer").hide),null!=b.panel&&b.panel.jqxPanel({focused:!0}),b.selectItem(c.element,"mouse"),void 0==c.isExpanding&&(c.isExpanding=!1),void 0==c.isCollapsing&&(c.isCollapsing=!1),i.length>0)return c.isExpanded?0==c.isCollapsing&&(c.isCollapsing=!0,b._collapseItem(b,c,!0)):0==c.isExpanding&&(c.isExpanding=!0,b._expandItem(b,c)),!1})},isTouchDevice:function(){if(void 0!=this._isTouchDevice)return this._isTouchDevice;var b=a.jqx.mobile.isTouchDevice();return 1==this.touchMode?b=!0:0==this.touchMode&&(b=!1),this._isTouchDevice=b,b},createID:function(){return a.jqx.utilities.createId()},createTree:function(b){if(null!=b){var c=this,d=a(b).find("li");this.items=new Array,this.itemMapping=new Array,a(b).addClass(c.toThemeProperty("jqx-tree-dropdown-root")),this.rtl&&a(b).addClass(c.toThemeProperty("jqx-tree-dropdown-root-rtl")),(this.rtl||a.jqx.browser.msie&&a.jqx.browser.version<8)&&(this._measureItem=a(""),this._measureItem.addClass(this.toThemeProperty("jqx-widget")),this._measureItem.addClass(this.toThemeProperty("jqx-fill-state-normal")),this._measureItem.addClass(this.toThemeProperty("jqx-tree-item")),this._measureItem.addClass(this.toThemeProperty("jqx-item")),a(document.body).append(this._measureItem)),a.jqx.browser.msie&&a.jqx.browser.version<8;for(var e=0;e0&&a.each(g,function(a){var b=c.itemMapping["id"+this.id].item,d=b.element.getAttribute("item-checked");void 0!=d&&null!=d&&"true"!=d&&1!=d||c.checkItem(b.element,!0,"tree")}),a.each(g,function(a){var b=c.itemMapping["id"+this.id].item;0!=b.checked&&(null==b.checked&&(e=!0),d++)}),f>0&&(d==f?this.checkItem(b.element,!0,"tree"):d>0?this.checkItem(b.element,null,"tree"):this.checkItem(b.element,!1,"tree"))}},_updateItemsNavigation:function(){for(var b=this.host.find("ul:first"),c=a(b).find("li"),d=0;d0&&this.itemMapping["id"+c[d-1].id]&&(f.prevItem=this.itemMapping["id"+c[d-1].id].item),d0&&d._arrowStyle(g,"",e.isExpanded),e.checkBoxElement&&a(e.checkBoxElement).jqxCheckBox({theme:c}),d.enableRoundedCorners&&(f.removeClass("jqx-rc-all-"+b),f.addClass(d.toThemeProperty("jqx-rc-all")))}),this.host.jqxPanel&&this.panel.jqxPanel({theme:c})},_refreshMapping:function(b,c){for(var d=this.host.find("li"),e=new Array,f=new Array,g=a.data(document.body,"treeItemsStorage"),h=this,i=0;i0,null!=l&&(e[i]={element:j,item:l},e["id"+j.id]=e[i])}}this.itemMapping=e,this.items=f},_createItem:function(b){if(null!=b&&void 0!=b){var c=b.id;c||(c=this.createID());var d=b,e=a(b);d.id=c;var f=a.data(document.body,"treeItemsStorage");void 0==f&&(f=new Array);var g=this.items.length;this.items[g]=new a.jqx._jqxTree.jqxTreeItem,this.treeElements[c]=this.items[g],f[d.id]=this.items[g],a.data(document.body,"treeItemsStorage",f),g=this.items.length;var h=0,i=this,j=null;e.attr("role","treeitem"),e.children().each(function(){if("ul"==this.tagName||"UL"==this.tagName)return i.items[g-1].subtreeElement=this,a(this).addClass(i.toThemeProperty("jqx-tree-dropdown")),i.rtl&&(a(this).addClass(i.toThemeProperty("jqx-tree-dropdown-rtl")),a(this).css("clear","both")),!1}),e.parents().each(function(){if("li"==this.tagName||"LI"==this.tagName)return h=this.id,j=this,!1});var k=b.getAttribute("item-expanded");k=null!=k&&void 0!=k&&("true"==k||1==k),d.removeAttribute("item-expanded");var l=b.getAttribute("item-locked");l=null!=l&&void 0!=l&&("true"==l||1==l),d.removeAttribute("item-locked");var m=b.getAttribute("item-selected");m=null!=m&&void 0!=m&&("true"==m||1==m),d.removeAttribute("item-selected");var n=b.getAttribute("item-disabled");n=null!=n&&void 0!=n&&("true"==n||1==n),d.removeAttribute("item-disabled");var o=b.getAttribute("item-checked");o=null!=o&&void 0!=o&&("true"==o||1==o);var p=b.getAttribute("item-title");(null==p||void 0==p||"true"!=p&&1!=p)&&(p=!1),d.removeAttribute("item-title");var q=b.getAttribute("item-icon"),r=b.getAttribute("item-iconsize"),s=b.getAttribute("item-label"),t=b.getAttribute("item-value");d.removeAttribute("item-icon"),d.removeAttribute("item-iconsize"),d.removeAttribute("item-label"),d.removeAttribute("item-value");var u=this.items[g-1];u.id=c,void 0==u.value&&(this._valueList&&this._valueList[c]?u.value=this._valueList[c]:u.value=t),u.icon=q,u.iconsize=r,u.parentId=h,u.disabled=n,u.parentElement=j,u.element=b,u.locked=l,u.selected=m,u.checked=o,u.isExpanded=k,u.treeInstance=this,this.itemMapping[g-1]={element:d,item:u},this.itemMapping["id"+d.id]=this.itemMapping[g-1];var v=!1,w=!1;if(v=!1,this.rtl&&(a(u.element).css("float","right"),a(u.element).css("clear","both")),!v||!w)if(a(d.firstChild).length>0){if(u.icon){var r=u.iconsize;r||(r=16);var q=a('');a(d).prepend(q),q.css("margin-right","4px"),this.rtl&&(q.css("margin-right","0px"),q.css("margin-left","4px"),q.css("float","right"))}var x=d.innerHTML.indexOf("'+d.innerHTML+"",u.titleElement=a(a(d)[0].firstChild);else{var y=d.innerHTML.substring(0,x);y=a.trim(y),u.originalTitle=y,y=a('
    '+y+"
    ");var z=a(d).find("ul:first");z.remove(),d.innerHTML="",a(d).prepend(y),a(d).append(z),u.titleElement=y,this.rtl&&(y.css("float","right"),z.css("padding-right","10px"))}if(a.jqx.browser.msie&&a.jqx.browser.version<8){a(a(d)[0].firstChild).css("display","inline-block");var A=!1;0==this._measureItem.parents().length&&(a(document.body).append(this._measureItem),A=!0),this._measureItem.css("min-width","20px"),this._measureItem[0].innerHTML=a(u.titleElement).text();var B=this._measureItem.width();u.icon&&(B+=20),a(a(item.titleElement).find("img")).length>0&&(B+=20),a(a(d)[0].firstChild).css("max-width",B+"px"),A&&this._measureItem.remove()}}else u.originalTitle="Item",a(d).append(a("Item")),a(d.firstChild).wrap(""),u.titleElement=a(d)[0].firstChild,a.jqx.browser.msie&&a.jqx.browser.version<8&&a(d.firstChild).css("display","inline-block");var C=a(u.titleElement),D=this.toThemeProperty("jqx-rc-all");if(this.allowDrag&&C.addClass("draggable"),null==s||void 0==s?(s=u.titleElement,u.label=a.trim(C.text())):u.label=s,a(d).addClass(this.toThemeProperty("jqx-tree-item-li")),this.rtl&&a(d).addClass(this.toThemeProperty("jqx-tree-item-li-rtl")),D+=" "+this.toThemeProperty("jqx-tree-item")+" "+this.toThemeProperty("jqx-item"),this.rtl&&(D+=" "+this.toThemeProperty("jqx-tree-item-rtl")),C[0].className=C[0].className+" "+D,u.level=a(b).parents("li").length,u.hasItems=a(b).find("li").length>0,this.rtl&&u.parentElement&&!this.checkboxes,this.checkboxes){if(!this.host.jqxCheckBox)throw new Error("jqxTree: Missing reference to jqxcheckbox.js.");var E=a('
    ');if(E.width(parseInt(this.checkSize)),E.height(parseInt(this.checkSize)),a(d).prepend(E),this.rtl&&(E.css("float","right"),E.css("position","static")),E.jqxCheckBox({hasInput:!1,checked:u.checked,boxSize:this.checkSize,animationShowDelay:0,animationHideDelay:0,disabled:n,theme:this.theme}),this.rtl){var F=5;u.parentElement?E.css("margin-right",F+5+"px"):E.css("margin-right",F+"px")}else C.css("margin-left",parseInt(this.checkSize)+6);u.checkBoxElement=E[0],E[0].treeItem=u;var G=C.outerHeight()/2-1-parseInt(this.checkSize)/2;E.css("margin-top",G),a.jqx.browser.msie&&a.jqx.browser.version<8?(C.css("width","1%"),C.css("margin-left",parseInt(this.checkSize)+25)):u.hasItems&&(this.rtl||E.css("margin-left",this.toggleIndicatorSize))}else a.jqx.browser.msie&&a.jqx.browser.version<8&&C.css("width","1%");n&&this.disableItem(u.element),m&&this.selectItem(u.element),a.jqx.browser.msie&&a.jqx.browser.version<8&&(a(d).css("margin","0px"),a(d).css("padding","0px"))}},destroy:function(){this.removeHandler(a(window),"resize.jqxtree"+this.element.id),this.host.removeClass(),this.isTouchDevice()&&(this.removeHandler(this.panel,a.jqx.mobile.getTouchEventName("touchend")+".touchScroll touchcancel.touchScroll"),this.removeHandler(this.panel,a.jqx.mobile.getTouchEventName("touchmove")+".touchScroll"),this.removeHandler(this.panel,a.jqx.mobile.getTouchEventName("touchstart")+".touchScroll"));var b=this,c=this.isTouchDevice();a.each(this.items,function(){var d=this,e=a(this.element),f=c?a.jqx.mobile.getTouchEventName("touchend"):"click";b.removeHandler(a(d.checkBoxElement),f);var g=a(d.titleElement);b.removeHandler(e);var h=b.allowDrag&&b._enableDragDrop;h?(b.removeHandler(g,"mousedown.item"),b.removeHandler(g,"click"),b.removeHandler(g,"dblclick"),b.removeHandler(g,"mouseenter"),b.removeHandler(g,"mouseleave")):b.removeHandler(g),$arrowSpan=a(d.arrow),$arrowSpan.length>0&&(b.removeHandler($arrowSpan,f),b.removeHandler($arrowSpan,"selectstart"),b.removeHandler($arrowSpan,"mouseup"),c||(b.removeHandler($arrowSpan,"mouseenter"),b.removeHandler($arrowSpan,"mouseleave")),b.removeHandler(g,"selectstart")),a.jqx.browser.opera&&b.removeHandler(g,"mousedown.item"),"click"!=b.toggleMode&&b.removeHandler(g,"click"),b.removeHandler(g,b.toggleMode)}),this.panel&&(this.panel.jqxPanel("destroy"),this.panel=null),this.host.remove()},_raiseEvent:function(b,c){void 0==c&&(c={owner:null});var d=this.events[b];args=c,args.owner=this;var e=new a.Event(d);e.owner=this,e.args=args;var f=this.host.trigger(e);return f},propertyChangedHandler:function(b,c,d,e){if(void 0!=this.isInitialized&&0!=this.isInitialized){if("submitCheckedItems"==c&&b._updateInputSelection(),"disabled"==c&&b._updateDisabledState(),"theme"==c&&b._applyTheme(d,e),"keyboardNavigation"==c&&(b.enableKeyboardNavigation=e),("width"==c||"height"==c)&&(b.refresh(),b._initialize(),b._calculateWidth(),b.host.jqxPanel)){var f="fixed";null!=this.height&&"auto"!=this.height||(f="verticalwrap"),null!=this.width&&"auto"!=this.width||(f="fixed"==f?"horizontalwrap":"wrap"),b.panel.jqxPanel({sizeMode:f})}if("touchMode"==c&&(b._isTouchDevice=null,e&&(b.enableHover=!1),b._render()),("source"==c||"checkboxes"==c)&&null!=this.source){var g=[];a.each(b.items,function(){this.isExpanded&&(g[g.length]={label:this.label,level:this.level})});var h=b.loadItems(b.source);b.host.jqxPanel?b.panel.jqxPanel("setcontent",h):b.element.innerHTML=h;var i=b.disabled,j=b.host.find("ul:first");j.length>0&&(b.createTree(j[0]),b._render());var k=b,l=k.animationShowDuration;k.animationShowDuration=0,b.disabled=!1,g.length>0&&a.each(b.items,function(){for(var a=0;a0){this.createTree(e[0]);this.createdTree=true}}if(this.source!=null){var d=this.loadItems(this.source);this.element.innerHTML=d;var e=this.host.find("ul:first");if(e.length>0){this.createTree(e[0]);this.createdTree=true}}this._itemslength=this.items.length;if(!this.createdTree){if(this.host.find("ul").length==0){this.host.append(a("
      "));var e=this.host.find("ul:first");if(e.length>0){this.createTree(e[0]);this.createdTree=true}this.createdTree=true}}if(this.createdTree==true){this._render();this._handleKeys()}this._updateCheckLayout()},checkItems:function(f,h){var e=this;if(f!=null){var d=0;var g=false;var b=0;var j=a(f.element).find("li");b=j.length;a.each(j,function(k){var l=e.itemMapping["id"+this.id].item;if(l.checked!=false){if(l.checked==null){g=true}d++}});if(f!=h){if(d==b){this.checkItem(f.element,true,"tree")}else{if(d>0){this.checkItem(f.element,null,"tree")}else{this.checkItem(f.element,false,"tree")}}}else{var c=h.checked;var j=a(h.element).find("li");a.each(j,function(){var k=e.itemMapping["id"+this.id].item;e.checkItem(this,c,"tree")})}this.checkItems(this._parentItem(f),h)}else{var c=h.checked;var j=a(h.element).find("li");a.each(j,function(){var k=e.itemMapping["id"+this.id].item;e.checkItem(this,c,"tree")})}},_getMatches:function(e,f){if(e==undefined||e.length==0){return -1}var c=this.items;var b=new Array();for(var d=0;d=33&&s<=40))){var t=-1;if(!b._searchString){b._searchString=""}if((s==8||s==46)&&b._searchString.length>=1){b._searchString=b._searchString.substr(0,b._searchString.length-1)}var h=String.fromCharCode(s);var o=(!isNaN(parseInt(h)));var n=false;if((s>=65&&s<=97)||o||s==8||s==32||s==46){if(!d.shiftKey){h=h.toLocaleLowerCase()}if(s!=8&&s!=32&&s!=46){if(!(b._searchString.length>0&&b._searchString.substr(0,1)==h)){b._searchString+=h}}if(s==32){b._searchString+=" "}b._searchTime=new Date();var r=b.selectedItem;if(r){var g=r.id;var m=-1;for(var k=0;k0&&f[0].id==g)){var f=b._getMatches(b._searchString)}}else{var f=b._getMatches(b._searchString)}if(f.length>0){var r=b.selectedItem;if(b.selectedItem&&b.selectedItem.id!=f[0].id){b.clearSelection();b.selectItem(f[0].element,"keyboard")}b._lastSearchString=b._searchString}}if(b._searchTimer!=undefined){clearTimeout(b._searchTimer)}if(s==27||s==13){b._searchString="";b._lastSearchString=""}b._searchTimer=setTimeout(function(){b._searchString="";b._lastSearchString=""},500);if(t>=0){return}if(n){return false}}switch(s){case 32:if(b.checkboxes){b.fromKey=true;var q=a(b.selectedItem.checkBoxElement).jqxCheckBox("checked");b.checkItem(b.selectedItem.element,!q,"tree");if(b.hasThreeStates){b.checkItems(b.selectedItem,b.selectedItem)}return false}return true;case 33:var j=b._getItemsOnPage();var p=b.selectedItem;for(var k=0;k=0;i--){var b=e[i];d=this.itemMapping["id"+b.id].item;if(c._isVisible(d)){return d}}return null},_parentItem:function(d){if(d==null||d==undefined){return null}var c=d.parentElement;if(!c){return null}var b=null;a.each(this.items,function(){if(this.element==c){b=this;return false}});return b},_nextVisibleItem:function(c){if(c==null||c==undefined){return null}var b=c;while(b!=null){b=b.nextItem;if(this._isVisible(b)&&!b.disabled){return b}}return null},_prevVisibleItem:function(c){if(c==null||c==undefined){return null}var b=c;while(b!=null){b=b.prevItem;if(this._isVisible(b)&&!b.disabled){return b}}return null},_isVisible:function(c){if(c==null||c==undefined){return false}if(!this._isElementVisible(c.element)){return false}var b=this._parentItem(c);if(b==null){return true}if(b!=null){if(!this._isElementVisible(b.element)){return false}if(b.isExpanded){while(b!=null){b=this._parentItem(b);if(b!=null&&!this._isElementVisible(b.element)){return false}if(b!=null&&!b.isExpanded){return false}}}else{return false}}return true},_getItemsOnPage:function(){var d=0;var c=this.panel.jqxPanel("getVScrollPosition");var b=parseInt(this.host.height());var f=0;var e=this._firstItem();if(parseInt(a(e.element).height())>0){while(f<=b){f+=parseInt(a(e.element).outerHeight());d++}}return d},_isElementVisible:function(b){if(b==null){return false}if(a(b).css("display")!="none"&&a(b).css("visibility")!="hidden"){return true}return false},refresh:function(c){if(this.width!=null&&this.width.toString().indexOf("px")!=-1){this.host.width(this.width)}else{if(this.width!=undefined&&!isNaN(this.width)){this.host.width(this.width)}}if(this.height!=null&&this.height.toString().indexOf("px")!=-1){this.host.height(this.height)}else{if(this.height!=undefined&&!isNaN(this.height)){this.host.height(this.height)}}if(this.panel){if(this.width!=null&&this.width.toString().indexOf("%")!=-1){var b=this;this.panel.jqxPanel("width","100%");b.removeHandler(a(window),"resize.jqxtree"+b.element.id);b.addHandler(a(window),"resize.jqxtree"+b.element.id,function(){b._calculateWidth()})}else{this.panel.jqxPanel("width",this.host.width())}this.panel.jqxPanel("_arrange")}this._calculateWidth();if(a.jqx.isHidden(this.host)){var b=this;if(this._hiddenTimer){clearInterval(this._hiddenTimer)}this._hiddenTimer=setInterval(function(){if(!a.jqx.isHidden(b.host)){clearInterval(b._hiddenTimer);b._calculateWidth()}},100)}if(c!=true){if(this.checkboxes){this._updateCheckLayout(null)}}},resize:function(c,b){this.width=c;this.height=b;this.refresh()},loadItems:function(c){if(c==null){return}var b=this;this.items=new Array();var d="
        ";a.map(c,function(e){if(e==undefined){return null}d+=b._parseItem(e)});d+="
      ";return d},_parseItem:function(n){var g="";if(n==undefined){return null}var k=n.label;var m=n.value;if(!n.label&&n.html){k=n.html}if(this.displayMember!=undefined&&this.displayMember!=""){k=n[this.displayMember]}if(this.valueMember!=undefined&&this.valueMember!=""){m=n[this.valueMember]}if(!k){k="Item"}if(typeof n==="string"){k=n}var h=false;if(n.expanded!=undefined&&n.expanded){h=true}var f=false;if(n.locked!=undefined&&n.locked){f=true}var d=false;if(n.selected!=undefined&&n.selected){d=true}var e=false;if(n.disabled!=undefined&&n.disabled){e=true}var l=false;if(n.checked!=undefined&&n.checked){l=true}var j=n.icon;var c=n.iconsize;g+="";return g},ensureVisible:function(d){if(d==null||d==undefined){return}if(this.panel){var c=this.panel.jqxPanel("getVScrollPosition");var e=this.panel.jqxPanel("getHScrollPosition");var b=parseInt(this.host.height());var f=a(d).position().top;if(f<=c||f>=b+c){this.panel.jqxPanel("scrollTo",e,f-b+a(d).outerHeight())}}},_syncItems:function(c){this._visibleItems=new Array();var b=this;a.each(c,function(){var e=a(this);if(e.css("display")!="none"){var d=e.outerHeight();if(e.height()>0){var f=parseInt(e.offset().top);b._visibleItems[b._visibleItems.length]={element:this,top:f,height:d,bottom:f+d}}}})},hitTest:function(h,g){var d=this;var b=this;var f=null;var e=this.host.find(".jqx-item");this._syncItems(e);if(b._visibleItems){var c=parseInt(b.host.offset().left);var j=b.host.outerWidth();a.each(b._visibleItems,function(l){if(h>=c&&h0){f=b.getItem(k[0]);if(f!=null){f.height=this.height;f.top=this.top;return false}}}}})}return f},addBefore:function(b,d,c){return this.addBeforeAfter(b,d,true,c)},addAfter:function(b,d,c){return this.addBeforeAfter(b,d,false,c)},addBeforeAfter:function(o,r,q,n){var l=this;var m=new Array();if(r&&r.treeInstance!=undefined){r=r.element}if(!a.isArray(o)){m[0]=o}else{m=o}var g="";var p=this;a.each(m,function(){g+=p._parseItem(this)});var b=a(g);if(l.element.innerHTML.indexOf("UL")){var h=l.host.find("ul:first")}if(r==undefined&&r==null){h.append(b)}else{if(q){a(r).before(b)}else{a(r).after(b)}}var d=b;for(var k=0;k0){for(var f=0;f");a(s).append(ulElement);e=s.find("ul:first");var t=n.itemMapping["id"+s[0].id].item;t.subtreeElement=e[0];t.hasItems=true;e.addClass(n.toThemeProperty("jqx-tree-dropdown"));if(r.rtl){e.addClass(n.toThemeProperty("jqx-tree-dropdown-rtl"))}e.append(b);var h=e.find("li:first");t.parentElement=h}else{e.append(b)}}var d=b;for(var m=0;m0){for(var g=0;g0){g+=20}a(h.titleElement).css("max-width",g+"px");this._measureItem.remove()}}if(j.icon){if(a(h.element).children(".itemicon").length>0){a(h.element).find(".itemicon")[0].src=j.icon}else{var c=j.iconsize;if(!c){c=16}var f=a('');a(h.titleElement).prepend(f);f.css("margin-right","4px");if(this.rtl){f.css("margin-right","0px");f.css("margin-left","4px");f.css("float","right")}}}if(j.expanded){this.expandItem(h)}if(j.disabled){this.disableItem(h)}if(j.selected){this.selectItem(h)}return true}return false},removeItem:function(b,d){if(b==undefined||b==null){return}if(b.treeInstance!=undefined){b=b.element}var e=this;var h=b.id;var c=-1;var f=this.getItem(b);if(f){c=this.items.indexOf(f);if(c!=-1){(function g(p){var n=-1;n=this.items.indexOf(p);if(n!=-1){this.items.splice(n,1)}var k=a(p.element).find("li");var j=k.length;var o=this;var l=new Array();if(j>0){a.each(k,function(q){var r=o.itemMapping["id"+this.id].item;l.push(r)});for(var m=0;m0){a(b).remove()}if(d==false){this._raiseEvent("5");return}e._updateItemsNavigation();if(e.allowDrag&&e._enableDragDrop){e._render(true,false)}else{e._render()}if(e.selectedItem!=null){if(e.selectedItem.element==b){a(e.selectedItem.titleElement).removeClass(e.toThemeProperty("jqx-fill-state-pressed"));a(e.selectedItem.titleElement).removeClass(e.toThemeProperty("jqx-tree-item-selected"));e.selectedItem=null}}this._raiseEvent("5");if(e.checkboxes){e._updateCheckLayout(null)}},clear:function(){this.items=new Array();this.itemMapping=new Array();var b=this.host.find("ul:first");if(b.length>0){b[0].innerHTML=""}this.selectedItem=null},disableItem:function(b){if(b==null){return false}if(b.treeInstance!=undefined){b=b.element}var c=this;a.each(c.items,function(){var d=this;if(d.element==b){d.disabled=true;a(d.titleElement).addClass(c.toThemeProperty("jqx-fill-state-disabled"));a(d.titleElement).addClass(c.toThemeProperty("jqx-tree-item-disabled"));if(c.checkboxes&&d.checkBoxElement){a(d.checkBoxElement).jqxCheckBox({disabled:true})}return false}})},_updateInputSelection:function(){if(this.input){if(this.selectedItem==null){this.input.val("")}else{var c=this.selectItem.value;if(c==null){c=this.selectedItem.label}this.input.val(c)}if(this.checkboxes){var b=this.getCheckedItems();if(this.submitCheckedItems){var f="";for(var d=0;d0){var c=this.getItem(b[0]);this.selectItem(c)}}else{var c=this.getItem(d);this.selectItem(c)}},getActiveDescendant:function(){if(this.selectedItem){return this.selectedItem.element.id}return""},clearSelection:function(){this.selectItem(null)},selectItem:function(b,c){if(this.disabled){return}var d=this;if(b&&b.treeInstance!=undefined){b=b.element}if(b==null||b==undefined){if(d.selectedItem!=null){a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-fill-state-pressed"));a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-tree-item-selected"));d.selectedItem=null}return}if(this.selectedItem!=null&&this.selectedItem.element==b){return}var e=this.selectedItem!=null?this.selectedItem.element:null;if(e){a(e).removeAttr("aria-selected")}a.each(d.items,function(){var f=this;this.selected=false;if(!f.disabled){if(f.element==b){if(d.selectedItem==null||(d.selectedItem!=null&&d.selectedItem.titleElement!=f.titleElement)){if(d.selectedItem!=null){a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-fill-state-pressed"));a(d.selectedItem.titleElement).removeClass(d.toThemeProperty("jqx-tree-item-selected"))}a(f.titleElement).addClass(d.toThemeProperty("jqx-fill-state-pressed"));a(f.titleElement).addClass(d.toThemeProperty("jqx-tree-item-selected"));d.selectedItem=f;this.selected=true;a(f.element).attr("aria-selected","true");a.jqx.aria(d,"aria-activedescendant",f.element.id)}}}});this._updateInputSelection();if(!c){c=null}this._raiseEvent("2",{element:b,prevElement:e,type:c})},collapseAll:function(){this.isUpdating=true;var d=this;var b=d.items;var c=this.animationHideDuration;this.animationHideDuration=0;a.each(b,function(){var e=this;if(e.isExpanded==true){d._collapseItem(d,e)}});setTimeout(function(){d.isUpdating=false;d._calculateWidth()},this.animationHideDuration);this.animationHideDuration=c},expandAll:function(){var c=this;this.isUpdating=true;var b=this.animationShowDuration;this.animationShowDuration=0;a.each(this.items,function(){var d=this;if(d.hasItems){c._expandItem(c,d)}});setTimeout(function(){c.isUpdating=false;c._calculateWidth()},this.animationShowDuration);this.animationShowDuration=b},collapseItem:function(b){if(b==null){return false}if(b.treeInstance!=undefined){b=b.element}var c=this;a.each(this.items,function(){var d=this;if(d.isExpanded==true&&d.element==b){c._collapseItem(c,d);return false}});return true},expandItem:function(b){if(b==null){return false}if(b.treeInstance!=undefined){b=b.element}var c=this;a.each(c.items,function(){var d=this;if(d.isExpanded==false&&d.element==b&&!d.disabled&&!d.locked){c._expandItem(c,d);if(d.parentElement){c.expandItem(d.parentElement)}}});return true},_getClosedSubtreeOffset:function(c){var b=a(c.subtreeElement);var e=-b.outerHeight();var d=-b.outerWidth();d=0;return{left:d,top:e}},_collapseItem:function(g,k,d,b){if(g==null||k==null){return false}if(k.disabled){return false}if(g.disabled){return false}if(g.locked){return false}var e=a(k.subtreeElement);var l=this._getClosedSubtreeOffset(k);var h=l.top;var c=l.left;$treeElement=a(k.element);var f=g.animationHideDelay;f=0;if(e.data("timer").show!=null){clearTimeout(e.data("timer").show);e.data("timer").show=null}var j=function(){k.isExpanded=false;if(g.checkboxes){var n=e.find(".chkbox");n.stop();n.css("opacity",1);e.find(".chkbox").animate({opacity:0},50)}var m=a(k.arrow);g._arrowStyle(m,"",k.isExpanded);e.slideUp(g.animationHideDuration,function(){k.isCollapsing=false;g._calculateWidth();var o=a(k.arrow);g._arrowStyle(o,"",k.isExpanded);e.hide();g._raiseEvent("1",{element:k.element})})};if(f>0){e.data("timer").hide=setTimeout(function(){j()},f)}else{j()}},_expandItem:function(g,k){if(g==null||k==null){return false}if(k.isExpanded){return false}if(k.locked){return false}if(k.disabled){return false}if(g.disabled){return false}var e=a(k.subtreeElement);if((e.data("timer"))!=null&&e.data("timer").hide!=null){clearTimeout(e.data("timer").hide)}var j=a(k.element);var h=0;var d=0;if(parseInt(e.css("top"))==h){k.isExpanded=true;return}var c=a(k.arrow);g._arrowStyle(c,"",k.isExpanded);if(g.checkboxes){var f=e.find(".chkbox");f.stop();f.css("opacity",0);f.animate({opacity:1},g.animationShowDuration)}e.slideDown(g.animationShowDuration,g.easing,function(){var l=a(k.arrow);k.isExpanded=true;g._arrowStyle(l,"",k.isExpanded);k.isExpanding=false;g._raiseEvent("0",{element:k.element});g._calculateWidth()});if(g.checkboxes){g._updateCheckItemLayout(k);if(k.subtreeElement){var b=a(k.subtreeElement).find("li");a.each(b,function(){var l=g.getItem(this);if(l!=null){g._updateCheckItemLayout(l)}})}}},_calculateWidth:function(){var f=this;var g=this.checkboxes?20:0;var e=0;if(this.isUpdating){return}a.each(this.items,function(){var h=a(this.element).height();if(h!=0){var l=a(this.titleElement).outerWidth()+10+g+(1+this.level)*20;e=Math.max(e,l);if(this.hasItems){var j=parseInt(a(this.titleElement).css("padding-top"));if(isNaN(j)){j=0}j=j*2;j+=2;var k=(j+a(this.titleElement).height())/2-17/2;if(a.jqx.browser.msie&&a.jqx.browser.version<9){a(this.arrow).css("margin-top","3px")}else{if(parseInt(k)>=0){a(this.arrow).css("margin-top",parseInt(k)+"px")}}}}});if(this.toggleIndicatorSize>16){e=e+this.toggleIndicatorSize-16}if(f.panel){if(e>this.host.width()){var b=e-this.host.width();var d=f.panel.jqxPanel("vScrollBar").css("visibility")!=="hidden"?10:0;b+=d;f.panel.jqxPanel({horizontalScrollBarMax:b})}else{f.panel.jqxPanel({horizontalScrollBarMax:0})}}this.host.find("ul:first").width(e);var c=this.host.width()-30;if(c>0){this.host.find("ul:first").css("min-width",c)}if(f.panel){f.panel.jqxPanel("_arrange")}},_arrowStyle:function(c,h,b){var e=this;if(c.length>0){c.removeClass();var g="";if(h=="hover"){g="-"+h}var f=b?"-expand":"-collapse";var d="jqx-tree-item-arrow"+f+g;c.addClass(e.toThemeProperty(d));if(!this.rtl){var f=!b?"-right":"-down";c.addClass(e.toThemeProperty("jqx-icon-arrow"+f+""))}if(this.rtl){c.addClass(e.toThemeProperty(d+"-rtl"));var f=!b?"-left":"-down";c.addClass(e.toThemeProperty("jqx-icon-arrow"+f+""))}}},_initialize:function(f,c){var e=this;var d=0;this.host.addClass(e.toThemeProperty("jqx-widget"));this.host.addClass(e.toThemeProperty("jqx-widget-content"));this.host.addClass(e.toThemeProperty("jqx-tree"));this._updateDisabledState();var b=a.jqx.browser.msie&&a.jqx.browser.version<8;a.each(this.items,function(){var m=this;$element=a(m.element);var k=null;if(e.checkboxes&&!m.hasItems&&m.checkBoxElement){a(m.checkBoxElement).css("margin-left","0px")}if(!b){if(!m.hasItems){if(!e.rtl){m.element.style.marginLeft=parseInt(e.toggleIndicatorSize)+"px"}else{m.element.style.marginRight=parseInt(e.toggleIndicatorSize)+"px"}var j=a(m.arrow);if(j.length>0){j.remove();m.arrow=null}return true}else{if(!e.rtl){m.element.style.marginLeft="0px"}else{m.element.style.marginRight="0px"}}}else{if(!m.hasItems&&a(m.element).find("ul").length>0){a(m.element).find("ul").remove()}}var j=a(m.arrow);if(j.length>0){j.remove()}k=a('');k.prependTo($element);if(!e.rtl){k.css("float","left")}else{k.css("float","right")}k.css("clear","both");k.width(e.toggleIndicatorSize);e._arrowStyle(k,"",m.isExpanded);var l=parseInt(a(this.titleElement).css("padding-top"));if(isNaN(l)){l=0}l=l*2;l+=2;var n=(l+a(this.titleElement).height())/2-17/2;if(a.jqx.browser.msie&&a.jqx.browser.version<9){k.css("margin-top","3px")}else{if(parseInt(n)>=0){k.css("margin-top",parseInt(n)+"px")}}$element.addClass(e.toThemeProperty("jqx-disableselect"));k.addClass(e.toThemeProperty("jqx-disableselect"));var g="click";var h=e.isTouchDevice();if(h){g=a.jqx.mobile.getTouchEventName("touchend")}e.addHandler(k,g,function(){if(!m.isExpanded){e._expandItem(e,m)}else{e._collapseItem(e,m)}return false});e.addHandler(k,"selectstart",function(){return false});e.addHandler(k,"mouseup",function(){if(!h){return false}});m.hasItems=a(m.element).find("li").length>0;m.arrow=k[0];if(!m.hasItems){k.css("visibility","hidden")}$element.css("float","none")})},_getOffset:function(b){var f=a(window).scrollTop();var h=a(window).scrollLeft();var c=a.jqx.mobile.isSafariMobileBrowser();var g=a(b).offset();var e=g.top;var d=g.left;if(c!=null&&c){return{left:d-h,top:e-f}}else{return a(b).offset()}},_renderHover:function(c,e,b){var d=this;if(!b){var f=a(e.titleElement);d.addHandler(f,"mouseenter",function(){if(!e.disabled&&d.enableHover&&!d.disabled){f.addClass(d.toThemeProperty("jqx-fill-state-hover"));f.addClass(d.toThemeProperty("jqx-tree-item-hover"))}});d.addHandler(f,"mouseleave",function(){if(!e.disabled&&d.enableHover&&!d.disabled){f.removeClass(d.toThemeProperty("jqx-fill-state-hover"));f.removeClass(d.toThemeProperty("jqx-tree-item-hover"))}})}},_updateDisabledState:function(){if(this.disabled){this.host.addClass(this.toThemeProperty("jqx-fill-state-disabled"))}else{this.host.removeClass(this.toThemeProperty("jqx-fill-state-disabled"))}},_addInput:function(){if(this.input==null){var b=this.host.attr("name");if(b){this.host.attr("name","")}this.input=a("");this.host.append(this.input);this.input.attr("name",b);this._updateInputSelection()}},render:function(){this._updateItemsNavigation();this._render()},_render:function(f,j){if(a.jqx.browser.msie&&a.jqx.browser.version<8){var g=this;a.each(this.items,function(){var n=a(this.element);var p=n.parent();var m=parseInt(this.titleElement.css("margin-left"))+this.titleElement[0].scrollWidth+13;n.css("min-width",m);var o=parseInt(p.css("min-width"));if(isNaN(o)){o=0}var l=n.css("min-width");if(o0){this.panel.jqxPanel({touchMode:this.touchMode});this.panel.jqxPanel("refresh");return}this.host.find("ul:first").wrap('
      ');var b=this.host.find("div:first");var k="fixed";if(this.height==null||this.height=="auto"){k="verticalwrap"}if(this.width==null||this.width=="auto"){if(k=="fixed"){k="horizontalwrap"}else{k="wrap"}}b.jqxPanel({rtl:this.rtl,theme:this.theme,width:"100%",height:"100%",touchMode:this.touchMode,sizeMode:k});if(a.jqx.browser.msie&&a.jqx.browser.version<8){b.jqxPanel("content").css("left","0px")}b.data({nestedWidget:true});if(this.height==null||(this.height!=null&&this.height.toString().indexOf("%")!=-1)){if(this.isTouchDevice()){this.removeHandler(b,a.jqx.mobile.getTouchEventName("touchend")+".touchScroll touchcancel.touchScroll");this.removeHandler(b,a.jqx.mobile.getTouchEventName("touchmove")+".touchScroll");this.removeHandler(b,a.jqx.mobile.getTouchEventName("touchstart")+".touchScroll")}}var e=a.data(b[0],"jqxPanel").instance;if(e!=null){this.vScrollInstance=e.vScrollInstance;this.hScrollInstance=e.hScrollInstance}this.panelInstance=e;if(a.jqx.browser.msie&&a.jqx.browser.version<8){this.host.attr("hideFocus",true);this.host.find("div").attr("hideFocus",true);this.host.find("ul").attr("hideFocus",true)}b[0].className="";this.panel=b}this._raiseEvent("3",this)},focus:function(){try{this.host.focus()}catch(b){}},_updateItemEvents:function(h,k){var b=this.isTouchDevice();if(b){this.toggleMode=a.jqx.mobile.getTouchEventName("touchend")}var j=a(k.element);if(h.enableRoundedCorners){j.addClass(h.toThemeProperty("jqx-rc-all"))}var e=!b?"mousedown":a.jqx.mobile.getTouchEventName("touchend");if(h.touchMode===true){h.removeHandler(a(k.checkBoxElement),"mousedown")}h.removeHandler(a(k.checkBoxElement),e);h.addHandler(a(k.checkBoxElement),e,function(l){if(!h.disabled){if(!this.treeItem.disabled){this.treeItem.checked=!this.treeItem.checked;h.checkItem(this.treeItem.element,this.treeItem.checked,"tree");if(h.hasThreeStates){h.checkItems(this.treeItem,this.treeItem)}}}return false});var c=a(k.titleElement);h.removeHandler(j);var f=this.allowDrag&&this._enableDragDrop;if(!f){h.removeHandler(c)}else{h.removeHandler(c,"mousedown.item");h.removeHandler(c,"click");h.removeHandler(c,"dblclick");h.removeHandler(c,"mouseenter");h.removeHandler(c,"mouseleave")}h._renderHover(j,k,b);var d=a(k.subtreeElement);if(d.length>0){var g=k.isExpanded?"block":"none";d.css({overflow:"hidden",display:g});d.data("timer",{})}h.addHandler(c,"selectstart",function(l){return false});if(a.jqx.browser.opera){h.addHandler(c,"mousedown.item",function(l){return false})}if(h.toggleMode!="click"){h.addHandler(c,"click",function(l){h.selectItem(k.element,"mouse");if(h.panel!=null){h.panel.jqxPanel({focused:true})}c.focus();h._raiseEvent("9",{element:k.element})})}h.addHandler(c,h.toggleMode,function(l){if(d.length>0){clearTimeout(d.data("timer").hide)}if(h.panel!=null){h.panel.jqxPanel({focused:true})}h.selectItem(k.element,"mouse");if(k.isExpanding==undefined){k.isExpanding=false}if(k.isCollapsing==undefined){k.isCollapsing=false}if(d.length>0){if(!k.isExpanded){if(false==k.isExpanding){k.isExpanding=true;h._expandItem(h,k)}}else{if(false==k.isCollapsing){k.isCollapsing=true;h._collapseItem(h,k,true)}}return false}})},isTouchDevice:function(){if(this._isTouchDevice!=undefined){return this._isTouchDevice}var b=a.jqx.mobile.isTouchDevice();if(this.touchMode==true){b=true}else{if(this.touchMode==false){b=false}}this._isTouchDevice=b;return b},createID:function(){return a.jqx.utilities.createId()},createTree:function(b){if(b==null){return}var d=this;var f=a(b).find("li");var c=0;this.items=new Array();this.itemMapping=new Array();a(b).addClass(d.toThemeProperty("jqx-tree-dropdown-root"));if(this.rtl){a(b).addClass(d.toThemeProperty("jqx-tree-dropdown-root-rtl"))}if(this.rtl||a.jqx.browser.msie&&a.jqx.browser.version<8){this._measureItem=a("");this._measureItem.addClass(this.toThemeProperty("jqx-widget"));this._measureItem.addClass(this.toThemeProperty("jqx-fill-state-normal"));this._measureItem.addClass(this.toThemeProperty("jqx-tree-item"));this._measureItem.addClass(this.toThemeProperty("jqx-item"));a(document.body).append(this._measureItem)}if(a.jqx.browser.msie&&a.jqx.browser.version<8){}for(var e=0;e0){a.each(g,function(h){var k=d.itemMapping["id"+this.id].item;var j=k.element.getAttribute("item-checked");if(j==undefined||j==null||j=="true"||j==true){d.checkItem(k.element,true,"tree")}})}a.each(g,function(h){var j=d.itemMapping["id"+this.id].item;if(j.checked!=false){if(j.checked==null){f=true}c++}});if(b>0){if(c==b){this.checkItem(e.element,true,"tree")}else{if(c>0){this.checkItem(e.element,null,"tree")}else{this.checkItem(e.element,false,"tree")}}}},_updateItemsNavigation:function(){var g=this.host.find("ul:first");var f=a(g).find("li");var c=0;for(var d=0;d0){if(this.itemMapping["id"+f[d-1].id]){e.prevItem=this.itemMapping["id"+f[d-1].id].item}}if(d0){f._arrowStyle(j,"",l.isExpanded)}if(l.checkBoxElement){a(l.checkBoxElement).jqxCheckBox({theme:h})}if(f.enableRoundedCorners){k.removeClass("jqx-rc-all-"+e);k.addClass(f.toThemeProperty("jqx-rc-all"))}});if(this.host.jqxPanel){this.panel.jqxPanel({theme:h})}},_refreshMapping:function(f,q){var e=this.host.find("li");var b=new Array();var p=new Array();var h=a.data(document.body,"treeItemsStorage");var l=this;for(var j=0;j0;if(o!=null){b[j]={element:k,item:o};b["id"+k.id]=b[j]}}this.itemMapping=b;this.items=p},_createItem:function(c){if(c==null||c==undefined){return}var r=c.id;if(!r){r=this.createID()}var F=c;var m=a(c);F.id=r;var g=a.data(document.body,"treeItemsStorage");if(g==undefined){g=new Array()}var x=this.items.length;this.items[x]=new a.jqx._jqxTree.jqxTreeItem();this.treeElements[r]=this.items[x];g[F.id]=this.items[x];a.data(document.body,"treeItemsStorage",g);x=this.items.length;var A=0;var H=this;var e=null;m.attr("role","treeitem");m.children().each(function(){if(this.tagName=="ul"||this.tagName=="UL"){H.items[x-1].subtreeElement=this;a(this).addClass(H.toThemeProperty("jqx-tree-dropdown"));if(H.rtl){a(this).addClass(H.toThemeProperty("jqx-tree-dropdown-rtl"));a(this).css("clear","both")}return false}});m.parents().each(function(){if((this.tagName=="li"||this.tagName=="LI")){A=this.id;e=this;return false}});var w=c.getAttribute("item-expanded");if(w==null||w==undefined||(w!="true"&&w!=true)){w=false}else{w=true}F.removeAttribute("item-expanded");var G=c.getAttribute("item-locked");if(G==null||G==undefined||(G!="true"&&G!=true)){G=false}else{G=true}F.removeAttribute("item-locked");var s=c.getAttribute("item-selected");if(s==null||s==undefined||(s!="true"&&s!=true)){s=false}else{s=true}F.removeAttribute("item-selected");var d=c.getAttribute("item-disabled");if(d==null||d==undefined||(d!="true"&&d!=true)){d=false}else{d=true}F.removeAttribute("item-disabled");var j=c.getAttribute("item-checked");if(j==null||j==undefined||(j!="true"&&j!=true)){j=false}else{j=true}var I=c.getAttribute("item-title");if(I==null||I==undefined||(I!="true"&&I!=true)){I=false}F.removeAttribute("item-title");var D=c.getAttribute("item-icon");var t=c.getAttribute("item-iconsize");var l=c.getAttribute("item-label");var v=c.getAttribute("item-value");F.removeAttribute("item-icon");F.removeAttribute("item-iconsize");F.removeAttribute("item-label");F.removeAttribute("item-value");var C=this.items[x-1];C.id=r;if(C.value==undefined){if(this._valueList&&this._valueList[r]){C.value=this._valueList[r]}else{C.value=v}}C.icon=D;C.iconsize=t;C.parentId=A;C.disabled=d;C.parentElement=e;C.element=c;C.locked=G;C.selected=s;C.checked=j;C.isExpanded=w;C.treeInstance=this;this.itemMapping[x-1]={element:F,item:C};this.itemMapping["id"+F.id]=this.itemMapping[x-1];var h=false;var E=false;h=false;if(this.rtl){a(C.element).css("float","right");a(C.element).css("clear","both")}if(!h||!E){if(a(F.firstChild).length>0){if(C.icon){var t=C.iconsize;if(!t){t=16}var D=a('');a(F).prepend(D);D.css("margin-right","4px");if(this.rtl){D.css("margin-right","0px");D.css("margin-left","4px");D.css("float","right")}}var b=F.innerHTML.indexOf("'+F.innerHTML+"
      ";C.titleElement=a(a(F)[0].firstChild)}else{var B=F.innerHTML.substring(0,b);B=a.trim(B);C.originalTitle=B;B=a('
      '+B+"
      ");var o=a(F).find("ul:first");o.remove();F.innerHTML="";a(F).prepend(B);a(F).append(o);C.titleElement=B;if(this.rtl){B.css("float","right");o.css("padding-right","10px")}}if(a.jqx.browser.msie&&a.jqx.browser.version<8){a(a(F)[0].firstChild).css("display","inline-block");var n=false;if(this._measureItem.parents().length==0){a(document.body).append(this._measureItem);n=true}this._measureItem.css("min-width","20px");this._measureItem[0].innerHTML=(a(C.titleElement).text());var u=this._measureItem.width();if(C.icon){u+=20}if(a(a(item.titleElement).find("img")).length>0){u+=20}a(a(F)[0].firstChild).css("max-width",u+"px");if(n){this._measureItem.remove()}}}else{C.originalTitle="Item";a(F).append(a("Item"));a(F.firstChild).wrap("");C.titleElement=a(F)[0].firstChild;if(a.jqx.browser.msie&&a.jqx.browser.version<8){a(F.firstChild).css("display","inline-block")}}}var z=a(C.titleElement);var q=this.toThemeProperty("jqx-rc-all");if(this.allowDrag){z.addClass("draggable")}if(l==null||l==undefined){l=C.titleElement;C.label=a.trim(z.text())}else{C.label=l}a(F).addClass(this.toThemeProperty("jqx-tree-item-li"));if(this.rtl){a(F).addClass(this.toThemeProperty("jqx-tree-item-li-rtl"))}q+=" "+this.toThemeProperty("jqx-tree-item")+" "+this.toThemeProperty("jqx-item");if(this.rtl){q+=" "+this.toThemeProperty("jqx-tree-item-rtl")}z[0].className=z[0].className+" "+q;C.level=a(c).parents("li").length;C.hasItems=a(c).find("li").length>0;if(this.rtl&&C.parentElement){if(!this.checkboxes){}}if(this.checkboxes){if(this.host.jqxCheckBox){var p=a('
      ');p.width(parseInt(this.checkSize));p.height(parseInt(this.checkSize));a(F).prepend(p);if(this.rtl){p.css("float","right");p.css("position","static")}p.jqxCheckBox({hasInput:false,checked:C.checked,boxSize:this.checkSize,animationShowDelay:0,animationHideDelay:0,disabled:d,theme:this.theme});if(!this.rtl){z.css("margin-left",parseInt(this.checkSize)+6)}else{var y=5;if(C.parentElement){p.css("margin-right",y+5+"px")}else{p.css("margin-right",y+"px")}}C.checkBoxElement=p[0];p[0].treeItem=C;var f=z.outerHeight()/2-1-parseInt(this.checkSize)/2;p.css("margin-top",f);if(a.jqx.browser.msie&&a.jqx.browser.version<8){z.css("width","1%");z.css("margin-left",parseInt(this.checkSize)+25)}else{if(C.hasItems){if(!this.rtl){p.css("margin-left",this.toggleIndicatorSize)}}}}else{throw new Error("jqxTree: Missing reference to jqxcheckbox.js.");return}}else{if(a.jqx.browser.msie&&a.jqx.browser.version<8){z.css("width","1%")}}if(d){this.disableItem(C.element)}if(s){this.selectItem(C.element)}if(a.jqx.browser.msie&&a.jqx.browser.version<8){a(F).css("margin","0px");a(F).css("padding","0px")}},destroy:function(){this.removeHandler(a(window),"resize.jqxtree"+this.element.id);this.host.removeClass();if(this.isTouchDevice()){this.removeHandler(this.panel,a.jqx.mobile.getTouchEventName("touchend")+".touchScroll touchcancel.touchScroll");this.removeHandler(this.panel,a.jqx.mobile.getTouchEventName("touchmove")+".touchScroll");this.removeHandler(this.panel,a.jqx.mobile.getTouchEventName("touchstart")+".touchScroll")}var c=this;var b=this.isTouchDevice();a.each(this.items,function(){var g=this;var e=a(this.element);var d=!b?"click":a.jqx.mobile.getTouchEventName("touchend");c.removeHandler(a(g.checkBoxElement),d);var h=a(g.titleElement);c.removeHandler(e);var f=c.allowDrag&&c._enableDragDrop;if(!f){c.removeHandler(h)}else{c.removeHandler(h,"mousedown.item");c.removeHandler(h,"click");c.removeHandler(h,"dblclick");c.removeHandler(h,"mouseenter");c.removeHandler(h,"mouseleave")}$arrowSpan=a(g.arrow);if($arrowSpan.length>0){c.removeHandler($arrowSpan,d);c.removeHandler($arrowSpan,"selectstart");c.removeHandler($arrowSpan,"mouseup");if(!b){c.removeHandler($arrowSpan,"mouseenter");c.removeHandler($arrowSpan,"mouseleave")}c.removeHandler(h,"selectstart")}if(a.jqx.browser.opera){c.removeHandler(h,"mousedown.item")}if(c.toggleMode!="click"){c.removeHandler(h,"click")}c.removeHandler(h,c.toggleMode)});if(this.panel){this.panel.jqxPanel("destroy");this.panel=null}this.host.remove()},_raiseEvent:function(f,c){if(c==undefined){c={owner:null}}var d=this.events[f];args=c;args.owner=this;var e=new a.Event(d);e.owner=this;e.args=args;var b=this.host.trigger(e);return b},propertyChangedHandler:function(d,l,b,j){if(this.isInitialized==undefined||this.isInitialized==false){return}if(l=="submitCheckedItems"){d._updateInputSelection()}if(l=="disabled"){d._updateDisabledState()}if(l=="theme"){d._applyTheme(b,j)}if(l=="keyboardNavigation"){d.enableKeyboardNavigation=j}if(l=="width"||l=="height"){d.refresh();d._initialize();d._calculateWidth();if(d.host.jqxPanel){var k="fixed";if(this.height==null||this.height=="auto"){k="verticalwrap"}if(this.width==null||this.width=="auto"){if(k=="fixed"){k="horizontalwrap"}else{k="wrap"}}d.panel.jqxPanel({sizeMode:k})}}if(l=="touchMode"){d._isTouchDevice=null;if(j){d.enableHover=false}d._render()}if(l=="source"||l=="checkboxes"){if(this.source!=null){var m=[];a.each(d.items,function(){if(this.isExpanded){m[m.length]={label:this.label,level:this.level}}});var f=d.loadItems(d.source);if(!d.host.jqxPanel){d.element.innerHTML=f}else{d.panel.jqxPanel("setcontent",f)}var e=d.disabled;var g=d.host.find("ul:first");if(g.length>0){d.createTree(g[0]);d._render()}var h=d;var c=h.animationShowDuration;h.animationShowDuration=0;d.disabled=false;if(m.length>0){a.each(d.items,function(){for(var n=0;n0)for(var h=k(f.records,new Array),i=0;i0&&(c[c.length-1]?c[c.length-1].aggregate||c.push({_visible:!0,level:b,siblings:c,aggregate:!0,leaf:!0}):a.jqx.browser.msie&&a.jqx.browser.version<9&&c[c.length-2]&&(c[c.length-2].aggregate||c.push({_visible:!0,level:b,siblings:c,aggregate:!0,leaf:!0})));for(var d=0;db.dataview.pagesize*b.dataview.pagenum&&c<=b.dataview.pagesize*b.dataview.pagenum+b.dataview.pagesize&&e.push(g),c>b.dataview.pagesize*b.dataview.pagenum+b.dataview.pagesize)break}return e};if(0===b.source.hierarchy.length){if("all"==b.dataview.pagesize||!b.pageable||b.serverProcessing){var o=l;if(b.pageable&&b.serverProcessing&&l.length>b.dataview.pagesize)var o=l.slice(b.dataview.pagesize*b.dataview.pagenum,b.dataview.pagesize*b.dataview.pagenum+b.dataview.pagesize)}else var o=l.slice(b.dataview.pagesize*b.dataview.pagenum,b.dataview.pagesize*b.dataview.pagenum+b.dataview.pagesize);var j=o}else{var l=k.call(b,l,new Array);if("all"!=b.dataview.pagesize&&b.pageable){var o=l.slice(b.dataview.pagesize*b.dataview.pagenum,b.dataview.pagesize*b.dataview.pagenum+b.dataview.pagesize);"root"==this.pageSizeMode&&(o=n(l))}else var o=l;var j=o,p=b.dataview.pagenum;if(b.updatepagerdetails(),b.dataview.pagenum!=p){if("all"!=b.dataview.pagesize&&b.pageable){var o=l.slice(b.dataview.pagesize*b.dataview.pagenum,b.dataview.pagesize*b.dataview.pagenum+b.dataview.pagesize);"root"==this.pageSizeMode&&(o=n(l))}else var o=l;var j=o}}b.renderedRecords=j;var q=j.length,r=b.tableZIndex,s=0,t=0;if(i)for(var u=0;uv.maxwidth&&(w=v.maxwidth);var x=a('
      ');a(document.body).append(x);var y=x.find("td");s=1+parseInt(y.css("padding-left"))+parseInt(y.css("padding-right")),x.remove();break}for(var z=b.rtl?" "+b.toTP("jqx-grid-table-rtl"):"",A="",B="
      ",C=null,u=0;uv.maxwidth&&(w=v.maxwidth),w-=s,w<0&&(w=0),i){var D=w;0==u&&D++,B+="",A+=""}else B+="",A+="";t+=w}}A+="",B+="",b._hiddencolumns=!1;var E=!1;if(0===q){var F='',G=b.host.height();if(b.pageable&&(G-=b.pagerHeight,"both"===b.pagerPosition&&(G-=b.pagerHeight)),G-=b.columnsHeight,b.filterable){var H=b.filter.find(".filterrow"),I=b.filter.find(".filterrow-hidden"),J=1;I.length>0&&(J=0),G-=b.filterHeight+b.filterHeight*H.length*J}b.showstatusbar&&(G-=b.statusBarHeight),b.showAggregates&&(G-=b.aggregatesHeight),G<25&&(G=25),"hidden"!=b.hScrollBar[0].style.visibility&&(G-=b.hScrollBar.outerHeight()),("auto"===b.height||null===b.height||b.autoheight)&&(G=100);var w=b.host.width()+2,x='",F+=x,A+=F,B+=F,b.table[0].style.width=t+2+"px",f=t}for(var K=b.source._source.hierarchy&&b.source._source.hierarchy.groupingDataFields?b.source._source.hierarchy.groupingDataFields.length:0,L=0;L0&&M[d.level]',O='';if(M.aggregate)var F='',O='';var P=0;if(b.rowinfo[N])void 0===b.rowinfo[N].checked&&(b.rowinfo[N].checked=M[d.checked]),void 0===b.rowinfo[N].icon&&(b.rowinfo[N].icon=M[d.icon]),void 0===b.rowinfo[N].aggregate&&(b.rowinfo[N].aggregate=M[d.aggregate]),void 0===b.rowinfo[N].row&&(b.rowinfo[N].row=M),void 0===b.rowinfo[N].leaf&&(b.rowinfo[N].leaf=M[d.leaf]),void 0===b.rowinfo[N].expanded&&(b.rowinfo[N].expanded=M[d.expanded]);else{var Q=M[d.checked];void 0===Q&&(Q=!1),b.rowinfo[N]={selected:M[d.selected],checked:Q,icon:M[d.icon],aggregate:M.aggregate,row:M,leaf:M[d.leaf],expanded:M[d.expanded]}}var R=b.rowinfo[N];R.row=M,M.originalRecord&&(R.originalRecord=M.originalRecord);for(var S=0,u=0;uT.maxwidth&&(w=T.maxwidth),w-=s,w<0&&(w=0);var g=b.toTP("jqx-cell")+" "+b.toTP("jqx-grid-cell")+" "+b.toTP("jqx-item");T.pinned&&(g+=" "+b.toTP("jqx-grid-cell-pinned")),b.sortcolumn===T.displayfield&&(g+=" "+b.toTP("jqx-grid-cell-sort")),b.altRows&&L%2!=0&&(g+=" "+b.toTP("jqx-grid-cell-alt")),b.rtl&&(g+=" "+b.toTP("jqx-cell-rtl"));var U="";if(K>0&&!i&&!M.aggregate&&M[d.level]W.maxwidth&&(w=W.maxwidth),X-=s,X<0&&(X=0),D+=X}}w=D}var x='",Y+='" class="'+g+'">',Y+=aa,Y+="",T.pinned?(O+=x,F+=x):(F+=x,E&&(O+=Y)),K>0&&!i&&M[d.level]",O+="",A+=F,B+=O,b.rowDetails&&!M.aggregate&&this.rowDetailsRenderer){var va='",A+=va,B+=va)}}if(A+="
      ',b._loading||(x+=b.gridlocalization.emptydatastring),x+="
      0&&M[d.level]0&&(R.leaf=!1),b.dataview.filters.length>0&&M.records&&M.records.length>0){for(var $=!1,_=0;_0&&!M.aggregate&&M[d.level]";aa+=d,M[T.displayfield]+=c+":"+a[obj]+"\n"}});else aa=""}if(1===S&&!b.rtl||T==C&&b.rtl||K>0&&M[d.level]";var ka="",la="",ma="";if(this.checkboxes&&!M.aggregate){var na=b.toThemeProperty("jqx-tree-grid-checkbox")+" "+ha+" "+b.toThemeProperty("jqx-checkbox-default")+" "+b.toThemeProperty("jqx-fill-state-normal")+" "+b.toThemeProperty("jqx-rc-all"),oa=!0;if(a.isFunction(this.checkboxes)&&(oa=this.checkboxes(N,M),void 0==oa&&(oa=!1)),oa)if(R){var pa=R.checked;0==this.hierarchicalCheckboxes&&null===pa&&(pa=!1),la+=pa?"
      ":pa===!1?"":"
      "}else la+=""}if(this.icons&&!M.aggregate){var qa=b.toThemeProperty("jqx-tree-grid-icon")+" "+ha;if(b.rtl)var qa=b.toThemeProperty("jqx-tree-grid-icon")+" "+b.toThemeProperty("jqx-tree-grid-icon-rtl")+" "+ha;var ra=b.toThemeProperty("jqx-tree-grid-icon-size")+" "+ha,sa=R.icon;a.isFunction(this.icons)&&(R.icon=this.icons(N,M),R.icon&&(sa=!0)),sa&&(ma+=R.icon?"":"")}var ta=b.autoRowHeight&&1===S&&T.autoCellHeight?" "+b.toTP("jqx-grid-cell-wrap"):"",ua=ga+ka+la+ma+""+aa+"";aa=b.rtl?""+aa+""+ma+la+ka+ga:ua}if(K>0&&i&&u>=K&&M[d.level]',x+=aa,x+="
      '+wa+"
      ",B+="",E){b.WinJS?MSApp.execUnsafeLocalFunction(function(){b.table.html(B+A)}):b.table[0].innerHTML=B+A;var xa=b.table.find("#table"+b.element.id),ya=b.table.find("#pinnedtable"+b.element.id);ya.css("float","left"),ya.css("pointer-events","none"),xa.css("float","left"),ya[0].style.position="absolute",xa[0].style.position="relative",xa[0].style.zIndex=r-10,ya[0].style.zIndex=r+10,b._table=xa,b._table[0].style.left="0px",b._pinnedTable=ya,i&&(ya[0].style.left="0px"),b._table[0].style.width=f+"px",b._pinnedTable[0].style.width=f+"px",b.rtl&&b._haspinned&&(b._pinnedTable[0].style.left=3-f+parseInt(b.element.style.width)+"px")}else{b.WinJS?MSApp.execUnsafeLocalFunction(function(){b.table.html(A)}):b.table[0].innerHTML=A;var V=b.table.find("#table"+b.element.id);b._table=V,a.jqx.browser.msie&&a.jqx.browser.version<10&&(b._table[0].style.width=f+"px"),0===q&&(b._table[0].style.width=2+f+"px")}0===q&&(b._table[0].style.tableLayout="auto",b._pinnedTable&&(b._pinnedTable[0].style.tableLayout="auto")),b.showAggregates&&b._updatecolumnsaggregates(),b._loading&&0==q&&(b._arrange(),this._showLoadElement()),b.rendered&&b.rendered()}},propertyChangedHandler:function(b,c,d,e){if(void 0!=b.isInitialized&&0!=b.isInitialized){var f=b.base;if("pageSizeMode"==c||"hierarchicalCheckboxes"==c)b._renderrows();else if("filterable"==c)f._render();else if("height"===c)f.host.height(b.height),f.host.width(b.width),f._updatesize(!1,!0);else if("width"===c)f.host.height(b.height),f.host.width(b.width),f._updatesize(!0,!1);else if("source"===c)f.updateBoundData();else if("columns"===c||"columnGroups"===c)f._columns=null,f._render();else if("rtl"===c)f.content.css("left",""),b.columns=b._columns,f.vScrollBar.jqxScrollBar({rtl:e}),f.hScrollBar.jqxScrollBar({rtl:e}),f._render();else if("pagerMode"===c)b.pagerMode=e,f._initpager();else if("pageSizeOptions"==c){f._initpager();for(var g=!1,h=0;h0&&l.jqxDropDownList({theme:f.theme}),f.filtercolumnsList&&f.filtercolumnsList.jqxDropDownList({theme:f.theme})}f.refresh()}else f.refresh()}}},checkRow:function(a,b,c){var d=this.base,e=d._names();if(!d._loading){var f=d.rowinfo[a];if(f)f.checked=!0,f.row[e.checked]=!0,f.originalRecord&&(f.originalRecord[e.checked]=!0),void 0==c&&this.hierarchicalCheckboxes&&this.checkRows(f.row,f.row),b!==!1&&d._renderrows(),d._raiseEvent("rowCheck",{key:a,row:f.row});else{var g=this.getRow(a);g&&(d.rowinfo[a]={row:g,checked:!0},d.rowinfo[a].row[e.checked]=!0,g.originalRecord&&(d.rowinfo[a].originalRecord=g.originalRecord),d._raiseEvent("rowCheck",{key:a,row:g}),void 0==c&&this.hierarchicalCheckboxes&&this.checkRows(g,g),b!==!1&&d._renderrows())}}},checkRows:function(b,c){var d=this.base,e=this,f=d._names(),g=function(a){var b=new Array,c=function(a){for(var d=0;d0?this.indeterminateRow(b.uid,!1,"tree"):this.uncheckRow(b.uid,!1,"tree");else{var l=c[f.checked],m=g(c);a.each(m,function(){l===!0?e.checkRow(this.uid,!1,"tree"):l===!1?e.uncheckRow(this.uid,!1,"tree"):e.indeterminateRow(this.uid,!1,"tree")})}var n=b[f.parent]?b[f.parent]:null;this.checkRows(n,c)}else{var l=c[f.checked],m=g(c);a.each(m,function(){l===!0?e.checkRow(this.uid,!1,"tree"):l===!1?e.uncheckRow(this.uid,!1,"tree"):e.indeterminateRow(this.uid,!1,"tree")})}},indeterminateRow:function(a,b,c){var d=this.base,e=d._names();if(!d._loading){var f=d.rowinfo[a];if(f)f.checked=null,f.row[e.checked]=null,f.originalRecord&&(f.originalRecord[e.checked]=null),void 0==c&&this.hierarchicalCheckboxes&&this.checkRows(f.row,f.row),b!==!1&&d._renderrows();else{var g=this.getRow(a);g&&(d.rowinfo[a]={row:g,checked:null},d.rowinfo[a].row[e.checked]=null,g.originalRecord&&(d.rowinfo[a].originalRecord=g.originalRecord),void 0==c&&this.hierarchicalCheckboxes&&this.checkRows(g,g),b!==!1&&d._renderrows())}}},uncheckRow:function(a,b,c){var d=this.base,e=d._names();if(!d._loading){var f=d.rowinfo[a];if(f)f.checked=!1,f.row[e.checked]=!1,f.originalRecord&&(f.originalRecord[e.checked]=!1),void 0==c&&this.hierarchicalCheckboxes&&this.checkRows(f.row,f.row),b!==!1&&d._renderrows(),d._raiseEvent("rowUncheck",{key:a,row:f.row});else{var g=this.getRow(a);g&&(d.rowinfo[a]={row:g,checked:!1},d.rowinfo[a].row[e.checked]=!1,g.originalRecord&&(d.rowinfo[a].originalRecord=g.originalRecord),d._raiseEvent("rowUncheck",{key:a,row:g}),void 0==c&&this.hierarchicalCheckboxes&&this.checkRows(g,g),b!==!1&&d._renderrows())}}},expandRows:function(b){var c=this;if(b)if(c.virtualModeCreateRecords)a.each(b,function(){var a=this,b=function(){c.base._loading=!1,c.expandRows(a.records)};c.base._loading=!1,c.expandRow(a.uid,b)});else for(var d=0;d0){var aK=aF(c.records,new Array());for(var x=0;x0){if(c[c.length-1]){if(!c[c.length-1].aggregate){c.push({_visible:true,level:s,siblings:c,aggregate:true,leaf:true})}}else{if(a.jqx.browser.msie&&a.jqx.browser.version<9){if(c[c.length-2]){if(!c[c.length-2].aggregate){c.push({_visible:true,level:s,siblings:c,aggregate:true,leaf:true})}}}}}}for(var j=0;jN.dataview.pagesize*N.dataview.pagenum&&w<=N.dataview.pagesize*N.dataview.pagenum+N.dataview.pagesize){i.push(j)}if(w>N.dataview.pagesize*N.dataview.pagenum+N.dataview.pagesize){break}}return i};if(N.source.hierarchy.length===0){if(N.dataview.pagesize=="all"||!N.pageable||N.serverProcessing){var ak=ao;if(N.pageable&&N.serverProcessing&&ao.length>N.dataview.pagesize){var ak=ao.slice(N.dataview.pagesize*N.dataview.pagenum,N.dataview.pagesize*N.dataview.pagenum+N.dataview.pagesize)}}else{var ak=ao.slice(N.dataview.pagesize*N.dataview.pagenum,N.dataview.pagesize*N.dataview.pagenum+N.dataview.pagesize)}var v=ak}else{var ao=aF.call(N,ao,new Array());if(N.dataview.pagesize=="all"||!N.pageable){var ak=ao}else{var ak=ao.slice(N.dataview.pagesize*N.dataview.pagenum,N.dataview.pagesize*N.dataview.pagenum+N.dataview.pagesize);if(this.pageSizeMode=="root"){ak=ap(ao)}}var v=ak;var I=N.dataview.pagenum;N.updatepagerdetails();if(N.dataview.pagenum!=I){if(N.dataview.pagesize=="all"||!N.pageable){var ak=ao}else{var ak=ao.slice(N.dataview.pagesize*N.dataview.pagenum,N.dataview.pagesize*N.dataview.pagenum+N.dataview.pagesize);if(this.pageSizeMode=="root"){ak=ap(ao)}}var v=ak}}N.renderedRecords=v;var D=v.length;var aG=N.tableZIndex;var k=0;var aq=0;if(O){for(var P=0;PT.maxwidth){aw=T.maxwidth}var av=a('
      ');a(document.body).append(av);var ag=av.find("td");k=1+parseInt(ag.css("padding-left"))+parseInt(ag.css("padding-right"));av.remove();break}}var B=N.rtl?" "+N.toTP("jqx-grid-table-rtl"):"";var y="";var W="
      ";var ab=null;for(var P=0;PT.maxwidth){aw=T.maxwidth}aw-=k;if(aw<0){aw=0}if(O){var H=aw;if(P==0){H++}W+="";y+=""}else{W+="";y+=""}aq+=aw}y+="";W+="";N._hiddencolumns=false;var r=false;if(D===0){var n='';var q=N.host.height();if(N.pageable){q-=N.pagerHeight;if(N.pagerPosition==="both"){q-=N.pagerHeight}}q-=N.columnsHeight;if(N.filterable){var aB=N.filter.find(".filterrow");var A=N.filter.find(".filterrow-hidden");var E=1;if(A.length>0){E=0}q-=N.filterHeight+N.filterHeight*aB.length*E}if(N.showstatusbar){q-=N.statusBarHeight}if(N.showAggregates){q-=N.aggregatesHeight}if(q<25){q=25}if(N.hScrollBar[0].style.visibility!="hidden"){q-=N.hScrollBar.outerHeight()}if(N.height==="auto"||N.height===null||N.autoheight){q=100}var aw=N.host.width()+2;var av='";n+=av;y+=n;W+=n;N.table[0].style.width=aq+2+"px";ay=aq}var m=N.source._source.hierarchy&&N.source._source.hierarchy.groupingDataFields?N.source._source.hierarchy.groupingDataFields.length:0;for(var Q=0;Q0){if(at[J.level]';var an='';if(at.aggregate){var n='';var an=''}var U=0;if(!N.rowinfo[ac]){var z=at[J.checked];if(z===undefined){z=false}N.rowinfo[ac]={selected:at[J.selected],checked:z,icon:at[J.icon],aggregate:at.aggregate,row:at,leaf:at[J.leaf],expanded:at[J.expanded]}}else{if(N.rowinfo[ac].checked===undefined){N.rowinfo[ac].checked=at[J.checked]}if(N.rowinfo[ac].icon===undefined){N.rowinfo[ac].icon=at[J.icon]}if(N.rowinfo[ac].aggregate===undefined){N.rowinfo[ac].aggregate=at[J.aggregate]}if(N.rowinfo[ac].row===undefined){N.rowinfo[ac].row=at}if(N.rowinfo[ac].leaf===undefined){N.rowinfo[ac].leaf=at[J.leaf]}if(N.rowinfo[ac].expanded===undefined){N.rowinfo[ac].expanded=at[J.expanded]}}var h=N.rowinfo[ac];h.row=at;if(at.originalRecord){h.originalRecord=at.originalRecord}var o=0;for(var P=0;PM.maxwidth){aw=M.maxwidth}aw-=k;if(aw<0){aw=0}var aI=N.toTP("jqx-cell")+" "+N.toTP("jqx-grid-cell")+" "+N.toTP("jqx-item");if(M.pinned){aI+=" "+N.toTP("jqx-grid-cell-pinned")}if(N.sortcolumn===M.displayfield){aI+=" "+N.toTP("jqx-grid-cell-sort")}if(N.altRows&&Q%2!=0){aI+=" "+N.toTP("jqx-grid-cell-alt")}if(N.rtl){aI+=" "+N.toTP("jqx-cell-rtl")}var R="";if(m>0&&!O&&!at.aggregate){if(at[J.level]S.maxwidth){aw=S.maxwidth}Z-=k;if(Z<0){Z=0}H+=Z}aw=H}}var av='";aj+='" class="'+aI+'">';aj+=V;aj+="";if(!M.pinned){n+=av;if(r){an+=aj}}else{an+=av;n+=av}if(m>0&&!O){if(at[J.level]";an+="";y+=n;W+=an;if(N.rowDetails&&!at.aggregate&&this.rowDetailsRenderer){var l='";y+=l;W+=l}}}y+="
      ';if(!N._loading){av+=N.gridlocalization.emptydatastring}av+="
      0&&at[J.level]0){h.leaf=false}if(N.dataview.filters.length>0){if(at.records&&at.records.length>0){var aa=false;for(var L=0;L0&&!at.aggregate){if(at[J.level]";V+=j;at[M.displayfield]+=c+":"+i[obj]+"\n"}})}}else{V=""}}}if((o===1&&!N.rtl)||(M==ab&&N.rtl)||(m>0&&at[J.level]"}var al="";var az="";var e="";if(this.checkboxes&&!at.aggregate){var aC=N.toThemeProperty("jqx-tree-grid-checkbox")+" "+d+" "+N.toThemeProperty("jqx-checkbox-default")+" "+N.toThemeProperty("jqx-fill-state-normal")+" "+N.toThemeProperty("jqx-rc-all");var g=true;if(a.isFunction(this.checkboxes)){g=this.checkboxes(ac,at);if(g==undefined){g=false}}if(g){if(h){var ax=h.checked;if(this.hierarchicalCheckboxes==false&&ax===null){ax=false}if(ax){az+="
      "}else{if(ax===false){az+=""}else{az+="
      "}}}else{az+=""}}}if(this.icons&&!at.aggregate){var af=N.toThemeProperty("jqx-tree-grid-icon")+" "+d;if(N.rtl){var af=N.toThemeProperty("jqx-tree-grid-icon")+" "+N.toThemeProperty("jqx-tree-grid-icon-rtl")+" "+d}var aA=N.toThemeProperty("jqx-tree-grid-icon-size")+" "+d;var f=h.icon;if(a.isFunction(this.icons)){h.icon=this.icons(ac,at);if(h.icon){f=true}}if(f){if(h.icon){e+=""}else{e+=""}}}var ad=N.autoRowHeight&&o===1&&M.autoCellHeight?" "+N.toTP("jqx-grid-cell-wrap"):"";var ai=ae+al+az+e+""+V+"";if(!N.rtl){V=ai}else{V=""+V+""+e+az+al+ae}}if(m>0&&O&&P>=m){if(at[J.level]';av+=V;av+="
      '+ah+"
      ";W+="";if(r){if(N.WinJS){MSApp.execUnsafeLocalFunction(function(){N.table.html(W+y)})}else{N.table[0].innerHTML=W+y}var aD=N.table.find("#table"+N.element.id);var aE=N.table.find("#pinnedtable"+N.element.id);aE.css("float","left");aE.css("pointer-events","none");aD.css("float","left");aE[0].style.position="absolute";aD[0].style.position="relative";aD[0].style.zIndex=aG-10;aE[0].style.zIndex=aG+10;N._table=aD;N._table[0].style.left="0px";N._pinnedTable=aE;if(O){aE[0].style.left="0px"}N._table[0].style.width=ay+"px";N._pinnedTable[0].style.width=ay+"px";if(N.rtl&&N._haspinned){N._pinnedTable[0].style.left=3-ay+parseInt(N.element.style.width)+"px"}}else{if(N.WinJS){MSApp.execUnsafeLocalFunction(function(){N.table.html(y)})}else{N.table[0].innerHTML=y}var K=N.table.find("#table"+N.element.id);N._table=K;if(a.jqx.browser.msie&&a.jqx.browser.version<10){N._table[0].style.width=ay+"px"}if(D===0){N._table[0].style.width=(2+ay)+"px"}}if(D===0){N._table[0].style.tableLayout="auto";if(N._pinnedTable){N._pinnedTable[0].style.tableLayout="auto"}}if(N.showAggregates){N._updatecolumnsaggregates()}if(N._loading&&D==0){N._arrange();this._showLoadElement()}if(N.rendered){N.rendered()}},propertyChangedHandler:function(b,c,e,d){if(b.isInitialized==undefined||b.isInitialized==false){return}if(c=="pageSizeMode"||c=="hierarchicalCheckboxes"){b._renderrows()}},checkRow:function(c,d,b){var e=this.base;var g=e._names();if(e._loading){return}var f=e.rowinfo[c];if(f){f.checked=true;f.row[g.checked]=true;if(f.originalRecord){f.originalRecord[g.checked]=true}if(b==undefined&&this.hierarchicalCheckboxes){this.checkRows(f.row,f.row)}if(d!==false){e._renderrows()}e._raiseEvent("rowCheck",{key:c,row:f.row})}else{var h=this.getRow(c);if(h){e.rowinfo[c]={row:h,checked:true};e.rowinfo[c].row[g.checked]=true;if(h.originalRecord){e.rowinfo[c].originalRecord=h.originalRecord}e._raiseEvent("rowCheck",{key:c,row:h});if(b==undefined&&this.hierarchicalCheckboxes){this.checkRows(h,h)}if(d!==false){e._renderrows()}}}},checkRows:function(d,n){var e=this.base;var j=this;var i=e._names();var l=function(o){var p=new Array();var q=function(s){for(var r=0;r0){this.indeterminateRow(d.uid,false,"tree")}else{this.uncheckRow(d.uid,false,"tree")}}}else{var k=n[i.checked];var h=l(n);a.each(h,function(){if(k===true){j.checkRow(this.uid,false,"tree")}else{if(k===false){j.uncheckRow(this.uid,false,"tree")}else{j.indeterminateRow(this.uid,false,"tree")}}})}var m=d[i.parent]?d[i.parent]:null;this.checkRows(m,n)}else{var k=n[i.checked];var h=l(n);a.each(h,function(){if(k===true){j.checkRow(this.uid,false,"tree")}else{if(k===false){j.uncheckRow(this.uid,false,"tree")}else{j.indeterminateRow(this.uid,false,"tree")}}})}},indeterminateRow:function(c,d,b){var f=this.base;var h=f._names();if(f._loading){return}var e=this;var g=f.rowinfo[c];if(g){g.checked=null;g.row[h.checked]=null;if(g.originalRecord){g.originalRecord[h.checked]=null}if(b==undefined&&this.hierarchicalCheckboxes){this.checkRows(g.row,g.row)}if(d!==false){f._renderrows()}}else{var i=this.getRow(c);if(i){f.rowinfo[c]={row:i,checked:null};f.rowinfo[c].row[h.checked]=null;if(i.originalRecord){f.rowinfo[c].originalRecord=i.originalRecord}if(b==undefined&&this.hierarchicalCheckboxes){this.checkRows(i,i)}if(d!==false){f._renderrows()}}}},uncheckRow:function(c,d,b){var f=this.base;var h=f._names();if(f._loading){return}var e=this;var g=f.rowinfo[c];if(g){g.checked=false;g.row[h.checked]=false;if(g.originalRecord){g.originalRecord[h.checked]=false}if(b==undefined&&this.hierarchicalCheckboxes){this.checkRows(g.row,g.row)}if(d!==false){f._renderrows()}f._raiseEvent("rowUncheck",{key:c,row:g.row})}else{var i=this.getRow(c);if(i){f.rowinfo[c]={row:i,checked:false};f.rowinfo[c].row[h.checked]=false;if(i.originalRecord){f.rowinfo[c].originalRecord=i.originalRecord}f._raiseEvent("rowUncheck",{key:c,row:i});if(b==undefined&&this.hierarchicalCheckboxes){this.checkRows(i,i)}if(d!==false){f._renderrows()}}}},expandRows:function(c){var e=this;if(!c){return}if(e.virtualModeCreateRecords){a.each(c,function(){var f=this;var g=function(){e.base._loading=false;e.expandRows(f.records)};e.base._loading=false;e.expandRow(f.uid,g)})}else{for(var d=0;d=this.height)for(var g=0;g=this.height){var d=b/this.height,e=this.width-d;c=new a(this.xoffset+d,this.yoffset,e,this.height)}else{var f=b/this.width,g=this.height-f;c=new a(this.xoffset,this.yoffset+f,this.width,g)}return c}}function b(a,b){for(var c=[],d=j(a),e=b/d,f=0;f=f}function h(a,b){var c=Math.min.apply(Math,a),d=Math.max.apply(Math,a),e=j(a);return Math.max(Math.pow(b,2)*d/Math.pow(e,2),Math.pow(e,2)/(Math.pow(b,2)*c))}function i(a){return a&&a.constructor===Array}function j(a){for(var b=0,c=0;c=c)return b.color;return"#fff"}},_getColor:function(a){var b=a.color,c=this.colorMode;if(this._isColor(b))return b;if("function"==typeof this._colorEvaluator[c])return this._colorEvaluator[c].call(this,a);throw"Invalid colorMode"},_renderRect:function(b,c){var d=a("
      "),e=b[2]-b[0],f=b[3]-b[1],g=this._getColor(c);d.css({position:"absolute",left:b[0]-1,top:b[1]-1,width:e,height:f,backgroundColor:g}),d.addClass(this.toThemeProperty("jqx-treemap-rectangle"));var h=this._colorEvaluator,i={data:c.data,label:c.label,value:c.value,parent:c.parent,record:c.record,color:g,rgb:h._toRgb(g)};if(c.parent==this._root&&(i.parent=null),"function"==typeof this.renderCallbacks["*"]){var j=this.renderCallbacks["*"](d,i);if(void 0!==j)return d}if("function"==typeof this.renderCallbacks[c.label])this.renderCallbacks[c.label](d,i);else{var e=d.width()-2;d.html(''+c.label+"")}return d},_centerLabel:function(a,b){var c=a[0].firstChild;c.style.position="absolute",b!==d.HORIZONTAL&&b!==d.BOTH||(c.style.left=(a[0].offsetWidth-c.offsetWidth)/2+"px"),b!==d.VERTICAL&&b!==d.BOTH||(c.style.top=(a[0].offsetHeight-c.offsetHeight)/2+"px")},_trigger:function(b,c){var d=a.Event(b);return d.args=c,this.host.trigger(d)},_addHandlers:function(b,c){var d=this;b.on("mouseenter",function(a){d.hoverEnabled&&(d.host.find(".jqx-treemap-rectangle").removeClass("jqx-treemap-rectangle-hover"),b.addClass(d.toThemeProperty("jqx-treemap-rectangle-hover"))),d._trigger("mouseenterSector",c)}),b.on("mouseleave",function(a){d.hoverEnabled&&b.removeClass("jqx-treemap-rectangle-hover"),d._trigger("mouseleaveSector",c)}),b.on("click",function(c){if(d.selectionEnabled){var e=a.data(this,"jqx-treemap-selected")||!1;d.singleSelection&&d.host.find(".jqx-treemap-rectangle-hover").each(function(b,c){a.data(c,"jqx-treemap-selected",!1),a(c).removeClass("jqx-treemap-rectangle-hover")}),e?(b.removeClass("jqx-treemap-rectangle-hover"),e=!1):(b.addClass(d.toThemeProperty("jqx-treemap-rectangle-hover")),e=!0),a.data(this,"jqx-treemap-selected",e),c.stopImmediatePropagation()}})},clearSelection:function(){this.host.find(".jqx-treemap-rectangle-hover").removeClass(this.toThemeProperty("jqx-treemap-rectangle-hover")),a.data(this,"jqx-treemap-selected",!1)},_layoutArea:function(a,b){a.children.length&&a.children.length>0?(this._centerLabel(b,d.HORIZONTAL),b.addClass(this.toThemeProperty("jqx-treemap-rectangle-parent"))):this._centerLabel(b,d.BOTH)},_render:function(a,b){if(a.children.length){var c=0;a.value&&(c=this.headerHeight);for(var d,e,f=this._getValues(a.children),g=(a.area.offset(),b(f,a.area.width(),a.area.height()-c,0,c)),h=0;ha.value&&(d=a),e.value'),d=a('
      ');d.text(this.legendLabel),c.children().append(d),b.prepend(c)},_renderColorLegend:function(b){var c,d,e=a('
      '),f=function(a){return a};"function"==typeof this.legendScaleCallback&&(f=this.legendScaleCallback);var g=a('');e.append(g),g.append(""),e.append("
      "),this.host.append(e),c=a(e.find("tr")[0]),d=a(e.find("div")[0]),d.addClass(this.toThemeProperty("jqx-treemap-legend-values"));var h=function(a,b){try{if(a.minb.min)return 1}catch(a){}return 0};b.sort(h);for(var i=Math.round(e.width()/b.length),j=-2,k=0,l=0;l');if(m.css("backgroundColor",b[l].color),c.append(m),0===l){var n=a('');n.text(f(b[l].min)),d.append(n),g.css("margin-left",n.width()/2),j+=n.width()/2,k=j}var n=a('');j+=i,n.text(f(b[l].max)),d.append(n),l==b.length-1&&(k+=n.width()/2,e.css("padding-right",k+5),j-=2),j-=n.width()/2,n.css("left",j),j+=n.width()/2}return e.css({position:"absolute",left:this.legendPosition.x,bottom:this.legendPosition.y,visibility:this.showLegend?"visible":"hidden"}),e},_buildTree:function(a,c){var d,e,f=null,g=[];for(g.push(c);g.length;){f=g.pop();for(var h=0;h=this.height){for(var t=0;t=this.height){var x=w/this.height,t=this.width-x;y=new g(this.xoffset+x,this.yoffset,t,this.height)}else{var v=w/this.width,u=this.height-v;y=new g(this.xoffset,this.yoffset+v,this.width,u)}return y}}function o(t,r){var s=[],q=j(t),u=r/q;for(var p=0;p=p}function k(t,s){var q=Math.min.apply(Math,t),p=Math.max.apply(Math,t),r=j(t);return Math.max(Math.pow(s,2)*p/Math.pow(r,2),Math.pow(r,2)/(Math.pow(s,2)*q))}function h(p){return p&&p.constructor===Array}function j(p){var r=0;for(var q=0;q=h){return g.color}}return"#fff"}},_getColor:function(f){var e=f.color,g=this.colorMode;if(this._isColor(e)){return e}if(typeof this._colorEvaluator[g]==="function"){return this._colorEvaluator[g].call(this,f)}else{throw"Invalid colorMode"}},_renderRect:function(i,f){var j=c("
      "),e=i[2]-i[0],l=i[3]-i[1];var g=this._getColor(f);j.css({position:"absolute",left:i[0]-1,top:i[1]-1,width:e,height:l,backgroundColor:g});j.addClass(this.toThemeProperty("jqx-treemap-rectangle"));var k=this._colorEvaluator;var h={data:f.data,label:f.label,value:f.value,parent:f.parent,record:f.record,color:g,rgb:k._toRgb(g)};if(f.parent==this._root){h.parent=null}if(typeof this.renderCallbacks["*"]==="function"){var m=this.renderCallbacks["*"](j,h);if(m!==undefined){return j}}if(typeof this.renderCallbacks[f.label]==="function"){this.renderCallbacks[f.label](j,h)}else{var e=j.width()-2;j.html(''+f.label+"")}return j},_centerLabel:function(g,f){var e=g[0].firstChild;e.style.position="absolute";if(f===a.HORIZONTAL||f===a.BOTH){e.style.left=(g[0].offsetWidth-e.offsetWidth)/2+"px"}if(f===a.VERTICAL||f===a.BOTH){e.style.top=(g[0].offsetHeight-e.offsetHeight)/2+"px"}},_trigger:function(g,f){var h=c.Event(g);h.args=f;return this.host.trigger(h)},_addHandlers:function(e,g){var f=this;e.bind("mouseenter",function(h){if(f.hoverEnabled){f.host.find(".jqx-treemap-rectangle").removeClass("jqx-treemap-rectangle-hover");e.addClass(f.toThemeProperty("jqx-treemap-rectangle-hover"))}f._trigger("mouseenterSector",g)});e.bind("mouseleave",function(h){if(f.hoverEnabled){e.removeClass("jqx-treemap-rectangle-hover")}f._trigger("mouseleaveSector",g)});e.bind("click",function(i){if(f.selectionEnabled){var h=c.data(this,"jqx-treemap-selected")||false;if(f.singleSelection){f.host.find(".jqx-treemap-rectangle-hover").each(function(j,k){c.data(k,"jqx-treemap-selected",false);c(k).removeClass("jqx-treemap-rectangle-hover")})}if(h){e.removeClass("jqx-treemap-rectangle-hover");h=false}else{e.addClass(f.toThemeProperty("jqx-treemap-rectangle-hover"));h=true}c.data(this,"jqx-treemap-selected",h);i.stopImmediatePropagation()}})},clearSelection:function(){this.host.find(".jqx-treemap-rectangle-hover").removeClass(this.toThemeProperty("jqx-treemap-rectangle-hover"));c.data(this,"jqx-treemap-selected",false)},_layoutArea:function(f,e){if(f.children.length&&f.children.length>0){this._centerLabel(e,a.HORIZONTAL);e.addClass(this.toThemeProperty("jqx-treemap-rectangle-parent"))}else{this._centerLabel(e,a.BOTH)}},_render:function(f,l){if(!f.children.length){return}var e=0;if(f.value){e=this.headerHeight}var n=this._getValues(f.children),g=f.area.offset(),j=l(n,f.area.width(),f.area.height()-e,0,e),k,m;for(var h=0;hk.value){j=k}if(e.value
      '),e=c('
      ');e.text(this.legendLabel);g.children().append(e);f.prepend(g)},_renderColorLegend:function(e){var o=c('
      '),q,n,r,p=function(i){return i};if(typeof this.legendScaleCallback==="function"){p=this.legendScaleCallback}var s=c('
      ');o.append(s);s.append("");o.append("
      ");this.host.append(o);q=c(o.find("tr")[0]);n=c(o.find("div")[0]);n.addClass(this.toThemeProperty("jqx-treemap-legend-values"));var g=function(t,i){try{if(t.mini.min){return 1}}catch(u){var v=u}return 0};e.sort(g);var f=Math.round(o.width()/e.length);var m=-2;var h=0;for(var k=0;k');j.css("backgroundColor",e[k].color);q.append(j);if(k===0){var l=c('');l.text(p(e[k].min));n.append(l);s.css("margin-left",l.width()/2);m+=l.width()/2;h=m}var l=c('');m+=f;l.text(p(e[k].max));n.append(l);if(k==e.length-1){h+=l.width()/2;o.css("padding-right",h+5);m-=2}m-=l.width()/2;l.css("left",m);m+=l.width()/2}o.css({position:"absolute",left:this.legendPosition.x,bottom:this.legendPosition.y,visibility:(this.showLegend)?"visible":"hidden"});return o},_buildTree:function(k,f){var g=null,m,l,e=[];e.push(f);while(e.length){g=e.pop();for(var h=0;hd&&(h=d,e=f))}k--,0==k&&"function"==typeof b&&(j._handleValidation(g,h,e,i),b&&b(g))};this._validateRule(this.rules[l],m)}else c=this._validateRule(this.rules[l]);if(0==c){g=!1,f=a(this.rules[l].input),i.push(f);var n=f.offset();n&&(d=n.top,h>d&&(h=d,e=f))}}return 0==k?(this._handleValidation(g,h,e,i),g):void 0},validateInput:function(a){for(var b=this._getRulesForInput(a),c=!0,d=0;d0&&(d.find(".jqx-input").length>0?d.find(".jqx-input").removeClass(a.toThemeProperty("jqx-validator-error-element")):d.find(".jqx-text-area").length>0?d.find(".jqx-text-area").removeClass(a.toThemeProperty("jqx-validator-error-element")):d.is(".jqx-checkbox")&&d.find(".jqx-checkbox-default").removeClass(a.toThemeProperty("jqx-validator-error-element")),d.is(".jqx-radiobutton")?d.find(".jqx-radiobutton-default").removeClass(a.toThemeProperty("jqx-validator-error-element")):d.removeClass(a.toThemeProperty("jqx-validator-error-element"))):d.removeClass(a.toThemeProperty("jqx-validator-error-element"))}};b&&(c=b.hint,c&&(this.positions&&this.positions[Math.round(c.offset().top)+"_"+Math.round(c.offset().left)]&&(this.positions[Math.round(c.offset().top)+"_"+Math.round(c.offset().left)]=null),"fade"===this.animation?c.fadeOut(this.animationDuration,function(){c.remove(),f()}):(c.remove(),f())),b.hint=null)},_handleValidation:function(a,b,c,d){a?(this._raiseEvent(1),"function"==typeof this.onSuccess&&this.onSuccess()):(this._scrollHandler(b),this.focus&&c.focus(),this._raiseEvent(0,{invalidInputs:d}),"function"==typeof this.onError&&this.onError(d))},_scrollHandler:function(b){if(this.scroll){var c=this;a("html,body").animate({scrollTop:b},this.scrollDuration,function(){"function"==typeof c.scrollCallback&&c.scrollCallback.call(c)})}},_higherPriorityActive:function(a){for(var b,c=!1,d=this.rules.length-1;d>=0;d-=1){if(b=this.rules[d],c&&b.input===a.input&&b.hint)return!0;b===a&&(c=!0)}return!1},_removeLowPriorityHints:function(a){for(var b,c=!1,d=0;d0){var d=this,e=function(){d.updatePosition()},f=this.host.parents(".jqx-window");this.addHandler(f,"closed",function(){d.hide()}),this.addHandler(f,"moved",e),this.addHandler(f,"moving",e),this.addHandler(f,"resized",e),this.addHandler(f,"resizing",e),this.addHandler(a(document.parentWindow),"scroll",function(){d.scroll&&e()})}for(var g=0;g0)return""!==a.trim(b.find("input").val());break;case"textarea":case"password":case"jqx-input":case"jqx-text-area":case"text":var c=a.data(b[0]);if(c.jqxMaskedInput){var d=b.jqxMaskedInput("promptChar"),e=b.jqxMaskedInput("value");return e&&e.indexOf(d)<0}return c.jqxNumberInput?""!==b.jqxNumberInput("inputValue"):!!c.jqxDateTimeInput||""!==a.trim(b.val());case"checkbox":return b.is(":checked");case"radio":return b.is(":checked");case"jqx-check-box":case"jqx-radio-button":return b[0].val();case"div":return b.is(".jqx-checkbox")?b.jqxCheckBox("checked"):!!b.is(".jqx-radiobutton")&&b.jqxRadioButton("checked")}return!1},_notNumber:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=/\d/;return!b.test(a)})},_startWithLetter:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=/\d/;return!b.test(a.substring(0,1))})},_number:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=new Number(a);return!isNaN(b)&&isFinite(b)})},_phone:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=/^\(\d{3}\)(\d){3}-(\d){4}$/;return b.test(a)})},_length:function(a,b,c){return this._minLength(a,b)&&this._maxLength(a,c)},_maxLength:function(a,b){return b=parseInt(b,10),this._validateText(a,function(a){return a.length<=b})},_minLength:function(a,b){return b=parseInt(b,10),this._validateText(a,function(a){return a.length>=b})},_email:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return b.test(a)})},_zipCode:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=/^(^\d{5}$)|(^\d{5}-\d{4}$)|(\d{3}-\d{2}-\d{4})$/;return b.test(a)})},_ssn:function(a){return this._validateText(a,function(a){if(""==a)return!0;var b=/\d{3}-\d{2}-\d{4}/;return b.test(a)})},_validateText:function(a,b){var c;return!!this._isTextInput(a)&&(c=this._isjQWidget(a)&&a.find("input").length>0?a.find("input").val():a.val(),b(c))},_isjQWidget:function(b){var c=a.data(b[0]);return!!(c.jqxMaskedInput||c.jqxNumberInput||c.jqxDateTimeInput)||(b[0].tagName.toLowerCase().indexOf("jqx-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-password-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-complex-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-formatted-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-masked-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-date-time-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-number-input")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-check-box")>=0||(b[0].tagName.toLowerCase().indexOf("jqx-radio-button")>=0||b[0].tagName.toLowerCase().indexOf("angular")>=0)))))))))},_isTextInput:function(a){var b=this._getType(a);return"text"===b||"textarea"===b||"password"===b||"jqx-input-inner"===b||a.is(".jqx-input")||a.is(".jqx-text-area")},_getType:function(b){if(b[0]){var c,d=b[0].tagName.toLowerCase();return"textarea"===d?"textarea":b.is(".jqx-input")?"jqx-input":b.is(".jqx-text-area")?"jqx-text-area":b.find(".jqx-input").length>0?"jqx-input-inner":"input"===d?c=a(b).attr("type")?a(b).attr("type").toLowerCase():"text":"jqx-password-input"===d?"password":"jqx-check-box"===d?"jqx-check-box":"jqx-radio-button"===d?"jqx-radio-button":d}},_hintRender:function(b,c){if("label"==this.hintType){var d=a('');d.html(b);var e=this;return this.closeOnClick&&d.click(function(){e.hideHint(c.selector)}),"left"==this.position||"top"==this.position?d.insertBefore(a(c)):d.insertAfter(a(c)),d}var d=a('
      '),f=this;return d.html(b),this.closeOnClick&&d.click(function(){f.hideHint(c.selector)}),null==this.ownerElement?d.appendTo(document.body):this.ownerElement.innerHTML?d.appendTo(a(this.ownerElement)):d.appendTo(this.ownerElement),d},_hintLayout:function(b,c,d,e){if(this._hintRender===e.hintRender){var f;if(f=this._getPosition(c,d,b,e),"label"==this.hintType){var g="2px";"left"!=this.position&&"top"!=this.position||(g="-2px"),"input"!=c[0].nodeName.toLowerCase()&&"textarea"!=c[0].nodeName.toLowerCase()?(c.find(".jqx-text-area").length>0&&c.find(".jqx-text-area").addClass(this.toThemeProperty("jqx-validator-error-element")),c.find("input").length>0&&(c.find(".jqx-input").length>0?c.find(".jqx-input").addClass(this.toThemeProperty("jqx-validator-error-element")):c.find(".jqx-text-area").length>0?c.find(".jqx-text-area").addClass(this.toThemeProperty("jqx-validator-error-element")):c.is(".jqx-checkbox")&&c.find(".jqx-checkbox-default").addClass(this.toThemeProperty("jqx-validator-error-element")),c.is(".jqx-radiobutton")?c.find(".jqx-radiobutton-default").addClass(this.toThemeProperty("jqx-validator-error-element")):c.addClass(this.toThemeProperty("jqx-validator-error-element")))):c.addClass(this.toThemeProperty("jqx-validator-error-element"));var h=a("");h.addClass(this.toThemeProperty("jqx-validator-hint")),h.html(b.text()),h.appendTo(a(document.body));var i=h.outerWidth();return h.remove(),b.css({position:"relative",left:a(c).css("margin-left"),width:a(c).width(),top:g}),void("center"==d&&(b.css("width",i),b.css("left","0px"),b.css("margin-left","auto"),b.css("margin-right","auto")))}b.css({position:"absolute",left:f.left,top:f.top}),this.arrow&&this._addArrow(c,b,d,f)}},_showHint:function(a){a&&"fade"===this.animation&&(a.fadeOut(0),a.fadeIn(this.animationDuration))},_getPosition:function(b,c,d,e){var f,g,h=b.offset(),i=b.outerWidth(),j=b.outerHeight();if(this.rtl&&c.indexOf("left")>=0&&(c="right"),this.rtl&&c.indexOf("right")>=0&&(c="left"),null!=this.ownerElement&&(h={left:0,top:0},h.top=parseInt(h.top)+b.position().top,h.left=parseInt(h.left)+b.position().left),e&&e.hintPositionRelativeElement){var k=a(e.hintPositionRelativeElement);h=k.offset(),i=k.width(),j=k.height()}return f=c.indexOf("top")>=0?h.top-j:c.indexOf("bottom")>=0?h.top+d.outerHeight()+this.hintPositionOffset+5:h.top,g=c.indexOf("center")>=0?h.left+this.hintPositionOffset+(i-d.outerWidth())/2:c.indexOf("left")>=0?h.left-d.outerWidth()-this.hintPositionOffset:c.indexOf("right")>=0?h.left+i+this.hintPositionOffset:h.left+this.hintPositionOffset,c.indexOf(":")>=0&&(c=c.split(":")[1].split(","),g+=parseInt(c[0],10),f+=parseInt(c[1],10)),this.positions||(this.positions=new Array),this.positions[Math.round(f)+"_"+Math.round(g)]&&this.positions[Math.round(f)+"_"+Math.round(g)].top==f&&(f+=b.outerHeight()),this.positions[Math.round(f)+"_"+Math.round(g)]={left:g,top:f},{left:g,top:f}},_addArrow:function(b,c,d,e){var f,g,h=a('
      ');this.rtl&&d.indexOf("left")>=0&&(d="right"),this.rtl&&d.indexOf("right")>=0&&(d="left"),c.children(".jqx-validator-hint-arrow").remove(),c.append(h);var i=h.outerHeight(),j=h.outerWidth(),k=c.outerHeight(),l=c.outerWidth();this._addImage(h),g=d.indexOf("top")>=0?k-i:d.indexOf("bottom")>=0?-i:(k-i)/2-i/2,d.indexOf("center")>=0?f=(l-j)/2:d.indexOf("left")>=0?f=l-j/2-1:d.indexOf("right")>=0&&(f=-j/2),(d.indexOf("topright")>=0||d.indexOf("bottomright")>=0)&&(f=0),(d.indexOf("topleft")>=0||d.indexOf("bottomleft")>=0)&&(f=l-j),h.css({position:"absolute",left:f,top:g})},_addImage:function(a){var b=a.css("background-image");b=b.replace('url("',""),b=b.replace('")',""),b=b.replace("url(",""),b=b.replace(")",""),a.css("background-image","none"),a.append('Arrow')},_raiseEvent:function(b,c){var d=a.Event(this._events[b]);return d.args=c,this.host.trigger(d)},propertyChangedHandler:function(a,b,c,d){"rules"===b&&(this._configureInputs(),this._removeEventListeners(),this._addEventListeners())}})}(jqxBaseFramework); -(function(a){a.jqx.jqxWidget("jqxValidator","",{});a.extend(a.jqx._jqxValidator.prototype,{defineInstance:function(){var b={rules:null,scroll:true,focus:true,scrollDuration:300,scrollCallback:null,position:"right",arrow:true,animation:"fade",animationDuration:150,closeOnClick:true,onError:null,onSuccess:null,ownerElement:null,_events:["validationError","validationSuccess"],hintPositionOffset:5,_inputHint:[],rtl:false,hintType:"tooltip"};a.extend(true,this,b);return b},createInstance:function(){if(this.hintType=="label"&&this.animationDuration==150){this.animationDuration=0}this._configureInputs();this._removeEventListeners();this._addEventListeners()},destroy:function(){this._removeEventListeners();this.hide()},validate:function(q){var b=true,p,f=Infinity,j,h,c,k=[],o;this.updatePosition();var l=this;var d=0;for(var g=0;gj){f=j;h=c}}}d--;if(d==0){if(typeof q==="function"){l._handleValidation(b,f,h,k);if(q){q(b)}}}};this._validateRule(this.rules[g],m)}else{p=this._validateRule(this.rules[g])}if(false==p){b=false;c=a(this.rules[g].input);k.push(c);var e=c.offset();if(e){j=e.top;if(f>j){f=j;h=c}}}}if(d==0){this._handleValidation(b,f,h,k);return b}else{return undefined}},validateInput:function(b){var e=this._getRulesForInput(b),d=true;for(var c=0;c0){if(c.find(".jqx-input").length>0){c.find(".jqx-input").removeClass(g.toThemeProperty("jqx-validator-error-element"))}else{if(c.find(".jqx-text-area").length>0){c.find(".jqx-text-area").removeClass(g.toThemeProperty("jqx-validator-error-element"))}else{if(c.is(".jqx-checkbox")){c.find(".jqx-checkbox-default").removeClass(g.toThemeProperty("jqx-validator-error-element"))}}}if(c.is(".jqx-radiobutton")){c.find(".jqx-radiobutton-default").removeClass(g.toThemeProperty("jqx-validator-error-element"))}else{c.removeClass(g.toThemeProperty("jqx-validator-error-element"))}}}else{c.removeClass(g.toThemeProperty("jqx-validator-error-element"))}};if(e){f=e.hint;if(f){if(this.positions){if(this.positions[Math.round(f.offset().top)+"_"+Math.round(f.offset().left)]){this.positions[Math.round(f.offset().top)+"_"+Math.round(f.offset().left)]=null}}if(this.animation==="fade"){f.fadeOut(this.animationDuration,function(){f.remove();d()})}else{f.remove();d()}}e.hint=null}},_handleValidation:function(b,e,d,c){if(!b){this._scrollHandler(e);if(this.focus){d.focus()}this._raiseEvent(0,{invalidInputs:c});if(typeof this.onError==="function"){this.onError(c)}}else{this._raiseEvent(1);if(typeof this.onSuccess==="function"){this.onSuccess()}}},_scrollHandler:function(c){if(this.scroll){var b=this;a("html,body").animate({scrollTop:c},this.scrollDuration,function(){if(typeof b.scrollCallback==="function"){b.scrollCallback.call(b)}})}},_higherPriorityActive:function(d){var e=false,c;for(var b=this.rules.length-1;b>=0;b-=1){c=this.rules[b];if(e&&c.input===d.input&&c.hint){return true}if(c===d){e=true}}return false},_removeLowPriorityHints:function(d){var e=false,c;for(var b=0;b0){var b=this;var g=function(){b.updatePosition()};var e=this.host.parents(".jqx-window");this.addHandler(e,"closed",function(){b.hide()});this.addHandler(e,"moved",g);this.addHandler(e,"moving",g);this.addHandler(e,"resized",g);this.addHandler(e,"resizing",g);this.addHandler(a(document.parentWindow),"scroll",function(){if(b.scroll){g()}})}for(var d=0;d=0){c=c.split("=");d=c[1].split(",");c=c[0]}e=this["_"+c];if(e){f.rule=function(g,h){return e.apply(this,[g].concat(d))}}else{b=true}}else{if(typeof c!=="function"){b=true}else{f.rule=c}}if(b){throw new Error("Wrong parameter!")}},_required:function(b){switch(this._getType(b)){case"jqx-input-inner":if(b.find("input").length>0){return a.trim(b.find("input").val())!==""}break;case"textarea":case"password":case"jqx-input":case"jqx-text-area":case"text":var d=a.data(b[0]);if(d.jqxMaskedInput){var e=b.jqxMaskedInput("promptChar"),c=b.jqxMaskedInput("value");return c&&c.indexOf(e)<0}else{if(d.jqxNumberInput){return b.jqxNumberInput("inputValue")!==""}else{if(d.jqxDateTimeInput){return true}else{return a.trim(b.val())!==""}}}case"checkbox":return b.is(":checked");case"radio":return b.is(":checked");case"div":if(b.is(".jqx-checkbox")){return b.jqxCheckBox("checked")}if(b.is(".jqx-radiobutton")){return b.jqxRadioButton("checked")}return false}return false},_notNumber:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=/\d/;return !c.test(d)})},_startWithLetter:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=/\d/;return !c.test(d.substring(0,1))})},_number:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=new Number(d);return !isNaN(c)&&isFinite(c)})},_phone:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=/^\(\d{3}\)(\d){3}-(\d){4}$/;return c.test(d)})},_length:function(c,d,b){return this._minLength(c,d)&&this._maxLength(c,b)},_maxLength:function(c,b){b=parseInt(b,10);return this._validateText(c,function(d){return d.length<=b})},_minLength:function(c,b){b=parseInt(b,10);return this._validateText(c,function(d){return d.length>=b})},_email:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return c.test(d)})},_zipCode:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=/^(^\d{5}$)|(^\d{5}-\d{4}$)|(\d{3}-\d{2}-\d{4})$/;return c.test(d)})},_ssn:function(b){return this._validateText(b,function(d){if(d==""){return true}var c=/\d{3}-\d{2}-\d{4}/;return c.test(d)})},_validateText:function(b,d){var c;if(this._isTextInput(b)){if(this._isjQWidget(b)){if(b.find("input").length>0){c=b.find("input").val()}else{c=b.val()}}else{c=b.val()}return d(c)}return false},_isjQWidget:function(b){var c=a.data(b[0]);if(c.jqxMaskedInput||c.jqxNumberInput||c.jqxDateTimeInput){return true}if(b[0].tagName.toLowerCase().indexOf("angular")>=0){return true}return false},_isTextInput:function(b){var c=this._getType(b);return c==="text"||c==="textarea"||c==="password"||c==="jqx-input-inner"||b.is(".jqx-input")||b.is(".jqx-text-area")},_getType:function(c){if(!c[0]){return}var b=c[0].tagName.toLowerCase(),d;if(b==="textarea"){return"textarea"}else{if(c.is(".jqx-input")){return"jqx-input"}else{if(c.is(".jqx-text-area")){return"jqx-text-area"}else{if(c.find(".jqx-input").length>0){return"jqx-input-inner"}else{if(b==="input"){d=a(c).attr("type")?a(c).attr("type").toLowerCase():"text";return d}}}}}return b},_hintRender:function(e,c){if(this.hintType=="label"){var f=a('');f.html(e);var d=this;if(this.closeOnClick){f.click(function(){d.hideHint(c.selector)})}if(this.position=="left"||this.position=="top"){f.insertBefore(a(c))}else{f.insertAfter(a(c))}return f}var f=a('
      '),b=this;f.html(e);if(this.closeOnClick){f.click(function(){b.hideHint(c.selector)})}if(this.ownerElement==null){f.appendTo(document.body)}else{if(this.ownerElement.innerHTML){f.appendTo(a(this.ownerElement))}else{f.appendTo(this.ownerElement)}}return f},_hintLayout:function(h,c,b,f){if(this._hintRender===f.hintRender){var i;i=this._getPosition(c,b,h,f);if(this.hintType=="label"){var e="2px";if(this.position=="left"||this.position=="top"){e="-2px"}if(c[0].nodeName.toLowerCase()!="input"&&c[0].nodeName.toLowerCase()!="textarea"){if(c.find(".jqx-text-area").length>0){c.find(".jqx-text-area").addClass(this.toThemeProperty("jqx-validator-error-element"))}if(c.find("input").length>0){if(c.find(".jqx-input").length>0){c.find(".jqx-input").addClass(this.toThemeProperty("jqx-validator-error-element"))}else{if(c.find(".jqx-text-area").length>0){c.find(".jqx-text-area").addClass(this.toThemeProperty("jqx-validator-error-element"))}else{if(c.is(".jqx-checkbox")){c.find(".jqx-checkbox-default").addClass(this.toThemeProperty("jqx-validator-error-element"))}}}if(c.is(".jqx-radiobutton")){c.find(".jqx-radiobutton-default").addClass(this.toThemeProperty("jqx-validator-error-element"))}else{c.addClass(this.toThemeProperty("jqx-validator-error-element"))}}}else{c.addClass(this.toThemeProperty("jqx-validator-error-element"))}var d=a("");d.addClass(this.toThemeProperty("jqx-validator-hint"));d.html(h.text());d.appendTo(a(document.body));var g=d.outerWidth();d.remove();h.css({position:"relative",left:a(c).css("margin-left"),width:a(c).width(),top:e});if(b=="center"){h.css("width",g);h.css("left","0px");h.css("margin-left","auto");h.css("margin-right","auto")}return}h.css({position:"absolute",left:i.left,top:i.top});if(this.arrow){this._addArrow(c,h,b,i)}}},_showHint:function(b){if(b){if(this.animation==="fade"){b.fadeOut(0);b.fadeIn(this.animationDuration)}}},_getPosition:function(i,f,d,g){var e=i.offset(),h,c;var b=i.outerWidth();var j=i.outerHeight();if(this.rtl&&f.indexOf("left")>=0){f="right"}if(this.rtl&&f.indexOf("right")>=0){f="left"}if(this.ownerElement!=null){e={left:0,top:0};e.top=parseInt(e.top)+i.position().top;e.left=parseInt(e.left)+i.position().left}if(g&&g.hintPositionRelativeElement){var k=a(g.hintPositionRelativeElement);e=k.offset();b=k.width();j=k.height()}if(f.indexOf("top")>=0){h=e.top-j}else{if(f.indexOf("bottom")>=0){h=e.top+d.outerHeight()+this.hintPositionOffset+5}else{h=e.top}}if(f.indexOf("center")>=0){c=e.left+this.hintPositionOffset+(b-d.outerWidth())/2}else{if(f.indexOf("left")>=0){c=e.left-d.outerWidth()-this.hintPositionOffset}else{if(f.indexOf("right")>=0){c=e.left+b+this.hintPositionOffset}else{c=e.left+this.hintPositionOffset}}}if(f.indexOf(":")>=0){f=f.split(":")[1].split(",");c+=parseInt(f[0],10);h+=parseInt(f[1],10)}if(!this.positions){this.positions=new Array()}if(this.positions[Math.round(h)+"_"+Math.round(c)]){if(this.positions[Math.round(h)+"_"+Math.round(c)].top==h){h+=i.outerHeight()}}this.positions[Math.round(h)+"_"+Math.round(c)]={left:c,top:h};return{left:c,top:h}},_addArrow:function(j,e,g,k){var l=a('
      '),d,i;if(this.rtl&&g.indexOf("left")>=0){g="right"}if(this.rtl&&g.indexOf("right")>=0){g="left"}e.children(".jqx-validator-hint-arrow").remove();e.append(l);var c=l.outerHeight(),f=l.outerWidth(),h=e.outerHeight(),b=e.outerWidth();this._addImage(l);if(g.indexOf("top")>=0){i=h-c}else{if(g.indexOf("bottom")>=0){i=-c}else{i=(h-c)/2-c/2}}if(g.indexOf("center")>=0){d=(b-f)/2}else{if(g.indexOf("left")>=0){d=b-f/2-1}else{if(g.indexOf("right")>=0){d=-f/2}}}if(g.indexOf("topright")>=0||g.indexOf("bottomright")>=0){d=0}if(g.indexOf("topleft")>=0||g.indexOf("bottomleft")>=0){d=b-f}l.css({position:"absolute",left:d,top:i})},_addImage:function(b){var c=b.css("background-image");c=c.replace('url("',"");c=c.replace('")',"");c=c.replace("url(","");c=c.replace(")","");b.css("background-image","none");b.append('Arrow')},_raiseEvent:function(b,d){var c=a.Event(this._events[b]);c.args=d;return this.host.trigger(c)},propertyChangedHandler:function(b,c,e,d){if(c==="rules"){this._configureInputs();this._removeEventListeners();this._addEventListeners()}}})})(jqxBaseFramework); \ No newline at end of file diff --git a/jqwidgets/jqxwindow.js b/jqwidgets/jqxwindow.js index 505ed08b2..1b72ba8c8 100644 --- a/jqwidgets/jqxwindow.js +++ b/jqwidgets/jqxwindow.js @@ -1,7 +1,8 @@ -/* -jQWidgets v4.4.0 (2016-Nov) -Copyright (c) 2011-2016 jQWidgets. -License: http://jqwidgets.com/license/ +/* +jQWidgets v4.5.1 (2017-Feb) +Copyright (c) 2011-2017 jQWidgets. +License: http://jqwidgets.com/license/ */ +!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=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,d1)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.heightthis.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='
      '+this._header[0].innerHTML+"
      ",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=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;cc;d--){var e,f=b[d],g=b[d-1];parseInt(f.css(a),10)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=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+3b._mousePosition.x||g+3b._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.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]), +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&&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&&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;he;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()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;dthis.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+3this._mouseResizePosition.x||b+3this._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=0?(this._resizeWrapper.style.cursor="sw-resize",this._resizeDirection="bottomleft"):b>=this.resizeTarget.height()-this.resizeIndicatorSize&&b=this.resizeTarget.width()-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.width()-this.resizeIndicatorSize&&a=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.yc.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()=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.xc.maxWidth?{fix:c.maxWidth,result:!1}:{result:!0,fix:b}},_resize:function(a,b,c){for(var d=this._resizeMethods.length,e=0;e0&&this.resizeTargetChildren[c].width(d)}else{var e=this.resizeTargetChildren[c].lastHeight-(this.resizeTarget.lastHeight-a);e0&&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); -(function(a){a.jqx.jqxWidget("jqxWindow","",{});a.extend(a.jqx._jqxWindow.prototype,{defineInstance:function(){var e={height:"auto",width:200,minHeight:50,maxHeight:600,minWidth:50,maxWidth:800,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:12990,modalZIndex:18000,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")}};a.extend(true,this,e);return e},createInstance:function(){this.host.attr("role","dialog");this.host.removeAttr("data-bind");this.host.detach();a(document.body).append(this.host);var g=this;var f=function(m){for(var l=0;l=0){g[k]=parseInt(g[k],10)}}};f(["minWidth","minHeight","maxWidth","maxHeight","width","height"]);var h=function(){var k=parseInt(a(g.restricter).css("padding-top"));var i=parseInt(a(g.restricter).css("padding-left"));var l=parseInt(a(g.restricter).css("padding-bottom"));var n=parseInt(a(g.restricter).css("padding-right"));var m=a(g.restricter).coord();g.dragArea={left:i+m.left,top:k+m.top,width:1+n+a(g.restricter).width(),height:1+l+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.host.css("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(n){var f=a.data(document.body,"jqxwindows-list")||[],o=this.zIndex,i;if(!this.isModal){if(this._indexOf(this.host,f)<0){f.push(this.host)}a.data(document.body,"jqxwindows-list",f);if(f.length>1){var g=f[f.length-2];if(g.css("z-index")=="auto"){o=this.zIndex+f.length+1}else{var e=this.zIndex;o=parseInt(g.css("z-index"),10)+1;if(o1){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))){throw new Error(this._invalidArgumentExceptions.invalidHeight)}if(this.width!=="auto"&&isNaN(parseInt(this.width))){throw new Error(this._invalidArgumentExceptions.invalidWidth)}if(this.height!=="auto"&&this.heightthis.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))){throw new Error(this._invalidArgumentExceptions.invalidMinHeight)}if(isNaN(parseInt(this.maxHeight))){throw new Error(this._invalidArgumentExceptions.invalidMaxHeight)}if(isNaN(parseInt(this.minWidth))){throw new Error(this._invalidArgumentExceptions.invalidMinWidth)}if(isNaN(parseInt(this.maxWidth))){throw new Error(this._invalidArgumentExceptions.invalidMaxWidth)}if(this.minHeight&&this.maxHeight){if(parseInt(this.minHeight)>parseInt(this.maxHeight)&&this.maxHeight!=Number.MAX_VALUE){throw new Error(this._invalidArgumentExceptions.invalidMinHeight)}}if(this.minWidth&&this.maxWidth){if(parseInt(this.minWidth)>parseInt(this.maxWidth)&&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("DIV");if(e.length===1){this._header=a("
      "+this.host.attr("caption")+"
      ");this.host.prepend(this._header);this.host.attr("caption","");this._content=a(e[0])}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.wrapInner('
      ');this._headerContentWrapper=this._header.children(0);if(this.headerHeight!==null){this._header.height(this.headerHeight)}}},_addCloseButton:function(){if(!this._closeButton){this._closeButtonWrapper=a('
      ');this._closeButton=a('
      ');this._closeButtonWrapper.append(this._closeButton);this._header.append(this._closeButtonWrapper)}},_addCollapseButton:function(){if(!this._collapseButton){this._collapseButtonWrapper=a('
      ');this._collapseButton=a('
      ');this._collapseButtonWrapper.append(this._collapseButton);this._header.append(this._collapseButtonWrapper)}},_removeModal:function(){if(!this.isModal&&typeof this._modalBackground==="object"&&this._modalBackground!==null&&this._modalBackground.length>=1){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||this._modalBackground.length<1)){var g=a.data(document.body,"jqxwindows-list");if(g){this._removeFromArray(this.host,g);a.data(document.body,"jqxwindows-list",g)}this._modalBackground=a("
      ");this._modalBackground.addClass(this.toThemeProperty("jqx-window-modal"));this._setModalBackgroundStyles();a(document.body).append(this._modalBackground);this.addHandler(this._modalBackground,this._getEvent("click"),function(){return false});var f=this;var e=function(i,k){var h=a(i).parents().get();for(j=0;j0){h[0].focus(1);setTimeout(function(){h[0].focus(1)},100)}i.preventDefault();return false});this.addHandler(a(document),"keydown.window"+this.element.id,function(l){if(l.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 k=f._getTabbables();var m=null;var i=null;if(k.length>0){m=k[0];i=k[k.length-1]}if(l.target==f.element){return}if(m==null){return}if(!e(l.target,f.host)){m.focus(1);return false}if(l.target===i&&!l.shiftKey){m.focus(1);return false}else{if(l.target===m&&l.shiftKey){i.focus(1);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.host.children().css("tab-index",0)}this.host.attr("hideFocus","true").css("outline","none")},_performHeaderLayout:function(){this._handleHeaderButtons();this._header.css("position","relative");if(this.rtl){this._headerContentWrapper.css("direction","rtl");this._headerContentWrapper.css("float","right")}else{this._headerContentWrapper.css("direction","ltr");this._headerContentWrapper.css("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.css("visibility","hidden")}else{this._closeButtonWrapper.css("visibility","visible");this._closeButtonWrapper.width(this.closeButtonSize);this._closeButtonWrapper.height(this.closeButtonSize)}if(!this.showCollapseButton){this._collapseButtonWrapper.css("visibility","hidden")}else{this._collapseButtonWrapper.css("visibility","visible");this._collapseButtonWrapper.width(this.collapseButtonSize);this._collapseButtonWrapper.height(this.collapseButtonSize)}},_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.css("margin-right",e);this._closeButtonWrapper.css("margin-left","0px")}else{this._closeButtonWrapper.css("margin-left",e);this._closeButtonWrapper.css("margin-right","0px")}}if(!this.rtl){this._closeButtonWrapper.css({position:"absolute",right:"0px",left:""})}else{this._closeButtonWrapper.css({position:"absolute",left:"0px",right:""})}},_performHeaderCollapseButtonLayout:function(){if(!this._closeButtonWrapper){return}var e=parseInt(this._header.css("padding-right"),10);if(!isNaN(e)){this._collapseButtonWrapper.width(this.collapseButtonSize);this._collapseButtonWrapper.height(this.collapseButtonSize);if(!this.rtl){this._collapseButtonWrapper.css("margin-right",e);this._collapseButtonWrapper.css("margin-left","0px")}else{this._collapseButtonWrapper.css("margin-left",e);this._collapseButtonWrapper.css("margin-right","0px")}}if(!this.rtl){this._collapseButtonWrapper.css({position:"absolute",right:(this.showCloseButton)?this._closeButton.outerWidth(true):0,left:""})}else{this._collapseButtonWrapper.css({position:"absolute",left:(this.showCloseButton)?this._closeButton.outerWidth(true):0,right:""})}this._centerElement(this._collapseButton,this._collapseButton.parent(),"y")},_performWidgetLayout:function(){var e;if(this.width!=="auto"){this.host.css("width",this.width)}if(!this.collapsed){if(this.height!=="auto"){this.host.height(this.height)}else{this.host.height(this.host.height())}this.host.css("min-height",this.minHeight)}this._setChildrenLayout();e=this._validateMinSize();this.host.css({"max-height":this.maxHeight,"min-width":this.minWidth,"max-width":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=0){var g=e.outerHeight(true),k=m.height(),i=(Math.max(0,k-g))/2;e.css(f+"top",i+"px")}if(h.indexOf("x")>=0){var o=e.outerWidth(true);var n=m.width();var l=(Math.max(0,n-o))/2;e.css(f+"left",l+"px")}},_centerElementInArea:function(f,e,h){h=h.toLowerCase();if(h.indexOf("y")>=0){var g=f.outerHeight(true);var k=e.height;var i=(k-g)/2;f.css("top",i+e.top+"px")}if(h.indexOf("x")>=0){var n=f.outerWidth(true);var m=e.width;var l=(m-n)/2;f.css("left",l+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"));this.removeHandler(a(this.okButton),this._getEvent("click"),this._setDialogResultHandler);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;hh;f--){var m=l[f],k=l[f-1],g;if(parseInt(m.css(e),10)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){this._modalBackground.fadeTo(0,this.modalOpacity);this._modalBackground.css({position:"absolute",top:"0px",left:"0px",width:this._getDocumentSize().width,height:this._getDocumentSize().height,"z-index":this.modalBackgroundZIndex});if(!this.autoOpen){this._modalBackground.css("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=0){this.move(k-i,m)}}}else{if(this.resizable){this.resize(h-i,o)}}p=false;break;case 38:if(!e){if(this.draggable){if(m-i>=0){this.move(k,m-i)}}}else{if(this.resizable){this.resize(h,o-i)}}p=false;break;case 39:if(!e){if(this.draggable){if(k+h+i<=g.width){this.move(k+i,m)}}}else{if(this.resizable){this.resize(h+i,o)}}p=false;break;case 40:if(!e){if(this.draggable){if(m+o+i<=g.height){this.move(k,m+i)}}}else{if(this.resizable){this.resize(h,o+i)}}p=false;break}if(!p){if(f.preventDefault){f.preventDefault()}if(f.stopPropagation){f.stopPropagation()}}return p},_addCollapseHandlers:function(){var e=this;this.addHandler(this._collapseButton,this._getEvent("click"),function(){if(!e.collapsed){e.collapse()}else{e.expand()}})},_closeWindow:function(e){this.closeWindow();return false},_addHeaderCursorHandlers:function(e){if(e.resizeArea&&e.resizable&&!e.collapsed){e._header.css("cursor",e._resizeWrapper.css("cursor"));return}else{if(e.draggable){e._header.css("cursor","move");return}}e._header.css("cursor","default");if(e._resizeWrapper&&e._resizeWrapper.length>0){e._resizeWrapper.css("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(k,i,l){if(i){k.pageX=i}if(l){k.pageY=l}e._headerMouseDownHandler(e,k);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 h=a.jqx.mobile.getTouches(g);var i=h[0];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 k=a.jqx.mobile.getTouches(i);var l=k[0];var h=l.pageX,g=l.pageY;var e=a.jqx.position(i);h=e.left;g=e.top;if((h+3f._mousePosition.x)||(g+3f._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,k){var f=true;if(g._isDragging&&!g.isResizing&&!g._resizeDirection){var e=parseInt(g.host.css("left"),10),l=parseInt(g.host.css("top"),10),i=(g._isTouchDevice)?0:k.pageX,h=(g._isTouchDevice)?0:k.pageY;g.enableResize=g._enableResizeBackup;g._enableResizeBackup="undefined";g._raiseEvent(3,e,l,i,h);f=false;if(k.preventDefault!="undefined"){k.preventDefault()}if(k.originalEvent!=null){k.originalEvent.mouseHandled=true}if(k.stopPropagation!="undefined"){k.stopPropagation()}}g._isDragging=false;g._mouseDown=false;a(document.body).removeClass(g.toThemeProperty("jqx-disableselect"));return f},_dragHandler:function(p,h){if(p._isDragging&&!p.isResizing&&!p._resizeDirection){var o=(p._isTouchDevice)?h.originalEvent.which:h.which;if(typeof p._enableResizeBackup==="undefined"){p._enableResizeBackup=p.enableResize}p.enableResize=false;if(o===0&&a.jqx.browser.msie&&a.jqx.browser.version<8){return p._dropHandler(p,h)}var m=a.jqx.mobile.getTouches(h);var l=m[0];var n=a.jqx.position(h);var k=n.left,i=n.top,g=k-p._mousePosition.x,f=i-p._mousePosition.y,e=p._windowPosition.x+g,q=p._windowPosition.y+f;p.move(e,q,h);h.preventDefault();return false}return true},_validateCoordinates:function(e,l,i,k){var h=this._getDraggingArea();e=(e=h.width+h.left-2*k){e=h.width+h.left-f-k}if(l+g>=h.height+h.top-i){l=h.height+h.top-g-i}return{x:e,y:l}},_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.host.css({left:this.position[0],top: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.host.css({left:this.position.x,top: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"));var e=parseInt(this.host.css("top"));this.host.css({left:f+g.left,top: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.host.css("top",f.top);break;case"left":this.host.css("left",f.left);break;case"bottom":this.host.css("top",f.height-this.host.height()+f.top);break;case"right":this.host.css("left",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.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){this._modalBackground.remove()}},_toClose:function(f,e){return((f&&e[0]===this.element)||(e[0]!==this.element&&typeof e[0]==="object"))},propertyChangedHandler:function(e,f,h,g){this._validateProperties();switch(f){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();break;case"keyboardCloseKey":this._removeEventHandlers();this._addEventHandlers();break;case"disabled":if(g){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(g);this.title=g;break;case"content":this.setContent(g);break;case"draggable":this._removeEventHandlers();this._addEventHandlers();this._removeResize();this._initializeResize();break;case"resizable":this.enableResize=g;if(g){this._initializeResize()}else{this._removeResize()}break;case"position":this._positionWindow();break;case"modalOpacity":this._setModalBackgroundStyles();break;case"okButton":if(g){this._addDialogButtonsHandlers()}else{this.removeHandler(this.okButton)}break;case"cancelButton":if(g){this._addDialogButtonsHandlers()}else{this.removeHandler(this.cancelButton)}break;case"collapsed":if(g){if(!h){this.collapsed=false;this.collapse(0)}}else{if(h){this.collapsed=true;this.expand(0)}}case"theme":a.jqx.utilities.setTheme(h,g,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.host.is(":animated")){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))?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.host.css("min-height",h);this.host.animate({height:h},g,function(){e.collapsed=true;e._collapseButton.addClass(e.toThemeProperty("jqx-window-collapse-button-collapsed"));e._collapseButton.addClass(e.toThemeProperty("jqx-icon-arrow-down"));e._content.css("display","none");e._raiseEvent(5);e._raiseEvent(9);a.jqx.aria(e,"aria-expanded",false)})}},expand:function(f){if(this.collapsed&&!this.host.is(":animated")){var e=this,f=!isNaN(parseInt(f))?f:this.collapseAnimationDuration;this.host.animate({height:this._heightBeforeCollapse},f,function(){e.collapsed=false;e.host.css("min-height",e._minHeightBeforeCollapse);e._collapseButton.removeClass(e.toThemeProperty("jqx-window-collapse-button-collapsed"));e._collapseButton.removeClass(e.toThemeProperty("jqx-icon-arrow-down"));e._content.css("display","block");e._raiseEvent(6);e._performWidgetLayout();e._raiseEvent(9);a.jqx.aria(e,"aria-expanded",true)})}},closeAll:function(h){var 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(e){a.jqx.utilities.html(this._headerContentWrapper,e);this.title=e;this._performLayout()},setContent:function(f){this._contentInitialized=false;var e=this._content,g=false;while(!g){e.css("height","auto");e.css("width","auto");if(e.is(".jqx-window")){g=true}else{e=e.parent()}}a.jqx.utilities.html(this._content,f);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 l=f[f.length-1],k=parseInt(l.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].css("z-index",h)}this.host.css("z-index",k);this._sortByStyle("z-index",f)},hide:function(h,g,e){if(this.closing){var f=this.closing();if(f==false){return}}g=g||this.closeAnimationDuration;switch(this.animationType){case"none":this.host.css("display","none");break;case"fade":this.host.fadeOut(g,function(){if(h instanceof Function){h()}});case"slide":this.host.slideUp(g,function(){if(h instanceof Function){h()}});case"combined":this.host.hide(g,function(){if(h instanceof Function){h()}})}this._visible=false;if(this.isModal){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(h,g){this._setDialogResult("none");g=g||this.showAnimationDuration;switch(this.animationType){case"none":this.host.css("display","block");break;case"fade":this.host.fadeIn(g,function(){if(h instanceof Function){h()}});break;case"slide":this.host.slideDown(g,function(){if(h instanceof Function){h()}});break;case"combined":this.host.show(g,function(){if(h instanceof Function){h()}});break}if(this.isModal){this._modalBackground.show();this._fixWindowZIndex("modal-show")}var f=this;if(!this._visible){if(g>150&&this.animationType!="none"){setTimeout(function(){if(!f._contentInitialized){if(f.initContent){f.initContent();f._contentInitialized=true}}f._raiseEvent(7);f._raiseEvent(9)},g-150)}else{if(!f._contentInitialized){if(f.initContent){f.initContent();f._contentInitialized=true}}this._raiseEvent(7);f._raiseEvent(9)}}this._visible=true;this._performLayout();if(this.autoFocus){var e=function(){if(!f._isTouchDevice){f._content.focus()}};e();setTimeout(function(){e()},100)}},_getTabbables:function(){var f=this._content.find("*");var e=new Array();a.each(f,function(){if(d(this)){e[e.length]=this}});return e},move:function(q,p,e,h){var g=0,f=0,n,k,i,q=parseInt(q,10),p=parseInt(p,10);if(a.jqx.browser.msie){if(a(window).width()>a(document).width()&&!this.dragArea){f=this._SCROLL_WIDTH}if(a(window).height()document.documentElement.scrollWidth&&!this.dragArea){g=this._SCROLL_WIDTH}}n=this._validateCoordinates(q,p,f,g);if(parseInt(this.host.css("left"),10)!==n.x||parseInt(this.host.css("top"),10)!==n.y){if(e){var m=a.jqx.mobile.getTouches(e);var l=m[0];var o=a.jqx.position(e);k=o.left;i=o.top}if(k==undefined){k=q}if(i==undefined){i=p}if(h!==false){this._raiseEvent(2,n.x,n.y,k,i)}}this.element.style.left=n.x+"px";this.element.style.top=n.y+"px";this._moved=true}});function c(g,e){var k=g.nodeName.toLowerCase();if("area"===k){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(k)?!g.disabled:"a"==k?g.href||e:e)&&b(g)}function b(e){return !a(e).parents().andSelf().filter(function(){return a.css(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function d(g){var e=a.attr(g,"tabindex"),f=isNaN(e);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._cursorBackup;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;dthis.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.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(){this.resizeTarget.wrapInner(c("
      "));this._resizeWrapper=this.resizeTarget.children(0);this._resizeWrapper.addClass("jqx-resize");this._resizeWrapper.addClass("jqx-rc-all");this._resizeWrapper.css("z-index",8000)},_performResizeLayout:function(){this._resizeWrapper.height(this.resizeTarget.height());this._resizeWrapper.width(this.resizeTarget.width())},_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;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,e){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.css("cursor",d._cursorBackup)}},_resizeHandler:function(d,e){if(d.enableResize&&!d.collapsed){if(d.isResizing&&d._resizeDirection){if(e.which===0&&c.jqx.browser.msie&&c.jqx.browser.version<9){d._stopResizing(e)}d._performResize(e.pageX,e.pageY);return false}else{return d._resizeCaptureCursor(e.pageX,e.pageY)}}},_resizeCaptureCursor:function(e,d){if(this._resizeMouseDown&&!this.isResizing&&this._resizeDirection){if((e+3this._mouseResizePosition.x)||(d+3this._mouseResizePosition.y)){this._changeCursor(e-parseInt(this.resizeTarget.css("left")),d-parseInt(this.resizeTarget.css("top")));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(d,e){if(d.enableResize&&!d.collapsed){if(!d.isResizing){d._changeCursor(e.pageX-parseInt(d.resizeTarget.css("left")),e.pageY-parseInt(d.resizeTarget.css("top")))}}},_resizeMouseDownHandler:function(d,e){if(d.enableResize){if(d._resizeDirection!==null){d._resizeMouseDown=true;d._mouseResizePosition.x=e.pageX;d._mouseResizePosition.y=e.pageY;e.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))){throw new Error(this._resizeExceptions.invalidMinHeight)}if(this.maxHeight<=0||isNaN(parseInt(this.maxHeight))){throw new Error(this._resizeExceptions.invalidMaxHeight)}if(this.minWidth<0||isNaN(parseInt(this.minWidth))){throw new Error(this._resizeExceptions.invalidMinWidth)}if(this.maxWidth<0||isNaN(parseInt(this.maxWidth))){throw new Error(this._resizeExceptions.invalidMaxWidth)}if(this.resizeIndicatorSize<0||isNaN(parseInt(this.resizeIndicatorSize))){throw new Error(this._resizeExceptions.invalidIndicatorSize)}if(this.minHeight>this.maxHeight||this.minWidth>this.maxWidth){throw new Error(this._resizeExceptions.invalidSize)}}catch(d){alert(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.css("cursor","nw-resize");this._resizeDirection="topleft"}else{if(e<=this.resizeIndicatorSize&&e>0&&d>=this.resizeTarget.width()-this.resizeIndicatorSize){this._resizeWrapper.css("cursor","ne-resize");this._resizeDirection="topright"}else{if(e>=this.resizeTarget.height()-this.resizeIndicatorSize&&e=0){this._resizeWrapper.css("cursor","sw-resize");this._resizeDirection="bottomleft"}else{if(e>=this.resizeTarget.height()-this.resizeIndicatorSize&&e=this.resizeTarget.width()-this.resizeIndicatorSize&&d=0){this._resizeWrapper.css("cursor","e-resize");this._resizeDirection="left"}else{if(e<=this.resizeIndicatorSize&&e>0){this._resizeWrapper.css("cursor","n-resize");this._resizeDirection="top"}else{if(e>=this.resizeTarget.height()-this.resizeIndicatorSize&&e=this.resizeTarget.width()-this.resizeIndicatorSize&&d=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(f,k,i){var l=0,e=2,d=false,h=f,g=this._getParent();if(c(window).width()>c(document).width()&&c.jqx.browser.msie&&g.height===c(document).height()){l=this._SCROLL_WIDTH}if(i==="bottom"&&(f+k.position().top+l+e>g.height+g.top)){return{fix:g.height-k.position().top-l-e+g.top,result:false}}if(i==="top"&&k.lastHeight-f+k.yk.maxHeight){return{fix:k.maxHeight,result:false}}return{result:true,fix:f}},_validateWidth:function(k,i,h){var l=0,e=2,d=false,g=k,f=this._getParent();if(c(window).height()=document.documentElement.scrollWidth&&f.width===c(document).width()){l=this._SCROLL_WIDTH}if(h==="right"&&(k+i.position().left+l+e>f.width+f.left)){return{fix:f.width-i.position().left-l-e+f.left,result:false}}if(h==="left"&&(i.lastWidth-k+i.xi.maxWidth){return{fix:i.maxWidth,result:false}}return{result:true,fix:k}},_resize:function(h,e,d){var l=this._resizeDirection;var k=this._resizeMethods.length;for(var g=0;g0){this.resizeTargetChildren[h].width(g)}}else{var d=this.resizeTargetChildren[h].lastHeight-(this.resizeTarget.lastHeight-e);if(d0){this.resizeTargetChildren[h].height(d)}}}},_resizeRight:function(e){var f=e.element.lastWidth+e.x,d=e.self._validateResize(f,0,"horizontal",e.element,"right");if(!d.result){f=d.fix}if(e.element.width()!==f){e.self._setResizeChildrenSize(f,"width");e.element.width(f);e.self._raiseResizeEvent(0)}return f},_resizeLeft:function(f){var g=f.element.lastWidth-f.x,e=f.self._validateResize(g,0,"horizontal",f.element,"left"),d=f.element.x+f.x;if(!e.result){d=f.element.x+(f.element.lastWidth-e.fix);g=e.fix;return}if(f.element.width()!==g){f.self._setResizeChildrenSize(g,"width");f.element.width(g);f.element.css("left",d);f.self._raiseResizeEvent(0)}return g},_resizeBottom:function(f){var e=f.element.lastHeight+f.y,d=f.self._validateResize(0,e,"vertical",f.element,"bottom");if(!d.result){e=d.fix}if(f.element.height()!==e){f.self._setResizeChildrenSize(e,"height");f.element.height(e);f.self._raiseResizeEvent(0)}return e},_resizeTop:function(f){var e=f.element.lastHeight-f.y,d=f.self._validateResize(0,e,"vertical",f.element,"top"),g=f.element.y+f.y;if(!d.result){g=f.element.y+(f.element.lastHeight-d.fix);e=d.fix;return}if(f.element.height()!==e){f.self._setResizeChildrenSize(e,"height");f.element.height(e);f.element.css("top",g);f.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);d.height=parseInt(this.resizeTarget[0].style.height);g.args=d;if(f==0){var e=this._resizeEvents[2],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)); \ No newline at end of file