").append(st.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,a||[e.responseText,t,e])}),this},st.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){st.fn[t]=function(e){return this.on(t,e)}}),st.each(["get","post"],function(e,n){st[n]=function(e,r,i,o){return st.isFunction(r)&&(o=o||i,i=r,r=t),st.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),st.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Dn,type:"GET",isLocal:Fn.test(jn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=utf-8",accepts:{"*":In,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":st.parseJSON,"text xml":st.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?H(H(e,st.ajaxSettings),t):H(st.ajaxSettings,e)},ajaxPrefilter:D(Wn),ajaxTransport:D($n),ajax:function(e,n){function r(e,n,r,s){var l,f,v,b,T,N=n;2!==x&&(x=2,u&&clearTimeout(u),i=t,a=s||"",w.readyState=e>0?4:0,r&&(b=M(p,w,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=w.getResponseHeader("Last-Modified"),T&&(st.lastModified[o]=T),T=w.getResponseHeader("etag"),T&&(st.etag[o]=T)),304===e?(l=!0,N="notmodified"):(l=q(p,b),N=l.state,f=l.data,v=l.error,l=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),w.status=e,w.statusText=(n||N)+"",l?g.resolveWith(d,[f,N,w]):g.rejectWith(d,[w,N,v]),w.statusCode(y),y=t,c&&h.trigger(l?"ajaxSuccess":"ajaxError",[w,p,l?f:v]),m.fireWith(d,[w,N]),c&&(h.trigger("ajaxComplete",[w,p]),--st.active||st.event.trigger("ajaxStop")))}"object"==typeof e&&(n=e,e=t),n=n||{};var i,o,a,s,u,l,c,f,p=st.ajaxSetup({},n),d=p.context||p,h=p.context&&(d.nodeType||d.jquery)?st(d):st.event,g=st.Deferred(),m=st.Callbacks("once memory"),y=p.statusCode||{},v={},b={},x=0,T="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!s)for(s={};t=_n.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=b[n]=b[n]||e,v[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)y[t]=[y[t],e[t]];else w.always(e[w.status]);return this},abort:function(e){var t=e||T;return i&&i.abort(t),r(0,t),this}};if(g.promise(w).complete=m.add,w.success=w.done,w.error=w.fail,p.url=((e||p.url||Dn)+"").replace(Mn,"").replace(Bn,jn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=st.trim(p.dataType||"*").toLowerCase().match(lt)||[""],null==p.crossDomain&&(l=Pn.exec(p.url.toLowerCase()),p.crossDomain=!(!l||l[1]===jn[1]&&l[2]===jn[2]&&(l[3]||("http:"===l[1]?80:443))==(jn[3]||("http:"===jn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=st.param(p.data,p.traditional)),L(Wn,p,n,w),2===x)return w;c=p.global,c&&0===st.active++&&st.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!On.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(Hn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=qn.test(o)?o.replace(qn,"$1_="+Ln++):o+(Hn.test(o)?"&":"?")+"_="+Ln++)),p.ifModified&&(st.lastModified[o]&&w.setRequestHeader("If-Modified-Since",st.lastModified[o]),st.etag[o]&&w.setRequestHeader("If-None-Match",st.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",p.contentType),w.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+In+"; q=0.01":""):p.accepts["*"]);for(f in p.headers)w.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(p.beforeSend.call(d,w,p)===!1||2===x))return w.abort();T="abort";for(f in{success:1,error:1,complete:1})w[f](p[f]);if(i=L($n,p,n,w)){w.readyState=1,c&&h.trigger("ajaxSend",[w,p]),p.async&&p.timeout>0&&(u=setTimeout(function(){w.abort("timeout")},p.timeout));try{x=1,i.send(v,r)}catch(N){if(!(2>x))throw N;r(-1,N)}}else r(-1,"No Transport");return w},getScript:function(e,n){return st.get(e,t,n,"script")},getJSON:function(e,t,n){return st.get(e,t,n,"json")}}),st.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return st.globalEval(e),e}}}),st.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),st.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=V.head||st("head")[0]||V.documentElement;return{send:function(t,i){n=V.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Xn=[],Un=/(=)\?(?=&|$)|\?\?/;st.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xn.pop()||st.expando+"_"+Ln++;return this[e]=!0,e}}),st.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Un.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Un.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=st.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Un,"$1"+o):n.jsonp!==!1&&(n.url+=(Hn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||st.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Xn.push(o)),s&&st.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Vn,Yn,Jn=0,Gn=e.ActiveXObject&&function(){var e;for(e in Vn)Vn[e](t,!0)};st.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&_()||F()}:_,Yn=st.ajaxSettings.xhr(),st.support.cors=!!Yn&&"withCredentials"in Yn,Yn=st.support.ajax=!!Yn,Yn&&st.ajaxTransport(function(n){if(!n.crossDomain||st.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,f,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=st.noop,Gn&&delete Vn[a]),i)4!==u.readyState&&u.abort();else{f={},s=u.status,p=u.responseXML,c=u.getAllResponseHeaders(),p&&p.documentElement&&(f.xml=p),"string"==typeof u.responseText&&(f.text=u.responseText);try{l=u.statusText}catch(d){l=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=f.text?200:404}}catch(h){i||o(-1,h)}f&&o(s,l,f,c)},n.async?4===u.readyState?setTimeout(r):(a=++Jn,Gn&&(Vn||(Vn={},st(e).unload(Gn)),Vn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Qn,Kn,Zn=/^(?:toggle|show|hide)$/,er=RegExp("^(?:([+-])=|)("+ut+")([a-z%]*)$","i"),tr=/queueHooks$/,nr=[W],rr={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=er.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(st.cssNumber[e]?"":"px"),"px"!==r&&s){s=st.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,st.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};st.Animation=st.extend(P,{tweener:function(e,t){st.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");for(var n,r=0,i=e.length;i>r;r++)n=e[r],rr[n]=rr[n]||[],rr[n].unshift(t)},prefilter:function(e,t){t?nr.unshift(e):nr.push(e)}}),st.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(st.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.pos=t=this.options.duration?st.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=st.css(e.elem,e.prop,"auto"),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){st.fx.step[e.prop]?st.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[st.cssProps[e.prop]]||st.cssHooks[e.prop])?st.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},st.each(["toggle","show","hide"],function(e,t){var n=st.fn[t];st.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(I(t,!0),e,r,i)}}),st.fn.extend({fadeTo:function(e,t,n,r){return this.filter(w).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=st.isEmptyObject(e),o=st.speed(t,n,r),a=function(){var t=P(this,st.extend({},e),o);a.finish=function(){t.stop(!0)},(i||st._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=st.timers,a=st._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&tr.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&st.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=st._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=st.timers,a=r?r.length:0;for(n.finish=!0,st.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),st.each({slideDown:I("show"),slideUp:I("hide"),slideToggle:I("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){st.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),st.speed=function(e,t,n){var r=e&&"object"==typeof e?st.extend({},e):{complete:n||!n&&t||st.isFunction(e)&&e,duration:e,easing:n&&t||t&&!st.isFunction(t)&&t};return r.duration=st.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in st.fx.speeds?st.fx.speeds[r.duration]:st.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){st.isFunction(r.old)&&r.old.call(this),r.queue&&st.dequeue(this,r.queue)},r},st.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},st.timers=[],st.fx=$.prototype.init,st.fx.tick=function(){var e,n=st.timers,r=0;for(Qn=st.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||st.fx.stop(),Qn=t},st.fx.timer=function(e){e()&&st.timers.push(e)&&st.fx.start()},st.fx.interval=13,st.fx.start=function(){Kn||(Kn=setInterval(st.fx.tick,st.fx.interval))},st.fx.stop=function(){clearInterval(Kn),Kn=null},st.fx.speeds={slow:600,fast:200,_default:400},st.fx.step={},st.expr&&st.expr.filters&&(st.expr.filters.animated=function(e){return st.grep(st.timers,function(t){return e===t.elem}).length}),st.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){st.offset.setOffset(this,e,t)});var n,r,i={top:0,left:0},o=this[0],a=o&&o.ownerDocument;if(a)return n=a.documentElement,st.contains(n,o)?(o.getBoundingClientRect!==t&&(i=o.getBoundingClientRect()),r=z(a),{top:i.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:i.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):i},st.offset={setOffset:function(e,t,n){var r=st.css(e,"position");"static"===r&&(e.style.position="relative");var i,o,a=st(e),s=a.offset(),u=st.css(e,"top"),l=st.css(e,"left"),c=("absolute"===r||"fixed"===r)&&st.inArray("auto",[u,l])>-1,f={},p={};c?(p=a.position(),i=p.top,o=p.left):(i=parseFloat(u)||0,o=parseFloat(l)||0),st.isFunction(t)&&(t=t.call(e,n,s)),null!=t.top&&(f.top=t.top-s.top+i),null!=t.left&&(f.left=t.left-s.left+o),"using"in t?t.using.call(e,f):a.css(f)}},st.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===st.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),st.nodeName(e[0],"html")||(n=e.offset()),n.top+=st.css(e[0],"borderTopWidth",!0),n.left+=st.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-st.css(r,"marginTop",!0),left:t.left-n.left-st.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent||V.documentElement;e&&!st.nodeName(e,"html")&&"static"===st.css(e,"position");)e=e.offsetParent;return e||V.documentElement})}}),st.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);st.fn[e]=function(i){return st.access(this,function(e,i,o){var a=z(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?st(a).scrollLeft():o,r?o:st(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}}),st.each({Height:"height",Width:"width"},function(e,n){st.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){st.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return st.access(this,function(n,r,i){var o;return st.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?st.css(n,r,s):st.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=st,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return st})})(window);
/*!
* jQuery Cookie Plugin v1.3.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(e){var a=/\+/g;function d(g){return g}function b(g){return decodeURIComponent(g.replace(a," "))}function f(g){if(g.indexOf('"')===0){g=g.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{return c.json?JSON.parse(g):g}catch(h){}}var c=e.cookie=function(p,o,u){if(o!==undefined){u=e.extend({},c.defaults,u);if(typeof u.expires==="number"){var q=u.expires,s=u.expires=new Date();s.setDate(s.getDate()+q)}o=c.json?JSON.stringify(o):String(o);return(document.cookie=[c.raw?p:encodeURIComponent(p),"=",c.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join(""))}var g=c.raw?d:b;var r=document.cookie.split("; ");var v=p?undefined:{};for(var n=0,k=r.length;n
").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;a.length>i;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;o.length>i;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(100*(a/n))),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var l=s.beforeSend;return s.beforeSend=function(e,t){t.data=n,l&&l.call(this,e,t)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(D),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action");w.setAttribute("target",d),u||w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(k)},m.timeout));var o=[];try{if(m.extraData)for(var l in m.extraData)m.extraData.hasOwnProperty(l)&&(e.isPlainObject(m.extraData[l])&&m.extraData[l].hasOwnProperty("name")&&m.extraData[l].hasOwnProperty("value")?o.push(e('
').val(m.extraData[l].value).appendTo(w)[0]):o.push(e('
').val(m.extraData[l]).appendTo(w)[0]));m.iframeTarget||(v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1)),setTimeout(t,15);try{w.submit()}catch(c){var p=document.createElement("form").submit;p.apply(w)}}finally{w.setAttribute("action",i),r?w.setAttribute("target",r):f.removeAttr("target"),e(o).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=D),t===k&&x)return x.abort("timeout"),S.reject(x,"timeout"),void 0;if(t==D&&x)return x.abort("server abort"),S.reject(x,"error","server abort"),void 0;if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),setTimeout(s,250),void 0;var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var l=(m.dataType||"").toLowerCase(),c=/(json|script|text)/.test(l);if(c||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(c){var d=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];d?x.responseText=d.textContent?d.textContent:d.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==l&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{L=_(x,l,m)}catch(b){i="parsererror",x.error=r=b||i}}catch(b){a("error caught: ",b),i="error",x.error=r=b||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&300>x.status||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,L,"success",x),S.resolve(x.responseText,"success",x),p&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),p&&e.event.trigger("ajaxError",[x,m,r])),p&&e.event.trigger("ajaxComplete",[x,m]),p&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget||v.remove(),x.responseXML=null},100)}}}var l,c,m,p,d,v,g,x,b,y,T,j,w=f[0],S=e.Deferred();if(r)for(c=0;h.length>c;c++)l=e(h[c]),i?l.prop("disabled",!1):l.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,d="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),y=v.attr2("name"),y?d=y:v.attr2("name",d)):(v=e('
'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),p&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},p=m.global,p&&0===e.active++&&e.event.trigger("ajaxStart"),p&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;b=w.clk,b&&(y=b.name,y&&!b.disabled&&(m.extraData=m.extraData||{},m.extraData[y]=b.value,"image"==b.type&&(m.extraData[y+".x"]=w.clk_x,m.extraData[y+".y"]=w.clk_y)));var k=1,D=2,A=e("meta[name=csrf-token]").attr("content"),E=e("meta[name=csrf-param]").attr("content");E&&A&&(m.extraData=m.extraData||{},m.extraData[E]=A),m.forceSync?o():setTimeout(o,10);var L,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,l,c,f=this;"function"==typeof t&&(t={success:t}),u=t.type||this.attr2("method"),l=t.url||this.attr2("action"),c="string"==typeof l?e.trim(l):"",c=c||window.location.href||"",c&&(c=(c.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:c,success:e.ajaxSettings.success,type:u||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var p=t.traditional;void 0===p&&(p=e.ajaxSettings.traditional);var d,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,d=e.param(t.data,p)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,p);d&&(g=g?g+"&"+d:d),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(b,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var y=t.error;t.error=function(e,r,a){var n=t.context||this;y.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e('input[type=file]:enabled[value!=""]',this),w=j.length>0,S="multipart/form-data",k=f.attr("enctype")==S||f.attr("encoding")==S,D=n.fileapi&&n.formdata;a("fileAPI :"+D);var A,E=(w||k)&&!D;t.iframe!==!1&&(t.iframe||E)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||k)&&D?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var L=0;h.length>L;L++)h[L]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!e.isReady&&i.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(i.s,i.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r){var a=[];if(0===this.length)return a;var i=this[0],o=t?i.getElementsByTagName("*"):i.elements;if(!o)return a;var s,u,l,c,f,m,p;for(s=0,m=o.length;m>s;s++)if(f=o[s],l=f.name,l&&!f.disabled)if(t&&i.clk&&"image"==f.type)i.clk==f&&(a.push({name:l,value:e(f).val(),type:f.type}),a.push({name:l+".x",value:i.clk_x},{name:l+".y",value:i.clk_y}));else if(c=e.fieldValue(f,!0),c&&c.constructor==Array)for(r&&r.push(f),u=0,p=c.length;p>u;u++)a.push({name:l,value:c[u]});else if(n.fileapi&&"file"==f.type){r&&r.push(f);var d=f.files;if(d.length)for(u=0;d.length>u;u++)a.push({name:l,value:d[u],type:f.type});else a.push({name:l,value:"",type:f.type})}else null!==c&&c!==void 0&&(r&&r.push(f),a.push({name:l,value:c,type:f.type,required:f.required}));if(!t&&i.clk){var h=e(i.clk),v=h[0];l=v.name,l&&!v.disabled&&"image"==v.type&&(a.push({name:l,value:h.val()}),a.push({name:l+".x",value:i.clk_x},{name:l+".y",value:i.clk_y}))}return a},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;o>i;i++)r.push({name:a,value:n[i]});else null!==n&&n!==void 0&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,l="select-one"==n,c=l?o+1:u.length,f=l?o:0;c>f;f++){var m=u[f];if(m.selected){var p=m.value;if(p||(p=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),l)return p;s.push(p)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1})(jQuery);
/*!
* ZUI - v1.4.0 - 2016-05-25
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2016 cnezsoft.com; Licensed MIT
*/
/*! Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/
!function(t,e){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var i=0;t.zui({uuid:function(){return 1e3*(new Date).getTime()+i++%1e3},callEvent:function(e,i,o){if(t.isFunction(e)){void 0!==o&&(e=t.proxy(e,o));var n=e(i);return i&&(i.result=n),!(void 0!==n&&!n)}return 1},clientLang:function(){var i,o=e.config;if("undefined"!=typeof o&&o.clientLang)i=o.clientLang;else{var n=t("html").attr("lang");i=n?n:navigator.userLanguage||navigator.userLanguage||"zh_cn"}return i.replace("-","_").toLowerCase()}}),t.fn.callEvent=function(e,i,o){var n=t(this),a=e.indexOf(".zui."),s=0>a?e:e.substring(0,a),r=t.Event(s,i);if(void 0===o&&a>0&&(o=n.data(e.substring(a+1))),o&&o.options){var l=o.options[s];t.isFunction(l)&&t.zui.callEvent(l,r,o)}return n.trigger(r),r}}(jQuery,window),function(){"use strict";String.prototype.format||(String.prototype.format=function(t){var e=this;if(arguments.length>0){var i;if(1==arguments.length&&"object"==typeof t)for(var o in t)void 0!==t[o]&&(i=new RegExp("({"+o+"})","g"),e=e.replace(i,t[o]));else for(var n=0;n
=0;t--)delete this.page[i[t]];this.set(n,this.page)}},a.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},a.prototype.pageClear=function(){this.page={},this.pageSave()},a.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},a.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},a.prototype.check=function(){if(!this.enable&&!this.slience)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},a.prototype.length=function(){return this.check()?o.getLength?o.getLength():o.length:0},a.prototype.removeItem=function(t){return o.removeItem(t),this},a.prototype.remove=function(t){return this.removeItem(t)},a.prototype.getItem=function(t){return o.getItem(t)},a.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},a.prototype.key=function(t){return o.key(t)},a.prototype.setItem=function(t,e){return o.setItem(t,e),this},a.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},a.prototype.clear=function(){return o.clear(),this},a.prototype.forEach=function(t){for(var e=o.length-1;e>=0;e--){var i=o.key(e);t(i,this.get(i))}return this},a.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},a.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},a.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new a})}(window,jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低,无法体验所有功能,建议升级或者更换浏览器。 了解更多...',zh_tw:'您的瀏覽器版本過低,無法體驗所有功能,建議升級或者更换瀏覽器。了解更多...',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. Learn more...'},i=function(){var t=this.isIE()||this.isIE10()||!1;if(t)for(var e=10;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",8>e).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",9>e).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",10>e)},i.prototype.tip=function(i){var o=t("#browseHappyTip");o.length||(o=t(''),o.prependTo("body")),o.find(".content").html(i||this.browseHappyTip||e[t.zui.clientLang()||"zh_cn"])},i.prototype.isIE=function(t){if(10===t)return this.isIE10();var e=document.createElement("b");return e.innerHTML="",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return!1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,o=i.closest("ul:not(.dropdown-menu)"),n=i.attr("data-target");if(n||(n=i.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var a=o.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:a});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(n);this.activate(i.parent("li"),o),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:a})})}}},i.prototype.activate=function(e,i,o){function n(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),o&&o()}var a=i.find("> .active"),s=o&&t.support.transition&&a.hasClass("fade");s?a.one(t.support.transition.end,n).emulateTransitionEnd(150):n(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=function(o){return this.each(function(){var n=t(this),a=n.data(e);a||n.data(e,a=new i(this)),"string"==typeof o&&a[o]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),function(t,e){"use strict";var i=1200,o=992,n=768,a={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop"},s=e(t),r=function(){var t=s.width();e("html").toggleClass(a.desktop,t>=o&&i>t).toggleClass(a.desktopLg,t>=i).toggleClass(a.tablet,t>=n&&o>t).toggleClass(a.phone,n>t).toggleClass(a.isMobile,o>t).toggleClass(a.isDesktop,t>=o)};s.resize(r),r()}(window,jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",o=function(i){t(i).on("click",e,this.close)};o.prototype.close=function(e){function o(){s.trigger("closed."+i).remove()}var n=t(this),a=n.attr("data-target");a||(a=n.attr("href"),a=a&&a.replace(/.*(?=#[^\s]*$)/,""));var s=t(a);e&&e.preventDefault(),s.length||(s=n.hasClass("alert")?n:n.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,o).emulateTransitionEnd(150):o())};var n=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var n=t(this),a=n.data(i);a||n.data(i,a=new o(this)),"string"==typeof e&&a[e].call(n)})},t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click."+i+".data-api",e,o.prototype.close)}(window.jQuery),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},e.prototype.touchable=function(){function e(e){var e=e||window.event;e.originalEvent&&(e=e.originalEvent);var a=t(this);switch(e.type){case"touchstart":o=e.touches[0].pageX,n=e.touches[0].pageY;break;case"touchend":var s=e.changedTouches[0].pageX-o,r=e.changedTouches[0].pageY-n;if(Math.abs(s)>Math.abs(r))i(a,s),Math.abs(s)>10&&e.preventDefault();else{var l=t(window);t("body,html").animate({scrollTop:l.scrollTop()-r},400)}}}function i(t,e){e>10?a.prev():-10>e&&a.next()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",e);var o,n,a=this}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,o=this.getActiveIndex();return e>this.$items.length-1||0>e?void 0:this.sliding?this.$element.one("slid",function(){i.to(e)}):o==e?this.pause().cycle():this.slide(e>o?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){return this.sliding?void 0:this.slide("next")},e.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},e.prototype.slide=function(e,i){var o=this.$element.find(".item.active"),n=i||o[e](),a=this.interval,s="next"==e?"left":"right",r="next"==e?"first":"last",l=this;if(!n.length){if(!this.options.wrap)return;n=this.$element.find(".item")[r]()}this.sliding=!0,a&&this.pause();var d=t.Event("slide.zui.carousel",{relatedTarget:n[0],direction:s});if(!n.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var e=t(l.$indicators.children()[l.getActiveIndex()]);e&&e.addClass("active")})),t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;n.addClass(e),n[0].offsetWidth,o.addClass(s),n.addClass(s),o.one(t.support.transition.end,function(){n.removeClass([e,s].join(" ")).addClass("active"),o.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;o.removeClass("active"),n.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return a&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=function(i){return this.each(function(){var o=t(this),n=o.data("zui.carousel"),a=t.extend({},e.DEFAULTS,o.data(),"object"==typeof i&&i),s="string"==typeof i?i:a.slide;n||o.data("zui.carousel",n=new e(this,a)),"number"==typeof i?n.to(i):s?n[s]():a.interval&&n.pause().cycle(),a.touchable&&n.touchable()})},t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this},t(document).on("click.zui.carousel.data-api","[data-slide], [data-slide-to]",function(e){var i,o=t(this),n=t(o.attr("data-target")||(i=o.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),a=t.extend({},n.data(),o.data()),s=o.attr("data-slide-to");s&&(a.interval=!1),n.carousel(a),(s=o.attr("data-slide-to"))&&n.data("zui.carousel").to(s),e.preventDefault()}),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);e.carousel(e.data())})})}(window.jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var o=this.$parent&&this.$parent.find("> .panel > .in");if(o&&o.length){var n=o.data(e);if(n&&n.transitioning)return;o.collapse("hide"),n||o.data(e,null)}var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[a]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",a].join("-"));this.$element.one(t.support.transition.end,t.proxy(s,this)).emulateTransitionEnd(350)[a](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var o=this.dimension();this.$element[o](this.$element[o]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[o](0).one(t.support.transition.end,t.proxy(n,this)).emulateTransitionEnd(350):n.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var o=t.fn.collapse;t.fn.collapse=function(o){return this.each(function(){var n=t(this),a=n.data(e),s=t.extend({},i.DEFAULTS,n.data(),"object"==typeof o&&o);a||n.data(e,a=new i(this,s)),"string"==typeof o&&a[o]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=o,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var o,n=t(this),a=n.attr("data-target")||i.preventDefault()||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""),s=t(a),r=s.data(e),l=r?"toggle":n.data(),d=n.attr("data-parent"),c=d&&t(d);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+d+'"]').not(n).addClass("collapsed"),n[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),+function(t){"use strict";function e(){t(n).remove(),t(a).each(function(e){var n=i(t(this));n.hasClass("open")&&(n.trigger(e=t.Event("hide."+o)),e.isDefaultPrevented()||n.removeClass("open").trigger("hidden."+o))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}var o="zui.dropdown",n=".dropdown-backdrop",a="[data-toggle=dropdown]",s=function(e){t(e).on("click."+o,this.toggle)};s.prototype.toggle=function(n){var a=t(this);if(!a.is(".disabled, :disabled")){var s=i(a),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('').insertAfter(t(this)).on("click",e),s.trigger(n=t.Event("show."+o)),n.isDefaultPrevented())return;s.toggleClass("open").trigger("shown."+o),a.focus()}return!1}},s.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var o=t(this);if(e.preventDefault(),e.stopPropagation(),!o.is(".disabled, :disabled")){var n=i(o),s=n.hasClass("open");if(!s||s&&27==e.keyCode)return 27==e.which&&n.find(a).focus(),o.click();var r=t("[role=menu] li:not(.divider):visible a",n);if(r.length){var l=r.index(r.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l').appendTo(this.$body),this.$element.on("mousedown.dismiss."+i,t.proxy(function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){n.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},o.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},o.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",t+this.scrollbarWidth)},o.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},o.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var n=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=o,t.fn.modal.noConflict=function(){return t.fn.modal=n,this},t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(o){var n=t(this),a=n.attr("href"),s=null;try{s=t(n.attr("data-target")||a&&a.replace(/.*(?=#[^\s]+$)/,""))}catch(r){return}if(s.length){var l=s.data(i)?"toggle":t.extend({remote:!/#/.test(a)&&a},s.data(),n.data());n.is("a")&&o.preventDefault(),s.one("show."+i,function(t){t.isDefaultPrevented()||s.one("hidden."+i,function(){n.is(":visible")&&n.trigger("focus")})}),e.call(s,l,this,n.data("position"))}})}(jQuery),function(t,e,i){"$:nomunge";function o(){n=e[r](function(){a.each(function(){var e=t(this),i=e.width(),o=e.height(),n=t.data(this,d);(i!==n.w||o!==n.h)&&e.trigger(l,[n.w=i,n.h=o])}),o()},s[c])}var n,a=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",d=l+"-special-event",c="delay",h="throttleWindow";s[c]=250,s[h]=!0,t.event.special[l]={setup:function(){if(!s[h]&&this[r])return!1;var e=t(this);a=a.add(e),t.data(this,d,{w:e.width(),h:e.height()}),1===a.length&&o()},teardown:function(){if(!s[h]&&this[r])return!1;var e=t(this);a=a.not(e),e.removeData(d),a.length||clearTimeout(n)},add:function(e){function o(e,o,a){var s=t(this),r=t.data(this,d)||{};r.w=o!==i?o:s.width(),r.h=a!==i?a:s.height(),n.apply(this,arguments)}if(!s[h]&&this[r])return!1;var n;return t.isFunction(e)?(n=e,o):(n=e.handler,void(e.handler=o))}}}(jQuery,this),function(t,e){"use strict";if(!t.fn.modal)throw new Error("Modal trigger requires modal.js");var i="zui.modaltrigger",o="ajax",n=".zui.modal",a="string",s=function(e,i){e=t.extend({},s.DEFAULTS,t.ModalTriggerDefaults,i?i.data():null,e),this.isShown,this.$trigger=i,this.options=e,this.id=t.zui.uuid()};s.DEFAULTS={type:"custom",height:"auto",name:"triggerModal",fade:!0,position:"fit",showHeader:!0,delay:0,backdrop:!0,keyboard:!0,waittime:0,loadingIcon:"icon-spinner-indicator"},s.prototype.init=function(s){var r=this;if(s.url&&(!s.type||s.type!=o&&"iframe"!=s.type)&&(s.type=o),s.remote)s.type=o,typeof s.remote===a&&(s.url=s.remote);else if(s.iframe)s.type="iframe",typeof s.iframe===a&&(s.url=s.iframe);else if(s.custom&&(s.type="custom",typeof s.custom===a)){var l;try{l=t(s.custom)}catch(d){}l&&l.length?s.custom=l:t.isFunction(e[s.custom])&&(s.custom=e[s.custom])}var c=t("#"+s.name);c.length&&(r.isShown||c.off(n),c.remove()),c=t(''+("string"==typeof s.loadingIcon&&0===s.loadingIcon.indexOf("icon-")?'
':s.loadingIcon)+'
').appendTo("body").data(i,r);var h=function(e,i){var o=s[e];t.isFunction(o)&&c.on(i+n,o)};h("onShow","show"),h("shown","shown"),h("onHide","hide"),h("hidden","hidden"),h("loaded","loaded"),c.on("shown"+n,function(){r.isShown=!0}).on("hidden"+n,function(){r.isShown=!1}),this.$modal=c,this.$dialog=c.find(".modal-dialog"),s.mergeOptions&&(this.options=s)},s.prototype.show=function(s){var r=t.extend({},this.options,{url:this.$trigger?this.$trigger.attr("href")||this.$trigger.attr("data-url")||this.$trigger.data("url"):this.options.url},s);this.init(r);var l=this,d=this.$modal,c=this.$dialog,h=r.custom,p=c.find(".modal-body").css("padding",""),u=c.find(".modal-header"),f=c.find(".modal-content");d.toggleClass("fade",r.fade).addClass(r.cssClass).toggleClass("modal-loading",!this.isShown),c.toggleClass("modal-md","md"===r.size).toggleClass("modal-sm","sm"===r.size).toggleClass("modal-lg","lg"===r.size).toggleClass("modal-fullscreen","fullscreen"===r.size),u.toggle(r.showHeader),u.find(".modal-icon").attr("class","modal-icon icon-"+r.icon),u.find(".modal-title-name").html(r.title||""),r.size&&"fullscreen"===r.size&&(r.width="",r.height="");var g=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){l.ajustPosition()},100)},m=function(t,e){return"undefined"==typeof t&&(t=r.delay),setTimeout(function(){c=d.find(".modal-dialog"),r.width&&"auto"!=r.width&&c.css("width",r.width),r.height&&"auto"!=r.height&&(c.css("height",r.height),"iframe"===r.type&&p.css("height",c.height()-u.outerHeight())),l.ajustPosition(r.position),d.removeClass("modal-loading"),"iframe"!=r.type&&c.off("resize."+i).on("resize."+i,g),e&&e()},t)};if("custom"===r.type&&h)if(t.isFunction(h)){var v=h({modal:d,options:r,modalTrigger:l,ready:m});typeof v===a&&(p.html(v),m())}else h instanceof t?(p.html(t("").append(h.clone()).html()),m()):(p.html(h),m());else if(r.url){var b=function(){var t=d.callEvent("broken"+n,l,l);t&&p.html(t)};if(d.attr("ref",r.url),"iframe"===r.type){d.addClass("modal-iframe"),this.firstLoad=!0;var y="iframe-"+r.name;u.detach(),p.detach(),f.empty().append(u).append(p),p.css("padding",0).html('
'),r.waittime>0&&(l.waitTimeout=m(r.waittime,b));var w=document.getElementById(y);w.onload=w.onreadystatechange=function(){if(l.firstLoad&&d.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){l.firstLoad=!1,r.waittime>0&&clearTimeout(l.waitTimeout);try{d.attr("ref",w.contentWindow.location.href);var t=e.frames[y].$;if(t&&"auto"===r.height&&"fullscreen"!=r.size){var o=t("body").addClass("body-modal");r.iframeBodyClass&&o.addClass(r.iframeBodyClass);var a=function(t){d.removeClass("fade");var e=o.outerHeight();t===!0&&r.onlyIncreaseHeight&&(e=Math.max(e,p.data("minModalHeight")||0),p.data("minModalHeight",e)),p.css("height",e),r.fade&&d.addClass("fade"),m()};d.callEvent("loaded"+n,{modalType:"iframe",jQuery:t},null),setTimeout(a,100),o.off("resize."+i).on("resize."+i,g)}else m();t.extend({closeModal:e.closeModal})}catch(s){m()}}}}else t.get(r.url,function(e){try{var i=t(e);i.hasClass("modal-dialog")?c.replaceWith(i):i.hasClass("modal-content")?c.find(".modal-content").replaceWith(i):p.wrapInner(i)}catch(a){d.html(e)}d.callEvent("loaded"+n,{modalType:o},l),m()}).error(b)}d.modal({show:"show",backdrop:r.backdrop,moveable:r.moveable,keyboard:r.keyboard})},s.prototype.close=function(i,o){(i||o)&&this.$modal.on("hidden"+n,function(){t.isFunction(i)&&i(),typeof o===a&&("this"===o?e.location.reload():e.location=o)}),this.$modal.modal("hide")},s.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},s.prototype.ajustPosition=function(t){this.$modal.modal("ajustPosition",t||this.options.position)},t.zui({ModalTrigger:s,modalTrigger:new s}),t.fn.modalTrigger=function(e,o){return t(this).each(function(){var n=t(this),r=n.data(i),l=t.extend({title:n.attr("title")||n.text(),url:n.attr("href"),type:n.hasClass("iframe")?"iframe":""},n.data(),t.isPlainObject(e)&&e);r||n.data(i,r=new s(l,n)),typeof e==a?r[e](o):l.show&&r.show(o),n.on((l.trigger||"click")+".toggle."+i,function(t){r.toggle(l),n.is("a")&&t.preventDefault()})})};var r=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var o=t(this);o.hasClass("modal")?r.call(o,e,i):o.modalTrigger(e,i)})};var l=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===a&&(e=t(e)),e&&e instanceof t?e:null},d=function(e,o,n){if(t.isFunction(e)){var a=n;n=o,o=e,e=a}e=l(e),e&&e.length&&e.each(function(){t(this).data(i).close(o,n)})},c=function(t,e){e=l(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:d,ajustModalPosition:c}),t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(e){var o=t(this),n=o.attr("href"),a=null;try{a=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}a&&a.length||(o.data(i)?o.trigger(".toggle."+i):o.modalTrigger({show:!0})),o.is("a")&&e.preventDefault()})}(window.jQuery,window),+function(t){"use strict";var e=function(t,e){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,o){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o);for(var n=this.options.trigger.split(" "),a=n.length;a--;){var s=n[a];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,
hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(i),i.isDefaultPrevented())return;var o=this.tip();this.setContent(e),this.options.animation&&o.addClass("fade");var n="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,s=a.test(n);s&&(n=n.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(n),this.options.container?o.appendTo(this.options.container):o.insertAfter(this.$element);var r=this.getPosition(),l=o[0].offsetWidth,d=o[0].offsetHeight;if(s){var c=this.$element.parent(),h=n,p=document.documentElement.scrollTop||document.body.scrollTop,u="body"==this.options.container?window.innerWidth:c.outerWidth(),f="body"==this.options.container?window.innerHeight:c.outerHeight(),g="body"==this.options.container?0:c.offset().left;n="bottom"==n&&r.top+r.height+d-p>f?"top":"top"==n&&r.top-p-d<0?"bottom":"right"==n&&r.right+l>u?"left":"left"==n&&r.left-l
'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),o=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](o),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,o=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return o?"$next"==o?e.next(".popover"):t(o):!1},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var o=t(this),n=o.data("zui.popover"),a="object"==typeof i&&i;n||o.data("zui.popover",n=new e(this,a)),"string"==typeof i&&n[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),function(t){"use strict";t.zui.imgReady=function(){var t=[],e=null,i=function(){for(var e=0;e1024)&&(n.call(p),r.end=!0)},r(),p.onload=function(){!r.end&&r(),a&&a.call(p),p=p.onload=p.onerror=null},void(r.end||(t.push(r),null===e&&(e=setInterval(i,40)))))}}()}(jQuery),function(t,e,i){"use strict";if(!t.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!t.zui.imgReady)throw new Error("imgReady requires for lightbox");var o=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};o.DEFAULTS={modalTeamplate:''},o.prototype.getOptions=function(e){var i="image";return e=t.extend({},o.DEFAULTS,this.$.data(),e),e[i]||(e[i]=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data(i,e[i])),e},o.prototype.init=function(){this.bindEvents()},o.prototype.initGroups=function(){var e=this.$.data("groups");e||(e=t('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",e),e.each(function(e){t(this).attr("data-group-index",e)})),this.groups=e,this.groupIndex=parseInt(this.$.data("group-index"))},o.prototype.bindEvents=function(){var o=this.$,n=this,a=this.options;return a.image?void o.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(o){n.initGroups();var s=o.modal,r=n.groups,l=n.groupIndex;s.addClass("modal-lightbox").html(a.modalTeamplate.format(a)).toggleClass("lightbox-with-caption","string"==typeof a.caption).removeClass("lightbox-full").data("group-index",l);var d=s.find(".modal-dialog"),c=t(e).width();t.zui.imgReady(a.image,function(){d.css({width:i.min(c,this.width)}),c
0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(l+1)+'"]').length>0),s.find(".controller").click(function(){var n=t(this),a=s.data("group-index")+(n.hasClass("prev")?-1:1),l=r.filter('[data-group-index="'+a+'"]');if(l.length){var h=l.data("image"),p=l.data("caption");s.addClass("modal-loading").data("group-index",a).toggleClass("lightbox-with-caption","string"==typeof p).removeClass("lightbox-full"),s.find(".lightbox-img").attr("src",h),s.find(".caption > .content").text(p),c=t(e).width(),t.zui.imgReady(h,function(){d.css({width:i.min(c,this.width)}),c0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(a+1)+'"]').length>0),!1})}}):!1},t.fn.lightbox=function(e){var i="group"+(new Date).getTime();return this.each(function(){var n=t(this),a="object"==typeof e&&e;"object"==typeof a&&a.group?n.attr("data-lightbox-group",a.group):n.data("group")?n.attr("data-lightbox-group",n.data("group")):n.attr("data-lightbox-group",i),n.data("group",n.data("lightbox-group"));var s=n.data("zui.lightbox");s||n.data("zui.lightbox",s=new o(this,a)),"string"==typeof e&&s[e]()})},t.fn.lightbox.Constructor=o,t(function(){t('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,Math),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function o(t){var e=m[f.locale];return e?e[t]:m.en[t]}function n(t,i,o){t.stopPropagation(),t.preventDefault();var n=e.isFunction(o)&&o.call(i,t)===!1;n||i.modal("hide")}function a(t){var e,i=0;for(e in t)i++;return i}function s(t,i){var o=0;e.each(t,function(t,e){i(t,e,o++)})}function r(t){var i,o;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=e.extend({},f,t),t.buttons||(t.buttons={}),i=t.buttons,o=a(i),s(i,function(t,n,a){if(e.isFunction(n)&&(n=i[t]={callback:n}),"object"!==e.type(n))throw new Error("button with key "+t+" must be an object");n.label||(n.label=t),n.className||(2===o&&("ok"===t||"confirm"===t)||1===o?n.className="btn-primary":n.className="btn-default")}),t}function l(t,e){var i=t.length,o={};if(1>i||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(o[e[0]]=t[0],o[e[1]]=t[1]):o=t[0],o}function d(t,i,o){return e.extend(!0,{},t,l(i,o))}function c(t,e,i,o){var n={className:"bootbox-"+t,buttons:h.apply(null,e)};return p(d(n,o,i),e)}function h(){for(var t={},e=0,i=arguments.length;i>e;e++){var n=arguments[e],a=n.toLowerCase(),s=n.toUpperCase();t[a]={label:o(s)}}return t}function p(t,e){var o={};return s(e,function(t,e){o[e]=!0}),s(t.buttons,function(t){if(o[t]===i)throw new Error("button key "+t+" is not allowed (options are "+e.join("\n")+")")}),t}var u={dialog:"",header:"",footer:"",closeButton:"",form:"",inputs:{text:"",textarea:"",email:"",select:"",checkbox:"",date:"",time:"",number:"",password:""}},f={locale:e.zui&&e.zui.clientLang?e.zui.clientLang():"zh_cn",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},g={};g.alert=function(){var t;if(t=c("alert",["ok"],["message","callback"],arguments),t.callback&&!e.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return e.isFunction(t.callback)?t.callback.call(this):!0},g.dialog(t)},g.confirm=function(){var t;if(t=c("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},!e.isFunction(t.callback))throw new Error("confirm requires a callback");return g.dialog(t)},g.prompt=function(){var t,o,n,a,r,l,c;if(a=e(u.form),o={className:"bootbox-prompt",buttons:h("cancel","confirm"),value:"",inputType:"text"},t=p(d(o,arguments,["title","callback"]),["confirm","cancel"]),l=t.show===i?!0:t.show,t.message=a,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=r.val();break;case"checkbox":var o=r.find("input:checked");i=[],s(o,function(t,o){i.push(e(o).val())})}return t.callback.call(this,i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if(!e.isFunction(t.callback))throw new Error("prompt requires a callback");if(!u.inputs[t.inputType])throw new Error("invalid prompt type");switch(r=e(u.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":r.val(t.value);break;case"select":var f={};if(c=t.inputOptions||[],!e.isArray(c))throw new Error("Please pass an array of input options");if(!c.length)throw new Error("prompt with select requires options");s(c,function(t,o){var n=r;if(o.value===i||o.text===i)throw new Error("given options in wrong format");o.group&&(f[o.group]||(f[o.group]=e("").attr("label",o.group)),n=f[o.group]),n.append("")}),s(f,function(t,e){r.append(e)}),r.val(t.value);break;case"checkbox":var m=e.isArray(t.value)?t.value:[t.value];if(c=t.inputOptions||[],!c.length)throw new Error("prompt with checkbox requires options");if(!c[0].value||!c[0].text)throw new Error("given options in wrong format");r=e(""),s(c,function(i,o){var n=e(u.inputs[t.inputType]);n.find("input").attr("value",o.value),n.find("label").append(o.text),s(m,function(t,e){e===o.value&&n.find("input").prop("checked",!0)}),r.append(n)})}return t.placeholder&&r.attr("placeholder",t.placeholder),t.pattern&&r.attr("pattern",t.pattern),t.maxlength&&r.attr("maxlength",t.maxlength),a.append(r),a.on("submit",function(t){t.preventDefault(),t.stopPropagation(),n.find(".btn-primary").click()}),n=g.dialog(t),n.off("shown.zui.modal"),n.on("shown.zui.modal",function(){r.focus()}),l===!0&&n.modal("show"),n},g.dialog=function(t){t=r(t);var o=e(u.dialog),a=o.find(".modal-dialog"),l=o.find(".modal-body"),d=t.buttons,c="",h={onEscape:t.onEscape};if(e.fn.modal===i)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(s(d,function(t,e){c+="",h[t]=e.callback}),l.find(".bootbox-body").html(t.message),t.animate===!0&&o.addClass("fade"),t.className&&o.addClass(t.className),"large"===t.size?a.addClass("modal-lg"):"small"===t.size&&a.addClass("modal-sm"),t.title&&l.before(u.header),t.closeButton){var p=e(u.closeButton);t.title?o.find(".modal-header").prepend(p):p.css("margin-top","-10px").prependTo(l)}return t.title&&o.find(".modal-title").html(t.title),c.length&&(l.after(u.footer),o.find(".modal-footer").html(c)),o.on("hidden.zui.modal",function(t){t.target===this&&o.remove()}),o.on("shown.zui.modal",function(){o.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&o.on("click.dismiss.zui.modal",function(t){o.children(".modal-backdrop").length&&(t.currentTarget=o.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&o.trigger("escape.close.bb")}),o.on("escape.close.bb",function(t){h.onEscape&&n(t,o,h.onEscape)}),o.on("click",".modal-footer button",function(t){var i=e(this).data("bb-handler");n(t,o,h[i])}),o.on("click",".bootbox-close-button",function(t){n(t,o,h.onEscape)}),o.on("keyup",function(t){27===t.which&&o.trigger("escape.close.bb")}),e(t.container).append(o),o.modal({backdrop:t.backdrop?"static":!1,keyboard:!1,show:!1}),t.show&&o.modal("show"),o},g.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(f,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return g.addLocale=function(t,i){return e.each(["OK","CANCEL","CONFIRM"],function(t,e){if(!i[e])throw new Error("Please supply a translation for '"+e+"'")}),m[t]={OK:i.OK,CANCEL:i.CANCEL,CONFIRM:i.CONFIRM},g},g.removeLocale=function(t){return delete m[t],g},g.setLocale=function(t){return g.setDefaults("locale",t)},g.init=function(i){return t(i||e)},g}),function(t,e,i,o){"use strict";function n(t){if(t=t.toLowerCase(),t&&c.test(t)){var e;if(4===t.length){var i="#";for(e=1;4>e;e+=1)i+=t.slice(e,e+1).concat(t.slice(e,e+1));t=i}var o=[];for(e=1;7>e;e+=2)o.push(y("0x"+t.slice(e,e+2)));return{r:o[0],g:o[1],b:o[2],a:1}}throw new Error("Wrong hex string! (hex: "+t+")")}function a(e){return typeof e===f&&("transparent"===e.toLowerCase()||m[e.toLowerCase()]||c.test(t.trim(e.toLowerCase())))}function s(t){function e(t){return t=0>t?t+1:t>1?t-1:t,1>6*t?r+(s-r)*t*6:1>2*t?s:2>3*t?r+(s-r)*(2/3-t)*6:r}var i=t.h,o=t.s,n=t.l,a=t.a;i=d(i)%p/p,o=l(d(o)),n=l(d(n)),a=l(d(a));var s=.5>=n?n*(o+1):n+o-n*o,r=2*n-s,c={r:e(i+1/3)*h,g:e(i)*h,b:e(i-1/3)*h,a:a};return c}function r(t,i,o){return v(o)&&(o=0),v(i)&&(i=h),e.min(e.max(t,o),i)}function l(t,e){return r(t,e)}function d(t){return"number"==typeof t?t:parseFloat(t)}var c=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,h=255,p=360,u=100,f="string",g="object",m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},v=function(t){return t===o},b=function(t){return!v(t)},y=function(t){return parseInt(t)},w=function(t){return y(l(d(t),h))},C=function(t,e,i,o){var a=this;if(a.r=a.g=a.b=0,a.a=1,b(o)&&(a.a=l(d(o),1)),b(t)&&b(e)&&b(i))a.r=w(t),a.g=w(e),a.b=w(i);else if(b(t)){var r=typeof t;if(r==f)t=t.toLowerCase(),"transparent"===t?a.a=0:m[t]?this.rgb(n(m[t])):a.rgb(n(t));else if("number"==r&&v(e))a.r=a.g=a.b=w(t);else if(r==g&&b(t.r))a.r=w(t.r),b(t.g)&&(a.g=w(t.g)),b(t.b)&&(a.b=w(t.b)),b(t.a)&&(a.a=l(d(t.a),1));else if(r==g&&b(t.h)){var c={h:l(d(t.h),p),s:1,l:1,a:1};b(t.s)&&(c.s=l(d(t.s),1)),b(t.l)&&(c.l=l(d(t.l),1)),b(t.a)&&(c.a=l(d(t.a),1)),a.rgb(s(c))}}};C.prototype.rgb=function(t){var e=this;if(b(t)){if(typeof t==g)b(t.r)&&(e.r=w(t.r)),b(t.g)&&(e.g=w(t.g)),b(t.b)&&(e.b=w(t.b)),b(t.a)&&(e.a=l(d(t.a),1));else{var i=y(d(t));e.r=i,e.g=i,e.b=i}return e}return{r:e.r,g:e.g,b:e.b,a:e.a}},C.prototype.hue=function(t){var e=this,i=e.toHsl();return v(t)?i.h:(i.h=l(d(t),p),e.rgb(s(i)),e)},C.prototype.darken=function(t){var e=this,i=e.toHsl();return i.l-=t/u,i.l=l(i.l,1),e.rgb(s(i)),e},C.prototype.clone=function(){var t=this;return new C(t.r,t.g,t.b,t.a)},C.prototype.lighten=function(t){return this.darken(-t)},C.prototype.fade=function(t){return this.a=l(t/u,1),this},C.prototype.spin=function(t){var e=this.toHsl(),i=(e.h+t)%p;return e.h=0>i?p+i:i,this.rgb(s(e))},C.prototype.toHsl=function(){var t,i,o=this,n=o.r/h,a=o.g/h,s=o.b/h,r=o.a,l=e.max(n,a,s),d=e.min(n,a,s),c=(l+d)/2,u=l-d;if(l===d)t=i=0;else{switch(i=c>.5?u/(2-l-d):u/(l+d),l){case n:t=(a-s)/u+(s>a?6:0);break;case a:t=(s-n)/u+2;break;case s:t=(n-a)/u+4}t/=6}return{h:t*p,s:i,l:c,a:r}},C.prototype.luma=function(){var t=this.r/h,i=this.g/h,o=this.b/h;return t=.03928>=t?t/12.92:e.pow((t+.055)/1.055,2.4),i=.03928>=i?i/12.92:e.pow((i+.055)/1.055,2.4),o=.03928>=o?o/12.92:e.pow((o+.055)/1.055,2.4),.2126*t+.7152*i+.0722*o},C.prototype.saturate=function(t){var e=this.toHsl();return e.s+=t/u,e.s=l(e.s),this.rgb(s(e))},C.prototype.desaturate=function(t){return this.saturate(-t)},C.prototype.contrast=function(t,e,i){if(e=v(e)?new C(h,h,h,1):new C(e),t=v(t)?new C(0,0,0,1):new C(t),this.a<.5)return t;if(i=v(i)?.43:d(i),t.luma()>e.luma()){var o=e;e=t,t=o}return this.luma()0?t.a<1?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":t.hexStr():"transparent"},C.isColor=a,t.zui({Color:C})}(jQuery,Math,window,void 0),function(t,e){function i(e,n){if(t.isArray(e))return void t.each(e,function(t,e){i(e,n)});var a={};a[e]=o[e],n?t.extend(n,a):t.extend(a)}var o=t.zui;o&&(i(["uuid","callEvent","clientLang","browser","messager","Messager","showMessager","closeModal","ajustModalPosition","ModalTrigger","modalTrigger","store"]),i(["Color","imgReady","messager","Messager","showMessager","closeModal","ajustModalPosition","ModalTrigger","modalTrigger","store"],e))}(jQuery,window),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var o;return t.isArray(e)&&(o={},t.each(e,function(e,i){t.isPlainObject(i)?o[i.action]=i:o[i]=!0}),e=o),t.isPlainObject(e)&&(o={},t.each(e,function(e,i){i?o[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):o[e]=!1}),e=o),i?t.extend(!0,{},i,e):e}function i(e,i,o){return i=i||e.type,t(o||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var o="zui.tree",n=0,a=function(e,i){this.name=o,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:''},add:{template:''},edit:{template:''},"delete":{template:''}};a.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:''},a.prototype.add=function(e,i,o,n,a){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t(""),r.append(s),this._initList(s,r))):s=r,s){var d=this;t.isArray(i)||(i=[i]),t.each(i,function(e,i){var o=t("").data(i).appendTo(s),n=l.itemWrapper?t('').appendTo(o):o;if(i.html)n.html(i.html);else if(t.isFunction(d.options.itemCreator)){var a=d.options.itemCreator(n,i);a!==!0&&n.html(a)}else n.append(t("",{href:i.url||"#"}).text(i.title||i.name));d._initItem(o,i.idx||e,s,i),i.children&&i.children.length&&d.add(o,i.children)}),this._initList(s),o&&!s.hasClass("tree")&&d.expand(s.parent("li"),n,a)}},a.prototype.reload=function(e){var i=this;e&&(i.$.empty(),i.add(i.$,e)),i.isPreserve&&i.store.time&&i.$.find("li:not(.tree-action-item)").each(function(){var e=t(this);i[i.store[e.data("id")]?"expand":"collapse"](e,!0,!0)})},a.prototype._initList=function(o,n,a,s){var r=this;o.hasClass("tree")?(a=0,n=null):(n=(n||o.closest("li")).addClass("has-list"),n.find(".list-toggle").length||n.prepend(this.options.toggleTemplate),a=a||n.data("idx")),o.attr("data-idx",a||0).children("li:not(.tree-action-item)").each(function(e){r._initItem(t(this),e+1,o)}),s=s||(n?n.data():null);var l=e(s?s.actions:null,this.actions);if(l){if(l.add&&l.add.templateInList!==!1){var d=o.children("li.tree-action-item");d.length?d.detach().appendTo(o):t('').append(i(l.add,"add",l.add.templateInList)).appendTo(o)}l.sort&&o.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:l.sort,$list:o,target:t.target,item:s})}},l.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}n&&(n.hasClass("open")||s&&s.open)&&n.addClass("open in")},a.prototype._initItem=function(o,n,a,s){if(void 0===n){var r=o.prev("li");n=r.length?r.data("idx")+1:1}if(a=a||o.closest("ul"),o.attr("data-idx",n),!o.data("id")){var l=n;a.hasClass("tree")||(l=a.parent("li").data("id")+"-"+l),o.attr("data-id",l)}s=s||o.data();var d=e(s.actions,this.actions);if(d){var c=o.find(".tree-actions");c.length||(c=t('').appendTo(this.options.itemWrapper?o.find(".tree-item-wrapper"):o),t.each(d,function(t,e){e&&c.append(i(e,t))}))}var h=o.children("ul");h.length&&this._initList(h,o,n,s)},a.prototype._init=function(){var i=this.options,a=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var s=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=o+"::"+(i.name||"")+"#"+(this.$.attr("id")||n++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===s&&(r?this.isPreserve=!0:this.options.initialState=s="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===s?this.expand():"collapse"===s&&this.collapse(),this.$.on("click",".list-toggle, a[href=#], .tree-toggle",function(e){var i=t(this).parent("li");a.callEvent("hit",{target:i,item:i.data()}),a.toggle(i),e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),"sort"!==i.type){var o=e.closest("li:not(.tree-action-item)");a.callEvent("action",{action:i,target:this,$item:o,item:o.data()})}})},a.prototype.preserve=function(e,i,o){if(this.isPreserve)if(e)i=i||e.data("id"),o=void 0===o?e.hasClass("open"):!1,o?this.store[i]=o:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var n=this;this.store={},this.$.find("li").each(function(){n.preserve(t(this))})}},a.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},a.prototype.show=function(e,i,o){var n=this;e.each(function(){var e=t(this);if(n.expand(e,i,o),e)for(var a=e.parent("ul");a&&a.length&&!a.hasClass("tree");){var s=a.parent("li");s.length?(n.expand(s,i,o),a=s.parent("ul")):a=!1}})},a.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),
this.callEvent("collapse",t,this)},a.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},a.prototype.getOptions=function(e){this.options=t.extend({},a.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},a.prototype.toData=function(e,i){t.isFunction(e)&&(i=e,e=null),e=e||this.$;var o=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),n=e.data();delete n["zui.droppable"];var a=e.children("ul");return a.length&&(n.children=o.toData(a)),t.isFunction(i)?i(n,e):n}).get()},a.prototype.callEvent=function(e,i){var o;return t.isFunction(this.options[e])&&(o=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),o},t.fn.tree=function(e,i){return this.each(function(){var n=t(this),s=n.data(o),r="object"==typeof e&&e;s||n.data(o,s=new a(this,r)),"string"==typeof e&&s[e](i)})},t.fn.tree.Constructor=a,t(function(){t('[data-ride="tree"]').tree()})}(jQuery);
// https://github.com/dankogai/js-base64
(function(global){"use strict";var _Base64=global.Base64;var version="2.1.9";var buffer;if(typeof module!=="undefined"&&module.exports){try{buffer=require("buffer").Buffer}catch(err){}}var b64chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var b64tab=function(bin){var t={};for(var i=0,l=bin.length;i>>6)+fromCharCode(128|cc&63):fromCharCode(224|cc>>>12&15)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|cc&63)}else{var cc=65536+(c.charCodeAt(0)-55296)*1024+(c.charCodeAt(1)-56320);return fromCharCode(240|cc>>>18&7)+fromCharCode(128|cc>>>12&63)+fromCharCode(128|cc>>>6&63)+fromCharCode(128|cc&63)}};var re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;var utob=function(u){return u.replace(re_utob,cb_utob)};var cb_encode=function(ccc){var padlen=[0,2,1][ccc.length%3],ord=ccc.charCodeAt(0)<<16|(ccc.length>1?ccc.charCodeAt(1):0)<<8|(ccc.length>2?ccc.charCodeAt(2):0),chars=[b64chars.charAt(ord>>>18),b64chars.charAt(ord>>>12&63),padlen>=2?"=":b64chars.charAt(ord>>>6&63),padlen>=1?"=":b64chars.charAt(ord&63)];return chars.join("")};var btoa=global.btoa?function(b){return global.btoa(b)}:function(b){return b.replace(/[\s\S]{1,3}/g,cb_encode)};var _encode=buffer?function(u){return(u.constructor===buffer.constructor?u:new buffer(u)).toString("base64")}:function(u){return btoa(utob(u))};var encode=function(u,urisafe){return!urisafe?_encode(String(u)):_encode(String(u)).replace(/[+\/]/g,function(m0){return m0=="+"?"-":"_"}).replace(/=/g,"")};var encodeURI=function(u){return encode(u,true)};var re_btou=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g");var cb_btou=function(cccc){switch(cccc.length){case 4:var cp=(7&cccc.charCodeAt(0))<<18|(63&cccc.charCodeAt(1))<<12|(63&cccc.charCodeAt(2))<<6|63&cccc.charCodeAt(3),offset=cp-65536;return fromCharCode((offset>>>10)+55296)+fromCharCode((offset&1023)+56320);case 3:return fromCharCode((15&cccc.charCodeAt(0))<<12|(63&cccc.charCodeAt(1))<<6|63&cccc.charCodeAt(2));default:return fromCharCode((31&cccc.charCodeAt(0))<<6|63&cccc.charCodeAt(1))}};var btou=function(b){return b.replace(re_btou,cb_btou)};var cb_decode=function(cccc){var len=cccc.length,padlen=len%4,n=(len>0?b64tab[cccc.charAt(0)]<<18:0)|(len>1?b64tab[cccc.charAt(1)]<<12:0)|(len>2?b64tab[cccc.charAt(2)]<<6:0)|(len>3?b64tab[cccc.charAt(3)]:0),chars=[fromCharCode(n>>>16),fromCharCode(n>>>8&255),fromCharCode(n&255)];chars.length-=[0,0,2,1][padlen];return chars.join("")};var atob=global.atob?function(a){return global.atob(a)}:function(a){return a.replace(/[\s\S]{1,4}/g,cb_decode)};var _decode=buffer?function(a){return(a.constructor===buffer.constructor?a:new buffer(a,"base64")).toString()}:function(a){return btou(atob(a))};var decode=function(a){return _decode(String(a).replace(/[-_]/g,function(m0){return m0=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};var noConflict=function(){var Base64=global.Base64;global.Base64=_Base64;return Base64};global.Base64={VERSION:version,atob:atob,btoa:btoa,fromBase64:decode,toBase64:encode,utob:utob,encode:encode,encodeURI:encodeURI,btou:btou,decode:decode,noConflict:noConflict};if(typeof Object.defineProperty==="function"){var noEnum=function(v){return{value:v,enumerable:false,writable:true,configurable:true}};global.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",noEnum(function(){return decode(this)}));Object.defineProperty(String.prototype,"toBase64",noEnum(function(urisafe){return encode(this,urisafe)}));Object.defineProperty(String.prototype,"toBase64URI",noEnum(function(){return encode(this,true)}))}}if(global["Meteor"]){Base64=global.Base64}})(this);
/* Set trigger modal default name to 'ajaxModal'. */
+(function(){$.ModalTriggerDefaults = {name: 'ajaxModal'};})();
$.extend(
{
setAjaxForm: function(formID, callback)
{
if(typeof(ajaxForms) != "string")
{
ajaxForms = ',' + formID + ',';
}
else
{
if(ajaxForms.indexOf(formID) != -1) return;
ajaxForms = ',' + formID + ',';
}
appendFingerprint(formID);
form = $(formID);
var options =
{
target : null,
timeout : 60000,
dataType:'json',
success: function(response)
{
appendFingerprint(formID);
$.enableForm(formID);
var submitButton = $(formID).find(':input[type=submit], .submit');
/* The response is not an object, some error occers, bootbox.alert it. */
if($.type(response) != 'object')
{
if(response) return bootbox.alert(response);
return bootbox.alert('No response.');
}
var showPopover = function(type, message) {
type = type || 'success';
message = message || response.message;
var container = submitButton.data('popoverContainer');
if(container === undefined) container = 'body';
submitButton.popover({container: container, trigger:'manual', content:message, placement: submitButton.data('placement') || 'right', tipClass: 'popover-' + type + ' popover-ajaxform'}).popover('show');
setTimeout(function(){submitButton.popover('destroy');}, 2000);
};
/* The response.result is success. */
if(response.result == 'success')
{
if(response.message && response.message.length) showPopover();
if($.isFunction(callback)) return setTimeout(function(){callback(response)}, 600);
if($('#responser').length && response.message && response.message.length)
{
$('#responser').html(response.message).addClass('red f-12px').show().delay(3000).fadeOut(100);
}
if(response.locate)
{
return setTimeout(function(){location.href = response.locate;}, 1200);
}
return true;
}
/**
* The response.result is fail.
*/
/* The result.message is just a string. */
if($.type(response.message) == 'string')
{
if($('#responser').length == 0)
{
showPopover('danger');
}
else $('#responser').html(response.message).addClass('red f-12px').show().delay(5000).fadeOut(100);
}
/* The result.message is just a object. */
if($.type(response.message) == 'object')
{
$.each(response.message, function(key, value)
{
/* Define the id of the error objecjt and it's label. */
var errorOBJ = '#' + key;
var errorLabel = key + 'Label';
/* Create the error message. */
var errorMSG = '';
errorMSG += $.type(value) == 'string' ? value : value.join(';');
errorMSG += '';
/* Append error message, set style and set the focus events. */
$('#' + errorLabel).remove();
var $errorOBJ = $(errorOBJ);
if($errorOBJ.closest('.input-group').length > 0)
{
$errorOBJ.closest('.input-group').after(errorMSG)
}
else
{
$errorOBJ.parent().append(errorMSG);
}
$errorOBJ.css('margin-bottom', 0);
$errorOBJ.css('border-color','#953B39')
$errorOBJ.change(function()
{
$errorOBJ.css('margin-bottom', 0);
$errorOBJ.css('border-color','')
$('#' + errorLabel).remove();
});
})
/* Focus the first error field thus to nitify the user. */
var firstErrorField = $('#' +$('span.red').first().attr('for'));
topOffset = parseInt(firstErrorField.offset().top) - 20; // 20px offset more for margin.
/* If there's the navbar-fixed-top element, minus it's height. */
if($('.navbar-fixed-top').size())
{
topOffset = topOffset - parseInt($('.navbar-fixed-top').height());
}
/* Scroll to the error field and foucus it. */
$(document).scrollTop(topOffset);
firstErrorField.focus();
}
if($.isFunction(callback)) return callback(response);
},
/* When error occers, alert the response text, status and error. */
error: function(jqXHR, textStatus, errorThrown)
{
$.enableForm(formID);
if(textStatus == 'timeout')
{
bootbox.alert(v.lang.timeout);
return false;
}
bootbox.alert(v.lang.errorThrown + '' + jqXHR.responseText + '
');
}
};
var storageName = 'ajaxFormOptions';
if(!$[storageName]) $[storageName] = {};
$[storageName][formID] = options;
form.data(storageName, options);
if(!form.data('ajaxFormSubmitEvent'))
{
/* Call ajaxSubmit to sumit the form. */
$(document).on('submit.ajaxform', formID, function()
{
$.disableForm(formID);
var $this = $(this);
$this.ajaxSubmit($this.data('ajaxFormOptions') || $.ajaxFormOptions[formID]);
return false; // Prevent the submitting event of the browser.
});
form.data('ajaxFormSubmitEvent', true);
}
},
/* Switch the label and disabled attribute for the submit button in a form. */
setSubmitButton: function(formID, action)
{
var submitButton = $(formID).find(':submit');
label = submitButton.val();
loading = submitButton.data('loading');
disabled = action == 'disable';
submitButton.attr('disabled', disabled);
submitButton.val(loading);
submitButton.data('loading', label);
},
/* Disable a form. */
disableForm: function(formID)
{
$.setSubmitButton(formID, 'disable');
},
/* Enable a form. */
enableForm: function(formID)
{
$.setSubmitButton(formID, 'enable');
}
});
$.extend(
{
/**
* Set ajax loader.
*
* Bind click event for some elements thus when click them,
* use $.load to load page into target.
*
* @param string selector
* @param string target
* @param funtion callback
*/
setAjaxLoader: function(selector, target, callback)
{
var target = $(target);
if(!target.size()) return false;
$(document).on('click', selector, function()
{
url = $(this).attr('href');
if(!url) url = $(this).data('rel');
if(!url) return false;
width = target.find('.modal-dialog').width();
target.attr('rel', url);
target.load(url, function()
{
target.find('.modal-dialog').css('width', width);
if(target.hasClass('modal'))
{
$.ajustModalPosition('fit', target);
}
callback && callback();
});
return false;
});
},
/**
* Set ajax jsoner.
*
* @param string selector
* @param object callback
*/
setAjaxJSONER: function(selector, callback)
{
$(document).on('click', selector, function()
{
/* Try to get the href of current element, then try it's data-rel attribute. */
url = $(this).attr('href');
if(!url) url = $(this).data('rel');
if(!url) return false;
$.getJSON(url, function(response)
{
/* If set callback, call it. */
if($.isFunction(callback)) return callback(response);
/* If the response has message attribute, show it in #responser or alert it. */
if(response.message)
{
if($('#responser').length)
{
$('#responser').html(response.message);
$('#responser').addClass('text-info f-12px');
$('#responser').show().delay(3000).fadeOut(100);
}
else
{
bootbox.alert(response.message);
}
}
/* If the response has locate param, locate the browse. */
if(response.locate) return setTimeout(function(){location.href = response.locate;}, 1200);
/* If target and source returned in reponse, update target with the source. */
if(response.target && response.source)
{
$(response.target).load(response.source);
}
});
return false;
});
},
/**
* Set ajax deleter.
*
* @param string $selector
* @access public
* @return void
*/
setAjaxDeleter: function (selector)
{
$(document).on('click', selector, function()
{
var deleter = $(this);
message = deleter.data('message') ? deleter.data('message') : v.lang.confirmDelete;
bootbox.confirm(message, function(result)
{
if(result)
{
deleter.text(v.lang.deleteing);
$.getJSON(deleter.attr('href'), function(data)
{
if(data.result == 'success')
{
if(deleter.parents('#ajaxModal').size())
{
if(typeof(data.locate) != 'undefined' && data.locate)
{
$('#ajaxModal').attr('rel', data.locate).load(data.locate);
}
else
{
$.reloadAjaxModal(1200);
}
}
else
{
if(typeof(data.locate) != 'undefined' && data.locate)
{
location.href = data.locate;
}
else
{
location.reload();
}
}
return true;
}
else
{
alert(data.message);
}
});
}
return true;
});
return false;
});
},
/**
* Set reload deleter.
*
* @param string $selector
* @access public
* @return void
*/
setReloadDeleter: function (selector)
{
$(document).on('click', selector, function()
{
if(confirm(v.lang.confirmDelete))
{
var deleter = $(this);
deleter.text(v.lang.deleteing);
$.getJSON(deleter.attr('href'), function(data)
{
if(data.result == 'success')
{
var table = $(deleter).closest('table');
var replaceID = table.attr('id');
table.wrap("");
$('#tmpDiv').load(document.location.href + ' #' + replaceID, function()
{
$('#tmpDiv').replaceWith($('#tmpDiv').html());
if(typeof sortTable == 'function')
{
sortTable();
}
else
{
$('.colored').colorize();
$('tfoot td').css('background', 'white').unbind('click').unbind('hover');
}
});
}
else
{
alert(data.message);
}
});
}
return false;
});
},
/**
* Set reload.
*
* @param string $selector
* @access public
* @return void
*/
setReload: function (selector)
{
$(document).on('click', selector, function()
{
var reload = $(this);
$.getJSON(reload.attr('href'), function(data)
{
if(data.result == 'success')
{
var table = $(reload).closest('table');
var replaceID = table.attr('id');
table.wrap("");
$('#tmpDiv').load(document.location.href + ' #' + replaceID, function()
{
$('#tmpDiv').replaceWith($('#tmpDiv').html());
if(typeof sortTable == 'function')
{
sortTable();
}
else
{
$('.colored').colorize();
$('tfoot td').css('background', 'white').unbind('click').unbind('hover');
}
});
}
else
{
alert(data.message);
}
});
return false;
});
},
/**
* Reload ajax modal.
*
* @param int duration
* @access public
* @return void
*/
reloadAjaxModal: function(duration)
{
if(typeof(duration) == 'undefined') duration = 1000;
setTimeout(function()
{
var url = $('#ajaxModal').attr('ref') || $('#ajaxModal').attr('rel');
$('#ajaxModal .modal-body').load(url + ' .modal-body', function()
{
$(this).find('.modal-dialog').css('width', $(this).data('width'));
$.ajustModalPosition('fit', '#ajaxModal');
$(this).find('.modal-body').unwrap();
});
}, duration);
}
});
/* jQuery extensions */
+(function($)
{
/**
* Resize image's max width and max height to made it center and middle.
*
* @param int maxWidth
* @param int maxHeight
* @return void
*/
jQuery.fn.resizeImage = function(maxWidth, maxHeight)
{
container = $(this).parent();
parentWidth = parseInt(container.width());
parentHeight = parseInt(container.height());
if(isNaN(maxWidth)) maxWidth = parentWidth;
if(isNaN(maxHeight)) maxHeight = parentHeight;
$(this).css('max-width', maxWidth);
$(this).css('max-height', maxHeight);
return true;
};
/**
* Force to break all letters
*
* @param string filter
* @param minLen min text length
* @return void
*/
jQuery.fn.breakAll = function(filter, minLen)
{
return $(this).each(function()
{
var $set = $(this), $e, text;
if(filter) $set = $set.find(filter);
if(!minLen) minLen = 10;
$set.each(function()
{
$e = $(this);
if($e.children().length) return;
text = $e.text();
if(text.length < minLen || text.indexOf(' ') > -1) return;
$e.css({'word-break': 'break-all', 'white-space': 'normal'});
});
});
};
})(jQuery);
/**
* Create link.
*
* @param string $moduleName
* @param string $methodName
* @param string $vars
* @param string $viewType
* @access public
* @return string
*/
function createLink(moduleName, methodName, vars, viewType)
{
if(!viewType) viewType = config.defaultView;
if(vars)
{
vars = vars.split('&');
for(i = 0; i < vars.length; i ++) vars[i] = vars[i].split('=');
}
if(config.requestType != 'GET')
{
if(config.requestType == 'PATH_INFO')
{
link = config.webRoot + moduleName + config.requestFix + methodName;
if(config.langCode != '') link = config.webRoot + config.langCode + '/' + moduleName + config.requestFix + methodName;
}
if(config.requestType == 'PATH_INFO2')
{
link = config.webRoot + 'index.php/' + moduleName + config.requestFix + methodName;
if(config.langCode != '') link = config.webRoot + 'index.php/' + config.langCode + '/' + moduleName + config.requestFix + methodName;
}
if(vars)
{
if(config.pathType == "full")
{
for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][0] + config.requestFix + vars[i][1];
}
else
{
for(i = 0; i < vars.length; i ++) link += config.requestFix + vars[i][1];
}
}
link += '.' + viewType;
}
else
{
link = config.router + '?' + config.moduleVar + '=' + moduleName + '&' + config.methodVar + '=' + methodName;
if(vars) for(i = 0; i < vars.length; i ++) link += '&' + vars[i][0] + '=' + vars[i][1];
if(config.langCode != '') link = link + '&l=' + config.langCode;
link = link + '&' + config.viewVar + '=' + viewType;
}
return link;
}
/**
* Set required fields, add star class to them.
*
* @access public
* @return void
*/
function setRequiredFields()
{
if(!config.requiredFields) return false;
requiredFields = config.requiredFields.split(',');
for(i = 0; i < requiredFields.length; i++)
{
$('#' + requiredFields[i]).closest('td,th').prepend("");
var colEle = $('#' + requiredFields[i]).closest('[class*="col-"]');
if(colEle.parent().hasClass('form-group')) colEle.addClass('required');
}
}
/**
* Set language.
*
* @access public
* @return void
*/
function selectLang(lang)
{
$.cookie(config.runMode + 'Lang', lang, {expires:config.cookieLife, path:config.webRoot});
location.href = removeAnchor(location.href);
}
/**
* Remove anchor from the url.
*
* @param string $url
* @access public
* @return string
*/
function removeAnchor(url)
{
pos = url.indexOf('#');
if(pos > 0) return url.substring(0, pos);
return url;
}
/**
* Ping to keep login
*
* @access public
* @return void
*/
function ping()
{
$.get(createLink('misc', 'ping'));
}
needPing = true;
if(config.runMode != 'admin') needPing = false;
/**
* Set 'go to top' button
*
* @access public
* @return void
*/
function setGo2Top()
{
if(!$('#go2top').length) return;
$(window).scroll(function()
{
if($(window).scrollTop() < 100) $('#go2top').fadeOut(); else $('#go2top').fadeIn();
}).resize(function ()
{
var parent = $('#go2top').closest('.page-container').find('.page-content');
if(!parent.length) return;
$('#go2top').css('left', parent.offset().left + parent.width() + 30);
if(parent.width() == $(window).width()) $('#go2top').css('left', parent.width() - 90);
}).scroll().resize();
$('#go2top').tooltip({container: 'body', placement: 'left', html: true})
.click(function(){$('body,html').animate({scrollTop:0},400); return false;});
}
/**
* Tidy blocks grid
*/
+(function($)
{
$.fn.tidyCards = function()
{
var winWidth = $(window).width();
$(this).each(function()
{
var $this = $(this);
var parentGrid = $this.closest('[class*="col-"]').parent().closest('[class*="col-"]').data('grid') || 12;
var grid = parentGrid * $this.closest('[class*="col-"]').data('grid') / 12,
$cards = $this.find('[class*="col-"]'),
layout = $this.data('layout');
recPerRow = $cards.data('recperrow');
if(layout == 'horizontal') $cards.attr('class', 'col-md-3 col-sm-4 col-xs-6');
else if(layout == 'vertical') $cards.attr('class', 'col-lg-12');
else
{
if(recPerRow && winWidth > 767)
{
width = 1 / recPerRow * 100;
$cards.attr('style', "width:" + width + '%' + (recPerRow > 1 ? ';float:left' : ''));
}
if(grid >= 9) $cards.attr('class', 'col-md-4 col-sm-6');
else if(grid >= 5) $cards.attr('class', 'col-md-6');
else $cards.attr('class', 'col-md-12');
}
});
};
function tidy($blocks, options)
{
$blocks = $blocks || $(this);
options = $.extend({}, $blocks.data(), options);
var winWidth = $(window).width();
if(!options.force && winWidth == $blocks.data('tidyWinWidth')) return;
else $blocks.data('tidyWinWidth', winWidth);
var rows = {};
var rowIndex = 0;
var disableGrid = winWidth < 992;
$blocks.children('.col').each(function()
{
var $col = $(this);
var $child = $col.children().not('style, script').first().css('height', 'auto');
var isColRow = $child.hasClass('row');
if(isColRow) tidy($child);
if(disableGrid) return;
var grid = $col.attr('data-grid');
if(!grid)
{
grid = options.grid || 12;
}
if(typeof grid === 'string')
{
grid = parseInt(grid);
}
$col.attr('data-grid', grid)
.attr('class', 'col col-' + grid + (isColRow ? ' col-row' : ''));
var row = rows[rowIndex];
var colHeight = $child.height();
if(isColRow) colHeight += 14 * (($child.outerHeight() - colHeight > 7) ? 1 : -1);
if(!row || (row.grid + grid > 12))
{
rowIndex++;
row =
{
grid: grid,
height: colHeight,
cols: $col
};
}
else
{
row.grid += grid;
row.cols = row.cols.add($col);
row.height = Math.max(colHeight, row.height);
}
$col.attr('data-row', rowIndex);
rows[rowIndex] = row;
});
$.each(rows, function(rIndex, row)
{
if(row.cols.length > 1)
{
row.cols.each(function()
{
$(this).children().not('style, script').first().css('height', row.height);
});
}
});
};
$.fn.tidy = function(options)
{
$(this).each(function()
{
var $this = $(this);
tidy($this, options);
if(!$this.data('tidyEvent'))
{
$this.on('tidy', function()
{
tidy($this, $.extend(options, {force: true}));
});
}
$this.data('tidyEvent', true);
});
};
var lastTidyTask = null;
var tidyBlocks = function()
{
clearTimeout(lastTidyTask);
lastTidyTask = setTimeout(function()
{
$('.row.blocks').tidy({force: true});
$('.cards-custom').tidyCards();
}, 300);
};
$.extend({tidyBlocks: tidyBlocks});
tidyBlocks();
$(window).resize(tidyBlocks);
setTimeout(tidyBlocks, 500);
$('.row.blocks img').load(tidyBlocks).each(function()
{
if(this.complete) $(this).load();
});
}(jQuery));
function appendFingerprint(form)
{
var $form = form instanceof jQuery ? form : $(form);
if($form.data('checkfingerprint'))
{
fingerprint = getFingerprint();
if($form.find('#fingerprint').size() == 0)
{
$form.append("");
}
else
{
$('#fingerprint').val(fingerprint);
}
}
}
function getFingerprint()
{
if(typeof(Fingerprint) == 'function') return new Fingerprint().get();
fingerprint = '';
$.each(navigator, function(key, value)
{
if(typeof(value) == 'string') fingerprint += value.length;
})
return fingerprint;
}
function associateSelect(first, sencond, data, firstVal, sencondVal)
{
$(first).change(function()
{
$(sencond).html('');
var options = data[$(first).val()];
$.each(options, function(key, value)
{
selected = key == sencondVal ? "selected" : '';
option = '';
$(sencond).append(option);
})
}).change();
}
/*
* Fit footer style of the 'wide' theme
*/
function fixFooterOfWideTheme()
{
var fit = function()
{
var $wrapper = $('.page-wrapper');
var fitHeight = $(window).height() - $wrapper.offset().top - $('#footer').outerHeight() - 10;
$wrapper.css('min-height', $wrapper.height() >= fitHeight ? fitHeight : 'initial');
};
var theme = $('#themeStyle').data();
if(theme && theme.theme === 'wide')
{
fit();
}
}
/* http://www.lalit.org/lab/javascript-css-font-detect/ */
var fontDetector = function()
{
var baseFonts = ['monospace', 'sans-serif', 'serif'];
var testString = "mmmmmmmmmmlli";
var testSize = '72px';
var h = document.getElementsByTagName("body")[0];
var s = document.createElement("span");
s.style.fontSize = testSize;
s.innerHTML = testString;
var defaultWidth = {};
var defaultHeight = {};
for (var index in baseFonts)
{
s.style.fontFamily = baseFonts[index];
h.appendChild(s);
defaultWidth[baseFonts[index]] = s.offsetWidth; //width for the default font
defaultHeight[baseFonts[index]] = s.offsetHeight; //height for the defualt font
h.removeChild(s);
}
function detect(font)
{
var detected = false;
for (var index in baseFonts)
{
s.style.fontFamily = font + ',' + baseFonts[index]; // name of the font along with the base font for fallback.
h.appendChild(s);
var matched = (s.offsetWidth != defaultWidth[baseFonts[index]] || s.offsetHeight != defaultHeight[baseFonts[index]]);
h.removeChild(s);
detected = detected || matched;
}
return detected;
}
this.detect = detect;
};
$(document).ready(function()
{
$('#navbar, #blogNav').find('ul.navbar-nav li a').each(function()
{
var $a = $(this);
var href = $a.attr('href'),
$li = $a.parents('li'),
url = document.location.href;
var hrefIndex = url.indexOf(href);
if(href !== '/' && hrefIndex > -1 && !$li.hasClass('active') && url.substring(hrefIndex) == href && !$('ul.navbar-nav li.active').length)
{
$li.addClass('active');
}
});
$('#navbar .dropdown-submenu, #blogNav .dropdown-submenu').mouseover(function()
{
var $menu = $('#navbar ul.navbar-nav > li.dropdown');
if($menu.offset().left + $menu.find('.dropdown-menu').width() + $menu.find('.dropdown-submenu').find('.dropdown-menu').width() > $(window).width())
{
$(this).addClass('pull-left');
}
})
setRequiredFields();
$.setAjaxForm('#ajaxForm');
$.setAjaxDeleter('.deleter');
$.setReloadDeleter('.reloadDeleter');
$.setReload('.reload');
$.setAjaxJSONER('.jsoner');
$.setAjaxLoader('.loadInModal', '#ajaxModal');
/* Ping for keep login every six minute. */
if(needPing) setInterval('ping()', 1000 * 360);
/* Set 'go to top' button. */
setGo2Top();
/* Slide pictures start. */
$(document).on('click', '.carousel .item[data-url]', function()
{
var url = $(this).data('url');
var target = $(this).data('target') || '_self';
if(url && url.length) window.open(url, target);
});
/* Fixed submenu position for browser which doesn't suppport relative postion in a table cell, like firefox 29. */
var ua = navigator.userAgent.toLowerCase();
var ver = (ua.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [0, '0'])[1];
if(ua.indexOf('firefox') > -1)
{
if(parseFloat(ver) < 30) $('#navbar .dropdown > .dropdown-menu').each(function(){$(this).css('left', $(this).closest('.dropdown').position().left - 2);});
else $('#navbar .dropdown').css('position', 'relative');
}
/* set right docker */
var $dockerBtn = $('#rightDockerBtn');
$dockerBtn.popover({container: 'body', html:true, trigger:'manual', tipId: 'dockerPopover'}).click(function(e)
{
if($dockerBtn.hasClass('showed')) return;
$('#rightDocker img[data-src]').each(function()
{
var $this = $(this);
$this.attr('src', $this.data('src')).removeAttr('data-src');
});
$dockerBtn.addClass('showed').popover('show');
$("#rightDockerBtn:not('.showed')").popover('hide');
e.stopPropagation();
});
$(window).scroll(function()
{
$dockerBtn.popover('hide').removeClass('showed');
});
$(document).click(function(){$dockerBtn.popover('hide').removeClass('showed');}).on('click', '.popover', function(event){event.stopPropagation();});
$('.article-content').breakAll('a');
$('.file-md5 a').popover();
fixFooterOfWideTheme(); // Fit footer style of the 'wide' theme
window.onload = function()
{
var detective = new fontDetector();
if(!detective.detect('Helvetica Neue') && !detective.detect('Helvetica') && detective.detect('Microsoft Yahei'))
{
$('#navbar a').css('font-weight', 'normal');
}
};
$('#commentBox').load( createLink('message', 'comment', 'objectType=' + v.objectType + '&objectID=' + v.objectID) );
// init tree
$('.tree').not('[data-ride="tree"]').each(function()
{
var $e = $(this).addClass('tree-lines');
$e.tree({initialState: $e.data('initialState') || 'preserve', name: config.currentModule + '-' + config.currentMethod + '-' + $e.data('type')});
});
});