diff --git a/demos/js/jquery-3.5.0.min.min.js b/demos/js/jquery-3.5.0.min.min.js
deleted file mode 100644
index f0015c6..0000000
--- a/demos/js/jquery-3.5.0.min.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jQuery v3.5.0 | (c) JS Foundation and other contributors | jquery.org/license */
-;!function(b,a){"object"==typeof module&&"object"==typeof module.exports?module.exports=b.document?a(b,!0):function(c){if(!c.document){throw new Error("jQuery requires a window with a document")}return a(c)}:a(b)}("undefined"!=typeof window?window:this,function(cr,bM){var bu=[],bw=Object.getPrototypeOf,bv=bu.slice,bJ=bu.flat?function(a){return bu.flat.call(a)}:function(a){return bu.concat.apply([],a)},br=bu.push,bH=bu.indexOf,bA={},bz=bA.toString,bq=bA.hasOwnProperty,bQ=bq.toString,bD=bQ.call(Object),bm={},bC=function(a){return"function"==typeof a&&"number"!=typeof a.nodeType},bo=function(a){return null!=a&&a===a.window},cn=cr.document,bO={type:!0,src:!0,nonce:!0,noModule:!0};function bP(d,b,g){var c,a,f=(g=g||cn).createElement("script");if(f.text=d,b){for(c in bO){(a=b[c]||b.getAttribute&&b.getAttribute(c))&&f.setAttribute(c,a)}}g.head.appendChild(f).parentNode.removeChild(f)}function bp(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?bA[bz.call(a)]||"object":typeof a}var bK="3.5.0",b4=function(b,a){return new b4.fn.init(b,a)};function by(b){var a=!!b&&"length" in b&&b.length,c=bp(b);return !bC(b)&&!bo(b)&&("array"===c||0===a||"number"==typeof a&&0+~]|"+dG+")"+dG+"*"),dv=new RegExp(dG+"|>"),ds=new RegExp(dO),du=new RegExp("^"+dK+"$"),dN={ID:new RegExp("^#("+dK+")"),CLASS:new RegExp("^\\.("+dK+")"),TAG:new RegExp("^("+dK+"|[*])"),ATTR:new RegExp("^"+dt),PSEUDO:new RegExp("^"+dO),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+dG+"*(even|odd|(([+-]|)(\\d*)n|)"+dG+"*(?:([+-]|)"+dG+"*(\\d+)|))"+dG+"*\\)|)","i"),bool:new RegExp("^(?:"+dz+")$","i"),needsContext:new RegExp("^"+dG+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+dG+"*((?:-\\d)?\\d*)"+dG+"*\\)|)(?=[^-]|$)","i")},dr=/HTML$/i,dA=/^(?:input|select|textarea|button)$/i,dJ=/^h\d$/i,dI=/^[^{]+\{\s*\[native \w/,dq=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,at=/[+~]/,dR=new RegExp("\\\\[\\da-fA-F]{1,6}"+dG+"?|\\\\([^\\r\\n\\f])","g"),dL=function(b,a){var c="0x"+b.slice(1)-65536;return a||(c<0?String.fromCharCode(c+65536):String.fromCharCode(c>>10|55296,1023&c|56320))},d4=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,c8=function(b,a){return a?"\0"===b?"\ufffd":b.slice(0,-1)+"\\"+b.charCodeAt(b.length-1).toString(16)+" ":"\\"+b},df=function(){dw()},dV=dx(function(a){return !0===a.disabled&&"fieldset"===a.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{dM.apply(cZ=dC.call(c4.childNodes),c4.childNodes),cZ[c4.childNodes.length].nodeType}catch(di){dM={apply:cZ.length?function(b,a){dH.apply(b,dC.call(a))}:function(c,a){var d=c.length,b=0;while(c[d++]=a[b++]){}c.length=d-1}}}function dY(y,q,h,b){var k,g,w,z,x,j,v,m=q&&q.ownerDocument,d=q?q.nodeType:9;if(h=h||[],"string"!=typeof y||!y||1!==d&&9!==d&&11!==d){return h}if(!b&&(dw(q),q=q||dS,dP)){if(11!==d&&(x=dq.exec(y))){if(k=x[1]){if(9===d){if(!(w=q.getElementById(k))){return h}if(w.id===k){return h.push(w),h}}else{if(m&&(w=m.getElementById(k))&&cU(q,w)&&w.id===k){return h.push(w),h}}}else{if(x[2]){return dM.apply(h,q.getElementsByTagName(y)),h}if((k=x[3])&&dj.getElementsByClassName&&q.getElementsByClassName){return dM.apply(h,q.getElementsByClassName(k)),h}}}if(dj.qsa&&!dE[y+" "]&&(!cX||!cX.test(y))&&(1!==d||"object"!==q.nodeName.toLowerCase())){if(v=y,m=q,1===d&&(dv.test(y)||cT.test(y))){(m=at.test(y)&&d0(q.parentNode)||q)===q&&dj.scope||((z=q.getAttribute("id"))?z=z.replace(d4,c8):q.setAttribute("id",z=dy)),g=(j=dd(y)).length;while(g--){j[g]=(z?"#"+z:":scope")+" "+d5(j[g])}v=j.join(",")}try{return dM.apply(h,m.querySelectorAll(v)),h}catch(q){dE(y,!0)}finally{z===dy&&q.removeAttribute("id")}}}return dg(y.replace(dZ,"$1"),q,h,b)}function dl(){var a=[];return function b(c,d){return a.push(c+" ")>dm.cacheLength&&delete b[a.shift()],b[c+" "]=d}}function d3(a){return a[dy]=!0,a}function c2(b){var a=dS.createElement("fieldset");try{return !!b(a)}catch(b){return !1}finally{a.parentNode&&a.parentNode.removeChild(a),a=null}}function d2(c,a){var d=c.split("|"),b=d.length;while(b--){dm.attrHandle[d[b]]=a}}function cR(c,a){var d=a&&c,b=d&&1===c.nodeType&&1===a.nodeType&&c.sourceIndex-a.sourceIndex;if(b){return b}if(d){while(d=d.nextSibling){if(d===a){return -1}}}return c?1:-1}function ct(a){return function(b){return"input"===b.nodeName.toLowerCase()&&b.type===a}}function dD(a){return function(c){var b=c.nodeName.toLowerCase();return("input"===b||"button"===b)&&c.type===a}}function dW(a){return function(b){return"form" in b?b.parentNode&&!1===b.disabled?"label" in b?"label" in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&dV(b)===a:b.disabled===a:"label" in b&&b.disabled===a}}function cS(b){return d3(function(a){return a=+a,d3(function(g,d){var h,f=b([],g.length,a),c=f.length;while(c--){g[h=f[c]]&&(g[h]=!(d[h]=g[h]))}})})}function d0(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}for(di in dj=dY.support={},dc=dY.isXML=function(b){var a=b.namespaceURI,c=(b.ownerDocument||b).documentElement;return !dr.test(a||c&&c.nodeName||"HTML")},dw=dY.setDocument=function(c){var a,d,b=c?c.ownerDocument||c:c4;return b!=dS&&9===b.nodeType&&b.documentElement&&(dn=(dS=b).documentElement,dP=!dc(dS),c4!=dS&&(d=dS.defaultView)&&d.top!==d&&(d.addEventListener?d.addEventListener("unload",df,!1):d.attachEvent&&d.attachEvent("onunload",df)),dj.scope=c2(function(f){return dn.appendChild(f).appendChild(dS.createElement("div")),"undefined"!=typeof f.querySelectorAll&&!f.querySelectorAll(":scope fieldset div").length}),dj.attributes=c2(function(f){return f.className="i",!f.getAttribute("className")}),dj.getElementsByTagName=c2(function(f){return f.appendChild(dS.createComment("")),!f.getElementsByTagName("*").length}),dj.getElementsByClassName=dI.test(dS.getElementsByClassName),dj.getById=c2(function(f){return dn.appendChild(f).id=dy,!dS.getElementsByName||!dS.getElementsByName(dy).length}),dj.getById?(dm.filter.ID=function(g){var f=g.replace(dR,dL);return function(h){return h.getAttribute("id")===f}},dm.find.ID=function(g,f){if("undefined"!=typeof f.getElementById&&dP){var h=f.getElementById(g);return h?[h]:[]}}):(dm.filter.ID=function(f){var g=f.replace(dR,dL);return function(i){var h="undefined"!=typeof i.getAttributeNode&&i.getAttributeNode("id");return h&&h.value===g}},dm.find.ID=function(j,g){if("undefined"!=typeof g.getElementById&&dP){var l,h,f,k=g.getElementById(j);if(k){if((l=k.getAttributeNode("id"))&&l.value===j){return[k]}f=g.getElementsByName(j),h=0;while(k=f[h++]){if((l=k.getAttributeNode("id"))&&l.value===j){return[k]}}}return[]}}),dm.find.TAG=dj.getElementsByTagName?function(g,f){return"undefined"!=typeof f.getElementsByTagName?f.getElementsByTagName(g):dj.qsa?f.querySelectorAll(g):void 0}:function(j,g){var l,h=[],f=0,k=g.getElementsByTagName(j);if("*"===j){while(l=k[f++]){1===l.nodeType&&h.push(l)}return h}return k},dm.find.CLASS=dj.getElementsByClassName&&function(g,f){if("undefined"!=typeof f.getElementsByClassName&&dP){return f.getElementsByClassName(g)}},c0=[],cX=[],(dj.qsa=dI.test(dS.querySelectorAll))&&(c2(function(g){var f;dn.appendChild(g).innerHTML="",g.querySelectorAll("[msallowcapture^='']").length&&cX.push("[*^$]="+dG+"*(?:''|\"\")"),g.querySelectorAll("[selected]").length||cX.push("\\["+dG+"*(?:value|"+dz+")"),g.querySelectorAll("[id~="+dy+"-]").length||cX.push("~="),(f=dS.createElement("input")).setAttribute("name",""),g.appendChild(f),g.querySelectorAll("[name='']").length||cX.push("\\["+dG+"*name"+dG+"*="+dG+"*(?:''|\"\")"),g.querySelectorAll(":checked").length||cX.push(":checked"),g.querySelectorAll("a#"+dy+"+*").length||cX.push(".#.+[+~]"),g.querySelectorAll("\\\f"),cX.push("[\\r\\n\\f]")}),c2(function(g){g.innerHTML="";var f=dS.createElement("input");f.setAttribute("type","hidden"),g.appendChild(f).setAttribute("name","D"),g.querySelectorAll("[name=d]").length&&cX.push("name"+dG+"*[*^$|!~]?="),2!==g.querySelectorAll(":enabled").length&&cX.push(":enabled",":disabled"),dn.appendChild(g).disabled=!0,2!==g.querySelectorAll(":disabled").length&&cX.push(":enabled",":disabled"),g.querySelectorAll("*,:x"),cX.push(",.*:")})),(dj.matchesSelector=dI.test(dk=dn.matches||dn.webkitMatchesSelector||dn.mozMatchesSelector||dn.oMatchesSelector||dn.msMatchesSelector))&&c2(function(f){dj.disconnectedMatch=dk.call(f,"*"),dk.call(f,"[s!='']:x"),c0.push("!=",dO)}),cX=cX.length&&new RegExp(cX.join("|")),c0=c0.length&&new RegExp(c0.join("|")),a=dI.test(dn.compareDocumentPosition),cU=a||dI.test(dn.contains)?function(h,f){var i=9===h.nodeType?h.documentElement:h,g=f&&f.parentNode;return h===g||!(!g||1!==g.nodeType||!(i.contains?i.contains(g):h.compareDocumentPosition&&16&h.compareDocumentPosition(g)))}:function(g,f){if(f){while(f=f.parentNode){if(f===g){return !0}}}return !1},dQ=a?function(g,f){if(g===f){return c9=!0,0}var h=!g.compareDocumentPosition-!f.compareDocumentPosition;return h||(1&(h=(g.ownerDocument||g)==(f.ownerDocument||f)?g.compareDocumentPosition(f):1)||!dj.sortDetached&&f.compareDocumentPosition(g)===h?g==dS||g.ownerDocument==c4&&cU(c4,g)?-1:f==dS||f.ownerDocument==c4&&cU(c4,f)?1:cY?dB(cY,g)-dB(cY,f):0:4&h?-1:1)}:function(l,h){if(l===h){return c9=!0,0}var p,k=0,g=l.parentNode,m=h.parentNode,f=[l],j=[h];if(!g||!m){return l==dS?-1:h==dS?1:g?-1:m?1:cY?dB(cY,l)-dB(cY,h):0}if(g===m){return cR(l,h)}p=l;while(p=p.parentNode){f.unshift(p)}p=h;while(p=p.parentNode){j.unshift(p)}while(f[k]===j[k]){k++}return k?cR(f[k],j[k]):f[k]==c4?-1:j[k]==c4?1:0}),dS},dY.matches=function(b,a){return dY(b,null,null,a)},dY.matchesSelector=function(b,a){if(dw(b),dj.matchesSelector&&dP&&!dE[a+" "]&&(!c0||!c0.test(a))&&(!cX||!cX.test(a))){try{var c=dk.call(b,a);if(c||dj.disconnectedMatch||b.document&&11!==b.document.nodeType){return c}}catch(b){dE(a,!0)}}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(dR,dL),a[3]=(a[3]||a[4]||a[5]||"").replace(dR,dL),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||dY.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&dY.error(a[0]),a},PSEUDO:function(b){var a,c=!b[6]&&b[2];return dN.CHILD.test(b[0])?null:(b[3]?b[2]=b[4]||b[5]||"":c&&ds.test(c)&&(a=dd(c,!0))&&(a=c.indexOf(")",c.length-a)-c.length)&&(b[0]=b[0].slice(0,a),b[2]=c.slice(0,a)),b.slice(0,3))}},filter:{TAG:function(b){var a=b.replace(dR,dL).toLowerCase();return"*"===b?function(){return !0}:function(c){return c.nodeName&&c.nodeName.toLowerCase()===a}},CLASS:function(b){var a=c7[b+" "];return a||(a=new RegExp("(^|"+dG+")"+b+"("+dG+"|$)"))&&c7(b,function(c){return a.test("string"==typeof c.className&&c.className||"undefined"!=typeof c.getAttribute&&c.getAttribute("class")||"")})},ATTR:function(c,b,a){return function(f){var d=dY.attr(f,c);return null==d?"!="===b:!b||(d+="","="===b?d===a:"!="===b?d!==a:"^="===b?a&&0===d.indexOf(a):"*="===b?a&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function cp(b,c,a){return bC(c)?b4.grep(b,function(f,d){return !!c.call(f,d,f)!==a}):c.nodeType?b4.grep(b,function(d){return d===c!==a}):"string"!=typeof c?b4.grep(b,function(d){return -1)[^>]*|#([\w-]+))$/;(b4.fn.init=function(d,b,f){var c,a;if(!d){return this}if(f=f||bF,"string"==typeof d){if(!(c="<"===d[0]&&">"===d[d.length-1]&&3<=d.length?[null,d,null]:bx.exec(d))||!c[1]&&b){return !b||b.jquery?(b||f).find(d):this.constructor(b).find(d)}if(c[1]){if(b=b instanceof b4?b[0]:b,b4.merge(this,b4.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:cn,!0)),cb.test(c[1])&&b4.isPlainObject(b)){for(c in b){bC(this[c])?this[c](b[c]):this.attr(c,b[c])}}return this}return(a=cn.getElementById(c[2]))&&(this[0]=a,this.length=1),this}return d.nodeType?(this[0]=d,this.length=1,this):bC(d)?void 0!==f.ready?f.ready(d):d(b4):b4.makeArray(d,this)}).prototype=b4.fn,bF=b4(cn);var cd=/^(?:parents|prev(?:Until|All))/,cj={children:!0,contents:!0,next:!0,prev:!0};function b9(b,a){while((b=b[a])&&1!==b.nodeType){}return b}b4.fn.extend({has:function(b){var a=b4(b,this),c=a.length;return this.filter(function(){for(var d=0;d\x20\t\r\n\f]*)/i,aK=/^$|^module$|\/(?:java|ecma)script/i;bG=cn.createDocumentFragment().appendChild(cn.createElement("div")),(a1=cn.createElement("input")).setAttribute("type","radio"),a1.setAttribute("checked","checked"),a1.setAttribute("name","t"),bG.appendChild(a1),bm.checkClone=bG.cloneNode(!0).cloneNode(!0).lastChild.checked,bG.innerHTML="",bm.noCloneChecked=!!bG.cloneNode(!0).lastChild.defaultValue,bG.innerHTML="",bm.option=!!bG.lastChild;var aS={thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};function aw(b,a){var c;return c="undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a||"*"):"undefined"!=typeof b.querySelectorAll?b.querySelectorAll(a||"*"):[],void 0===a||a&&cv(b,a)?b4.merge([b],c):c}function cJ(c,a){for(var d=0,b=c.length;d",""]);var cH=/<|?\w+;/;function ac(x,C,k,b,q){for(var j,A,D,B,m,z,w=C.createDocumentFragment(),g=[],y=0,v=x.length;y\s*$/g;function bc(b,a){return cv(b,"table")&&cv(11!==a.nodeType?a:a.firstChild,"tr")&&b4(b).children("tbody")[0]||b}function bb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function cG(a){return"true/"===(a.type||"").slice(0,5)?a.type=a.type.slice(5):a.removeAttribute("type"),a}function aL(h,d){var k,g,c,j,b,f;if(1===d.nodeType){if(bW.hasData(h)&&(f=bW.get(h).events)){for(c in bW.remove(d,"handle events"),f){for(k=0,g=f[c].length;k").attr(c.scriptAttrs||{}).prop({charset:c.scriptCharset,src:c.url}).on("load error",a=function(g){b.remove(),a=null,g&&d("error"===g.type?404:200,g.type)}),cn.head.appendChild(b[0])},abort:function(){a&&a()}}}});var cl,ba=[],bL=/(=)\?(?=&|$)|\?\?/;b4.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=ba.pop()||b4.expando+"_"+aF.guid++;return this[a]=!0,a}}),b4.ajaxPrefilter("json jsonp",function(g,d,j){var f,c,h,b=!1!==g.jsonp&&(bL.test(g.url)?"url":"string"==typeof g.data&&0===(g.contentType||"").indexOf("application/x-www-form-urlencoded")&&bL.test(g.data)&&"data");if(b||"jsonp"===g.dataTypes[0]){return f=g.jsonpCallback=bC(g.jsonpCallback)?g.jsonpCallback():g.jsonpCallback,b?g[b]=g[b].replace(bL,"$1"+f):!1!==g.jsonp&&(g.url+=(an.test(g.url)?"&":"?")+g.jsonp+"="+f),g.converters["script json"]=function(){return h||b4.error(f+" was not called"),h[0]},g.dataTypes[0]="json",c=cr[f],cr[f]=function(){h=arguments},j.always(function(){void 0===c?b4(cr).removeProp(f):cr[f]=c,g[f]&&(g.jsonpCallback=d.jsonpCallback,ba.push(f)),h&&bC(c)&&c(h[0]),h=c=void 0}),"script"}}),bm.createHTMLDocument=((cl=cn.implementation.createHTMLDocument("").body).innerHTML="",2===cl.childNodes.length),b4.parseHTML=function(d,b,g){return"string"!=typeof d?[]:("boolean"==typeof b&&(g=b,b=!1),b||(bm.createHTMLDocument?((c=(b=cn.implementation.createHTMLDocument("")).createElement("base")).href=cn.location.href,b.head.appendChild(c)):b=cn),f=!g&&[],(a=cb.exec(d))?[b.createElement(a[1])]:(a=ac([d],b,f),f&&f.length&&b4(f).remove(),b4.merge([],a.childNodes)));var c,a,f},b4.fn.load=function(h,d,k){var g,c,j,b=this,f=h.indexOf(" ");return -1").append(b4.parseHTML(a)).find(g):a)}).always(k&&function(i,a){b.each(function(){k.apply(this,j||[i.responseText,a,i])})}),this},b4.expr.pseudos.animated=function(a){return b4.grep(b4.timers,function(b){return a===b.elem}).length},b4.offset={setOffset:function(m,w,g){var b,j,d,q,x,v,h=b4.css(m,"position"),p=b4(m),k={};"static"===h&&(m.style.position="relative"),x=p.offset(),d=b4.css(m,"top"),v=b4.css(m,"left"),("absolute"===h||"fixed"===h)&&-1<(d+v).indexOf("auto")?(q=(b=p.position()).top,j=b.left):(q=parseFloat(d)||0,j=parseFloat(v)||0),bC(w)&&(w=w.call(m,g,b4.extend({},x))),null!=w.top&&(k.top=w.top-x.top+q),null!=w.left&&(k.left=w.left-x.left+j),"using" in w?w.using.call(m,k):("number"==typeof k.top&&(k.top+="px"),"number"==typeof k.left&&(k.left+="px"),p.css(k))}},b4.fn.extend({offset:function(a){if(arguments.length){return void 0===a?this:this.each(function(f){b4.offset.setOffset(this,a,f)})}var c,d,b=this[0];return b?b.getClientRects().length?(c=b.getBoundingClientRect(),d=b.ownerDocument.defaultView,{top:c.top+d.pageYOffset,left:c.left+d.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var d,b,f,c=this[0],a={top:0,left:0};if("fixed"===b4.css(c,"position")){b=c.getBoundingClientRect()}else{b=this.offset(),f=c.ownerDocument,d=c.offsetParent||f.documentElement;while(d&&(d===f.body||d===f.documentElement)&&"static"===b4.css(d,"position")){d=d.parentNode}d&&d!==c&&1===d.nodeType&&((a=b4(d).offset()).top+=b4.css(d,"borderTopWidth",!0),a.left+=b4.css(d,"borderLeftWidth",!0))}return{top:b.top-a.top-b4.css(c,"marginTop",!0),left:b.left-a.left-b4.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent;while(a&&"static"===b4.css(a,"position")){a=a.offsetParent}return a||a4})}}),b4.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,a){var c="pageYOffset"===a;b4.fn[b]=function(d){return cF(this,function(h,f,i){var g;if(bo(h)?g=h:9===h.nodeType&&(g=h.defaultView),void 0===i){return g?g[a]:h[f]}g?g.scrollTo(c?g.pageXOffset:i,c?i:g.pageYOffset):h[f]=i},b,d,arguments.length)}}),b4.each(["top","left"],function(a,b){b4.cssHooks[b]=cq(bm.pixelPosition,function(d,c){if(c){return c=aR(d,b),a3.test(c)?b4(d).position()[b]+"px":c}})}),b4.each({Height:"height",Width:"width"},function(b,c){b4.each({padding:"inner"+b,content:c,"":"outer"+b},function(a,d){b4.fn[d]=function(h,g){var j=arguments.length&&(a||"boolean"!=typeof h),f=a||(!0===h||!0===g?"margin":"border");return cF(this,function(l,i,m){var k;return bo(l)?0===d.indexOf("outer")?l["inner"+b]:l.document.documentElement["client"+b]:9===l.nodeType?(k=l.documentElement,Math.max(l.body["scroll"+b],k["scroll"+b],l.body["offset"+b],k["offset"+b],k["client"+b])):void 0===m?b4.css(l,i,f):b4.style(l,i,m,f)},c,j?h:void 0,j)}})}),b4.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(b,a){b4.fn[a]=function(c){return this.on(a,c)}}),b4.fn.extend({bind:function(b,a,c){return this.on(b,null,a,c)},unbind:function(b,a){return this.off(b,null,a)},delegate:function(c,a,d,b){return this.on(a,c,d,b)},undelegate:function(b,a,c){return 1===arguments.length?this.off(b,"**"):this.off(a,b||"**",c)},hover:function(b,a){return this.mouseenter(b).mouseleave(a||b)}}),b4.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){b4.fn[b]=function(d,c){return 0 0)
- date.setDate(date.getDate() + o.expires);
- else {
- date.setYear(1970);
- clear = true;
- }
- }
- if (date) params += ';expires='+ date.toUTCString();
- if (o.path) params += ';path='+ o.path;
- if (o.domain) params += ';domain='+ o.domain;
- if (o.secure) params += ';secure';
- document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie
- }
+ , write: function (name, val, cookieOpts) {
+ var
+ params = ''
+ , date = ''
+ , clear = false
+ , o = cookieOpts || {}
+ ;
+ if (!o.expires) ; // skip
+ else if (o.expires.toUTCString)
+ date = o.expires;
+ else if (typeof o.expires == 'number') {
+ date = new Date();
+ if (o.expires > 0)
+ date.setDate(date.getDate() + o.expires);
+ else {
+ date.setYear(1970);
+ clear = true;
+ }
+ }
+ if (date) params += '; expires='+ date.toUTCString();
+ if (o.path) params += '; path='+ o.path;
+ if (o.domain) params += '; domain='+ o.domain;
+ if (o.secure) params += '; Secure; SameSite=' + o.sameSite;
+ if (o.httpOnly) params += '; HttpOnly';
+ document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie
+ }
-, clear: function (name) {
- $.ui.cookie.write(name, '', {expires: -1});
- }
+ , clear: function (name) {
+ $.ui.cookie.write(name, '', {expires: -1});
+ }
-};
+ };
// tell Layout that the state plugin is available
-$.layout.plugins.stateManagement = true;
+ $.layout.plugins.stateManagement = true;
// Add State-Management options to layout.defaults
-$.layout.defaults.stateManagement = {
- enabled: false // true = enable state-management, even if not using cookies
-, autoSave: true // Save a state-cookie when page exits?
-, autoLoad: true // Load the state-cookie when Layout inits?
- // List state-data to save - must be pane-specific
-, stateKeys: "north.size,south.size,east.size,west.size,"+
- "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+
- "north.isHidden,south.isHidden,east.isHidden,west.isHidden"
-, cookie: {
- name: "" // If not specified, will use Layout.name, else just "Layout"
- , domain: "" // blank = current domain
- , path: "" // blank = current page, '/' = entire website
- , expires: "" // 'days' to keep cookie - leave blank for 'session cookie'
- , secure: false
- }
-};
+ $.layout.defaults.stateManagement = {
+ enabled: false // true = enable state-management, even if not using cookies
+ , autoSave: true // Save a state-cookie when page exits?
+ , autoLoad: true // Load the state-cookie when Layout inits?
+ // List state-data to save - must be pane-specific
+ , stateKeys: "north.size,south.size,east.size,west.size,"+
+ "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+
+ "north.isHidden,south.isHidden,east.isHidden,west.isHidden"
+ , cookie: {
+ name: "" // If not specified, will use Layout.name, else just "Layout"
+ , domain: "" // blank = current domain
+ , path: "" // blank = current page, '/' = entire website
+ , expires: "" // 'days' to keep cookie - leave blank for 'session cookie'
+ , secure: false
+ , sameSite: "Strict" //Default to strict but allow override to non
+ , httpOnly: false //careful, JS - for now - does need to access the cookie
+ , hostOnly: true
+ }
+ };
// Set stateManagement as a layout-option, NOT a pane-option
-$.layout.optionsMap.layout.push("stateManagement");
+ $.layout.optionsMap.layout.push("stateManagement");
-/*
- * State Managment methods
- */
-$.layout.state = {
- // set data used by multiple methods below
- config: {
- allPanes: "north,south,west,east,center"
- }
+ /*
+ * State Managment methods
+ */
+ $.layout.state = {
+ // set data used by multiple methods below
+ config: {
+ allPanes: "north,south,west,east,center"
+ }
- /**
- * Get the current layout state and save it to a cookie
- *
- * myLayout.saveCookie( keys, cookieOpts )
- *
- * @param {Object} inst
- * @param {(string|Array)=} keys
- * @param {Object=} opts
- */
-, saveCookie: function (inst, keys, cookieOpts) {
- var o = inst.options
- , oS = o.stateManagement
- , oC = $.extend( {}, oS.cookie, cookieOpts || {} )
- , data = inst.state.stateData = inst.readState( keys || oS.stateKeys ) // read current panes-state
- ;
- $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC );
- return $.extend( {}, data ); // return COPY of state.stateData data
- }
+ /**
+ * Get the current layout state and save it to a cookie
+ *
+ * myLayout.saveCookie( keys, cookieOpts )
+ *
+ * @param {Object} inst
+ * @param {(string|Array)=} keys
+ * @param {Object=} opts
+ */
+ , saveCookie: function (inst, keys, cookieOpts) {
+ var o = inst.options
+ , oS = o.stateManagement
+ , oC = $.extend( {}, oS.cookie, cookieOpts || {} )
+ , data = inst.state.stateData = inst.readState( keys || oS.stateKeys ) // read current panes-state
+ ;
+ $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC );
+ return $.extend( {}, data ); // return COPY of state.stateData data
+ }
- /**
- * Remove the state cookie
- *
- * @param {Object} inst
- */
-, deleteCookie: function (inst) {
- var o = inst.options;
- $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" );
- }
+ /**
+ * Remove the state cookie
+ *
+ * @param {Object} inst
+ */
+ , deleteCookie: function (inst) {
+ var o = inst.options;
+ $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" );
+ }
- /**
- * Read & return data from the cookie - as JSON
- *
- * @param {Object} inst
- */
-, readCookie: function (inst) {
- var o = inst.options;
- var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" );
- // convert cookie string back to a hash and return it
- return c ? $.layout.state.decodeJSON(c) : {};
- }
+ /**
+ * Read & return data from the cookie - as JSON
+ *
+ * @param {Object} inst
+ */
+ , readCookie: function (inst) {
+ var o = inst.options;
+ var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" );
+ // convert cookie string back to a hash and return it
+ return c ? $.layout.state.decodeJSON(c) : {};
+ }
- /**
- * Get data from the cookie and USE IT to loadState
- *
- * @param {Object} inst
- */
-, loadCookie: function (inst) {
- var c = $.layout.state.readCookie(inst); // READ the cookie
- if (c && !$.isEmptyObject( c )) {
- inst.state.stateData = $.extend({}, c); // SET state.stateData
- inst.loadState(c); // LOAD the retrieved state
- }
- return c;
- }
+ /**
+ * Get data from the cookie and USE IT to loadState
+ *
+ * @param {Object} inst
+ */
+ , loadCookie: function (inst) {
+ var c = $.layout.state.readCookie(inst); // READ the cookie
+ if (c && !$.isEmptyObject( c )) {
+ inst.state.stateData = $.extend({}, c); // SET state.stateData
+ inst.loadState(c); // LOAD the retrieved state
+ }
+ return c;
+ }
- /**
- * Update layout options from the cookie, if one exists
- *
- * @param {Object} inst
- * @param {Object=} stateData
- * @param {boolean=} animate
- */
-, loadState: function (inst, stateData, animate) {
- stateData = $.layout.transformData( stateData ); // panes = default subkey
- $.extend( true, inst.options, stateData ); // update layout options
- // if layout has already been initialized, then UPDATE layout state
- if (inst.state.initialized) {
- var pane, o, s, h, c
- , noAnimate = (animate===false);
- $.each($.layout.state.config.allPanes.split(","), function (idx, pane) {
- o = stateData[ pane ];
- if (typeof o != 'object') return; // no key, continue
- s = o.size;
- c = o.initClosed;
- h = o.initHidden;
- if (s > 0 || s=="auto") inst.sizePane(pane, s, false, null, noAnimate); // will animate resize if option enabled
- if (h === true) inst.hide(pane, a);
- else if (c === false) inst.open (pane, false, noAnimate);
- else if (c === true) inst.close(pane, false, noAnimate);
- else if (h === false) inst.show (pane, false, noAnimate);
- });
- }
- }
+ /**
+ * Update layout options from the cookie, if one exists
+ *
+ * @param {Object} inst
+ * @param {Object=} stateData
+ * @param {boolean=} animate
+ */
+ , loadState: function (inst, stateData, animate) {
+ stateData = $.layout.transformData( stateData ); // panes = default subkey
+ $.extend( true, inst.options, stateData ); // update layout options
+ // if layout has already been initialized, then UPDATE layout state
+ if (inst.state.initialized) {
+ var pane, o, s, h, c
+ , noAnimate = (animate===false);
+ $.each($.layout.state.config.allPanes.split(","), function (idx, pane) {
+ o = stateData[ pane ];
+ if (typeof o != 'object') return; // no key, continue
+ s = o.size;
+ c = o.initClosed;
+ h = o.initHidden;
+ if (s > 0 || s=="auto") inst.sizePane(pane, s, false, null, noAnimate); // will animate resize if option enabled
+ if (h === true) inst.hide(pane, a);
+ else if (c === false) inst.open (pane, false, noAnimate);
+ else if (c === true) inst.close(pane, false, noAnimate);
+ else if (h === false) inst.show (pane, false, noAnimate);
+ });
+ }
+ }
- /**
- * Get the *current layout state* and return it as a hash
- *
- * @param {Object=} inst
- * @param {(string|Array)=} keys
- */
-, readState: function (inst, keys) {
- var
- data = {}
- , alt = { isClosed: 'initClosed', isHidden: 'initHidden' }
- , state = inst.state
- , pair, pane, key, val
- ;
- if (!keys) keys = inst.options.stateManagement.stateKeys; // if called by user
- if ($.isArray(keys)) keys = keys.join(",");
- // convert keys to an array and change delimiters from '__' to '.'
- keys = keys.replace(/__/g, ".").split(',');
- // loop keys and create a data hash
- for (var i=0, n=keys.length; i < n; i++) {
- pair = keys[i].split(".");
- pane = pair[0];
- key = pair[1];
- if ($.layout.state.config.allPanes.indexOf(pane) < 0) continue; // bad pane!
- val = state[ pane ][ key ];
- if (val == undefined) continue;
- if (key=="isClosed" && state[pane]["isSliding"])
- val = true; // if sliding, then *really* isClosed
- ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val;
- }
- return data;
- }
+ /**
+ * Get the *current layout state* and return it as a hash
+ *
+ * @param {Object=} inst
+ * @param {(string|Array)=} keys
+ */
+ , readState: function (inst, keys) {
+ var
+ data = {}
+ , alt = { isClosed: 'initClosed', isHidden: 'initHidden' }
+ , state = inst.state
+ , pair, pane, key, val
+ ;
+ if (!keys) keys = inst.options.stateManagement.stateKeys; // if called by user
+ if ($.isArray(keys)) keys = keys.join(",");
+ // convert keys to an array and change delimiters from '__' to '.'
+ keys = keys.replace(/__/g, ".").split(',');
+ // loop keys and create a data hash
+ for (var i=0, n=keys.length; i < n; i++) {
+ pair = keys[i].split(".");
+ pane = pair[0];
+ key = pair[1];
+ if ($.layout.state.config.allPanes.indexOf(pane) < 0) continue; // bad pane!
+ val = state[ pane ][ key ];
+ if (val == undefined) continue;
+ if (key=="isClosed" && state[pane]["isSliding"])
+ val = true; // if sliding, then *really* isClosed
+ ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val;
+ }
+ return data;
+ }
- /**
- * Stringify a JSON hash so can save in a cookie or db-field
- */
-, encodeJSON: function (JSON) {
- var native = window.JSON || {};
- return (native.stringify || stringify)(JSON);
+ /**
+ * Stringify a JSON hash so can save in a cookie or db-field
+ */
+ , encodeJSON: function (JSON) {
+ var native = window.JSON || {};
+ return (native.stringify || stringify)(JSON);
- function stringify (h) {
- var D=[], i=0, k, v, t; // k = key, v = value
- for (k in h) {
- v = h[k];
- t = typeof v;
- if (t == 'string') // STRING - add quotes
- v = '"'+ v +'"';
- else if (t == 'object') // SUB-KEY - recurse into it
- v = parse(v);
- D[i++] = '"'+ k +'":'+ v;
- }
- return '{'+ D.join(',') +'}';
- };
- }
+ function stringify (h) {
+ var D=[], i=0, k, v, t; // k = key, v = value
+ for (k in h) {
+ v = h[k];
+ t = typeof v;
+ if (t == 'string') // STRING - add quotes
+ v = '"'+ v +'"';
+ else if (t == 'object') // SUB-KEY - recurse into it
+ v = parse(v);
+ D[i++] = '"'+ k +'":'+ v;
+ }
+ return '{'+ D.join(',') +'}';
+ };
+ }
- /**
- * Convert stringified JSON back to a hash object
- * @see $.parseJSON(), adding in jQuery 1.4.1
- */
-, decodeJSON: function (str) {
- try { return $.parseJSON ? $.parseJSON(str) : window["eval"]("("+ str +")") || {}; }
- catch (e) { return {}; }
- }
+ /**
+ * Convert stringified JSON back to a hash object
+ * @see $.parseJSON(), adding in jQuery 1.4.1
+ */
+ , decodeJSON: function (str) {
+ try { return JSON ? JSON.parse(str) : window["eval"]("("+ str +")") || {}; }
+ catch (e) { return {}; }
+ }
-, _create: function (inst) {
- // ADD State-Management plugin methods to inst
- $.extend( inst, {
- // readCookie - update options from cookie - returns hash of cookie data
- readCookie: function () { return $.layout.state.readCookie(inst); }
- // deleteCookie
- , deleteCookie: function () { $.layout.state.deleteCookie(inst); }
- // saveCookie - optionally pass keys-list and cookie-options (hash)
- , saveCookie: function (keys, cookieOpts) { return $.layout.state.saveCookie(inst, keys, cookieOpts); }
- // loadCookie - readCookie and use to loadState() - returns hash of cookie data
- , loadCookie: function () { return $.layout.state.loadCookie(inst); }
- // loadState - pass a hash of state to use to update options
- , loadState: function (stateData, animate) { $.layout.state.loadState(inst, stateData, animate); }
- // readState - returns hash of current layout-state
- , readState: function (keys) { return $.layout.state.readState(inst, keys); }
- // add JSON utility methods too...
- , encodeJSON: $.layout.state.encodeJSON
- , decodeJSON: $.layout.state.decodeJSON
- });
+ , _create: function (inst) {
+ // ADD State-Management plugin methods to inst
+ $.extend( inst, {
+ // readCookie - update options from cookie - returns hash of cookie data
+ readCookie: function () { return $.layout.state.readCookie(inst); }
+ // deleteCookie
+ , deleteCookie: function () { $.layout.state.deleteCookie(inst); }
+ // saveCookie - optionally pass keys-list and cookie-options (hash)
+ , saveCookie: function (keys, cookieOpts) { return $.layout.state.saveCookie(inst, keys, cookieOpts); }
+ // loadCookie - readCookie and use to loadState() - returns hash of cookie data
+ , loadCookie: function () { return $.layout.state.loadCookie(inst); }
+ // loadState - pass a hash of state to use to update options
+ , loadState: function (stateData, animate) { $.layout.state.loadState(inst, stateData, animate); }
+ // readState - returns hash of current layout-state
+ , readState: function (keys) { return $.layout.state.readState(inst, keys); }
+ // add JSON utility methods too...
+ , encodeJSON: $.layout.state.encodeJSON
+ , decodeJSON: $.layout.state.decodeJSON
+ });
- // init state.stateData key, even if plugin is initially disabled
- inst.state.stateData = {};
+ // init state.stateData key, even if plugin is initially disabled
+ inst.state.stateData = {};
- // read and load cookie-data per options
- var oS = inst.options.stateManagement;
- if (oS.enabled) {
- if (oS.autoLoad) // update the options from the cookie
- inst.loadCookie();
- else // don't modify options - just store cookie data in state.stateData
- inst.state.stateData = inst.readCookie();
- }
- }
+ // read and load cookie-data per options
+ var oS = inst.options.stateManagement;
+ if (oS.enabled) {
+ if (oS.autoLoad) // update the options from the cookie
+ inst.loadCookie();
+ else // don't modify options - just store cookie data in state.stateData
+ inst.state.stateData = inst.readCookie();
+ }
+ }
-, _unload: function (inst) {
- var oS = inst.options.stateManagement;
- if (oS.enabled) {
- if (oS.autoSave) // save a state-cookie automatically
- inst.saveCookie();
- else // don't save a cookie, but do store state-data in state.stateData key
- inst.state.stateData = inst.readState();
- }
- }
+ , _unload: function (inst) {
+ var oS = inst.options.stateManagement;
+ if (oS.enabled) {
+ if (oS.autoSave) // save a state-cookie automatically
+ inst.saveCookie();
+ else // don't save a cookie, but do store state-data in state.stateData key
+ inst.state.stateData = inst.readState();
+ }
+ }
-};
+ };
// add state initialization method to Layout's onCreate array of functions
-$.layout.onCreate.push( $.layout.state._create );
-$.layout.onUnload.push( $.layout.state._unload );
+ $.layout.onCreate.push( $.layout.state._create );
+ $.layout.onUnload.push( $.layout.state._unload );
})( jQuery );
diff --git a/demos/js/jquery.layout_and_plugins.js b/demos/js/jquery.layout_and_plugins.js
index ebef014..fac9f08 100644
--- a/demos/js/jquery.layout_and_plugins.js
+++ b/demos/js/jquery.layout_and_plugins.js
@@ -1,8 +1,8 @@
/**
* @preserve
- * jquery.layout 1.8.1
- * $Date: 2019-06-05 $
- * $Rev: 1.8.1 $
+ * jquery.layout 1.8.2
+ * $Date: 2019-06-18 $
+ * $Rev: 1.8.2 $
*
* Copyright (c) 2014 Kevin Dalman (http://jquery-dev.com)
* Based on work by Fabrizio Balliano (http://www.fabrizioballiano.net)
@@ -85,8 +85,8 @@
* GENERIC $.layout METHODS - used by all layouts
*/
$.layout = {
- version: "1.7.4"
- , revision: 1.7002 // eg: ver 1.4.4 = rev 1.0404 - major(n+).minor(nn)+patch(nn+)
+ version: "1.8.2"
+ , revision: 1.8002 // eg: ver 1.4.4 = rev 1.0404 - major(n+).minor(nn)+patch(nn+)
// $.layout.browser REPLACES $.browser
, browser: {} // set below
@@ -2372,7 +2372,7 @@
, layoutEdge: pane
, layoutRole: "pane"
})
- .css(c.cssReq).css("zIndex", options.zIndexes.pane_normal)
+ .css(c.cssReq).css("zIndex", new String(options.zIndexes.pane_normal))
.css(o.applyDemoStyles ? c.cssDemo : {}) // demo styles
.addClass(o.paneClass + " " + o.paneClass + "-" + pane) // default = "ui-layout-pane ui-layout-pane-west" - may be a dupe of 'paneSelector'
.on("mouseenter." + sID, addHover)
@@ -3947,12 +3947,12 @@
// must remove double-click-toggle when using dblclick-slide
if (o.resizerDblClickToggle && evtName.match(/click/)) {
- $R[enable ? "unbind" : "bind"]('dblclick.' + sID, toggle)
+ $R[enable ? "off" : "on"]('dblclick.' + sID, toggle)
}
$R
// add or remove event
- [enable ? "bind" : "unbind"](evtName + '.' + sID, slideOpen)
+ [enable ? "on" : "off"](evtName + '.' + sID, slideOpen)
// set the appropriate cursor & title/tip
.css("cursor", enable ? o.sliderCursor : "default")
.attr("title", enable ? o.tips.Slide : "")
@@ -3974,7 +3974,7 @@
, c = _c[pane]
, z = options.zIndexes
, evtName = o.slideTrigger_close.toLowerCase()
- , action = (enable ? "bind" : "unbind")
+ , action = (enable ? "on" : "off")
, $P = $Ps[pane]
, $R = $Rs[pane]
;
@@ -5455,7 +5455,8 @@
// in the packed version for some reason...
var path = options.path ? '; path=' + (options.path) : '';
var domain = options.domain ? '; domain=' + (options.domain) : '';
- var secure = options.secure ? '; secure' : '';
+ var secure = options.secure ? '; secure; samesite=' + options.sameSite : '';
+ var httpOnly = options.httpOnly ? '; HttpOnly' : '';
document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
} else { // only name given, get cookie
var cookieValue = null;
@@ -5475,494 +5476,350 @@
};
- (function ($) {
+ /**
+ * @preserve jquery.layout.state 1.0
+ * $Date: 2011-07-16 08:00:00 (Sat, 16 July 2011) $
+ *
+ * Copyright (c) 2010
+ * Kevin Dalman (http://allpro.net)
+ *
+ * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html)
+ * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses.
+ *
+ * @dependancies: UI Layout 1.3.0.rc30.1 or higher
+ * @dependancies: $.ui.cookie (above)
+ *
+ * @support: http://groups.google.com/group/jquery-ui-layout
+ */
+ /*
+ * State-management options stored in options.stateManagement, which includes a .cookie hash
+ * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden
+ *
+ * // STATE/COOKIE OPTIONS
+ * @example $(el).layout({
+ stateManagement: {
+ enabled: true
+ , stateKeys: "east.size,west.size,east.isClosed,west.isClosed"
+ , cookie: { name: "appLayout", path: "/" }
+ }
+ })
+ * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies
+ * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } })
+ * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" })
+ *
+ * // STATE/COOKIE METHODS
+ * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} );
+ * @example myLayout.loadCookie();
+ * @example myLayout.deleteCookie();
+ * @example var JSON = myLayout.readState(); // CURRENT Layout State
+ * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie)
+ * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash)
+ *
+ * CUSTOM STATE-MANAGEMENT (eg, saved in a database)
+ * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" );
+ * @example myLayout.loadState( JSON );
+ */
- if (!$.layout)
- return;
+ // NOTE: For best readability, view with a fixed-width font and tabs equal to 4-chars
+ ;(function ($) {
- /**
- * UI COOKIE UTILITY
- *
- * A $.cookie OR $.ui.cookie namespace *should be standard*, but until then...
- * This creates $.ui.cookie so Layout does not need the cookie.jquery.js plugin
- * NOTE: This utility is REQUIRED by the layout.state plugin
- *
- * Cookie methods in Layout are created as part of State Management
- */
- if (!$.ui)
- $.ui = {};
- $.ui.cookie = {
- // cookieEnabled is not in DOM specs, but DOES works in all browsers,including IE6
- acceptsCookies: !!navigator.cookieEnabled
+ if (!$.layout) return;
- , read: function (name) {
- var
- c = document.cookie
- , cs = c ? c.split(';') : []
- , pair, data, i
- ;
- for (i = 0; pair = cs[i]; i++) {
- data = String.prototype.trim.call(pair).split('='); // name=value => [ name, value ]
- if (data[0] == name) // found the layout cookie
- return decodeURIComponent(data[1]);
- }
- return null;
+
+ /*
+ * GENERIC COOKIE/DATA MANAGEMENT
+ *
+ * A $.cookie OR $.ui.cookie namespace *should be* standard.
+ * Until this is standard, I'll create my own $.ui.cookie methods!
+ */
+ $.ui.cookie = {
+
+ // TODO: is the cookieEnabled property fully cross-browser???
+ acceptsCookies: !!navigator.cookieEnabled
+
+ , read: function (name) {
+ var
+ c = document.cookie
+ , cs = c ? c.split(';') : []
+ , pair // loop var
+ ;
+ for (var i=0, n=cs.length; i < n; i++) {
+ pair = String.prototype.trim.call(cs[i]).split('='); // name=value pair
+ if (pair[0] == name) // found the layout cookie
+ return decodeURIComponent(pair[1]);
}
+ return "";
+ }
- , write: function (name, val, cookieOpts) {
- var params = ""
- , date = ""
- , clear = false
- , o = cookieOpts || {}
- , x = o.expires || null
- , t = typeof(x)
- ;
- if (t === "date")
- date = x;
- else if (t === "string" && x > 0) {
- x = parseInt(x, 10);
- t = "number";
- }
- if (t === "number") {
- date = new Date();
- if (x > 0)
- date.setDate(date.getDate() + x);
- else {
- date.setFullYear(1970);
- clear = true;
- }
+ , write: function (name, val, cookieOpts) {
+ var
+ params = ''
+ , date = ''
+ , clear = false
+ , o = cookieOpts || {}
+ ;
+ if (!o.expires) ; // skip
+ else if (o.expires.toUTCString)
+ date = o.expires;
+ else if (typeof o.expires == 'number') {
+ date = new Date();
+ if (o.expires > 0)
+ date.setDate(date.getDate() + o.expires);
+ else {
+ date.setYear(1970);
+ clear = true;
}
- if (date)
- params += ";expires=" + date.toUTCString();
- if (o.path)
- params += ";path=" + o.path;
- if (o.domain)
- params += ";domain=" + o.domain;
- if (o.secure)
- params += ";secure";
- document.cookie = name + "=" + (clear ? "" : encodeURIComponent(val)) + params; // write or clear cookie
}
+ if (date) params += '; expires='+ date.toUTCString();
+ if (o.path) params += '; path='+ o.path;
+ if (o.domain) params += '; domain='+ o.domain;
+ if (o.secure) params += '; Secure; SameSite=' + o.sameSite;
+ if (o.httpOnly) params += '; HttpOnly';
+ document.cookie = name +'='+ (clear ? "" : encodeURIComponent( val )) + params; // write or clear cookie
+ }
- , clear: function (name) {
- $.ui.cookie.write(name, "", {expires: -1});
- }
+ , clear: function (name) {
+ $.ui.cookie.write(name, '', {expires: -1});
+ }
- };
-// if cookie.jquery.js is not loaded, create an alias to replicate it
-// this may be useful to other plugins or code dependent on that plugin
- if (!$.cookie)
- $.cookie = function (k, v, o) {
- var C = $.ui.cookie;
- if (v === null)
- C.clear(k);
- else if (v === undefined)
- return C.read(k);
- else
- C.write(k, v, o);
- };
+ };
+ // tell Layout that the state plugin is available
+ $.layout.plugins.stateManagement = true;
+
+ // Add State-Management options to layout.defaults
+ $.layout.defaults.stateManagement = {
+ enabled: false // true = enable state-management, even if not using cookies
+ , autoSave: true // Save a state-cookie when page exits?
+ , autoLoad: true // Load the state-cookie when Layout inits?
+ // List state-data to save - must be pane-specific
+ , stateKeys: "north.size,south.size,east.size,west.size,"+
+ "north.isClosed,south.isClosed,east.isClosed,west.isClosed,"+
+ "north.isHidden,south.isHidden,east.isHidden,west.isHidden"
+ , cookie: {
+ name: "" // If not specified, will use Layout.name, else just "Layout"
+ , domain: "" // blank = current domain
+ , path: "" // blank = current page, '/' = entire website
+ , expires: "" // 'days' to keep cookie - leave blank for 'session cookie'
+ , secure: false
+ , sameSite: "Strict" //Default to strict but allow override to non
+ , httpOnly: false //careful, JS - for now - does need to access the cookie
+ , hostOnly: true
+ }
+ };
+ // Set stateManagement as a layout-option, NOT a pane-option
+ $.layout.optionsMap.layout.push("stateManagement");
+
+ /*
+ * State Managment methods
+ */
+ $.layout.state = {
+ // set data used by multiple methods below
+ config: {
+ allPanes: "north,south,west,east,center"
+ }
+
/**
- * State-management options stored in options.stateManagement, which includes a .cookie hash
- * Default options saves ALL KEYS for ALL PANES, ie: pane.size, pane.isClosed, pane.isHidden
- *
- * // STATE/COOKIE OPTIONS
- * @example $(el).layout({
- stateManagement: {
- enabled: true
- , stateKeys: "east.size,west.size,east.isClosed,west.isClosed"
- , cookie: { name: "appLayout", path: "/" }
- }
- })
- * @example $(el).layout({ stateManagement__enabled: true }) // enable auto-state-management using cookies
- * @example $(el).layout({ stateManagement__cookie: { name: "appLayout", path: "/" } })
- * @example $(el).layout({ stateManagement__cookie__name: "appLayout", stateManagement__cookie__path: "/" })
+ * Get the current layout state and save it to a cookie
*
- * // STATE/COOKIE METHODS
- * @example myLayout.saveCookie( "west.isClosed,north.size,south.isHidden", {expires: 7} );
- * @example myLayout.loadCookie();
- * @example myLayout.deleteCookie();
- * @example var JSON = myLayout.readState(); // CURRENT Layout State
- * @example var JSON = myLayout.readCookie(); // SAVED Layout State (from cookie)
- * @example var JSON = myLayout.state.stateData; // LAST LOADED Layout State (cookie saved in layout.state hash)
+ * myLayout.saveCookie( keys, cookieOpts )
*
- * CUSTOM STATE-MANAGEMENT (eg, saved in a database)
- * @example var JSON = myLayout.readState( "west.isClosed,north.size,south.isHidden" );
- * @example myLayout.loadState( JSON );
+ * @param {Object} inst
+ * @param {(string|Array)=} keys
+ * @param {Object=} opts
*/
+ , saveCookie: function (inst, keys, cookieOpts) {
+ var o = inst.options
+ , oS = o.stateManagement
+ , oC = $.extend( {}, oS.cookie, cookieOpts || {} )
+ , data = inst.state.stateData = inst.readState( keys || oS.stateKeys ) // read current panes-state
+ ;
+ $.ui.cookie.write( oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC );
+ return $.extend( {}, data ); // return COPY of state.stateData data
+ }
-// tell Layout that the state plugin is available
- $.layout.plugins.stateManagement = true;
-
-// Add State-Management options to layout.defaults
- $.layout.defaults.stateManagement = {
- enabled: false // true = enable state-management, even if not using cookies
- , autoSave: true // Save a state-cookie when page exits?
- , autoLoad: true // Load the state-cookie when Layout inits?
- , animateLoad: true // animate panes when loading state into an active layout
- , includeChildren: true // recurse into child layouts to include their state as well
- // List state-data to save - must be pane-specific
- , stateKeys: "north.size,south.size,east.size,west.size," +
- "north.isClosed,south.isClosed,east.isClosed,west.isClosed," +
- "north.isHidden,south.isHidden,east.isHidden,west.isHidden"
- , cookie: {
- name: "" // If not specified, will use Layout.name, else just "Layout"
- , domain: "" // blank = current domain
- , path: "" // blank = current page, "/" = entire website
- , expires: "" // 'days' to keep cookie - leave blank for 'session cookie'
- , secure: false
- }
- };
-
-// Set stateManagement as a 'layout-option', NOT a 'pane-option'
- $.layout.optionsMap.layout.push("stateManagement");
-// Update config so layout does not move options into the pane-default branch (panes)
- $.layout.config.optionRootKeys.push("stateManagement");
-
- /*
- * State Management methods
- */
- $.layout.state = {
- /**
- * Get the current layout state and save it to a cookie
- *
- * myLayout.saveCookie( keys, cookieOpts )
- *
- * @param {Object} inst
- * @param {(string|Array)=} keys
- * @param {Object=} cookieOpts
- */
- saveCookie: function (inst, keys, cookieOpts) {
- var o = inst.options
- , sm = o.stateManagement
- , oC = $.extend(true, {}, sm.cookie, cookieOpts || null)
- , data = inst.state.stateData = inst.readState(keys || sm.stateKeys) // read current panes-state
- ;
- $.ui.cookie.write(oC.name || o.name || "Layout", $.layout.state.encodeJSON(data), oC);
- return $.extend(true, {}, data); // return COPY of state.stateData data
- }
+ /**
+ * Remove the state cookie
+ *
+ * @param {Object} inst
+ */
+ , deleteCookie: function (inst) {
+ var o = inst.options;
+ $.ui.cookie.clear( o.stateManagement.cookie.name || o.name || "Layout" );
+ }
- /**
- * Remove the state cookie
- *
- * @param {Object} inst
- */
- , deleteCookie: function (inst) {
- var o = inst.options;
- $.ui.cookie.clear(o.stateManagement.cookie.name || o.name || "Layout");
- }
+ /**
+ * Read & return data from the cookie - as JSON
+ *
+ * @param {Object} inst
+ */
+ , readCookie: function (inst) {
+ var o = inst.options;
+ var c = $.ui.cookie.read( o.stateManagement.cookie.name || o.name || "Layout" );
+ // convert cookie string back to a hash and return it
+ return c ? $.layout.state.decodeJSON(c) : {};
+ }
- /**
- * Read & return data from the cookie - as JSON
- *
- * @param {Object} inst
- */
- , readCookie: function (inst) {
- var o = inst.options;
- var c = $.ui.cookie.read(o.stateManagement.cookie.name || o.name || "Layout");
- // convert cookie string back to a hash and return it
- return c ? $.layout.state.decodeJSON(c) : {};
+ /**
+ * Get data from the cookie and USE IT to loadState
+ *
+ * @param {Object} inst
+ */
+ , loadCookie: function (inst) {
+ var c = $.layout.state.readCookie(inst); // READ the cookie
+ if (c && !$.isEmptyObject( c )) {
+ inst.state.stateData = $.extend({}, c); // SET state.stateData
+ inst.loadState(c); // LOAD the retrieved state
}
+ return c;
+ }
- /**
- * Get data from the cookie and USE IT to loadState
- *
- * @param {Object} inst
- */
- , loadCookie: function (inst) {
- var c = $.layout.state.readCookie(inst); // READ the cookie
- if (c && !$.isEmptyObject(c)) {
- inst.state.stateData = $.extend(true, {}, c); // SET state.stateData
- inst.loadState(c); // LOAD the retrieved state
- }
- return c;
+ /**
+ * Update layout options from the cookie, if one exists
+ *
+ * @param {Object} inst
+ * @param {Object=} stateData
+ * @param {boolean=} animate
+ */
+ , loadState: function (inst, stateData, animate) {
+ stateData = $.layout.transformData( stateData ); // panes = default subkey
+ $.extend( true, inst.options, stateData ); // update layout options
+ // if layout has already been initialized, then UPDATE layout state
+ if (inst.state.initialized) {
+ var pane, o, s, h, c
+ , noAnimate = (animate===false);
+ $.each($.layout.state.config.allPanes.split(","), function (idx, pane) {
+ o = stateData[ pane ];
+ if (typeof o != 'object') return; // no key, continue
+ s = o.size;
+ c = o.initClosed;
+ h = o.initHidden;
+ if (s > 0 || s=="auto") inst.sizePane(pane, s, false, null, noAnimate); // will animate resize if option enabled
+ if (h === true) inst.hide(pane, a);
+ else if (c === false) inst.open (pane, false, noAnimate);
+ else if (c === true) inst.close(pane, false, noAnimate);
+ else if (h === false) inst.show (pane, false, noAnimate);
+ });
}
+ }
- /**
- * Update layout options from the cookie, if one exists
- *
- * @param {Object} inst
- * @param {Object=} stateData
- * @param {boolean=} animate
- */
- , loadState: function (inst, data, opts) {
- if (!$.isPlainObject(data) || $.isEmptyObject(data))
- return;
-
- // normalize data & cache in the state object
- data = inst.state.stateData = $.layout.transformData(data); // panes = default subkey
-
- // add missing/default state-restore options
- var smo = inst.options.stateManagement;
- opts = $.extend({
- animateLoad: false //smo.animateLoad
- , includeChildren: smo.includeChildren
- }, opts);
-
- if (!inst.state.initialized) {
- /*
- * layout NOT initialized, so just update its options
- */
- // MUST remove pane.children keys before applying to options
- // use a copy so we don't remove keys from original data
- var o = $.extend(true, {}, data);
- //delete o.center; // center has no state-data - only children
- $.each($.layout.config.allPanes, function (idx, pane) {
- if (o[pane])
- delete o[pane].children;
- });
- // update CURRENT layout-options with saved state data
- $.extend(true, inst.options, o);
- } else {
- /*
- * layout already initialized, so modify layout's configuration
- */
- var noAnimate = !opts.animateLoad
- , o, c, h, state, open
- ;
- $.each($.layout.config.borderPanes, function (idx, pane) {
- o = data[pane];
- if (!$.isPlainObject(o))
- return; // no key, skip pane
-
- s = o.size;
- c = o.initClosed;
- h = o.initHidden;
- ar = o.autoResize;
- state = inst.state[pane];
- open = state.isVisible;
-
- // reset autoResize
- if (ar)
- state.autoResize = ar;
- // resize BEFORE opening
- if (!open)
- inst._sizePane(pane, s, false, false, false); // false=skipCallback/noAnimation/forceResize
- // open/close as necessary - DO NOT CHANGE THIS ORDER!
- if (h === true)
- inst.hide(pane, noAnimate);
- else if (c === true)
- inst.close(pane, false, noAnimate);
- else if (c === false)
- inst.open(pane, false, noAnimate);
- else if (h === false)
- inst.show(pane, false, noAnimate);
- // resize AFTER any other actions
- if (open)
- inst._sizePane(pane, s, false, false, noAnimate); // animate resize if option passed
- });
-
- /*
- * RECURSE INTO CHILD-LAYOUTS
- */
- if (opts.includeChildren) {
- var paneStateChildren, childState;
- $.each(inst.children, function (pane, paneChildren) {
- paneStateChildren = data[pane] ? data[pane].children : 0;
- if (paneStateChildren && paneChildren) {
- $.each(paneChildren, function (stateKey, child) {
- childState = paneStateChildren[stateKey];
- if (child && childState)
- child.loadState(childState);
- });
- }
- });
- }
- }
+ /**
+ * Get the *current layout state* and return it as a hash
+ *
+ * @param {Object=} inst
+ * @param {(string|Array)=} keys
+ */
+ , readState: function (inst, keys) {
+ var
+ data = {}
+ , alt = { isClosed: 'initClosed', isHidden: 'initHidden' }
+ , state = inst.state
+ , pair, pane, key, val
+ ;
+ if (!keys) keys = inst.options.stateManagement.stateKeys; // if called by user
+ if ($.isArray(keys)) keys = keys.join(",");
+ // convert keys to an array and change delimiters from '__' to '.'
+ keys = keys.replace(/__/g, ".").split(',');
+ // loop keys and create a data hash
+ for (var i=0, n=keys.length; i < n; i++) {
+ pair = keys[i].split(".");
+ pane = pair[0];
+ key = pair[1];
+ if ($.layout.state.config.allPanes.indexOf(pane) < 0) continue; // bad pane!
+ val = state[ pane ][ key ];
+ if (val == undefined) continue;
+ if (key=="isClosed" && state[pane]["isSliding"])
+ val = true; // if sliding, then *really* isClosed
+ ( data[pane] || (data[pane]={}) )[ alt[key] ? alt[key] : key ] = val;
}
+ return data;
+ }
- /**
- * Get the *current layout state* and return it as a hash
- *
- * @param {Object=} inst // Layout instance to get state for
- * @param {object=} [opts] // State-Managements override options
- */
- , readState: function (inst, opts) {
- // backward compatility
- if (typeof(opts) === 'string')
- opts = {keys: opts};
- if (!opts)
- opts = {};
- var sm = inst.options.stateManagement
- , ic = opts.includeChildren
- , recurse = ic !== undefined ? ic : sm.includeChildren
- , keys = opts.stateKeys || sm.stateKeys
- , alt = {isClosed: 'initClosed', isHidden: 'initHidden'}
- , state = inst.state
- , panes = $.layout.config.allPanes
- , data = {}
- , pair, pane, key, val
- , ps, pC, child, array, count, branch
- ;
- if (Array.isArray(keys))
- keys = keys.join(",");
- // convert keys to an array and change delimiters from '__' to '.'
- keys = keys.replace(/__/g, ".").split(',');
- // loop keys and create a data hash
- for (var i = 0, n = keys.length; i < n; i++) {
- pair = keys[i].split(".");
- pane = pair[0];
- key = pair[1];
- if ($.inArray(pane, panes) < 0)
- continue; // bad pane!
- val = state[pane][key];
- if (val == undefined)
- continue;
- if (key == "isClosed" && state[pane]["isSliding"])
- val = true; // if sliding, then *really* isClosed
- (data[pane] || (data[pane] = {}))[alt[key] ? alt[key] : key] = val;
+ /**
+ * Stringify a JSON hash so can save in a cookie or db-field
+ */
+ , encodeJSON: function (JSON) {
+ var native = window.JSON || {};
+ return (native.stringify || stringify)(JSON);
+
+ function stringify (h) {
+ var D=[], i=0, k, v, t; // k = key, v = value
+ for (k in h) {
+ v = h[k];
+ t = typeof v;
+ if (t == 'string') // STRING - add quotes
+ v = '"'+ v +'"';
+ else if (t == 'object') // SUB-KEY - recurse into it
+ v = parse(v);
+ D[i++] = '"'+ k +'":'+ v;
}
+ return '{'+ D.join(',') +'}';
+ };
+ }
- // recurse into the child-layouts for each pane
- if (recurse) {
- $.each(panes, function (idx, pane) {
- pC = inst.children[pane];
- ps = state.stateData[pane];
- if ($.isPlainObject(pC) && !$.isEmptyObject(pC)) {
- // ensure a key exists for this 'pane', eg: branch = data.center
- branch = data[pane] || (data[pane] = {});
- if (!branch.children)
- branch.children = {};
- $.each(pC, function (key, child) {
- // ONLY read state from an initialize layout
- if (child.state.initialized)
- branch.children[key] = $.layout.state.readState(child);
- // if we have PREVIOUS (onLoad) state for this child-layout, KEEP IT!
- else if (ps && ps.children && ps.children[key]) {
- branch.children[key] = $.extend(true, {}, ps.children[key]);
- }
- });
- }
- });
- }
+ /**
+ * Convert stringified JSON back to a hash object
+ * @see $.parseJSON(), adding in jQuery 1.4.1
+ */
+ , decodeJSON: function (str) {
+ try { return JSON ? JSON.parse(str) : window["eval"]("("+ str +")") || {}; }
+ catch (e) { return {}; }
+ }
- return data;
- }
- /**
- * Stringify a JSON hash so can save in a cookie or db-field
- */
- , encodeJSON: function (json) {
- var local = window.JSON || {};
- return (local.stringify || stringify)(json);
+ , _create: function (inst) {
+ // ADD State-Management plugin methods to inst
+ $.extend( inst, {
+ // readCookie - update options from cookie - returns hash of cookie data
+ readCookie: function () { return $.layout.state.readCookie(inst); }
+ // deleteCookie
+ , deleteCookie: function () { $.layout.state.deleteCookie(inst); }
+ // saveCookie - optionally pass keys-list and cookie-options (hash)
+ , saveCookie: function (keys, cookieOpts) { return $.layout.state.saveCookie(inst, keys, cookieOpts); }
+ // loadCookie - readCookie and use to loadState() - returns hash of cookie data
+ , loadCookie: function () { return $.layout.state.loadCookie(inst); }
+ // loadState - pass a hash of state to use to update options
+ , loadState: function (stateData, animate) { $.layout.state.loadState(inst, stateData, animate); }
+ // readState - returns hash of current layout-state
+ , readState: function (keys) { return $.layout.state.readState(inst, keys); }
+ // add JSON utility methods too...
+ , encodeJSON: $.layout.state.encodeJSON
+ , decodeJSON: $.layout.state.decodeJSON
+ });
- function stringify(h) {
- var D = [], i = 0, k, v, t // k = key, v = value
- , a = Array.isArray(h)
- ;
- for (k in h) {
- v = h[k];
- t = typeof v;
- if (t == 'string') // STRING - add quotes
- v = '"' + v + '"';
- else if (t == 'object') // SUB-KEY - recurse into it
- v = parse(v);
- D[i++] = (!a ? '"' + k + '":' : '') + v;
- }
- return (a ? '[' : '{') + D.join(',') + (a ? ']' : '}');
- }
- }
+ // init state.stateData key, even if plugin is initially disabled
+ inst.state.stateData = {};
- /**
- * Convert stringified JSON back to a hash object
- * @see $.parseJSON(), adding in jQuery 1.4.1
- */
- , decodeJSON: function (str) {
- try {
- return $.parseJSON ? $.parseJSON(str) : window["eval"]("(" + str + ")") || {};
- } catch (e) {
- return {};
- }
+ // read and load cookie-data per options
+ var oS = inst.options.stateManagement;
+ if (oS.enabled) {
+ if (oS.autoLoad) // update the options from the cookie
+ inst.loadCookie();
+ else // don't modify options - just store cookie data in state.stateData
+ inst.state.stateData = inst.readCookie();
}
+ }
-
- , _create: function (inst) {
- var s = $.layout.state
- , o = inst.options
- , sm = o.stateManagement
- ;
- // ADD State-Management plugin methods to inst
- $.extend(inst, {
- // readCookie - update options from cookie - returns hash of cookie data
- readCookie: function () {
- return s.readCookie(inst);
- }
- // deleteCookie
- , deleteCookie: function () {
- s.deleteCookie(inst);
- }
- // saveCookie - optionally pass keys-list and cookie-options (hash)
- , saveCookie: function (keys, cookieOpts) {
- return s.saveCookie(inst, keys, cookieOpts);
- }
- // loadCookie - readCookie and use to loadState() - returns hash of cookie data
- , loadCookie: function () {
- return s.loadCookie(inst);
- }
- // loadState - pass a hash of state to use to update options
- , loadState: function (stateData, opts) {
- s.loadState(inst, stateData, opts);
- }
- // readState - returns hash of current layout-state
- , readState: function (keys) {
- return s.readState(inst, keys);
- }
- // add JSON utility methods too...
- , encodeJSON: s.encodeJSON
- , decodeJSON: s.decodeJSON
- });
-
- // init state.stateData key, even if plugin is initially disabled
- inst.state.stateData = {};
-
- // autoLoad MUST BE one of: data-array, data-hash, callback-function, or TRUE
- if (!sm.autoLoad)
- return;
-
- // When state-data exists in the autoLoad key USE IT,
- // even if stateManagement.enabled == false
- if ($.isPlainObject(sm.autoLoad)) {
- if (!$.isEmptyObject(sm.autoLoad)) {
- inst.loadState(sm.autoLoad);
- }
- } else if (sm.enabled) {
- // update the options from cookie or callback
- // if options is a function, call it to get stateData
- if (typeof sm.autoLoad === "function") {
- var d = {};
- try {
- d = sm.autoLoad(inst, inst.state, inst.options, inst.options.name || ''); // try to get data from fn
- } catch (e) {
- }
- if (d && $.isPlainObject(d) && !$.isEmptyObject(d))
- inst.loadState(d);
- } else // any other truthy value will trigger loadCookie
- inst.loadCookie();
- }
+ , _unload: function (inst) {
+ var oS = inst.options.stateManagement;
+ if (oS.enabled) {
+ if (oS.autoSave) // save a state-cookie automatically
+ inst.saveCookie();
+ else // don't save a cookie, but do store state-data in state.stateData key
+ inst.state.stateData = inst.readState();
}
+ }
- , _unload: function (inst) {
- var sm = inst.options.stateManagement;
- if (sm.enabled && sm.autoSave) {
- // if options is a function, call it to save the stateData
- if (typeof sm.autoSave === "function") {
- try {
- sm.autoSave(inst, inst.state, inst.options, inst.options.name || ''); // try to get data from fn
- } catch (e) {
- }
- } else // any truthy value will trigger saveCookie
- inst.saveCookie();
- }
- }
+ };
- };
+ // add state initialization method to Layout's onCreate array of functions
+ $.layout.onCreate.push( $.layout.state._create );
+ $.layout.onUnload.push( $.layout.state._unload );
-// add state initialization method to Layout's onCreate array of functions
- $.layout.onCreate.push($.layout.state._create);
- $.layout.onUnload.push($.layout.state._unload);
+})( jQuery );
- })(jQuery);
(function ($) {
diff --git a/demos/js/jquery.layout_and_plugins.min.js b/demos/js/jquery.layout_and_plugins.min.js
index 72daffd..435d77a 100644
--- a/demos/js/jquery.layout_and_plugins.min.js
+++ b/demos/js/jquery.layout_and_plugins.min.js
@@ -1 +1 @@
-(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(jQuery){(function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(v){return typeof(v)==="string"},runPluginCallbacks=function(Instance,a_fn){if(Array.isArray(a_fn)){for(var i=0,c=a_fn.length;i').appendTo("body"),d={width:$c.outerWidth-$c[0].clientWidth,height:100-$c[0].clientHeight};$c.remove();window.scrollbarWidth=d.width;window.scrollbarHeight=d.height;return dim.match(/^(width|height)$/)?d[dim]:d},disableTextSelection:function(){var $d=$(document),s="textSelectionDisabled",x="textSelectionInitialized";if($.fn.disableSelection){if(!$d.data(x)){$d.on("mouseup",$.layout.enableTextSelection).data(x,true)}if(!$d.data(s)){$d.disableSelection().data(s,true)}}},enableTextSelection:function(){var $d=$(document),s="textSelectionDisabled";if($.fn.enableSelection&&$d.data(s)){$d.enableSelection().data(s,false)}},showInvisibly:function($E,force){if($E&&$E.length&&(force||$E.css("display")==="none")){var s=$E[0].style,CSS={display:s.display||"",visibility:s.visibility||""};$E.css({display:"block",visibility:"hidden"});return CSS}return{}},getElementDimensions:function($E,inset){var d={css:{},inset:{}},x=d.css,i={bottom:0},N=$.layout.cssNum,R=Math.round,off=$E.offset(),b,p,ei;d.offsetLeft=off.left;d.offsetTop=off.top;if(!inset){inset={}}$.each("Left,Right,Top,Bottom".split(","),function(idx,e){b=x["border"+e]=$.layout.borderWidth($E,e);p=x["padding"+e]=$.layout.cssNum($E,"padding"+e);ei=e.toLowerCase();d.inset[ei]=inset[ei]>=0?inset[ei]:p;i[ei]=d.inset[ei]+b});x.width=R($E.width());x.height=R($E.height());x.top=N($E,"top",true);x.bottom=N($E,"bottom",true);x.left=N($E,"left",true);x.right=N($E,"right",true);d.outerWidth=R($E.outerWidth());d.outerHeight=R($E.outerHeight());d.innerWidth=max(0,d.outerWidth-i.left-i.right);d.innerHeight=max(0,d.outerHeight-i.top-i.bottom);d.layoutWidth=R($E.innerWidth());d.layoutHeight=R($E.innerHeight());return d},getElementStyles:function($E,list){var CSS={},style=$E[0].style,props=list.split(","),sides="Top,Bottom,Left,Right".split(","),attrs="Color,Style,Width".split(","),p,s,a,i,j,k;for(i=0;i=L&&x<=R)&&(y>=T&&y<=B))},msg:function(info,popup,debugTitle,debugOpts){if($.isPlainObject(info)&&window.debugData){if(typeof popup==="string"){debugOpts=debugTitle;debugTitle=popup}else{if(typeof debugTitle==="object"){debugOpts=debugTitle;debugTitle=null}}var t=debugTitle||"log( /g,">")+"")}}}function createLog(){var pos=$.support.fixedPosition?"fixed":"absolute",$e=$('').appendTo("body");$e.css("left",$(window).width()-$e.outerWidth()-5);if($.ui.draggable){$e.draggable({handle:":first-child"})}return $e}}};(function(){var u=navigator.userAgent.toLowerCase(),m=/(chrome)[ \/]([\w.]+)/.exec(u)||/(webkit)[ \/]([\w.]+)/.exec(u)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(u)||/(msie) ([\w.]+)/.exec(u)||u.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(u)||[],b=m[1]||"",v=m[2]||0,ie=b==="msie",cm=document.compatMode,$s=$.support,bs=$s.boxSizing!==undefined?$s.boxSizing:$s.boxSizingReliable,bm=!ie||!cm||cm==="CSS1Compat"||$s.boxModel||false,lb=$.layout.browser={version:v,safari:b==="webkit",webkit:b==="chrome",msie:ie,isIE6:ie&&v==6,boxModel:bm,boxSizing:!!(typeof bs==="function"?bs():bs)};if(b){lb[b]=true}if(!bm&&!cm){$(function(){lb.boxModel=$s.boxModel})}})();$.layout.defaults={name:"",containerClass:"ui-layout-container",inset:null,scrollToBookmarkOnLoad:true,resizeWithWindow:true,resizeWithWindowDelay:200,resizeWithWindowMaxDelay:0,maskPanesEarly:false,onresizeall_start:null,onresizeall_end:null,onload_start:null,onload_end:null,onunload_start:null,onunload_end:null,initPanes:true,showErrorMessages:true,showDebugMessages:false,zIndex:null,zIndexes:{pane_normal:0,content_mask:1,resizer_normal:2,pane_sliding:100,pane_animate:1000,resizer_drag:10000},errors:{pane:"pane",selector:"selector",addButtonError:"Error Adding Button\nInvalid ",containerMissing:"UI Layout Initialization Error\nThe specified layout-container does not exist.",centerPaneMissing:"UI Layout Initialization Error\nThe center-pane element does not exist.\nThe center-pane is a required element.",noContainerHeight:"UI Layout Initialization Warning\nThe layout-container \"CONTAINER\" has no height.\nTherefore the layout is 0-height and hence 'invisible'!",callbackError:"UI Layout Callback Error\nThe EVENT callback is not a valid function."},panes:{applyDemoStyles:false,responsive:{enabled:false,when:"md",sizes:{xl:1140,lg:992,md:768,sm:576,xs:0}},closable:true,resizable:true,slidable:true,initClosed:false,initHidden:false,contentSelector:".ui-layout-content",contentIgnoreSelector:".ui-layout-ignore",findNestedContent:false,paneClass:"ui-layout-pane",resizerClass:"ui-layout-resizer",togglerClass:"ui-layout-toggler",buttonClass:"ui-layout-button",minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerContent_open:"",togglerContent_closed:"",resizerDblClickToggle:true,autoResize:true,autoReopen:true,resizerDragOpacity:1,maskContents:false,maskObjects:false,maskZindex:null,resizingGrid:false,livePaneResizing:false,liveContentResizing:false,liveResizingTolerance:1,sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseleave",slideDelay_open:300,slideDelay_close:300,hideTogglerOnSlide:false,preventQuickSlideClose:$.layout.browser.webkit,preventPrematureSlideClose:false,tips:{Open:"Open",Close:"Close",Resize:"Resize",Slide:"Slide Open",Pin:"Pin",Unpin:"Un-Pin",noRoomToOpen:"Not enough room to show this panel.",minSizeWarning:"Panel has reached its minimum size",maxSizeWarning:"Panel has reached its maximum size"},showOverflowOnHover:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},fxOpacityFix:true,animatePaneSizing:false,children:null,containerSelector:"",initChildren:true,destroyChildren:true,resizeChildren:true,triggerEventsOnLoad:false,triggerEventsDuringLiveResize:true,onshow_start:null,onshow_end:null,onhide_start:null,onhide_end:null,onopen_start:null,onopen_end:null,onclose_start:null,onclose_end:null,onresize_start:null,onresize_end:function(){},onsizecontent_start:null,onsizecontent_end:null,onswap_start:null,onswap_end:null,ondrag_start:null,ondrag_end:null},north:{paneSelector:".ui-layout-north",size:"auto",resizerCursor:"n-resize",customHotkey:""},south:{paneSelector:".ui-layout-south",size:"auto",resizerCursor:"s-resize",customHotkey:""},east:{paneSelector:".ui-layout-east",size:200,resizerCursor:"e-resize",customHotkey:""},west:{paneSelector:".ui-layout-west",size:200,resizerCursor:"w-resize",customHotkey:""},center:{paneSelector:".ui-layout-center",minWidth:0,minHeight:0}};$.layout.optionsMap={layout:("name,instanceKey,stateManagement,effects,inset,zIndexes,errors,zIndex,scrollToBookmarkOnLoad,showErrorMessages,maskPanesEarly,outset,resizeWithWindow,resizeWithWindowDelay,resizeWithWindowMaxDelay,onresizeall,onresizeall_start,onresizeall_end,onload,onload_start,onload_end,onunload,onunload_start,onunload_end").split(","),center:("paneClass,contentSelector,contentIgnoreSelector,findNestedContent,applyDemoStyles,triggerEventsOnLoad,showOverflowOnHover,maskContents,maskObjects,liveContentResizing,containerSelector,children,initChildren,resizeChildren,destroyChildren,onresize,onresize_start,onresize_end,onsizecontent,onsizecontent_start,onsizecontent_end").split(","),noDefault:("paneSelector,resizerCursor,customHotkey").split(",")};$.layout.transformData=function(hash,addKeys){var json=addKeys?{panes:{},center:{}}:{},branch,optKey,keys,key,val,i,c;if(typeof hash!=="object"){return json}for(optKey in hash){branch=json;val=hash[optKey];keys=optKey.split("__");c=keys.length-1;for(i=0;i<=c;i++){key=keys[i];if(i===c){if($.isPlainObject(val)){branch[key]=$.layout.transformData(val)}else{branch[key]=val}}else{if(!branch[key]){branch[key]={}}branch=branch[key]}}}return json};$.layout.backwardCompatibility={map:{applyDefaultStyles:"applyDemoStyles",childOptions:"children",initChildLayout:"initChildren",destroyChildLayout:"destroyChildren",resizeChildLayout:"resizeChildren",resizeNestedLayout:"resizeChildren",resizeWhileDragging:"livePaneResizing",resizeContentWhileDragging:"liveContentResizing",triggerEventsWhileDragging:"triggerEventsDuringLiveResize",maskIframesOnResize:"maskContents",useStateCookie:"stateManagement.enabled","cookie.autoLoad":"stateManagement.autoLoad","cookie.autoSave":"stateManagement.autoSave","cookie.keys":"stateManagement.stateKeys","cookie.name":"stateManagement.cookie.name","cookie.domain":"stateManagement.cookie.domain","cookie.path":"stateManagement.cookie.path","cookie.expires":"stateManagement.cookie.expires","cookie.secure":"stateManagement.cookie.secure",noRoomToOpenTip:"tips.noRoomToOpen",togglerTip_open:"tips.Close",togglerTip_closed:"tips.Open",resizerTip:"tips.Resize",sliderTip:"tips.Slide"},renameOptions:function(opts){var map=$.layout.backwardCompatibility.map,oldData,newData,value;for(var itemPath in map){oldData=getBranch(itemPath);value=oldData.branch[oldData.key];if(value!==undefined){newData=getBranch(map[itemPath],true);newData.branch[newData.key]=value;delete oldData.branch[oldData.key]}}function getBranch(path,create){var a=path.split("."),c=a.length-1,D={branch:opts,key:a[c]},i=0,k,undef;for(;i0){if(autoHide&&$E.data("autoHidden")&&$E.innerHeight()>0){$E.show().data("autoHidden",false);if(!browser.mozilla){$E.css(_c.hidden).css(_c.visible)}}}else{if(autoHide&&!$E.data("autoHidden")){$E.hide().data("autoHidden",true)}}},setOuterHeight=function(el,outerHeight,autoHide){var $E=el,h;if(isStr(el)){$E=$Ps[el]}else{if(!el.jquery){$E=$(el)}}h=cssH($E,outerHeight);$E.css({height:h,visibility:"visible"});if(h>0&&$E.innerWidth()>0){if(autoHide&&$E.data("autoHidden")){$E.show().data("autoHidden",false);if(!browser.mozilla){$E.css(_c.hidden).css(_c.visible)}}}else{if(autoHide&&!$E.data("autoHidden")){$E.hide().data("autoHidden",true)}}},_parseSize=function(pane,size,dir){if(!dir){dir=_c[pane].dir}if(isStr(size)&&size.match(/%/)){size=(size==="100%")?-1:parseInt(size,10)/100}if(size===0){return 0}else{if(size>=1){return parseInt(size,10)}}var o=options,avail=0;if(dir=="horz"){avail=sC.innerHeight-($Ps.north?o.north.spacing_open:0)-($Ps.south?o.south.spacing_open:0)}else{if(dir=="vert"){avail=sC.innerWidth-($Ps.west?o.west.spacing_open:0)-($Ps.east?o.east.spacing_open:0)}}if(size===-1){return avail}else{if(size>0){return round(avail*size)}else{if(pane=="center"){return 0}else{var dim=(dir==="horz"?"height":"width"),$P=$Ps[pane],$C=dim==="height"?$Cs[pane]:false,vis=$.layout.showInvisibly($P),szP=$P.css(dim),szC=$C?$C.css(dim):0;$P.css(dim,"auto");if($C){$C.css(dim,"auto")}size=(dim==="height")?$P.outerHeight():$P.outerWidth();$P.css(dim,szP).css(vis);if($C){$C.css(dim,szC)}return size}}}},getPaneSize=function(pane,inclSpace){var $P=$Ps[pane],o=options[pane],s=state[pane],oSp=(inclSpace?o.spacing_open:0),cSp=(inclSpace?o.spacing_closed:0);if(!$P||s.isHidden){return 0}else{if(s.isClosed||(s.isSliding&&inclSpace)){return cSp}else{if(_c[pane].dir==="horz"){return $P.outerHeight()+oSp}else{return $P.outerWidth()+oSp}}}},setSizeLimits=function(pane,slide){if(!isInitialized()){return}var o=options[pane],s=state[pane],c=_c[pane],dir=c.dir,type=c.sizeType.toLowerCase(),isSliding=(slide!=undefined?slide:s.isSliding),$P=$Ps[pane],paneSpacing=o.spacing_open,altPane=_c.oppositeEdge[pane],altS=state[altPane],$altP=$Ps[altPane],altPaneSize=(!$altP||altS.isVisible===false||altS.isSliding?0:(dir=="horz"?$altP.outerHeight():$altP.outerWidth())),altPaneSpacing=((!$altP||altS.isHidden?0:options[altPane][altS.isClosed!==false?"spacing_closed":"spacing_open"])||0),containerSize=(dir=="horz"?sC.innerHeight:sC.innerWidth),minCenterDims=cssMinDims("center"),minCenterSize=dir=="horz"?max(options.center.minHeight,minCenterDims.minHeight):max(options.center.minWidth,minCenterDims.minWidth),limitSize=(containerSize-paneSpacing-(isSliding?0:(_parseSize("center",minCenterSize,dir)+altPaneSize+altPaneSpacing))),minSize=s.minSize=max(_parseSize(pane,o.minSize),cssMinDims(pane).minSize),maxSize=s.maxSize=min((o.maxSize?_parseSize(pane,o.maxSize):100000),limitSize),r=s.resizerPosition={},top=sC.inset.top,left=sC.inset.left,W=sC.innerWidth,H=sC.innerHeight,rW=o.spacing_open;switch(pane){case"north":r.min=top+minSize;r.max=top+maxSize;break;case"west":r.min=left+minSize;r.max=left+maxSize;break;case"south":r.min=top+H-maxSize-rW;r.max=top+H-minSize-rW;break;case"east":r.min=left+W-maxSize-rW;r.max=left+W-minSize-rW;break}},calcNewCenterPaneDims=function(){var d={top:getPaneSize("north",true),bottom:getPaneSize("south",true),left:getPaneSize("west",true),right:getPaneSize("east",true),width:0,height:0};d.width=sC.innerWidth-d.left-d.right;d.height=sC.innerHeight-d.bottom-d.top;d.top+=sC.inset.top;d.bottom+=sC.inset.bottom;d.left+=sC.inset.left;d.right+=sC.inset.right;return d},getHoverClasses=function(el,allStates){var $El=$(el),type=$El.data("layoutRole"),pane=$El.data("layoutEdge"),o=options[pane],root=o[type+"Class"],_pane="-"+pane,_open="-open",_closed="-closed",_slide="-sliding",_hover="-hover ",_state=$El.hasClass(root+_closed)?_closed:_open,_alt=_state===_closed?_open:_closed,classes=(root+_hover)+(root+_pane+_hover)+(root+_state+_hover)+(root+_pane+_state+_hover);if(allStates){classes+=(root+_alt+_hover)+(root+_pane+_alt+_hover)}if(type=="resizer"&&$El.hasClass(root+_slide)){classes+=(root+_slide+_hover)+(root+_pane+_slide+_hover)}return String.prototype.trim.call(classes)},addHover=function(evt,el){var $E=$(el||this);if(evt&&$E.data("layoutRole")==="toggler"){evt.stopPropagation()}$E.addClass(getHoverClasses($E))},removeHover=function(evt,el){var $E=$(el||this);$E.removeClass(getHoverClasses($E,true))},onResizerEnter=function(evt){var pane=$(this).data("layoutEdge"),s=state[pane],$d=$(document);if(s.isResizing||state.paneResizing){return}if(options.maskPanesEarly){showMasks(pane,{resizing:true})}},onResizerLeave=function(evt,el){var e=el||this,pane=$(e).data("layoutEdge"),name=pane+"ResizerLeave",$d=$(document);timer.clear(pane+"_openSlider");timer.clear(name);if(!el){timer.set(name,function(){onResizerLeave(evt,e)},200)}else{if(options.maskPanesEarly&&!state.paneResizing){hideMasks()}}},_create=function(){initOptions();var o=options,s=state;s.creatingLayout=true;runPluginCallbacks(Instance,$.layout.onCreate);if(false===_runCallbacks("onload_start")){return"cancel"}_initContainer();initHotkeys();$(window).on("unload."+sID,unload);runPluginCallbacks(Instance,$.layout.onLoad);if(o.initPanes){_initLayoutElements()}delete s.creatingLayout;resizeAll();$.each(["south","north","east","west"],function(i,pane){if(!$Ps[pane]){return}o=options[pane];s=state[pane];var $P=$Ps[pane];if(o.initHidden){hide(pane)}else{if(o.initClosed){close(pane)}}});return state.initialized},isInitialized=function(){if(state.initialized||state.creatingLayout){return true}else{return _initLayoutElements()}},_initLayoutElements=function(retry){var o=options;if(!$N.is(":visible")){if(!retry&&browser.webkit&&$N[0].tagName==="BODY"){setTimeout(function(){_initLayoutElements(true)},50)}return false}if(!getPane("center").length){return _log(o.errors.centerPaneMissing)}state.creatingLayout=true;$.extend(sC,elDims($N,o.inset));initPanes();if(o.scrollToBookmarkOnLoad){var l=self.location;if(l.hash){l.replace(l.hash)}}if(Instance.hasParentLayout){o.resizeWithWindow=false}else{if(o.resizeWithWindow){$(window).on("resize."+sID,windowResize)}}delete state.creatingLayout;state.initialized=true;runPluginCallbacks(Instance,$.layout.onReady);_runCallbacks("onload_end");return true},createChildren=function(evt_or_pane,opts){var pane=evtPane.call(this,evt_or_pane),$P=$Ps[pane];if(!$P){return}var $C=$Cs[pane],s=state[pane],o=options[pane],sm=options.stateManagement||{},cos=opts?(o.children=opts):o.children;if($.isPlainObject(cos)){cos=[cos]}else{if(!cos||!Array.isArray(cos)){return}}$.each(cos,function(idx,co){if(!$.isPlainObject(co)){return}var $containers=co.containerSelector?$P.find(co.containerSelector):($C||$P);$containers.each(function(){var $cont=$(this),child=$cont.data("layout");if(!child){setInstanceKey({container:$cont,options:co},s);if(sm.includeChildren&&state.stateData[pane]){var paneChildren=state.stateData[pane].children||{},childState=paneChildren[co.instanceKey],co_sm=co.stateManagement||(co.stateManagement={autoLoad:true});if(co_sm.autoLoad===true&&childState){co_sm.autoSave=false;co_sm.includeChildren=true;co_sm.autoLoad=$.extend(true,{},childState)}}child=$cont.layout(co);if(child){refreshChildren(pane,child)}}})})},setInstanceKey=function(child,parentPaneState){var $c=child.container,o=child.options,sm=o.stateManagement,key=o.instanceKey||$c.data("layoutInstanceKey");if(!key){key=(sm&&sm.cookie?sm.cookie.name:"")||o.name}if(!key){key="layout"+(++parentPaneState.childIdx)}else{key=key.replace(/[^\w-]/gi,"_").replace(/_{2,}/g,"_")}o.instanceKey=key;$c.data("layoutInstanceKey",key);return key},refreshChildren=function(pane,newChild){var $P=$Ps[pane],pC=children[pane],s=state[pane],o;if($.isPlainObject(pC)){$.each(pC,function(key,child){if(child.destroyed){delete pC[key]}});if($.isEmptyObject(pC)){pC=children[pane]=null}}if(!newChild&&!pC){newChild=$P.data("layout")}if(newChild){newChild.hasParentLayout=true;o=newChild.options;setInstanceKey(newChild,s);if(!pC){pC=children[pane]={}}pC[o.instanceKey]=newChild.container.data("layout")}Instance[pane].children=children[pane];if(!newChild){createChildren(pane)}},windowResize=function(){var o=options,delay=Number(o.resizeWithWindowDelay);if(delay<10){delay=100}timer.clear("winResize");timer.set("winResize",function(){timer.clear("winResize");timer.clear("winResizeRepeater");var dims=elDims($N,o.inset);if(dims.innerWidth!==sC.innerWidth||dims.innerHeight!==sC.innerHeight){resizeAll()}},delay);if(!timer.data.winResizeRepeater){setWindowResizeRepeater()}},setWindowResizeRepeater=function(){var delay=Number(options.resizeWithWindowMaxDelay);if(delay>0){timer.set("winResizeRepeater",function(){setWindowResizeRepeater();resizeAll()},delay)}},unload=function(){var o=options;_runCallbacks("onunload_start");runPluginCallbacks(Instance,$.layout.onUnload);_runCallbacks("onunload_end")},_initContainer=function(){var N=$N[0],$H=$("html"),tag=sC.tagName=N.tagName,id=sC.id=N.id,cls=sC.className=N.className,o=options,name=o.name,props="position,margin,padding,border",css="layoutCSS",CSS={},hid="hidden",parent=$N.data("parentLayout"),pane=$N.data("layoutEdge"),isChild=parent&&pane,num=$.layout.cssNum,$parent,n;sC.ref=(o.name?o.name+" layout / ":"")+tag+(id?"#"+id:cls?".["+cls+"]":"");sC.isBody=(tag==="BODY");if(!isChild&&!sC.isBody){$parent=$N.closest("."+$.layout.defaults.panes.paneClass);parent=$parent.data("parentLayout");pane=$parent.data("layoutEdge");isChild=parent&&pane}$N.data({layout:Instance,layoutContainer:sID}).addClass(o.containerClass);var layoutMethods={destroy:"",initPanes:"",resizeAll:"resizeAll",resize:"resizeAll"};for(name in layoutMethods){$N.on("layout"+name.toLowerCase()+"."+sID,Instance[layoutMethods[name]||name])}if(isChild){Instance.hasParentLayout=true;parent.refreshChildren(pane,Instance)}if(!$N.data(css)){if(sC.isBody){$N.data(css,$.extend(styles($N,props),{height:$N.css("height"),overflow:$N.css("overflow"),overflowX:$N.css("overflowX"),overflowY:$N.css("overflowY")}));$H.data(css,$.extend(styles($H,"padding"),{height:"auto",overflow:$H.css("overflow"),overflowX:$H.css("overflowX"),overflowY:$H.css("overflowY")}))}else{$N.data(css,styles($N,props+",top,bottom,left,right,width,height,overflow,overflowX,overflowY"))}}try{CSS={overflow:hid,overflowX:hid,overflowY:hid};$N.css(CSS);if(o.inset&&!$.isPlainObject(o.inset)){n=parseInt(o.inset,10)||0;o.inset={top:n,bottom:n,left:n,right:n}}if(sC.isBody){if(!o.outset){o.outset={top:num($H,"paddingTop"),bottom:num($H,"paddingBottom"),left:num($H,"paddingLeft"),right:num($H,"paddingRight")}}else{if(!$.isPlainObject(o.outset)){n=parseInt(o.outset,10)||0;o.outset={top:n,bottom:n,left:n,right:n}}}$H.css(CSS).css({height:"100%",border:"none",padding:0,margin:0});if(browser.isIE6){$N.css({width:"100%",height:"100%",border:"none",padding:0,margin:0,position:"relative"});if(!o.inset){o.inset=elDims($N).inset}}else{$N.css({width:"auto",height:"auto",margin:0,position:"absolute"});$N.css(o.outset)}$.extend(sC,elDims($N,o.inset))}else{var p=$N.css("position");if(!p||!p.match(/(fixed|absolute|relative)/)){$N.css("position","relative")}if($N.is(":visible")){$.extend(sC,elDims($N,o.inset));if(sC.innerHeight<1){_log(o.errors.noContainerHeight.replace(/CONTAINER/,sC.ref))}}}if(num($N,"minWidth")){$N.parent().css("overflowX","auto")}if(num($N,"minHeight")){$N.parent().css("overflowY","auto")}}catch(ex){}},initHotkeys=function(panes){panes=panes?panes.split(","):_c.borderPanes;$.each(panes,function(i,pane){var o=options[pane];if(o.enableCursorHotkey||o.customHotkey){$(document).on("keydown."+sID,keyDown);return false}})},initOptions=function(){var data,d,pane,key,val,i,c,o;opts=$.layout.transformData(opts,true);opts=$.layout.backwardCompatibility.renameAllOptions(opts);if(!$.isEmptyObject(opts.panes)){data=$.layout.optionsMap.noDefault;for(i=0,c=data.length;i0){z.pane_normal=zo;z.content_mask=max(zo+1,z.content_mask);z.resizer_normal=max(zo+2,z.resizer_normal)}delete options.panes;function createFxOptions(pane){var o=options[pane],d=options.panes;if(!o.fxSettings){o.fxSettings={}}if(!d.fxSettings){d.fxSettings={}}$.each(["_open","_close","_size"],function(i,n){var sName="fxName"+n,sSpeed="fxSpeed"+n,sSettings="fxSettings"+n,fxName=o[sName]=o[sName]||d[sName]||o.fxName||d.fxName||"none",fxExists=$.effects&&($.effects[fxName]||($.effects.effect&&$.effects.effect[fxName]));if(fxName==="none"||!options.effects[fxName]||!fxExists){fxName=o[sName]="none"}var fx=options.effects[fxName]||{},fx_all=fx.all||null,fx_pane=fx[pane]||null;o[sSpeed]=o[sSpeed]||d[sSpeed]||o.fxSpeed||d.fxSpeed||null;o[sSettings]=$.extend(true,{},fx_all,fx_pane,d.fxSettings,o.fxSettings,d[sSettings],o[sSettings])});delete o.fxName;delete o.fxSpeed;delete o.fxSettings}},getPane=function(pane){var sel=options[pane].paneSelector;if(sel.substr(0,1)==="#"){return $N.find(sel).eq(0)}else{var $P=$N.children(sel).eq(0);return $P.length?$P:$N.children("form:first").children(sel).eq(0)}},initPanes=function(evt){evtPane(evt);$.each(_c.allPanes,function(idx,pane){addPane(pane,true)});initHandles();$.each(_c.borderPanes,function(i,pane){if($Ps[pane]&&state[pane].isVisible){setSizeLimits(pane);makePaneFit(pane)}});sizeMidPanes("center");$.each(_c.allPanes,function(idx,pane){afterInitPane(pane)})},addPane=function(pane,force){if(!force&&!isInitialized()){return}var o=options[pane],s=state[pane],c=_c[pane],dir=c.dir,fx=s.fx,spacing=o.spacing_open||0,isCenter=(pane==="center"),CSS={},$P=$Ps[pane],size,minSize,maxSize,child;if($P){removePane(pane,false,true,false)}else{$Cs[pane]=false}$P=$Ps[pane]=getPane(pane);if(!$P.length){$Ps[pane]=false;return}if(!$P.data("layoutCSS")){var props="position,top,left,bottom,right,width,height,overflow,zIndex,display,backgroundColor,padding,margin,border";$P.data("layoutCSS",styles($P,props))}Instance[pane]={name:pane,pane:$Ps[pane],content:$Cs[pane],options:options[pane],state:state[pane],children:children[pane]};$P.data({parentLayout:Instance,layoutPane:Instance[pane],layoutEdge:pane,layoutRole:"pane"}).css(c.cssReq).css("zIndex",options.zIndexes.pane_normal).css(o.applyDemoStyles?c.cssDemo:{}).addClass(o.paneClass+" "+o.paneClass+"-"+pane).on("mouseenter."+sID,addHover).on("mouseleave."+sID,removeHover);var paneMethods={hide:"",show:"",toggle:"",close:"",open:"",slideOpen:"",slideClose:"",slideToggle:"",size:"sizePane",sizePane:"sizePane",sizeContent:"",sizeHandles:"",enableClosable:"",disableClosable:"",enableSlideable:"",disableSlideable:"",enableResizable:"",disableResizable:"",swapPanes:"swapPanes",swap:"swapPanes",move:"swapPanes",removePane:"removePane",remove:"removePane",createChildren:"",resizeChildren:"",resizeAll:"resizeAll",resizeLayout:"resizeAll"},name;for(name in paneMethods){$P.on("layoutpane"+name.toLowerCase()+"."+sID,Instance[paneMethods[name]||name])}initContent(pane,false);if(!isCenter){size=s.size=_parseSize(pane,o.size);minSize=_parseSize(pane,o.minSize)||1;maxSize=_parseSize(pane,o.maxSize)||100000;if(size>0){size=max(min(size,maxSize),minSize)}s.autoResize=o.autoResize;s.isClosed=false;s.isSliding=false;s.isResizing=false;s.isHidden=false;if(!s.pins){s.pins=[]}}s.tagName=$P[0].tagName;s.edge=pane;s.noRoom=false;s.isVisible=true;setPanePosition(pane);if(dir==="horz"){CSS.height=cssH($P,size)}else{if(dir==="vert"){CSS.width=cssW($P,size)}}$P.css(CSS);if(dir!="horz"){sizeMidPanes(pane,true)}if(state.initialized){initHandles(pane);initHotkeys(pane)}if(o.initClosed&&o.closable&&!o.initHidden){close(pane,true,true)}else{if(o.initHidden||o.initClosed){hide(pane)}else{if(!s.noRoom){$P.css("display","block")}}}$P.css("visibility","visible");if(o.showOverflowOnHover){$P.on("hover",allowOverflow,resetOverflow)}if(state.initialized){afterInitPane(pane)}},afterInitPane=function(pane){var $P=$Ps[pane],s=state[pane],o=options[pane];if(!$P){return}if($P.data("layout")){refreshChildren(pane,$P.data("layout"))}if(s.isVisible){if(state.initialized){resizeAll()}else{sizeContent(pane)}if(o.triggerEventsOnLoad){_runCallbacks("onresize_end",pane)}else{resizeChildren(pane,true)}}if(o.initChildren&&o.children){createChildren(pane)}},setPanePosition=function(panes){panes=panes?panes.split(","):_c.borderPanes;$.each(panes,function(i,pane){var $P=$Ps[pane],$R=$Rs[pane],o=options[pane],s=state[pane],side=_c[pane].side,CSS={};if(!$P){return}switch(pane){case"north":CSS.top=sC.inset.top;CSS.left=sC.inset.left;CSS.right=sC.inset.right;break;case"south":CSS.bottom=sC.inset.bottom;CSS.left=sC.inset.left;CSS.right=sC.inset.right;break;case"west":CSS.left=sC.inset.left;break;case"east":CSS.right=sC.inset.right;break;case"center":}$P.css(CSS);if($R&&s.isClosed){$R.css(side,sC.inset[side])}else{if($R&&!s.isHidden){$R.css(side,sC.inset[side]+getPaneSize(pane))}}})},initHandles=function(panes){panes=panes?panes.split(","):_c.borderPanes;$.each(panes,function(i,pane){var $P=$Ps[pane];$Rs[pane]=false;$Ts[pane]=false;if(!$P){return}var o=options[pane],s=state[pane],c=_c[pane],paneId=o.paneSelector.substr(0,1)==="#"?o.paneSelector.substr(1):"",rClass=o.resizerClass,tClass=o.togglerClass,spacing=(s.isVisible?o.spacing_open:o.spacing_closed),_pane="-"+pane,_state=(s.isVisible?"-open":"-closed"),I=Instance[pane],$R=I.resizer=$Rs[pane]=$(""),$T=I.toggler=(o.closable?$Ts[pane]=$(""):false);if(!s.isVisible&&o.slidable){$R.attr("title",o.tips.Slide).css("cursor",o.sliderCursor)}$R.attr("id",paneId?paneId+"-resizer":"").data({parentLayout:Instance,layoutPane:Instance[pane],layoutEdge:pane,layoutRole:"resizer"}).css(_c.resizers.cssReq).css("zIndex",new String(options.zIndexes.resizer_normal)).css(o.applyDemoStyles?_c.resizers.cssDemo:{}).addClass(rClass+" "+rClass+_pane).on("hover",addHover,removeHover).on("hover",onResizerEnter,onResizerLeave).on("mousedown",$.layout.disableTextSelection).on("mouseup",$.layout.enableTextSelection).appendTo($N);if($.fn.disableSelection){$R.disableSelection()}if(o.resizerDblClickToggle){$R.on("dblclick."+sID,toggle)}if($T){$T.attr("id",paneId?paneId+"-toggler":"").data({parentLayout:Instance,layoutPane:Instance[pane],layoutEdge:pane,layoutRole:"toggler"}).css(_c.togglers.cssReq).css(o.applyDemoStyles?_c.togglers.cssDemo:{}).addClass(tClass+" "+tClass+_pane).on("hover",addHover,removeHover).on("mouseenter",onResizerEnter).appendTo($R);if(o.togglerContent_open){$(""+o.togglerContent_open+"").data({layoutEdge:pane,layoutRole:"togglerContent"}).data("layoutRole","togglerContent").data("layoutEdge",pane).addClass("content content-open").css("display","none").appendTo($T)}if(o.togglerContent_closed){$(""+o.togglerContent_closed+"").data({layoutEdge:pane,layoutRole:"togglerContent"}).addClass("content content-closed").css("display","none").appendTo($T)}enableClosable(pane)}initResizable(pane);if(s.isVisible){setAsOpen(pane)}else{setAsClosed(pane);bindStartSlidingEvents(pane,true)}});sizeHandles()},initContent=function(pane,resize){if(!isInitialized()){return}var o=options[pane],sel=o.contentSelector,I=Instance[pane],$P=$Ps[pane],$C;if(sel){$C=I.content=$Cs[pane]=(o.findNestedContent)?$P.find(sel).eq(0):$P.children(sel).eq(0)}if($C&&$C.length){$C.data("layoutRole","content");if(!$C.data("layoutCSS")){$C.data("layoutCSS",styles($C,"height"))}$C.css(_c.content.cssReq);if(o.applyDemoStyles){$C.css(_c.content.cssDemo);$P.css(_c.content.cssDemoPane)}if($P.css("overflowX").match(/(scroll|auto)/)){$P.css("overflow","hidden")}state[pane].content={};if(resize!==false){sizeContent(pane)}}else{I.content=$Cs[pane]=false}},initResizable=function(panes){var draggingAvailable=$.layout.plugins.draggable,side;panes=panes?panes.split(","):_c.borderPanes;$.each(panes,function(idx,pane){var o=options[pane];if(!draggingAvailable||!$Ps[pane]||!o.resizable){o.resizable=false;return true}var s=state[pane],z=options.zIndexes,c=_c[pane],side=c.dir=="horz"?"top":"left",$P=$Ps[pane],$R=$Rs[pane],base=o.resizerClass,lastPos=0,r,live,resizerClass=base+"-drag",resizerPaneClass=base+"-"+pane+"-drag",helperClass=base+"-dragging",helperPaneClass=base+"-"+pane+"-dragging",helperLimitClass=base+"-dragging-limit",helperPaneLimitClass=base+"-"+pane+"-dragging-limit",helperClassesSet=false;if(!s.isClosed){$R.attr("title",o.tips.Resize).css("cursor",o.resizerCursor)}$R.draggable({containment:$N[0],axis:(c.dir=="horz"?"y":"x"),delay:0,distance:1,grid:o.resizingGrid,helper:"clone",opacity:o.resizerDragOpacity,addClasses:false,zIndex:z.resizer_drag,start:function(e,ui){o=options[pane];s=state[pane];live=o.livePaneResizing;if(false===_runCallbacks("ondrag_start",pane)){return false}s.isResizing=true;state.paneResizing=pane;timer.clear(pane+"_closeSlider");setSizeLimits(pane);r=s.resizerPosition;lastPos=ui.position[side];$R.addClass(resizerClass+" "+resizerPaneClass);helperClassesSet=false;showMasks(pane,{resizing:true})},drag:function(e,ui){if(!helperClassesSet){ui.helper.addClass(helperClass+" "+helperPaneClass).css({right:"auto",bottom:"auto"}).children().css("visibility","hidden");helperClassesSet=true;if(s.isSliding){$Ps[pane].css("zIndex",z.pane_sliding)}}var limit=0;if(ui.position[side]r.max){ui.position[side]=r.max;limit=1}}if(limit){ui.helper.addClass(helperLimitClass+" "+helperPaneLimitClass);window.defaultStatus=(limit>0&&pane.match(/(north|west)/))||(limit<0&&pane.match(/(south|east)/))?o.tips.maxSizeWarning:o.tips.minSizeWarning}else{ui.helper.removeClass(helperLimitClass+" "+helperPaneLimitClass);window.defaultStatus=""}if(live&&Math.abs(ui.position[side]-lastPos)>=o.liveResizingTolerance){lastPos=ui.position[side];resizePanes(e,ui,pane)}},stop:function(e,ui){$("body").enableSelection();window.defaultStatus="";$R.removeClass(resizerClass+" "+resizerPaneClass);s.isResizing=false;state.paneResizing=false;resizePanes(e,ui,pane,true)}})});var resizePanes=function(evt,ui,pane,resizingDone){var dragPos=ui.position,c=_c[pane],o=options[pane],s=state[pane],resizerPos;switch(pane){case"north":resizerPos=dragPos.top;break;case"west":resizerPos=dragPos.left;break;case"south":resizerPos=sC.layoutHeight-dragPos.top-o.spacing_open;break;case"east":resizerPos=sC.layoutWidth-dragPos.left-o.spacing_open;break}var newSize=resizerPos-sC.inset[c.side];if(!resizingDone){if(Math.abs(newSize-s.size)=0;i--){$M=$Ms.eq(i);p=$M.data("layoutMask");if(!options[p].maskObjects){$M.hide()}}}}},getMasks=function(pane){var $Masks=$([]),$M,i=0,c=$Ms.length;for(;is.maxSize){syncPinBtns(pane,false);if(!noAlert&&o.tips.noRoomToOpen){alert(o.tips.noRoomToOpen)}return queueNext()}if(slide){bindStopSlidingEvents(pane,true)}else{if(s.isSliding){bindStopSlidingEvents(pane,false)}else{if(o.slidable){bindStartSlidingEvents(pane,false)}}}s.noRoom=false;makePaneFit(pane);isShowing=s.isShowing;delete s.isShowing;doFX=!noAnimation&&s.isClosed&&(o.fxName_open!="none");s.isMoving=true;s.isVisible=true;s.isClosed=false;if(isShowing){s.isHidden=false}if(doFX){lockPaneForFX(pane,true);$P.show(o.fxName_open,o.fxSettings_open,o.fxSpeed_open,function(){lockPaneForFX(pane,false);if(s.isVisible){open_2()}queueNext()})}else{_showPane(pane);open_2();queueNext()}});function open_2(){s.isMoving=false;_fixIframe(pane);if(!s.isSliding){sizeMidPanes(_c[pane].dir=="vert"?"center":"",false)}setAsOpen(pane)}},setAsOpen=function(pane,skipCallback){var $P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],side=_c[pane].side,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_closed="-closed",_sliding="-sliding";$R.css(side,sC.inset[side]+getPaneSize(pane)).removeClass(rClass+_closed+" "+rClass+_pane+_closed).addClass(rClass+_open+" "+rClass+_pane+_open);if(s.isSliding){$R.addClass(rClass+_sliding+" "+rClass+_pane+_sliding)}else{$R.removeClass(rClass+_sliding+" "+rClass+_pane+_sliding)}removeHover(0,$R);if(o.resizable&&$.layout.plugins.draggable){$R.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.tips.Resize)}else{if(!s.isSliding){$R.css("cursor","default")}}if($T){$T.removeClass(tClass+_closed+" "+tClass+_pane+_closed).addClass(tClass+_open+" "+tClass+_pane+_open).attr("title",o.tips.Close);removeHover(0,$T);$T.children(".content-closed").hide();$T.children(".content-open").css("display","block")}syncPinBtns(pane,!s.isSliding);$.extend(s,elDims($P));if(state.initialized){sizeHandles();sizeContent(pane,true)}if(!skipCallback&&(state.initialized||o.triggerEventsOnLoad)&&$P.is(":visible")){_runCallbacks("onopen_end",pane);if(s.isShowing){_runCallbacks("onshow_end",pane)}if(state.initialized){_runCallbacks("onresize_end",pane)}}},slideOpen=function(evt_or_pane){if(!isInitialized()){return}var evt=evtObj(evt_or_pane),pane=evtPane.call(this,evt_or_pane),s=state[pane],delay=options[pane].slideDelay_open;if(pane==="center"){return}if(evt){evt.stopImmediatePropagation()}if(s.isClosed&&evt&&evt.type==="mouseenter"&&delay>0){timer.set(pane+"_openSlider",open_NOW,delay)}else{open_NOW()}function open_NOW(){if(!s.isClosed){bindStopSlidingEvents(pane,true)}else{if(!s.isMoving){open(pane,true)}}}},slideClose=function(evt_or_pane){if(!isInitialized()){return}var evt=evtObj(evt_or_pane),pane=evtPane.call(this,evt_or_pane),o=options[pane],s=state[pane],delay=s.isMoving?1000:300;if(pane==="center"){return}if(s.isClosed||s.isResizing){}else{if(o.slideTrigger_close==="click"){close_NOW()}else{if(o.preventQuickSlideClose&&s.isMoving){}else{if(o.preventPrematureSlideClose&&evt&&$.layout.isMouseOverElem(evt,$Ps[pane])){}else{if(evt){timer.set(pane+"_closeSlider",close_NOW,max(o.slideDelay_close,delay))}else{close_NOW()}}}}}function close_NOW(){if(s.isClosed){bindStopSlidingEvents(pane,false)}else{if(!s.isMoving){close(pane)}}}},slideToggle=function(evt_or_pane){var pane=evtPane.call(this,evt_or_pane);toggle(pane,true)},lockPaneForFX=function(pane,doLock){var $P=$Ps[pane],s=state[pane],o=options[pane],z=options.zIndexes;if(doLock){showMasks(pane,{animation:true,objectsOnly:true});$P.css({zIndex:z.pane_animate});if(pane=="south"){$P.css({top:sC.inset.top+sC.innerHeight-$P.outerHeight()})}else{if(pane=="east"){$P.css({left:sC.inset.left+sC.innerWidth-$P.outerWidth()})}}}else{hideMasks();$P.css({zIndex:(s.isSliding?z.pane_sliding:z.pane_normal)});if(pane=="south"){$P.css({top:"auto"})}else{if(pane=="east"&&!$P.css("left").match(/\-99999/)){$P.css({left:"auto"})}}if(browser.msie&&o.fxOpacityFix&&o.fxName_open!="slide"&&$P.css("filter")&&$P.css("opacity")==1){$P[0].style.removeAttribute("filter")}}},bindStartSlidingEvents=function(pane,enable){var o=options[pane],$P=$Ps[pane],$R=$Rs[pane],evtName=o.slideTrigger_open.toLowerCase();if(!$R||(enable&&!o.slidable)){return}if(evtName.match(/mouseover/)){evtName=o.slideTrigger_open="mouseenter"}else{if(!evtName.match(/(click|dblclick|mouseenter)/)){evtName=o.slideTrigger_open="click"}}if(o.resizerDblClickToggle&&evtName.match(/click/)){$R[enable?"unbind":"bind"]("dblclick."+sID,toggle)}$R[enable?"bind":"unbind"](evtName+"."+sID,slideOpen).css("cursor",enable?o.sliderCursor:"default").attr("title",enable?o.tips.Slide:"")},bindStopSlidingEvents=function(pane,enable){var o=options[pane],s=state[pane],c=_c[pane],z=options.zIndexes,evtName=o.slideTrigger_close.toLowerCase(),action=(enable?"bind":"unbind"),$P=$Ps[pane],$R=$Rs[pane];timer.clear(pane+"_closeSlider");if(enable){s.isSliding=true;state.panesSliding[pane]=true;bindStartSlidingEvents(pane,false)}else{s.isSliding=false;delete state.panesSliding[pane]}$P.css("zIndex",enable?z.pane_sliding:z.pane_normal);$R.css("zIndex",enable?z.pane_sliding+2:z.resizer_normal);if(!evtName.match(/(click|mouseleave)/)){evtName=o.slideTrigger_close="mouseleave"}$R[action](evtName,slideClose);if(evtName==="mouseleave"){$P[action]("mouseleave."+sID,slideClose);$R[action]("mouseenter."+sID,cancelMouseOut);$P[action]("mouseenter."+sID,cancelMouseOut)}if(!enable){timer.clear(pane+"_closeSlider")}else{if(evtName==="click"&&!o.resizable){$R.css("cursor",enable?o.sliderCursor:"default");$R.attr("title",enable?o.tips.Close:"")}}function cancelMouseOut(evt){timer.clear(pane+"_closeSlider");evt.stopPropagation()}},makePaneFit=function(pane,isOpening,skipCallback,force){var o=options[pane],s=state[pane],c=_c[pane],$P=$Ps[pane],$R=$Rs[pane],isSidePane=c.dir==="vert",hasRoom=false;if(pane==="center"||(isSidePane&&s.noVerticalRoom)){hasRoom=(s.maxHeight>=0);if(hasRoom&&s.noRoom){_showPane(pane);if($R){$R.show()}s.isVisible=true;s.noRoom=false;if(isSidePane){s.noVerticalRoom=false}_fixIframe(pane)}else{if(!hasRoom&&!s.noRoom){_hidePane(pane);if($R){$R.hide()}s.isVisible=false;s.noRoom=true}}}if(pane==="center"){}else{if(s.minSize<=s.maxSize){hasRoom=true;if(s.size>s.maxSize){sizePane(pane,s.maxSize,skipCallback,true,force)}else{if(s.sizesize){thisTry.attempt=max(0,lastTry.attempt-(lastTry.actual-size))}else{thisTry.attempt=max(0,lastTry.attempt+(size-lastTry.actual))}thisTry.cssSize=cssSize(pane,thisTry.attempt);$P.css(dimName,thisTry.cssSize);thisTry.actual=dimName=="width"?$P.outerWidth():$P.outerHeight();thisTry.correct=(size===thisTry.actual);if(tries.length===1){_log(msg,false,true);_log(lastTry,false,true)}_log(thisTry,false,true);if(tries.length>3){break}tries.push(thisTry);lastTry=tries[tries.length-1]}s.size=size;$.extend(s,elDims($P));if(s.isVisible&&$P.is(":visible")){if($R){$R.css(side,size+sC.inset[side])}sizeContent(pane)}if(!skipCallback&&!skipResizeWhileDragging&&state.initialized&&s.isVisible){_runCallbacks("onresize_end",pane)}if(!skipCallback){if(!s.isSliding){sizeMidPanes(_c[pane].dir=="horz"?"":"center",skipResizeWhileDragging,force)}sizeHandles()}var altPane=_c.oppositeEdge[pane];if(size1){_log(msg+"\nSee the Error Console for details.",true,true)}}},sizeMidPanes=function(panes,skipCallback,force){panes=(panes?panes:"east,west,center").split(",");$.each(panes,function(i,pane){if(!$Ps[pane]){return}var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],isCenter=(pane=="center"),hasRoom=true,CSS={},visCSS=$.layout.showInvisibly($P),newCenter=calcNewCenterPaneDims();$.extend(s,elDims($P));if(pane==="center"){if(!force&&s.isVisible&&newCenter.width===s.outerWidth&&newCenter.height===s.outerHeight){$P.css(visCSS);return true}$.extend(s,cssMinDims(pane),{maxWidth:newCenter.width,maxHeight:newCenter.height});CSS=newCenter;s.newWidth=CSS.width;s.newHeight=CSS.height;CSS.width=cssW($P,CSS.width);CSS.height=cssH($P,CSS.height);hasRoom=CSS.width>=0&&CSS.height>=0;if(!state.initialized&&o.minWidth>newCenter.width){var reqPx=o.minWidth-s.outerWidth,minE=options.east.minSize||0,minW=options.west.minSize||0,sizeE=state.east.size,sizeW=state.west.size,newE=sizeE,newW=sizeW;if(reqPx>0&&state.east.isVisible&&sizeE>minE){newE=max(sizeE-minE,sizeE-reqPx);reqPx-=sizeE-newE}if(reqPx>0&&state.west.isVisible&&sizeW>minW){newW=max(sizeW-minW,sizeW-reqPx);reqPx-=sizeW-newW}if(reqPx===0){if(sizeE&&sizeE!=minE){sizePane("east",newE,true,true,force)}if(sizeW&&sizeW!=minW){sizePane("west",newW,true,true,force)}sizeMidPanes("center",skipCallback,force);$P.css(visCSS);return}}}else{if(s.isVisible&&!s.noVerticalRoom){$.extend(s,elDims($P),cssMinDims(pane))}if(!force&&!s.noVerticalRoom&&newCenter.height===s.outerHeight){$P.css(visCSS);return true}CSS.top=newCenter.top;CSS.bottom=newCenter.bottom;s.newSize=newCenter.height;CSS.height=cssH($P,newCenter.height);s.maxHeight=CSS.height;hasRoom=(s.maxHeight>=0);if(!hasRoom){s.noVerticalRoom=true}}if(hasRoom){if(!skipCallback&&state.initialized){_runCallbacks("onresize_start",pane)}$P.css(CSS);if(pane!=="center"){sizeHandles(pane)}if(s.noRoom&&!s.isClosed&&!s.isHidden){makePaneFit(pane)}if(s.isVisible){$.extend(s,elDims($P));if(state.initialized){sizeContent(pane)}}}else{if(!s.noRoom&&s.isVisible){makePaneFit(pane)}}$P.css(visCSS);delete s.newSize;delete s.newWidth;delete s.newHeight;if(!s.isVisible){return true}if(pane==="center"){var fix=browser.isIE6||!browser.boxModel;if($Ps.north&&(fix||state.north.tagName=="IFRAME")){$Ps.north.css("width",cssW($Ps.north,sC.innerWidth))}if($Ps.south&&(fix||state.south.tagName=="IFRAME")){$Ps.south.css("width",cssW($Ps.south,sC.innerWidth))}}if(!skipCallback&&state.initialized){_runCallbacks("onresize_end",pane)}})},resizeAll=function(evt_or_refresh){var oldW=sC.innerWidth,oldH=sC.innerHeight;evtPane(evt_or_refresh);if(!$N.is(":visible")){return}if(!state.initialized){_initLayoutElements();return}if(evt_or_refresh===true&&$.isPlainObject(options.outset)){$N.css(options.outset)}$.extend(sC,elDims($N,options.inset));if(!sC.outerHeight){return}if(evt_or_refresh===true){setPanePosition()}if(false===_runCallbacks("onresizeall_start")){return false}var shrunkH=(sC.innerHeight=o.responsive.sizes.lg){if(o.responsive.when==="lg"||o.responsive.when==="md"||o.responsive.when==="sm"||o.responsive.when==="xs"){paneResponsive=false}else{paneResponsive=true}}if(windowWidth>=o.responsive.sizes.md&&windowWidth=o.responsive.sizes.sm&&windowWidth=o.responsive.sizes.xs&&windowWidth0&&$P.css("overflow")==="hidden"){$P.css("overflow","visible");_measure();$P.css("overflow","hidden")}}var newH=s.innerHeight-(m.spaceAbove-s.css.paddingTop)-(m.spaceBelow-s.css.paddingBottom);if(!$C.is(":visible")||m.height!=newH){setOuterHeight($C,newH,true);m.height=newH}if(state.initialized){_runCallbacks("onsizecontent_end",pane)}function _below($E){return max(s.css.paddingBottom,(parseInt($E.css("marginBottom"),10)||0))}function _measure(){var ignore=options[pane].contentIgnoreSelector,$Fs=$C.nextAll().not(".ui-layout-mask").not(ignore||":lt(0)"),$Fs_vis=$Fs.filter(":visible"),$F=$Fs_vis.filter(":last");m={top:$C[0].offsetTop,height:$C.outerHeight(),numFooters:$Fs.length,hiddenFooters:$Fs.length-$Fs_vis.length,spaceBelow:0};m.spaceAbove=m.top;m.bottom=m.top+m.height;if($F.length){m.spaceBelow=($F[0].offsetTop+$F.outerHeight())-m.bottom+_below($F)}else{m.spaceBelow=_below($C)}}})},sizeHandles=function(evt_or_panes){var panes=evtPane.call(this,evt_or_panes);panes=panes?panes.split(","):_c.borderPanes;$.each(panes,function(i,pane){var o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],$TC;if(!$P||!$R){return}var dir=_c[pane].dir,_state=(s.isClosed?"_closed":"_open"),spacing=o["spacing"+_state],togAlign=o["togglerAlign"+_state],togLen=o["togglerLength"+_state],paneLen,left,offset,CSS={};if(spacing===0){$R.hide();return}else{if(!s.noRoom&&!s.isHidden){$R.show()}}if(dir==="horz"){paneLen=sC.innerWidth;s.resizerLength=paneLen;left=$.layout.cssNum($P,"left");$R.css({width:cssW($R,paneLen),height:cssH($R,spacing),left:left>-9999?left:sC.inset.left})}else{paneLen=$P.outerHeight();s.resizerLength=paneLen;$R.css({height:cssH($R,paneLen),width:cssW($R,spacing),top:sC.inset.top+getPaneSize("north",true)})}removeHover(o,$R);if($T){if(togLen===0||(s.isSliding&&o.hideTogglerOnSlide)){$T.hide();return}else{$T.show()}if(!(togLen>0)||togLen==="100%"||togLen>paneLen){togLen=paneLen;offset=0}else{if(isStr(togAlign)){switch(togAlign){case"top":case"left":offset=0;break;case"bottom":case"right":offset=paneLen-togLen;break;case"middle":case"center":default:offset=round((paneLen-togLen)/2)}}else{var x=parseInt(togAlign,10);if(togAlign>=0){offset=x}else{offset=paneLen-togLen+x}}}if(dir==="horz"){var width=cssW($T,togLen);$T.css({width:width,height:cssH($T,spacing),left:offset,top:0});$T.children(".content").each(function(){$TC=$(this);$TC.css("marginLeft",round((width-$TC.outerWidth())/2))})}else{var height=cssH($T,togLen);$T.css({height:height,width:cssW($T,spacing),top:offset,left:0});$T.children(".content").each(function(){$TC=$(this);$TC.css("marginTop",round((height-$TC.outerHeight())/2))})}removeHover(0,$T)}if(!state.initialized&&(o.initHidden||s.isHidden)){$R.hide();if($T){$T.hide()}}})},enableClosable=function(evt_or_pane){if(!isInitialized()){return}var pane=evtPane.call(this,evt_or_pane),$T=$Ts[pane],o=options[pane];if(!$T){return}o.closable=true;$T.on("click."+sID,function(evt){evt.stopPropagation();toggle(pane)}).css("visibility","visible").css("cursor","pointer").attr("title",state[pane].isClosed?o.tips.Open:o.tips.Close).show()},disableClosable=function(evt_or_pane,hide){if(!isInitialized()){return}var pane=evtPane.call(this,evt_or_pane),$T=$Ts[pane];if(!$T){return}options[pane].closable=false;if(state[pane].isClosed){open(pane,false,true)}$T.off("."+sID).css("visibility",hide?"hidden":"visible").css("cursor","default").attr("title","")},enableSlidable=function(evt_or_pane){if(!isInitialized()){return}var pane=evtPane.call(this,evt_or_pane),$R=$Rs[pane];if(!$R||!$R.data("draggable")){return}options[pane].slidable=true;if(state[pane].isClosed){bindStartSlidingEvents(pane,true)}},disableSlidable=function(evt_or_pane){if(!isInitialized()){return}var pane=evtPane.call(this,evt_or_pane),$R=$Rs[pane];if(!$R){return}options[pane].slidable=false;if(state[pane].isSliding){close(pane,false,true)}else{bindStartSlidingEvents(pane,false);$R.css("cursor","default").attr("title","");removeHover(null,$R[0])}},enableResizable=function(evt_or_pane){if(!isInitialized()){return}var pane=evtPane.call(this,evt_or_pane),$R=$Rs[pane],o=options[pane];if(!$R||!$R.data("draggable")){return}o.resizable=true;$R.draggable("enable");if(!state[pane].isClosed){$R.css("cursor",o.resizerCursor).attr("title",o.tips.Resize)}},disableResizable=function(evt_or_pane){if(!isInitialized()){return}var pane=evtPane.call(this,evt_or_pane),$R=$Rs[pane];if(!$R||!$R.data("draggable")){return}options[pane].resizable=false;$R.draggable("disable").css("cursor","default").attr("title","");removeHover(null,$R[0])},swapPanes=function(evt_or_pane1,pane2){if(!isInitialized()){return}var pane1=evtPane.call(this,evt_or_pane1);state[pane1].edge=pane2;state[pane2].edge=pane1;if(false===_runCallbacks("onswap_start",pane1)||false===_runCallbacks("onswap_start",pane2)){state[pane1].edge=pane1;state[pane2].edge=pane2;return}var oPane1=copy(pane1),oPane2=copy(pane2),sizes={};sizes[pane1]=oPane1?oPane1.state.size:0;sizes[pane2]=oPane2?oPane2.state.size:0;$Ps[pane1]=false;$Ps[pane2]=false;state[pane1]={};state[pane2]={};if($Ts[pane1]){$Ts[pane1].remove()}if($Ts[pane2]){$Ts[pane2].remove()}if($Rs[pane1]){$Rs[pane1].remove()}if($Rs[pane2]){$Rs[pane2].remove()}$Rs[pane1]=$Rs[pane2]=$Ts[pane1]=$Ts[pane2]=false;move(oPane1,pane2);move(oPane2,pane1);oPane1=oPane2=sizes=null;if($Ps[pane1]){$Ps[pane1].css(_c.visible)}if($Ps[pane2]){$Ps[pane2].css(_c.visible)}resizeAll();_runCallbacks("onswap_end",pane1);_runCallbacks("onswap_end",pane2);function copy(n){var $P=$Ps[n],$C=$Cs[n];return !$P?false:{pane:n,P:$P?$P[0]:false,C:$C?$C[0]:false,state:$.extend(true,{},state[n]),options:$.extend(true,{},options[n])}}function move(oPane,pane){if(!oPane){return}var P=oPane.P,C=oPane.C,oldPane=oPane.pane,c=_c[pane],s=$.extend(true,{},state[pane]),o=options[pane],fx={resizerCursor:o.resizerCursor},re,size,pos;$.each("fxName,fxSpeed,fxSettings".split(","),function(i,k){fx[k+"_open"]=o[k+"_open"];fx[k+"_close"]=o[k+"_close"];fx[k+"_size"]=o[k+"_size"]});$Ps[pane]=$(P).data({layoutPane:Instance[pane],layoutEdge:pane}).css(_c.hidden).css(c.cssReq);$Cs[pane]=C?$(C):false;options[pane]=$.extend(true,{},oPane.options,fx);state[pane]=$.extend(true,{},oPane.state);re=new RegExp(o.paneClass+"-"+oldPane,"g");P.className=P.className.replace(re,o.paneClass+"-"+pane);initHandles(pane);if(c.dir!=_c[oldPane].dir){size=sizes[pane]||0;setSizeLimits(pane);size=max(size,state[pane].minSize);manualSizePane(pane,size,true,true)}else{$Rs[pane].css(c.side,sC.inset[c.side]+(state[pane].isVisible?getPaneSize(pane):0))}if(oPane.state.isVisible&&!s.isVisible){setAsOpen(pane,true)}else{setAsClosed(pane);bindStartSlidingEvents(pane,true)}oPane=null}},syncPinBtns=function(pane,doPin){if($.layout.plugins.buttons){$.each(state[pane].pins,function(i,selector){$.layout.buttons.setPinState(Instance,$(selector),pane,doPin)})}};function keyDown(evt){if(!evt){return true}var code=evt.keyCode;if(code<33){return true}var PANE={38:"north",40:"south",37:"west",39:"east"},ALT=evt.altKey,SHIFT=evt.shiftKey,CTRL=evt.ctrlKey,CURSOR=(CTRL&&code>=37&&code<=40),o,k,m,pane;if(CURSOR&&options[PANE[code]].enableCursorHotkey){pane=PANE[code]}else{if(CTRL||SHIFT){$.each(_c.borderPanes,function(i,p){o=options[p];k=o.customHotkey;m=o.customHotkeyModifier;if((SHIFT&&m=="SHIFT")||(CTRL&&m=="CTRL")||(CTRL&&SHIFT)){if(k&&code===(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){pane=p;return false}}})}}if(!pane||!$Ps[pane]||!options[pane].closable||state[pane].isHidden){return true}toggle(pane);evt.stopPropagation();evt.returnValue=false;return false}function allowOverflow(el){if(!isInitialized()){return}if(this&&this.tagName){el=this}var $P;if(isStr(el)){$P=$Ps[el]}else{if($(el).data("layoutRole")){$P=$(el)}else{$(el).parents().each(function(){if($(this).data("layoutRole")){$P=$(this);return false}})}}if(!$P||!$P.length){return}var pane=$P.data("layoutEdge"),s=state[pane];if(s.cssSaved){resetOverflow(pane)}if(s.isSliding||s.isResizing||s.isClosed){s.cssSaved=false;return}var newCSS={zIndex:(options.zIndexes.resizer_normal+1)},curCSS={},of=$P.css("overflow"),ofX=$P.css("overflowX"),ofY=$P.css("overflowY");if(of!="visible"){curCSS.overflow=of;newCSS.overflow="visible"}if(ofX&&!ofX.match(/(visible|auto)/)){curCSS.overflowX=ofX;newCSS.overflowX="visible"}if(ofY&&!ofY.match(/(visible|auto)/)){curCSS.overflowY=ofX;newCSS.overflowY="visible"}s.cssSaved=curCSS;$P.css(newCSS);$.each(_c.allPanes,function(i,p){if(p!=pane){resetOverflow(p)}})}function resetOverflow(el){if(!isInitialized()){return}if(this&&this.tagName){el=this}var $P;if(isStr(el)){$P=$Ps[el]}else{if($(el).data("layoutRole")){$P=$(el)}else{$(el).parents().each(function(){if($(this).data("layoutRole")){$P=$(this);return false}})}}if(!$P||!$P.length){return}var pane=$P.data("layoutEdge"),s=state[pane],CSS=s.cssSaved||{};if(!s.isSliding&&!s.isResizing){$P.css("zIndex",options.zIndexes.pane_normal)}$P.css(CSS);s.cssSaved=false}var $N=$(this).eq(0);if(!$N.length){return _log(options.errors.containerMissing)}if($N.data("layoutContainer")&&$N.data("layout")){return $N.data("layout")}var $Ps={},$Cs={},$Rs={},$Ts={},$Ms=$([]),sC=state.container,sID=state.id;var Instance={options:options,state:state,container:$N,panes:$Ps,contents:$Cs,resizers:$Rs,togglers:$Ts,hide:hide,show:show,toggle:toggle,open:open,close:close,slideOpen:slideOpen,slideClose:slideClose,slideToggle:slideToggle,setSizeLimits:setSizeLimits,_sizePane:sizePane,sizePane:manualSizePane,sizeContent:sizeContent,swapPanes:swapPanes,showMasks:showMasks,hideMasks:hideMasks,initContent:initContent,addPane:addPane,removePane:removePane,createChildren:createChildren,refreshChildren:refreshChildren,enableClosable:enableClosable,disableClosable:disableClosable,enableSlidable:enableSlidable,disableSlidable:disableSlidable,enableResizable:enableResizable,disableResizable:disableResizable,allowOverflow:allowOverflow,resetOverflow:resetOverflow,destroy:destroy,initPanes:isInitialized,resizeAll:resizeAll,runCallbacks:_runCallbacks,hasParentLayout:false,children:children,north:false,south:false,west:false,east:false,center:false};if(_create()==="cancel"){return null}else{return Instance}}})(jQuery);jQuery.cookie=function(name,value,options){if(typeof value!="undefined"){options=options||{};if(value===null){value="";options.expires=-1}var expires="";if(options.expires&&(typeof options.expires=="number"||options.expires.toUTCString)){var date;if(typeof options.expires=="number"){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000))}else{date=options.expires}expires="; expires="+date.toUTCString()}var path=options.path?"; path="+(options.path):"";var domain=options.domain?"; domain="+(options.domain):"";var secure=options.secure?"; secure":"";document.cookie=[name,"=",encodeURIComponent(value),expires,path,domain,secure].join("")}else{var cookieValue=null;if(document.cookie&&document.cookie!=""){var cookies=document.cookie.split(";");for(var i=0;i0){x=parseInt(x,10);t="number"}}if(t==="number"){date=new Date();if(x>0){date.setDate(date.getDate()+x)}else{date.setFullYear(1970);clear=true}}if(date){params+=";expires="+date.toUTCString()}if(o.path){params+=";path="+o.path}if(o.domain){params+=";domain="+o.domain}if(o.secure){params+=";secure"}document.cookie=name+"="+(clear?"":encodeURIComponent(val))+params},clear:function(name){$.ui.cookie.write(name,"",{expires:-1})}};if(!$.cookie){$.cookie=function(k,v,o){var C=$.ui.cookie;if(v===null){C.clear(k)}else{if(v===undefined){return C.read(k)}else{C.write(k,v,o)}}}}$.layout.plugins.stateManagement=true;$.layout.defaults.stateManagement={enabled:false,autoSave:true,autoLoad:true,animateLoad:true,includeChildren:true,stateKeys:"north.size,south.size,east.size,west.size,north.isClosed,south.isClosed,east.isClosed,west.isClosed,north.isHidden,south.isHidden,east.isHidden,west.isHidden",cookie:{name:"",domain:"",path:"",expires:"",secure:false}};$.layout.optionsMap.layout.push("stateManagement");$.layout.config.optionRootKeys.push("stateManagement");$.layout.state={saveCookie:function(inst,keys,cookieOpts){var o=inst.options,sm=o.stateManagement,oC=$.extend(true,{},sm.cookie,cookieOpts||null),data=inst.state.stateData=inst.readState(keys||sm.stateKeys);$.ui.cookie.write(oC.name||o.name||"Layout",$.layout.state.encodeJSON(data),oC);return $.extend(true,{},data)},deleteCookie:function(inst){var o=inst.options;$.ui.cookie.clear(o.stateManagement.cookie.name||o.name||"Layout")},readCookie:function(inst){var o=inst.options;var c=$.ui.cookie.read(o.stateManagement.cookie.name||o.name||"Layout");return c?$.layout.state.decodeJSON(c):{}},loadCookie:function(inst){var c=$.layout.state.readCookie(inst);if(c&&!$.isEmptyObject(c)){inst.state.stateData=$.extend(true,{},c);inst.loadState(c)}return c},loadState:function(inst,data,opts){if(!$.isPlainObject(data)||$.isEmptyObject(data)){return}data=inst.state.stateData=$.layout.transformData(data);var smo=inst.options.stateManagement;opts=$.extend({animateLoad:false,includeChildren:smo.includeChildren},opts);if(!inst.state.initialized){var o=$.extend(true,{},data);$.each($.layout.config.allPanes,function(idx,pane){if(o[pane]){delete o[pane].children}});$.extend(true,inst.options,o)}else{var noAnimate=!opts.animateLoad,o,c,h,state,open;$.each($.layout.config.borderPanes,function(idx,pane){o=data[pane];if(!$.isPlainObject(o)){return}s=o.size;c=o.initClosed;h=o.initHidden;ar=o.autoResize;state=inst.state[pane];open=state.isVisible;if(ar){state.autoResize=ar}if(!open){inst._sizePane(pane,s,false,false,false)}if(h===true){inst.hide(pane,noAnimate)}else{if(c===true){inst.close(pane,false,noAnimate)}else{if(c===false){inst.open(pane,false,noAnimate)}else{if(h===false){inst.show(pane,false,noAnimate)}}}}if(open){inst._sizePane(pane,s,false,false,noAnimate)}});if(opts.includeChildren){var paneStateChildren,childState;$.each(inst.children,function(pane,paneChildren){paneStateChildren=data[pane]?data[pane].children:0;if(paneStateChildren&&paneChildren){$.each(paneChildren,function(stateKey,child){childState=paneStateChildren[stateKey];if(child&&childState){child.loadState(childState)}})}})}}},readState:function(inst,opts){if(typeof(opts)==="string"){opts={keys:opts}}if(!opts){opts={}}var sm=inst.options.stateManagement,ic=opts.includeChildren,recurse=ic!==undefined?ic:sm.includeChildren,keys=opts.stateKeys||sm.stateKeys,alt={isClosed:"initClosed",isHidden:"initHidden"},state=inst.state,panes=$.layout.config.allPanes,data={},pair,pane,key,val,ps,pC,child,array,count,branch;if(Array.isArray(keys)){keys=keys.join(",")}keys=keys.replace(/__/g,".").split(",");for(var i=0,n=keys.length;i=0){var btn=o[pane].buttonClass+"-"+action;$E.addClass(btn+" "+btn+"-"+pane).data("layoutName",o.name)}return $E},bind:function(inst,sel,action,pane){var _=$.layout.buttons;switch(action.toLowerCase()){case"toggle":_.addToggle(inst,sel,pane);break;case"open":_.addOpen(inst,sel,pane);break;case"close":_.addClose(inst,sel,pane);break;case"pin":_.addPin(inst,sel,pane);break;case"toggle-slide":_.addToggle(inst,sel,pane,true);break;case"open-slide":_.addOpen(inst,sel,pane,true);break}return inst},addToggle:function(inst,selector,pane,slide){$.layout.buttons.get(inst,selector,pane,"toggle").on("click",function(evt){inst.toggle(pane,!!slide);evt.stopPropagation()});return inst},addSlideToggle:function(inst,selector,pane,slide){$.layout.buttons.get(inst,selector,pane,"slideToggle").on("click",function(evt){inst.slideToggle(pane,!!slide);evt.stopPropagation()});return inst},addOpen:function(inst,selector,pane,slide){$.layout.buttons.get(inst,selector,pane,"open").attr("title",inst.options[pane].tips.Open).on("click",function(evt){inst.open(pane,!!slide);evt.stopPropagation()});return inst},addClose:function(inst,selector,pane){$.layout.buttons.get(inst,selector,pane,"close").attr("title",inst.options[pane].tips.Close).on("click",function(evt){inst.close(pane);evt.stopPropagation()});return inst},addPin:function(inst,selector,pane){var $E=$.layout.buttons.get(inst,selector,pane,"pin");if($E.length){var s=inst.state[pane];$E.on("click",function(evt){$.layout.buttons.setPinState(inst,$(this),pane,(s.isSliding||s.isClosed));if(s.isSliding||s.isClosed){inst.open(pane)}else{inst.close(pane)}evt.stopPropagation()});$.layout.buttons.setPinState(inst,$E,pane,(!s.isClosed&&!s.isSliding));s.pins.push(selector)}return inst},setPinState:function(inst,$Pin,pane,doPin){var updown=$Pin.attr("pin");if(updown&&doPin===(updown=="down")){return}var po=inst.options[pane],lang=po.tips,pin=po.buttonClass+"-pin",side=pin+"-"+pane,UP=pin+"-up "+side+"-up",DN=pin+"-down "+side+"-down";$Pin.attr("pin",doPin?"down":"up").attr("title",doPin?lang.Unpin:lang.Pin).removeClass(doPin?UP:DN).addClass(doPin?DN:UP)},syncPinBtns:function(inst,pane,doPin){$.each(state[pane].pins,function(i,selector){$.layout.buttons.setPinState(inst,$(selector),pane,doPin)})},_load:function(inst){$.extend(inst,{bindButton:function(selector,action,pane){return $.layout.buttons.on(inst,selector,action,pane)},addToggleBtn:function(selector,pane,slide){return $.layout.buttons.addToggle(inst,selector,pane,slide)},addSlideToggleBtn:function(selector,pane,slide){return $.layout.buttons.addSlideToggle(inst,selector,pane,slide)},addOpenBtn:function(selector,pane,slide){return $.layout.buttons.addOpen(inst,selector,pane,slide)},addCloseBtn:function(selector,pane){return $.layout.buttons.addClose(inst,selector,pane)},addPinBtn:function(selector,pane){return $.layout.buttons.addPin(inst,selector,pane)}});for(var i=0;i<4;i++){var pane=$.layout.buttons.config.borderPanes[i];inst.state[pane].pins=[]}if(inst.options.autoBindCustomButtons){$.layout.buttons.init(inst)}},_unload:function(inst){}};$.layout.onLoad.push($.layout.buttons._load)})(jQuery);(function($){$.layout.plugins.browserZoom=true;$.layout.defaults.browserZoomCheckInterval=1000;$.layout.optionsMap.layout.push("browserZoomCheckInterval");$.layout.browserZoom={_init:function(inst){if($.layout.browserZoom.ratio()!==false){$.layout.browserZoom._setTimer(inst)}},_setTimer:function(inst){if(inst.destroyed){return}var o=inst.options,s=inst.state,ms=inst.hasParentLayout?5000:Math.max(o.browserZoomCheckInterval,100);setTimeout(function(){if(inst.destroyed||!o.resizeWithWindow){return}var d=$.layout.browserZoom.ratio();if(d!==s.browserZoom){s.browserZoom=d;inst.resizeAll()}$.layout.browserZoom._setTimer(inst)},ms)},ratio:function(){var w=window,s=screen,d=document,dE=d.documentElement||d.body,b=$.layout.browser,v=b.version,r,sW,cW;if(!b.msie||v>8){return false}if(s.deviceXDPI&&s.systemXDPI){return calc(s.deviceXDPI,s.systemXDPI)}if(b.webkit&&(r=d.body.getBoundingClientRect)){return calc((r.left-r.right),d.body.offsetWidth)}if(b.webkit&&(sW=w.outerWidth)){return calc(sW,w.innerWidth)}if((sW=s.width)&&(cW=dE.clientWidth)){return calc(sW,cW)}return false;function calc(x,y){return(parseInt(x,10)/parseInt(y,10)*100).toFixed()}}};$.layout.onReady.push($.layout.browserZoom._init)})(jQuery);(function($){if($.effects){$.layout.defaults.panes.useOffscreenClose=false;if($.layout.plugins){$.layout.plugins.effects.slideOffscreen=true}$.layout.effects.slideOffscreen=$.extend(true,{},$.layout.effects.slide);$.effects.slideOffscreen=function(o){return this.queue(function(){var fx=$.effects,opt=o.options,$el=$(this),pane=$el.data("layoutEdge"),state=$el.data("parentLayout").state,dist=state[pane].size,s=this.style,props=["top","bottom","left","right"],mode=fx.setMode($el,opt.mode||"show"),show=(mode=="show"),dir=opt.direction||"left",ref=(dir=="up"||dir=="down")?"top":"left",pos=(dir=="up"||dir=="left"),offscrn=$.layout.config.offscreenCSS||{},keyLR=$.layout.config.offscreenReset,keyTB="offscreenResetTop",animation={};animation[ref]=(show?(pos?"+=":"-="):(pos?"-=":"+="))+dist;if(show){$el.data(keyTB,{top:s.top,bottom:s.bottom});if(pos){$el.css(ref,isNaN(dist)?"-"+dist:-dist)}else{if(dir==="right"){$el.css({left:state.container.layoutWidth,right:"auto"})}else{$el.css({top:state.container.layoutHeight,bottom:"auto"})}}if(ref==="top"){$el.css($el.data(keyLR)||{})}}else{$el.data(keyTB,{top:s.top,bottom:s.bottom});$el.data(keyLR,{left:s.left,right:s.right})}$el.show().animate(animation,{queue:false,duration:o.duration,easing:opt.easing,complete:function(){if($el.data(keyTB)){$el.css($el.data(keyTB)).removeData(keyTB)}if(show){$el.css($el.data(keyLR)||{}).removeData(keyLR)}else{$el.css(offscrn)}if(o.callback){o.callback.apply(this,arguments)}$el.dequeue()}})})}}})(jQuery);(function($){var _=$.layout;if(!_.callbacks){_.callbacks={}}_.callbacks.resizePaneAccordions=function(x,ui){var $P=ui.jquery?ui:$(ui.newPanel||ui.panel);$P.find(".ui-accordion:visible").each(function(){var $E=$(this);if($E.data("accordion")){$E.accordion("resize")}if($E.data("ui-accordion")){$E.accordion("refresh")}})}})(jQuery);(function($){$.layout.callbacks.resizeDataTables=function(x,ui){var oPane=ui.jquery?ui[0]:ui.panel;if(!$(oPane).is(":visible")){return}$($.fn.dataTable.fnTables(true)).each(function(i,table){if($.contains(oPane,table)){$(table).dataTable().fnAdjustColumnSizing()}})}})(jQuery);(function($){var _=$.layout;if(!_.callbacks){_.callbacks={}}_.callbacks.resizeTabLayout=function(x,ui){var $P=ui.jquery?ui:$(ui.newPanel||ui.panel);$P.filter(":visible").find(".ui-layout-container:visible").addBack().each(function(){var layout=$(this).data("layout");if(layout){layout.options.resizeWithWindow=false;layout.resizeAll()}})}})(jQuery);return jQuery}));
\ No newline at end of file
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(jQuery){var $;return function($){var min=Math.min,max=Math.max,round=Math.floor,isStr=function(e){return"string"==typeof e},runPluginCallbacks=function(Instance,a_fn){if(Array.isArray(a_fn))for(var i=0,c=a_fn.length;i').appendTo("body"),s={width:t.outerWidth-t[0].clientWidth,height:100-t[0].clientHeight};return t.remove(),window.scrollbarWidth=s.width,window.scrollbarHeight=s.height,e.match(/^(width|height)$/)?s[e]:s},disableTextSelection:function(){var e=$(document),t="textSelectionDisabled",s="textSelectionInitialized";$.fn.disableSelection&&(e.data(s)||e.on("mouseup",$.layout.enableTextSelection).data(s,!0),e.data(t)||e.disableSelection().data(t,!0))},enableTextSelection:function(){var e=$(document),t="textSelectionDisabled";$.fn.enableSelection&&e.data(t)&&e.enableSelection().data(t,!1)},showInvisibly:function(e,t){if(e&&e.length&&(t||"none"===e.css("display"))){var s=e[0].style,i={display:s.display||"",visibility:s.visibility||""};return e.css({display:"block",visibility:"hidden"}),i}return{}},getElementDimensions:function(e,t){var s,i,n,o={css:{},inset:{}},a=o.css,r={bottom:0},l=$.layout.cssNum,d=Math.round,c=e.offset();return o.offsetLeft=c.left,o.offsetTop=c.top,t||(t={}),$.each("Left,Right,Top,Bottom".split(","),function(l,d){s=a["border"+d]=$.layout.borderWidth(e,d),i=a["padding"+d]=$.layout.cssNum(e,"padding"+d),n=d.toLowerCase(),o.inset[n]=t[n]>=0?t[n]:i,r[n]=o.inset[n]+s}),a.width=d(e.width()),a.height=d(e.height()),a.top=l(e,"top",!0),a.bottom=l(e,"bottom",!0),a.left=l(e,"left",!0),a.right=l(e,"right",!0),o.outerWidth=d(e.outerWidth()),o.outerHeight=d(e.outerHeight()),o.innerWidth=max(0,o.outerWidth-r.left-r.right),o.innerHeight=max(0,o.outerHeight-r.top-r.bottom),o.layoutWidth=d(e.innerWidth()),o.layoutHeight=d(e.innerHeight()),o},getElementStyles:function(e,t){var s,i,n,o,a,r,l={},d=e[0].style,c=t.split(","),u="Top,Bottom,Left,Right".split(","),p="Color,Style,Width".split(",");for(o=0;o=o&&l<=a&&d>=n&&d<=r},msg:function(e,t,s,i){if($.isPlainObject(e)&&window.debugData){"string"==typeof t?(i=s,s=t):"object"==typeof s&&(i=s,s=null);var n=s||"log(