if(function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Vue=e()}(this,function(){"use strict";var y=Object.freeze({});function I(t){return null==t}function L(t){return null!=t}function A(t){return!0===t}function S(t){return"string"==typeof t||"number"==typeof t||"symbol"==typeof t||"boolean"==typeof t}function D(t){return null!==t&&"object"==typeof t}var r=Object.prototype.toString;function c(t){return"[object Object]"===r.call(t)}function o(t){var e=parseFloat(String(t));return 0<=e&&Math.floor(e)===e&&isFinite(t)}function g(t){return L(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function e(t){return null==t?"":Array.isArray(t)||c(t)&&t.toString===r?JSON.stringify(t,null,2):String(t)}function F(t){var e=parseFloat(t);return isNaN(e)?t:e}function s(t,e){for(var n=Object.create(null),r=t.split(","),o=0;odocument.createEvent("Event").timeStamp&&(cn=function(){return ln.now()})}function un(){var t,e;for(sn=cn(),on=!0,tn.sort(function(t,e){return t.id-e.id}),an=0;ant.id;)n--;tn.splice(n+1,0,t)}else tn.push(t);rn||(rn=!0,Zt(un))}}(this)},fn.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||D(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(t){zt(t,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},fn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},fn.prototype.depend=function(){for(var t=this.deps.length;t--;)this.deps[t].depend()},fn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||_(this.vm._watchers,this);for(var t=this.deps.length;t--;)this.deps[t].removeSub(this);this.active=!1}};var dn={enumerable:!0,configurable:!0,get:x,set:x};function hn(t,e,n){dn.get=function(){return this[e][n]},dn.set=function(t){this[e][n]=t},Object.defineProperty(t,n,dn)}var vn={lazy:!0};function mn(t,e,n){var r=!et();"function"==typeof n?(dn.get=r?yn(e):gn(n),dn.set=x):(dn.get=n.get?r&&!1!==n.cache?yn(e):gn(n.get):x,dn.set=n.set||x),Object.defineProperty(t,e,dn)}function yn(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),lt.target&&t.depend(),t.value}}function gn(t){return function(){return t.call(this,this)}}function _n(t,e,n,r){return c(n)&&(n=(r=n).handler),"string"==typeof n&&(n=t[n]),t.$watch(e,n,r)}var bn,wn,xn,$n,kn,Cn=0;function On(t){var e=t.options;if(t.super){var n=On(t.super);if(n!==t.superOptions){t.superOptions=n;var r=function(t){var e,n=t.options,r=t.sealedOptions;for(var o in n)n[o]!==r[o]&&((e=e||{})[o]=n[o]);return e}(t);r&&v(t.extendOptions,r),(e=t.options=Pt(n,t.extendOptions)).name&&(e.components[e.name]=t)}}return e}function An(t){this._init(t)}function Sn(t){return t&&(t.Ctor.options.name||t.tag)}function Tn(t,e){return Array.isArray(t)?-1parseInt(this.max)&&En(a,s[0],s,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}}};Mn=An,Pn={get:function(){return M}},Object.defineProperty(Mn,"config",Pn),Mn.util={warn:st,extend:v,mergeOptions:Pt,defineReactive:Ct},Mn.set=Ot,Mn.delete=At,Mn.nextTick=Zt,Mn.observable=function(t){return kt(t),t},Mn.options=Object.create(null),O.forEach(function(t){Mn.options[t+"s"]=Object.create(null)}),v((Mn.options._base=Mn).options.components,Ln),Mn.use=function(t){var e=this._installedPlugins||(this._installedPlugins=[]);if(-1=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Qr.addEventListener(t,e,Z?{capture:n,passive:r}:n)}function no(t,e,n,r){(r||Qr).removeEventListener(t,e._wrapper||e,n)}function ro(t,e){if(!I(t.data.on)||!I(e.data.on)){var n=e.data.on||{},r=t.data.on||{};Qr=e.elm,function(t){if(L(t.__r)){var e=J?"change":"input";t[e]=[].concat(t.__r,t[e]||[]),delete t.__r}L(t.__c)&&(t.change=[].concat(t.__c,t.change||[]),delete t.__c)}(n),oe(n,r,eo,no,Zr,e.context),Qr=void 0}}var oo,io={create:ro,update:ro};function ao(t,e){if(!I(t.data.domProps)||!I(e.data.domProps)){var n,r,o=e.elm,i=t.data.domProps||{},a=e.data.domProps||{};for(n in L(a.__ob__)&&(a=e.data.domProps=v({},a)),i)n in a||(o[n]="");for(n in a){if(r=a[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),r===i[n])continue;1===o.childNodes.length&&o.removeChild(o.childNodes[0])}if("value"===n&&"PROGRESS"!==o.tagName){var s=I(o._value=r)?"":String(r);u=s,(l=o).composing||"OPTION"!==l.tagName&&!function(t,e){var n=!0;try{n=document.activeElement!==t}catch(t){}return n&&t.value!==e}(l,u)&&!function(t,e){var n=t.value,r=t._vModifiers;if(L(r)){if(r.number)return F(n)!==F(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}(l,u)||(o.value=s)}else if("innerHTML"===n&&tr(o.tagName)&&I(o.innerHTML)){(oo=oo||document.createElement("div")).innerHTML=""+r+"";for(var c=oo.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;c.firstChild;)o.appendChild(c.firstChild)}else if(r!==i[n])try{o[n]=r}catch(t){}}}var l,u}var so={create:ao,update:ao},co=t(function(t){var n={},r=/:(.+)/;return t.split(/;(?![^(]*\))/g).forEach(function(t){if(t){var e=t.split(r);1=a&&s()};setTimeout(function(){l\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Oi=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ai="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+N.source+"]*",Si="((?:"+Ai+"\\:)?"+Ai+")",Ti=new RegExp("^<"+Si),ji=/^\s*(\/?)>/,Ei=new RegExp("^<\\/"+Si+"[^>]*>"),Mi=/^]+>/i,Ni=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Fi=/&(?:lt|gt|quot|amp|#39);/g,Ri=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,zi=s("pre,textarea",!0);var Hi,Ui,Bi,Vi,Wi,qi,Ji,Gi,Ki=/^@|^v-on:/,Xi=/^v-|^@|^:/,Qi=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Yi=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Zi=/^\(|\)$/g,ta=/^\[.*\]$/,ea=/:(.*)$/,na=/^:|^\.|^v-bind:/,ra=/\.[^.\]]+(?=[^\]]*$)/g,oa=/^v-slot(:|$)|^#/,ia=/[\r\n]/,aa=/\s+/g,sa=t(function(t){return(mi=mi||document.createElement("div")).innerHTML=t,mi.textContent}),ca="_empty_";function la(t,e,n){return{type:1,tag:t,attrsList:e,attrsMap:function(t){for(var e={},n=0,r=t.length;n-1"+("true"===f?":("+c+")":":_q("+c+","+f+")")),Rr(s,"change","var $$a="+c+",$$el=$event.target,$$c=$$el.checked?("+f+"):("+p+");if(Array.isArray($$a)){var $$v="+(l?"_n("+u+")":u)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Wr(c,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Wr(c,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Wr(c,"$$c")+"}",null,!0);else if("input"===g&&"radio"===_)r=t,o=m,i=y&&y.number,a=zr(r,"value")||"null",Ir(r,"checked","_q("+o+","+(a=i?"_n("+a+")":a)+")"),Rr(r,"change",Wr(o,a),null,!0);else if("input"===g||"textarea"===g)!function(t,e,n){var r=t.attrsMap.type,o=n||{},i=o.lazy,a=o.number,s=o.trim,c=!i&&"range"!==r,l=i?"change":"range"===r?Yr:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var f=Wr(e,u);c&&(f="if($event.target.composing)return;"+f),Ir(t,"value","("+e+")"),Rr(t,l,f,null,!0),(s||a)&&Rr(t,"blur","$forceUpdate()")}(t,m,y);else if(!M.isReservedTag(g))return Vr(t,m,y),!1;return!0},text:function(t,e){e.value&&Ir(t,"textContent","_s("+e.value+")",e)},html:function(t,e){e.value&&Ir(t,"innerHTML","_s("+e.value+")",e)}},isPreTag:function(t){return"pre"===t},isUnaryTag:xi,mustUseProp:Dn,canBeLeftOpenTag:$i,isReservedTag:Qn,getTagNamespace:er,staticKeys:ba.reduce(function(t,e){return t.concat(e.staticKeys||[])},[]).join(",")},xa=t(function(t){return s("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(t?","+t:""))});var $a=/^([\w$_]+|\([^)]*?\))\s*=>|^function\s*(?:[\w$]+)?\s*\(/,ka=/\([^)]*?\);*$/,Ca=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Oa={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Aa={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Sa=function(t){return"if("+t+")return null;"},Ta={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Sa("$event.target!==$event.currentTarget"),ctrl:Sa("!$event.ctrlKey"),shift:Sa("!$event.shiftKey"),alt:Sa("!$event.altKey"),meta:Sa("!$event.metaKey"),left:Sa("'button' in $event&&$event.button!==0"),middle:Sa("'button' in $event&&$event.button!==1"),right:Sa("'button' in $event&&$event.button!==2")};function ja(t,e){var n=e?"nativeOn:":"on:",r="",o="";for(var i in t){var a=Ea(t[i]);t[i]&&t[i].dynamic?o+=i+","+a+",":r+='"'+i+'":'+a+","}return r="{"+r.slice(0,-1)+"}",o?n+"_d("+r+",["+o.slice(0,-1)+"])":n+r}function Ea(t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return Ea(t)}).join(",")+"]";var e=Ca.test(t.value),n=$a.test(t.value),r=Ca.test(t.value.replace(ka,""));if(t.modifiers){var o="",i="",a=[];for(var s in t.modifiers)if(Ta[s])i+=Ta[s],Oa[s]&&a.push(s);else if("exact"===s){var c=t.modifiers;i+=Sa(["ctrl","shift","alt","meta"].filter(function(t){return!c[t]}).map(function(t){return"$event."+t+"Key"}).join("||"))}else a.push(s);return a.length&&(o+="if(!$event.type.indexOf('key')&&"+a.map(Ma).join("&&")+")return null;"),i&&(o+=i),"function($event){"+o+(e?"return "+t.value+"($event)":n?"return ("+t.value+")($event)":r?"return "+t.value:t.value)+"}"}return e||n?t.value:"function($event){"+(r?"return "+t.value:t.value)+"}"}function Ma(t){var e=parseInt(t,10);if(e)return"$event.keyCode!=="+e;var n=Oa[t],r=Aa[t];return"_k($event.keyCode,"+JSON.stringify(t)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Na={on:function(t,e){t.wrapListeners=function(t){return"_g("+t+","+e.value+")"}},bind:function(e,n){e.wrapData=function(t){return"_b("+t+",'"+e.tag+"',"+n.value+","+(n.modifiers&&n.modifiers.prop?"true":"false")+(n.modifiers&&n.modifiers.sync?",true":"")+")"}},cloak:x},Pa=function(t){this.options=t,this.warn=t.warn||Nr,this.transforms=Pr(t.modules,"transformCode"),this.dataGenFns=Pr(t.modules,"genData"),this.directives=v(v({},Na),t.directives);var e=t.isReservedTag||T;this.maybeComponent=function(t){return!!t.component||!e(t.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ia(t,e){var n=new Pa(e);return{render:"with(this){return "+(t?La(t,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function La(t,e){if(t.parent&&(t.pre=t.pre||t.parent.pre),t.staticRoot&&!t.staticProcessed)return Da(t,e);if(t.once&&!t.onceProcessed)return Fa(t,e);if(t.for&&!t.forProcessed)return za(t,e);if(t.if&&!t.ifProcessed)return Ra(t,e);if("template"!==t.tag||t.slotTarget||e.pre){if("slot"===t.tag)return f=e,p=(u=t).slotName||'"default"',d=Va(u,f),h="_t("+p+(d?","+d:""),v=u.attrs||u.dynamicAttrs?Ja((u.attrs||[]).concat(u.dynamicAttrs||[]).map(function(t){return{name:b(t.name),value:t.value,dynamic:t.dynamic}})):null,m=u.attrsMap["v-bind"],!v&&!m||d||(h+=",null"),v&&(h+=","+v),m&&(h+=(v?"":",null")+","+m),h+")";var n;if(t.component)a=t.component,c=e,l=(s=t).inlineTemplate?null:Va(s,c,!0),n="_c("+a+","+Ha(s,c)+(l?","+l:"")+")";else{var r;(!t.plain||t.pre&&e.maybeComponent(t))&&(r=Ha(t,e));var o=t.inlineTemplate?null:Va(t,e,!0);n="_c('"+t.tag+"'"+(r?","+r:"")+(o?","+o:"")+")"}for(var i=0;i>>0}(a):"")+")"}(o,o.scopedSlots,t)+","),o.model&&(e+="model:{value:"+o.model.value+",callback:"+o.model.callback+",expression:"+o.model.expression+"},"),o.inlineTemplate){var i=function(t,e){var n=o.children[0];if(n&&1===n.type){var r=Ia(n,e.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(t){return"function(){"+t+"}"}).join(",")+"]}"}}(0,t);i&&(e+=i+",")}return e=e.replace(/,$/,"")+"}",o.dynamicAttrs&&(e="_b("+e+',"'+o.tag+'",'+Ja(o.dynamicAttrs)+")"),o.wrapData&&(e=o.wrapData(e)),o.wrapListeners&&(e=o.wrapListeners(e)),e}function Ua(t){return 1===t.type&&("slot"===t.tag||t.children.some(Ua))}function Ba(t,e){var n=t.attrsMap["slot-scope"];if(t.if&&!t.ifProcessed&&!n)return Ra(t,e,Ba,"null");if(t.for&&!t.forProcessed)return za(t,e,Ba);var r=t.slotScope===ca?"":String(t.slotScope),o="function("+r+"){return "+("template"===t.tag?t.if&&n?"("+t.if+")?"+(Va(t,e)||"undefined")+":undefined":Va(t,e)||"undefined":La(t,e))+"}",i=r?"":",proxy:true";return"{key:"+(t.slotTarget||'"default"')+",fn:"+o+i+"}"}function Va(t,e,n,r,o){var i=t.children;if(i.length){var a=i[0];if(1===i.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag){var s=n?e.maybeComponent(a)?",1":",0":"";return(r||La)(a,e)+s}var c=n?function(t,e){for(var n=0,r=0;r]*>)","i")),n=o.replace(e,function(t,e,n){return r=n.length,Ii(i)||"noscript"===i||(e=e.replace(//g,"$1").replace(//g,"$1")),vi(i,e)&&(e=e.slice(1)),d.chars&&d.chars(e),""});a+=o.length-n.length,o=n,O(i,a-r,a)}else{var s=o.indexOf("<");if(0===s){if(Ni.test(o)){var c=o.indexOf("--\x3e");if(0<=c){d.shouldKeepComment&&d.comment(o.substring(4,c),a,a+c+3),$(c+3);continue}}if(Pi.test(o)){var l=o.indexOf("]>");if(0<=l){$(l+2);continue}}var u=o.match(Mi);if(u){$(u[0].length);continue}var f=o.match(Ei);if(f){var p=a;$(f[0].length),O(f[1],p,a);continue}var _=k();if(_){C(_),vi(_.tagName,o)&&$(1);continue}}var b=void 0,w=void 0,x=void 0;if(0<=s){for(w=o.slice(s);!(Ei.test(w)||Ti.test(w)||Ni.test(w)||Pi.test(w)||(x=w.indexOf("<",1))<0);)s+=x,w=o.slice(s);b=o.substring(0,s)}s<0&&(b=o),b&&$(b.length),d.chars&&b&&d.chars(b,a-b.length,a)}if(o===t){d.chars&&d.chars(o);break}}function $(t){a+=t,o=o.substring(t)}function k(){var t=o.match(Ti);if(t){var e,n,r={tagName:t[1],attrs:[],start:a};for($(t[0].length);!(e=o.match(ji))&&(n=o.match(Oi)||o.match(Ci));)n.start=a,$(n[0].length),n.end=a,r.attrs.push(n);if(e)return r.unarySlash=e[1],$(e[0].length),r.end=a,r}}function C(t){var e,n,r,o=t.tagName,i=t.unarySlash;m&&("p"===h&&ki(o)&&O(h),g(o)&&h===o&&O(o));for(var a=y(o)||!!i,s=t.attrs.length,c=new Array(s),l=0;ls&&(a.push(o=t.slice(s,r)),i.push(JSON.stringify(o)));var c=Er(n[1].trim());i.push("_s("+c+")"),a.push({"@binding":c}),s=r+n[0].length}return s':'
',0

'),a.alerts.dialogClass&&a("#popup_container").addClass(a.alerts.dialogClass);var i=a.browser.msie&&parseInt(a.browser.version)<=6?"absolute":"fixed";switch(a("#popup_container").css({position:i,zIndex:99999,padding:0,margin:0}),a("#popup_title").text(t),a("#popup_content").addClass(r),a("#popup_message").text(e),a("#popup_message").html(a("#popup_message").text().replace(/\n/g,"
")),a("#popup_container").css({minWidth:a("#popup_container").outerWidth(),maxWidth:a("#popup_container").outerWidth()}),a.alerts._reposition(),a.alerts._maintainPosition(!0),r){case"alert":a("#popup_message").after(''),a("#popup_ok").click(function(){a.alerts._hide(),o(!0)}),a("#popup_ok").focus().keypress(function(t){13!=t.keyCode&&27!=t.keyCode||a("#popup_ok").trigger("click")});break;case"confirm":a("#popup_message").after(''),a("#popup_ok").click(function(){a.alerts._hide(),o&&o(!0)}),a("#popup_cancel").click(function(){a.alerts._hide(),o&&o(!1)}),a("#popup_ok").focus(),a("#popup_ok, #popup_cancel").keypress(function(t){13==t.keyCode&&a("#popup_ok").trigger("click"),27==t.keyCode&&a("#popup_cancel").trigger("click")});break;case"prompt":a("#popup_message").append('
').after(''),a("#popup_prompt").width(a("#popup_message").width()),a("#popup_ok").click(function(){var t=a("#popup_prompt").val();a.alerts._hide(),o&&o(t)}),a("#popup_cancel").click(function(){a.alerts._hide(),o&&o(null)}),a("#popup_prompt, #popup_ok, #popup_cancel").keypress(function(t){13==t.keyCode&&a("#popup_ok").trigger("click"),27==t.keyCode&&a("#popup_cancel").trigger("click")}),n&&a("#popup_prompt").val(n),a("#popup_prompt").focus().select()}if(a.alerts.draggable)try{a("#popup_container").draggable({handle:a("#popup_title")}),a("#popup_title").css({cursor:"move"})}catch(t){}},_hide:function(){a("#popup_container").remove(),a.alerts._overlay("hide"),a.alerts._maintainPosition(!1)},_overlay:function(t){switch(t){case"show":a.alerts._overlay("hide"),a("BODY").append(''),a("#popup_overlay").css({position:"absolute",zIndex:99998,top:"0px",left:"0px",width:"100%",height:a(document).height(),background:a.alerts.overlayColor,opacity:a.alerts.overlayOpacity});break;case"hide":a("#popup_overlay").remove()}},_reposition:function(){var t=a(window).height()/2-a("#popup_container").outerHeight()/2+a.alerts.verticalOffset,e=a(window).width()/2-a("#popup_container").outerWidth()/2+a.alerts.horizontalOffset;t<0&&(t=0),e<0&&(e=0),a.browser.msie&&parseInt(a.browser.version)<=6&&(t+=a(window).scrollTop()),a("#popup_container").css({top:t+"px",left:e+"px"}),a("#popup_overlay").height(a(document).height())},_maintainPosition:function(t){if(a.alerts.repositionOnResize)switch(t){case!0:a(window).bind("resize",a.alerts._reposition);break;case!1:a(window).unbind("resize",a.alerts._reposition)}}},window.jAlert=function(t,e,n){a.alerts.alert(t,e,n)},window.jConfirm=function(t,e,n){a.alerts.confirm(t,e,n)},window.jPrompt=function(t,e,n,r){a.alerts.prompt(t,e,n,r)}}(jQuery),function(s){var r,o=[],i=!1,a=!1,c={interval:250,force_process:!1},l=s(window);function u(){a=!1;for(var t=0;t=r&&a-(e.data("appear-top-offset")||0)<=r+l.height()&&i+e.width()>=n&&i-(e.data("appear-left-offset")||0)<=n+l.width()},s.fn.extend({appear:function(t){var e=s.extend({},c,t||{}),n=this.selector||this;if(!i){function r(){a||(a=!0,setTimeout(u,e.interval))}s(window).scroll(r).resize(r),i=!0}return e.force_process&&setTimeout(u,e.interval),o.push(n),s(n)}}),s.extend({force_appear:function(){return!!i&&(u(),!0)}})}(jQuery),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"undefined"!=typeof module&&module.exports?module.exports=t(require("jquery")):t(jQuery)}(function(g){"use strict";var _=g.scrollTo=function(t,e,n){return g(window).scrollTo(t,e,n)};function b(t){return!t.nodeName||-1!==g.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function e(t){return g.isFunction(t)||g.isPlainObject(t)?t:{top:t,left:t}}return _.defaults={axis:"xy",duration:0,limit:!0},g.fn.scrollTo=function(t,n,m){"object"==typeof n&&(m=n,n=0),"function"==typeof m&&(m={onAfter:m}),"max"===t&&(t=9e9),m=g.extend({},_.defaults,m),n=n||m.duration;var y=m.queue&&1').html('
'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},s.fn.tipsy=function(n){if(!0===n)return this.data("tipsy");if("string"==typeof n){var t=this.data("tipsy");return t&&t[n](),this}function e(t){var e=s.data(t,"tipsy");return e||(e=new a(t,s.fn.tipsy.elementOptions(t,n)),s.data(t,"tipsy",e)),e}if((n=s.extend({},s.fn.tipsy.defaults,n)).live||this.each(function(){e(this)}),"manual"!=n.trigger){var r=n.live?"live":"bind",o="hover"==n.trigger?"mouseenter":"focus",i="hover"==n.trigger?"mouseleave":"blur";this[r](o,function(){var t=e(this);t.hoverState="in",0==n.delayIn?t.show():(t.fixTitle(),setTimeout(function(){"in"==t.hoverState&&t.show()},n.delayIn))})[r](i,function(){var t=e(this);t.hoverState="out",0==n.delayOut?t.hide():setTimeout(function(){"out"==t.hoverState&&t.hide()},n.delayOut)})}return this},s.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},s.fn.tipsy.revalidate=function(){s(".tipsy").each(function(){var t=s.data(this,"tipsy-pointee");t&&function(t){for(;t=t.parentNode;)if(t==document)return!0;return!1}(t)||s(this).remove()})},s.fn.tipsy.elementOptions=function(t,e){return s.metadata?s.extend({},e,s(t).metadata()):e},s.fn.tipsy.autoNS=function(){return s(this).offset().top>s(document).scrollTop()+s(window).height()/2?"s":"n"},s.fn.tipsy.autoWE=function(){return s(this).offset().left>s(document).scrollLeft()+s(window).width()/2?"e":"w"},s.fn.tipsy.autoBounds=function(o,i){return function(){var t={ns:i[0],ew:1").addClass("scroll-wrapper").addClass(d.attr("class")).css("position","absolute"==d.css("position")?"absolute":"relative").insertBefore(d).append(d),d.is("textarea")&&(this.containerWrapper=o=y("
").insertBefore(d).append(d),n.addClass("scroll-textarea")),o.addClass("scroll-content").css({height:"auto","margin-bottom":-1*u.scroll.height+"px","margin-right":-1*u.scroll.width+"px","max-height":""}),d.on("scroll"+h,function(t){y.isFunction(v.onScroll)&&v.onScroll.call(p,{maxScroll:m.y.maxScrollOffset,scroll:d.scrollTop(),size:m.y.size,visible:m.y.visible},{maxScroll:m.x.maxScrollOffset,scroll:d.scrollLeft(),size:m.x.size,visible:m.x.visible}),m.x.isVisible&&m.x.scroll.bar.css("left",d.scrollLeft()*m.x.kx+"px"),m.y.isVisible&&m.y.scroll.bar.css("top",d.scrollTop()*m.y.kx+"px")}),n.on("scroll"+h,function(){n.scrollTop(0).scrollLeft(0)}),v.disableBodyScroll){var r=function(t){g(t)?m.y.isVisible&&m.y.mousewheel(t):m.x.isVisible&&m.x.mousewheel(t)};n.on("MozMousePixelScroll"+h,r),n.on("mousewheel"+h,r),u.mobile&&n.on("touchstart"+h,function(t){var e=t.originalEvent.touches&&t.originalEvent.touches[0]||t,n=e.pageX,r=e.pageY,o=d.scrollLeft(),i=d.scrollTop();y(document).on("touchmove"+h,function(t){var e=t.originalEvent.targetTouches&&t.originalEvent.targetTouches[0]||t;d.scrollLeft(o+n-e.pageX),d.scrollTop(i+r-e.pageY),t.preventDefault()}),y(document).on("touchend"+h,function(){y(document).off(h)})})}y.isFunction(v.onInit)&&v.onInit.apply(this,[d])}y.each(m,function(o,i){function a(){var t=d[l]();d[l](t+u),1==c&&f<=t+u&&(t=d[l]()),-1==c&&t+u<=f&&(t=d[l]()),d[l]()==t&&s&&s()}var s=null,c=1,l="x"===o?"scrollLeft":"scrollTop",u=v.scrollStep,f=0;i.scroll||(i.scroll=p._getScroll(v["scroll"+o]).addClass("scroll-"+o),v.showArrows&&i.scroll.addClass("scroll-element_arrows_visible"),i.mousewheel=function(t){if(!i.isVisible||"x"===o&&g(t))return!0;if("y"===o&&!g(t))return m.x.mousewheel(t),!0;var e=-1*t.originalEvent.wheelDelta||t.originalEvent.detail,n=i.size-i.visible-i.offset;return(0','
','
','
','
','
','
','
','
',"
","
",'
','
','
',"
",'
','
',"
","
","
"].join(""),simple:['
','
','
','
','
',"
","
"].join("")};return e[t]&&(t=e[t]),t="string"==typeof(t=t||e.simple)?y(t).appendTo(this.wrapper):y(t),y.extend(t,{bar:t.find(".scroll-bar"),size:t.find(".scroll-element_size"),track:t.find(".scroll-element_track")}),t},_handleMouseDown:function(t,e){var n=this.namespace;return y(document).on("blur"+n,function(){y(document).add("body").off(n),t&&t()}),y(document).on("dragstart"+n,function(t){return t.preventDefault(),!1}),y(document).on("mouseup"+n,function(){y(document).add("body").off(n),t&&t()}),y("body").on("selectstart"+n,function(t){return t.preventDefault(),!1}),e&&e.preventDefault(),!1},_updateScroll:function(t,e){var n=this.container,r=this.containerWrapper||n,o="scroll-scroll"+t+"_visible",i="x"===t?this.scrolly:this.scrollx,a=parseInt(this.container.css("x"===t?"left":"top"),10)||0,s=this.wrapper,c=e.size,l=e.visible+a;e.isVisible=1").css(y.extend({},e)),u.data.outer=y("
").css(y.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},e)).append(u.data.inner).appendTo("body")}return u.data.outer.scrollLeft(1e3).scrollTop(1e3),{height:Math.ceil(u.data.outer.offset().top-u.data.inner.offset().top||0),width:Math.ceil(u.data.outer.offset().left-u.data.inner.offset().left||0)}}function g(t){var e=t.originalEvent;return(!e.axis||e.axis!==e.HORIZONTAL_AXIS)&&!e.wheelDeltaX}window.angular&&(r=window.angular).module("jQueryScrollbar",[]).provider("jQueryScrollbar",function(){var e=n;return{setOptions:function(t){r.extend(e,t)},$get:function(){return{options:r.copy(e)}}}}).directive("jqueryScrollbar",["jQueryScrollbar","$parse",function(o,i){return{restrict:"AC",link:function(t,e,n){var r=i(n.jqueryScrollbar)(t);e.scrollbar(r||o.options).on("$destroy",function(){e.scrollbar("destroy")})}}}])}); window.wpCookies={each:function(e,t,n){var i,s;if(!e)return 0;if(n=n||e,void 0!==e.length){for(i=0,s=e.length;i'+r+"
"),s=null,c=0,l=!1,u="el"===n.arrowOffset?i.outerWidth()/2:8,f=t("#__"+o);function d(){if(s)clearTimeout(s);else{n.single&&t(".learn-press-tip").not(i).LP("QuickTip","close"),a.appendTo(document.body);var e=i.offset();a.css({top:e.top-a.outerHeight()-8,left:e.left-a.outerWidth()/2+u})}}function p(){s&&clearTimeout(s),s=setTimeout((function(){a.detach(),s=null}),c)}function h(){c=0,p(),c=n.closeInterval}return 0===f.length&&t(document.body).append(t("
").attr("id","__"+o).html(r).css("display","none")),r=f.html(),a.addClass(n.tipClass),i.data("content-tip",r),i.attr("data-content-tip")&&(l=!0),c=n.closeInterval,!1===n.autoClose&&(a.append(''),a.on("click",".close",(function(){h()}))),l||i.html(""),"click"===n.event&&i.on("click",(function(t){t.stopPropagation(),d()})),t(document).on("learn-press/close-all-quick-tip",(function(){h()})),i.hover((function(t){t.stopPropagation(),"click"!==n.event&&d()}),(function(t){t.stopPropagation(),n.autoClose&&p()})).addClass("ready"),{close:h,open:function(){d()}}}t.fn.LP("QuickTip",(function(n){return t.each(this,(function(){var i=t(this).data("quick-tip");i||(i=new e(this,n),t(this).data("quick-tip",i)),"string"===t.type(n)&&i[n]&&i[n].apply(i)}))}))}(jQuery)},,,function(t,e,n){"use strict";n.r(e);var i,o=n(1),r=window.jQuery;void 0!==r&&(r.fn.LP=i=function(t,e){if(r.isFunction(e))r.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var i=1;i').insertAfter(n),o=l(t).position()||{left:0,top:0},r=null,a=null,s=3,c=function(){i.fadeOut("fast",(function(){l(this).remove(),i.parent().css("position","")})),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){a&&clearInterval(a),r&&clearInterval(r)},f=function(){r=setInterval((function(){0==--s&&(c.call(i[0]),l.isFunction(e.onCancel)&&e.onCancel(e.data),u()),i.find("span").html(" ("+s+")")}),1e3),a=setInterval((function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),i.remove(),i.parent().css("position",""),l.isFunction(e.onCancel)&&e.onCancel(e.data))}),350)};e=l.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),i.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append(" ("+s+")").css({}),i.click((function(){l.isFunction(e.onOk)&&e.onOk(e.data),c()})).hover((function(){u()}),(function(){f()})),i.css({left:o.left+n.outerWidth()-i.outerWidth()+e.offset.left,top:o.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),f(),this.destroy=function(){i.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){l.proxy((function(){e=l.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;l(document);var n=l(document.body);this.$block||(this.$block=l('
').appendTo(n)),this.$window||(this.$window=l('
').insertAfter(this.$block),this.$window.click((function(){}))),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),l(window).bind("resize.message-box",l.proxy(this.update,this)).bind("scroll.message-box",l.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout((function(){LP.MessageBox.hide(),l.isFunction(e.onHide)&&e.onHide.call(LP.MessageBox,e)}),e.autohide)}),this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'
',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),l(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),i=n.data("timer"),o=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),i=(n.outerWidth(),n.outerHeight()),o=t.height(),r=l(window).height();n.offset().top;o>r-50?(t.css({height:r-25}),i=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(l(window).height()-i)/2}),LP.Hook.doAction("learn_press_message_box_resize",i,e)};t&&o(),i&&clearTimeout(i),i=setTimeout(o,250)},_removeInstance:function(t){for(var e=0;e'+e+""),i.append(l('
').html(t)),n){var o=l('
');switch(n){case"yesNo":o.append(this._createButton(LP_Settings.localize.button_yes,"yes")),o.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":o.append(this._createButton(LP_Settings.localize.button_ok,"ok")),o.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:o.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}i.append(o)}},_createButton:function(t,e){var n=l('"),i="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",i).click((function(){var t=l(this).data("instance"),e=t.events[l(this).data("callback")];"function"===l.type(e)&&!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t)})).data("instance",this.instance),n}},f=function(t){var e={},n=window.jQuery;this.on=function(n,i){var o=n.split("."),r="";return o.length>1&&(n=o[0],r=o[1]),e[n]||(e[n]=[[],{}]),r?(e[n][1][r]||(e[n][1][r]=[]),e[n][1][r].push(i)):e[n][0].push(i),t},this.off=function(i,o){var r=i.split("."),a="";if(r.length>1&&(i=r[0],a=r[1]),!e[i])return t;var s=-1;if(a){if(!e[i][1][a])return t;if(n.isFunction(o)){if((s=e[i][1][a].indexOf(o))<0)return t;e[i][1][a].splice(s,1)}else e[i][1][a]=[]}else if(n.isFunction(o)){if((s=e[i][0].indexOf(o))<0)return t;e[i][0].splice(s,1)}else e[i][0]=[];return t},this.callEvent=function(i,o){if(e[i]){if(e[i][0])for(var r=0;r=0;r--)void 0!==i&&i!==o[r].tag||void 0!==n&&n!==o[r].priority||o.splice(r,1);return this}};n(7);function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var v=jQuery;String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(this);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,i=n.split("#");return n=i[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(i[1]?"#"+i[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(i,""))+(n[1]?"#"+n[1]:"")},0==v.isEmptyObject("")&&(v.isEmptyObject=function(t){var e;for(e in t)if(t.hasOwnProperty(e))return!1;return!0});var g={Hook:d,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=v(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle((function(){v(this).is(":visible")?v(e).addClass("toggle-on").removeClass("toggle-off"):v(e).addClass("toggle-off").removeClass("toggle-on")}))},overflow:function(t,e){var n=v(t),i=n.css("overflow");e?n.css("overflow",e).data("overflow",i):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){var e=(t+"").match(/<-- LP_AJAX_START -->(.*)<-- LP_AJAX_END -->/);try{t=e?v.parseJSON(e[1]):v.parseJSON(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",i=t.action?v.extend(t.data,{"lp-ajax":t.action}):t.data,o=t.beforeSend||function(){},r=t.url||window.location.href;v.ajax({data:i,url:r,type:e,dataType:"html",beforeSend:o.apply(null,t),success:function(e){var i=LP.parseResponse(e,n);v.isFunction(t.success)&&t.success(i,e)},error:function(){v.isFunction(t.error)&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",i=(void 0===t.prefix||"learnpress_")+t.action,o=t.action?v.extend(t.data,{action:i}):t.data;v.ajax({data:o,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var i=LP.parseResponse(e,n);v.isFunction(t.success)&&t.success(i,e)},error:function(){v.isFunction(t.error)&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;na:r<=o&&a>=n}(t,!0)||i.fadeIn(10).delay(e.delay).animate({scrollTop:o},e.duration,e.callback)}},uniqueId:function(t,e){var n;void 0===t&&(t="");var i=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=i(parseInt((new Date).getTime()/1e3,10),8),n+=i(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},o=function(e){return(n=n||_.template(v("#"+t).html(),null,i))(e)};return e?o(e):o}),(function(t,e){return t+"-"+JSON.stringify(e)})):function(){return""},alert:function(t,e){var n="",i="";"string"==typeof t?i=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(i=t.message)),v.alerts.alert(i,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},confirm:function(t,e){var n="",i="";"string"==typeof t?i=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(i=t.message)),v.alerts.confirm(i,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},_on_alert_show:function(){var t=v("#popup_container");v('').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=v("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(v(document.body)),e.stop().animate({top:"+=50",opacity:0},250,(function(){v(this).remove()}))},sendMessage:function(t,e,n,i){v.isPlainObject(t)&&(t=JSON.stringify(t)),n=n||"*",(e=e||window).postMessage(t,n,i)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,i=t.data||t.originalEvent.data||"";("string"==typeof i||i instanceof String)&&0===i.indexOf("{")&&(i=LP.parseJSON(i)),LP.Hook.doAction("learn_press_receive_message",i,n)}};v(document).ready((function(){var t,e;void 0!==v.alerts&&(v.alerts.overlayColor="#000",v.alerts.overlayOpacity=.5,v.alerts.okButton=lpGlobalSettings.localize.button_ok,v.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),v(".learn-press-message.fixed").each((function(){var t=v(this),e=t.data();!function(t,e){e.delayIn&&setTimeout((function(){t.show().hide().fadeIn()}),e.delayIn),e.delayOut&&setTimeout((function(){t.fadeOut()}),e.delayOut+(e.delayIn||0))}(t,e)})),v("body").on("click",".learn-press-nav-tabs li a",(function(t){t.preventDefault();var e=v(this);e.closest("li").addClass("active").siblings().removeClass("active"),v(e.attr("data-tab")).addClass("active").siblings().removeClass("active"),v(document).trigger("learn-press/nav-tabs/clicked",e)})),setTimeout((function(){v(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")}),300),v("body.course-item-popup").parent().css("overflow","hidden"),t=null,e=function(){v(".auto-check-lines").checkLines((function(t){t>1?v(this).removeClass("single-lines"):v(this).addClass("single-lines"),v(this).attr("rows",t)}))},v(window).on("resize.check-lines",(function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})),v(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),v(".learn-press-icon").LP_Tooltip({offset:[30,30]}),v(".learn-press-message[data-autoclose]").each((function(){var t=v(this),e=parseInt(t.data("autoclose"));e&&setTimeout((function(t){t.fadeOut()}),e,t)})),v(document).on("click",(function(){v(document).trigger("learn-press/close-all-quick-tip")}))})),Object(o.a)(function(t){for(var e=1;e').html(n).appendTo($("body")).hide();var r=e.offset();if($.isArray(t.offset)){var a=t.offset[1],s=t.offset[0];$.isNumeric(s)&&(r.left+=s),$.isNumeric(a)&&(r.top+=a)}i.css({top:r.top,left:r.left}),i.fadeIn()}),(function(){i&&i.remove()})),e.data("tooltip",!0)}}))},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i=0){ return sections[pos]; }} return sections; } this.set=function (sections){ if(typeof sections!=='string'){ sections=sections.join(','); } storage.setItem(this.key, sections); return sections.split(','); } this.hasSection=function (id){ id=id + ''; var sections=this.get(), at=sections.indexOf(id); return at >=0 ? at:false; } this.add=function (id){ id=id + ''; var sections=this.get(); if(this.hasSection(id)){ return; } sections.push(id); this.set(sections); return sections; } this.remove=function (id){ id=id + ''; var at=this.hasSection(id); if(at!==false){ var sections=this.get(); sections.splice(at, 1); this.set(sections); return sections; } return false; }} function LP_Course(settings){ var sectionStorage=new LP_Storage('sections'), $body=$('body'), $content=$('.content-item-scrollable'), $curriculum=$('#learn-press-course-curriculum'), $contentItem=$('#learn-press-content-item'), $curriculumScrollable=$curriculum.find('.curriculum-scrollable'), $header=$('#course-item-content-header'), $footer=$('#course-item-content-footer'), $courseItems=$curriculum.find('.course-item'), isShowingHeader=true, fullScreen, contentTop=0, headerTimer, inPopup=false; function toggleAnswerOptions(event){ var $el=$(event.target), $chk; if($el.is('input.option-check')){ return; } $chk=$el.closest('.answer-option').find('input.option-check'); if(!$chk.length){ return; } if($chk.is(':disabled')){ return; } if($chk.is(':checkbox')){ $chk[0].checked = !$chk[0].checked; }else{ $chk[0].checked=true; }} function toggleSection(){ var id=$(this).closest('.section').data('section-id'); $(this).siblings('.section-content').slideToggle(function (){ if($(this).is(':visible')){ sectionStorage.remove(id); }else{ sectionStorage.add(id); }}); } function initSections(){ var $activeSection=$('.course-item.current').closest('.section'), sections=$('.curriculum-sections').find('.section'), sectionId=$activeSection.data('section-id'), hiddenSections=[]; if($activeSection){ hiddenSections=sectionStorage.remove(sectionId); }else{ hiddenSections=sectionStorage.get(); } for (var i=0; i < hiddenSections.length; i++){ sections.filter('[data-section-id="' + hiddenSections[i] + '"]').find('.section-content').hide(); }} function prepareForm(form){ var $answerOptions=$('.answer-options'), $form=$(form), data=$answerOptions.serializeJSON(), $hidden=$('').val(JSON.stringify(data)); if(($form.attr('method') + '').toLowerCase()!=='post'){ return; } $form.find('input[name="question-data"]').remove(); return $form.append($hidden).append($('
').append($answerOptions.clone()).hide()); } function onTabCourseClick(e, tab){ if($(document.body).hasClass('course-item-popup')){ return; } var $tab=$(tab), $parent=$tab.closest('.course-nav'); if($parent.siblings().length===0){ return; } LP.setUrl($tab.attr('href')) } function onSearchInputKeypress(e){ if(e.type==='keypress'&&e.keyCode===13){ return false; } var s=this.value, r=new RegExp(s, 'ig'); $courseItems.map(function (){ var $item=$(this), itemName=$item.find('.item-name').text(); if(itemName.match(r)||!s.length){ $item.show(); }else{ $item.hide(); }}); $('.section').show().each(function (){ if(s.length){ if(!$(this).find('.section-content').children(':visible').length){ $(this).hide(); }else{ $(this).show(); }}else{ $(this).show(); }}); $(this).closest('.course-item-search').toggleClass('has-keyword', !!this.value.length); } function onClearSearchInputClick(e){ var $form=$(this).closest('.course-item-search'); $form.find('input').val('').trigger('keyup') } function onClickQM(){ $('#qm').css({'z-index': 999999999, position: 'relative'}); $('html, body').css('overflow', 'auto'); } function getCurriculumWidth(){ return $curriculum.outerWidth(); } function maybeShowCurriculum(e){ return; var offset=$(this).offset(), offsetX=e.pageX - offset.left, curriculumWidth=getCurriculumWidth(); if(!fullScreen||(offsetX > 50)){ return; } timeoutToClose(); if(!isShowingHeader){ $curriculum.stop().animate({ left: 0 }); $contentItem.stop().animate({ left: curriculumWidth }); $footer.stop().animate({ left: curriculumWidth }, function (){ $(document, window).trigger('learn-press/toggle-content-item'); }); $header.find('.course-item-search').show(); toggleEventShowCurriculum(true); isShowingHeader=true; }} function toggleEventShowCurriculum(b){ $(document)[b ? 'off':'on']('mousemove.maybe-show-curriculum', 'body', maybeShowCurriculum); } function timeoutToClose(){ headerTimer&&clearTimeout(headerTimer); headerTimer=setTimeout(function (){ var curriculumWidth=getCurriculumWidth(); if(!fullScreen){ return; } $curriculum.stop().animate({ left: -curriculumWidth }); $contentItem.stop().animate({ left: 0 }); $footer.stop().animate({ left: 0 }, function (){ $(document, window).trigger('learn-press/toggle-content-item'); }); $header.find('.course-item-search').hide(); isShowingHeader=false; toggleEventShowCurriculum(); }, 3000); } function toggleContentItem(e){ e.preventDefault(); var curriculumWidth=getCurriculumWidth(); fullScreen=$body.toggleClass('full-screen-content-item').hasClass('full-screen-content-item'); $curriculum .stop() .animate({ left: fullScreen ? -curriculumWidth:0 }); $contentItem .stop() .animate({ left: fullScreen ? 0:curriculumWidth }); $footer.stop().animate({ left: fullScreen ? 0:curriculumWidth }, function (){ $(document, window).trigger('learn-press/toggle-content-item'); }); isShowingHeader = !fullScreen; window.localStorage&&window.localStorage.setItem('lp-full-screen', fullScreen ? 'yes':'no'); fullScreen&&toggleEventShowCurriculum(); $header.find('.course-title').stop().animate({marginLeft: fullScreen ? -curriculumWidth:0}) $header.find('.course-item-search').stop().animate({opacity: fullScreen ? 0:1}); } function initEvents(){ $(document) .on('learn-press/nav-tabs/clicked', onTabCourseClick) .on('keyup keypress', '.course-item-search input', onSearchInputKeypress) .on('click', '.course-item-search button', onClearSearchInputClick) .on('click', '#wp-admin-bar-query-monitor', onClickQM) .on('click', '.answer-options .answer-option', toggleAnswerOptions) .on('click', '.section-header', toggleSection) .on('submit', 'form.lp-form', function (){ prepareForm(this); }).on('click', '.toggle-content-item', toggleContentItem); $curriculum.hover(function (){ headerTimer&&clearTimeout(headerTimer); }, function (){ if(fullScreen) timeoutToClose(); }) } function initScrollbar(){ $content.addClass('scrollbar-light') .scrollbar({ scrollx: false }); $content.parent().css({ position: 'absolute', top: 0, bottom: $('#course-item-content-footer:visible').outerHeight()||0, width: '100%' }).css('opacity', 1).end().css('opacity', 1); $curriculumScrollable.addClass('scrollbar-light') .scrollbar({ scrollx: false }); $curriculumScrollable.parent().css({ position: 'absolute', top: 0, bottom: 0, width: '100%' }).css('opacity', 1).end().css('opacity', 1); } function fitVideo(){ var $wrapContent=$('.content-item-summary.content-item-video'); if(!$wrapContent.length){ return; } var $entryVideo=$wrapContent.find('.entry-video'), $frame=$entryVideo.find('iframe'), width=$frame.attr('width'), height=$frame.attr('height'), ratio=1, contentHeight, timer; function resizeVideo(){ var frameWidth=$frame.width(); contentHeight=frameWidth * ratio; $frame.css({ height: contentHeight, marginLeft:($entryVideo.width() - frameWidth) / 2 }); $wrapContent.css({ paddingTop: contentHeight }); } if(!$entryVideo.length){ return false; } if(width&&height){ if(width.indexOf('%')===-1&&height.indexOf('%')===-1){ ratio=height / width; }} $(window).on('resize.fit-content-video learn-press/toggle-content-item', function (){ timer&&clearTimeout(timer); timer=setTimeout(resizeVideo, 250); }).trigger('resize.fit-content-video'); $('.content-item-scrollable').scroll(function (){ $(this).find('.entry-video').css('padding-top', this.scrollTop); }); } function init(){ inPopup=$body.hasClass('course-item-popup'); initSections(); initEvents(); if(!inPopup){ return; } $contentItem.appendTo($body); $curriculum.appendTo($body); if($('#wpadminbar').length){ $body.addClass('wpadminbar'); contentTop=32; } initScrollbar(); fitVideo(); fullScreen=window.localStorage&&'yes'===window.localStorage.getItem('lp-full-screen'); if($(window).width()<=768){ fullScreen=true; } if(fullScreen){ var curriculumWidth=getCurriculumWidth(); $body.addClass('full-screen-content-item'); $contentItem.css('left', 0); $curriculum.css('left', -curriculumWidth); $footer.css('left', 0); isShowingHeader = !fullScreen; $header.find('.course-title').css({marginLeft: fullScreen ? -curriculumWidth:0}) $header.find('.course-item-search').css({opacity: fullScreen ? 0:1}); toggleEventShowCurriculum(); } setTimeout(function (){ var $cs=$body.find('.curriculum-sections').parent(); $cs.scrollTo($cs.find('.course-item.current'), 100); if(window.location.hash){ $('.content-item-scrollable:last').scrollTo($(window.location.hash)); }}, 300); $body.css('opacity', 1); } new LP.Alerts(); init(); } LP.Alerts=function (){ this.isShowing=false; var $doc=$(document), self=this, trigger=function (action, args){ var triggered=$doc.triggerHandler(action, args); if(triggered!==undefined){ return triggered; } return $.isArray(args) ? args[0]:undefined; }, confirmHandle=function (e){ try { var $form=$(this), message=$form.data('confirm'), action=$form.data('action'); message=trigger('learn-press/confirm-message', [message, action]); if(!message){ return true; } jConfirm(message, '', function (confirm){ confirm&&$form.off('submit.learn-press-confirm', confirmHandle).submit(); self.isShowing=false; }); self.isShowing=true; return false; } catch (ex){ console.log(ex) } return true; } this.watchChange('isShowing', function (prop, oldVal, newVal){ if(newVal){ setTimeout(function (){ $.alerts._reposition(); $('#popup_container').addClass('ready') }, 30) var $a=$('') $('#popup_container').append($a); $a.on('click', function (){ $.alerts._hide(); return false; }); } $(document.body).toggleClass('confirm', newVal); return newVal; }); var $forms=$('form[data-confirm]').on('submit.learn-press-confirm', confirmHandle); } $(document).ready(function (){ $(document).ready(function (){ new LP_Course({}); $(this).on('submit', 'form[name="course-external-link"]', function (){ var redirect=$(this).attr('action'); if(redirect){ window.location.href=redirect; return false; }}) }); }); }) (jQuery, LP, _); var MXI_DEBUG=!1;!function(s,E){"use strict";var a={};function n(e,t){for(var i,n=[],r=0;rt[s]){a=1;break}}if(!i)return a;switch(i){case">":case"gt":return 0=":case"ge":return 0<=a;case"<=":case"le":return a<=0;case"==":case"=":case"eq":return 0===a;case"<>":case"!=":case"ne":return 0!==a;case"":case"<":case"lt":return a<0;default:return null}},global_event_dispatcher:"moxie.core.EventTarget.instance.dispatchEvent"};return s.OS=s.os,MXI_DEBUG&&(s.debug={runtime:!0,events:!1},s.log=function(){var e,t,i=arguments[0];"string"===n.typeOf(i)&&(i=n.sprintf.apply(this,arguments)),window&&window.console&&window.console.log?window.console.log(i):document&&((e=document.getElementById("moxie-console"))||((e=document.createElement("pre")).id="moxie-console",document.body.appendChild(e)),-1!==n.inArray(n.typeOf(i),["object","array"])?(t=i,e.appendChild(document.createTextNode(t+"\n"))):e.appendChild(document.createTextNode(i+"\n")))}),s}),e("moxie/core/I18n",["moxie/core/utils/Basic"],function(i){var t={};return{addI18n:function(e){return i.extend(t,e)},translate:function(e){return t[e]||e},_:function(e){return this.translate(e)},sprintf:function(e){var t=[].slice.call(arguments,1);return e.replace(/%[a-z]/g,function(){var e=t.shift();return"undefined"!==i.typeOf(e)?e:""})}}}),e("moxie/core/utils/Mime",["moxie/core/utils/Basic","moxie/core/I18n"],function(a,n){var e={mimes:{},extensions:{},addMimeType:function(e){for(var t,i,n=e.split(/,/),r=0;r>16&255,n=s>>8&255,s=255&s,d[l++]=64==r?String.fromCharCode(i):64==o?String.fromCharCode(i,n):String.fromCharCode(i,n,s),c>12&63,n=o>>6&63,r=63&o,l[u++]=s.charAt(o>>18&63)+s.charAt(i)+s.charAt(n)+s.charAt(r),ap.MAX_RESIZE_WIDTH||this.height>p.MAX_RESIZE_HEIGHT)throw new u.ImageError(u.ImageError.MAX_RESOLUTION_ERR);this.exec("Image","downsize",e.width,e.height,e.crop,e.preserveHeaders)}catch(e){this.trigger("error",e.code)}},crop:function(e,t,i){this.downsize(e,t,!0,i)},getAsCanvas:function(){if(!l.can("create_canvas"))throw new u.RuntimeError(u.RuntimeError.NOT_SUPPORTED_ERR);return this.connectRuntime(this.ruid).exec.call(this,"Image","getAsCanvas")},getAsBlob:function(e,t){if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsBlob",e||"image/jpeg",t||90)},getAsDataURL:function(e,t){if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);return this.exec("Image","getAsDataURL",e||"image/jpeg",t||90)},getAsBinaryString:function(e,t){t=this.getAsDataURL(e,t);return h.atob(t.substring(t.indexOf("base64,")+7))},embed:function(r,e){var o,s=this;e=a.extend({width:this.width,height:this.height,type:this.type||"image/jpeg",quality:90},e||{});try{if(!(r=n.get(r)))throw new u.DOMException(u.DOMException.INVALID_NODE_TYPE_ERR);if(!this.size)throw new u.DOMException(u.DOMException.INVALID_STATE_ERR);this.width>p.MAX_RESIZE_WIDTH||this.height;var t=new p;return t.bind("Resize",function(){!function(e,t){var i=this;if(l.can("create_canvas")){var n=i.getAsCanvas();if(n)return r.appendChild(n),n=null,i.destroy(),void s.trigger("embedded")}if(!(n=i.getAsDataURL(e,t)))throw new u.ImageError(u.ImageError.WRONG_FORMAT);l.can("use_data_uri_of",n.length)?(r.innerHTML='',i.destroy(),s.trigger("embedded")):((t=new c).bind("TransportingComplete",function(){o=s.connectRuntime(this.result.ruid),s.bind("Embedded",function(){a.extend(o.getShimContainer().style,{top:"0px",left:"0px",width:i.width+"px",height:i.height+"px"}),o=null},999),o.exec.call(s,"ImageView","display",this.result.uid,width,height),i.destroy()}),t.transport(h.atob(n.substring(n.indexOf("base64,")+7)),e,{required_caps:{display_media:!0},runtime_order:"flash,silverlight",container:r}))}.call(this,e.type,e.quality)}),t.bind("Load",function(){t.downsize(e)}),this.meta.thumb&&this.meta.thumb.width>=e.width&&this.meta.thumb.height>=e.height?t.load(this.meta.thumb.data):t.clone(this,!1),t}catch(e){this.trigger("error",e.code)}},destroy:function(){this.ruid&&(this.getRuntime().exec.call(this,"Image","destroy"),this.disconnectRuntime()),this.unbindAll()}}),this.handleEventProps(f),this.bind("Load Resize",function(){!function(e){e=e||this.exec("Image","getInfo");this.size=e.size,this.width=e.width,this.height=e.height,this.type=e.type,this.meta=e.meta,""===this.name&&(this.name=e.name)}.call(this)},999)}return p.MAX_RESIZE_WIDTH=8192,p.MAX_RESIZE_HEIGHT=8192,p.prototype=i.instance,p}),e("moxie/runtime/html5/Runtime",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/Runtime","moxie/core/utils/Env"],function(s,e,a,u){var c={};return a.addConstructor("html5",function(e){var t,i,n=this,r=a.capTest,o=a.capTrue,o=s.extend({access_binary:r(window.FileReader||window.File&&window.File.getAsDataURL),access_image_binary:function(){return n.can("access_binary")&&!!c.Image},display_media:r(u.can("create_canvas")||u.can("use_data_uri_over32kb")),do_cors:r(window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest),drag_and_drop:r(("draggable"in(t=document.createElement("div"))||"ondragstart"in t&&"ondrop"in t)&&("IE"!==u.browser||u.verComp(u.version,9,">"))),filter_by_extension:r("Chrome"===u.browser&&u.verComp(u.version,28,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||"Safari"===u.browser&&u.verComp(u.version,7,">=")),return_response_headers:o,return_response_type:function(e){return!("json"!==e||!window.JSON)||u.can("return_response_type",e)},return_status_code:o,report_upload_progress:r(window.XMLHttpRequest&&(new XMLHttpRequest).upload),resize_image:function(){return n.can("access_binary")&&u.can("create_canvas")},select_file:function(){return u.can("use_fileinput")&&window.File},select_folder:function(){return n.can("select_file")&&"Chrome"===u.browser&&u.verComp(u.version,21,">=")},select_multiple:function(){return n.can("select_file")&&!("Safari"===u.browser&&"Windows"===u.os)&&!("iOS"===u.os&&u.verComp(u.osVersion,"7.0.0",">")&&u.verComp(u.osVersion,"8.0.0","<"))},send_binary_string:r(window.XMLHttpRequest&&((new XMLHttpRequest).sendAsBinary||window.Uint8Array&&window.ArrayBuffer)),send_custom_headers:r(window.XMLHttpRequest),send_multipart:function(){return!!(window.XMLHttpRequest&&(new XMLHttpRequest).upload&&window.FormData)||n.can("send_binary_string")},slice_blob:r(window.File&&(File.prototype.mozSlice||File.prototype.webkitSlice||File.prototype.slice)),stream_upload:function(){return n.can("slice_blob")&&n.can("send_multipart")},summon_file_dialog:function(){return n.can("select_file")&&("Firefox"===u.browser&&u.verComp(u.version,4,">=")||"Opera"===u.browser&&u.verComp(u.version,12,">=")||"IE"===u.browser&&u.verComp(u.version,10,">=")||!!~s.inArray(u.browser,["Chrome","Safari"]))},upload_filesize:o},arguments[2]);a.call(this,e,arguments[1]||"html5",o),s.extend(this,{init:function(){this.trigger("Init")},destroy:(i=this.destroy,function(){i.call(n),i=n=null})}),s.extend(this.getShim(),c)}),c}),e("moxie/core/utils/Events",["moxie/core/utils/Basic"],function(o){var s={},a="moxie_"+o.guid();function u(){this.returnValue=!1}function c(){this.cancelBubble=!0}function r(t,e,i){if(e=e.toLowerCase(),t[a]&&s[t[a]]&&s[t[a]][e]){for(var n,r=(n=s[t[a]][e]).length-1;0<=r&&(n[r].orig!==i&&n[r].key!==i||(t.removeEventListener?t.removeEventListener(e,n[r].func,!1):t.detachEvent&&t.detachEvent("on"+e,n[r].func),n[r].orig=null,n[r].func=null,n.splice(r,1),void 0===i));r--);if(n.length||delete s[t[a]][e],o.isEmptyObj(s[t[a]])){delete s[t[a]];try{delete t[a]}catch(e){t[a]=void 0}}}}return{addEvent:function(e,t,i,n){var r;t=t.toLowerCase(),e.addEventListener?e.addEventListener(t,r=i,!1):e.attachEvent&&e.attachEvent("on"+t,r=function(){var e=window.event;e.target||(e.target=e.srcElement),e.preventDefault=u,e.stopPropagation=c,i(e)}),e[a]||(e[a]=o.guid()),s.hasOwnProperty(e[a])||(s[e[a]]={}),(e=s[e[a]]).hasOwnProperty(t)||(e[t]=[]),e[t].push({func:r,orig:i,key:n})},removeEvent:r,removeAllEvents:function(i,n){i&&i[a]&&o.each(s[i[a]],function(e,t){r(i,t,n)})}}}),e("moxie/runtime/html5/file/FileInput",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,a,u,c,l,d,m){return e.FileInput=function(){var s;u.extend(this,{init:function(e){var t,i,n=this,r=n.getRuntime(),o=(s=e).accept.mimes||d.extList2mimes(s.accept,r.can("filter_by_extension"));(i=r.getShimContainer()).innerHTML='",t=c.get(r.uid),u.extend(t.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),e=c.get(s.browse_button),r.can("summon_file_dialog")&&("static"===c.getStyle(e,"position")&&(e.style.position="relative"),o=parseInt(c.getStyle(e,"z-index"),10)||1,e.style.zIndex=o,i.style.zIndex=o-1,l.addEvent(e,"click",function(e){var t=c.get(r.uid);t&&!t.disabled&&t.click(),e.preventDefault()},n.uid)),e=r.can("summon_file_dialog")?e:i,l.addEvent(e,"mouseover",function(){n.trigger("mouseenter")},n.uid),l.addEvent(e,"mouseout",function(){n.trigger("mouseleave")},n.uid),l.addEvent(e,"mousedown",function(){n.trigger("mousedown")},n.uid),l.addEvent(c.get(s.container),"mouseup",function(){n.trigger("mouseup")},n.uid),t.onchange=function e(t){var i;n.files=[],u.each(this.files,function(e){var t="";if(s.directory&&"."==e.name)return!0;e.webkitRelativePath&&(t="/"+e.webkitRelativePath.replace(/^\//,"")),(e=new a(r.uid,e)).relativePath=t,n.files.push(e)}),"IE"!==m.browser&&"IEMobile"!==m.browser?this.value="":(i=this.cloneNode(!0),this.parentNode.replaceChild(i,this),i.onchange=e),n.files.length&&n.trigger("change")},n.trigger({type:"ready",async:!0}),i=null},disable:function(e){var t=this.getRuntime();(t=c.get(t.uid))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();l.removeAllEvents(e,this.uid),l.removeAllEvents(s&&c.get(s.container),this.uid),l.removeAllEvents(s&&c.get(s.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),s=e=t=null}})}}),e("moxie/runtime/html5/file/Blob",["moxie/runtime/html5/Runtime","moxie/file/Blob"],function(e,t){return e.Blob=function(){this.slice=function(){return new t(this.getRuntime().uid,function(t,i,n){var e;if(!window.File.prototype.slice)return(e=window.File.prototype.webkitSlice||window.File.prototype.mozSlice)?e.call(t,i,n):null;try{return t.slice(),t.slice(i,n)}catch(e){return t.slice(i,n-i)}}.apply(this,arguments))}}}),e("moxie/runtime/html5/file/FileDrop",["moxie/runtime/html5/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime"],function(e,r,c,l,d,m){return e.FileDrop=function(){var t,i,o=[],n=[];function s(e){if(e.dataTransfer&&e.dataTransfer.types){e=c.toArray(e.dataTransfer.types||[]);return-1!==c.inArray("Files",e)||-1!==c.inArray("public.file-url",e)||-1!==c.inArray("application/x-moz-file",e)}}function a(e,t){!function(e){if(!n.length)return!0;e=m.getFileExtension(e.name);return!e||-1!==c.inArray(e,n)}(e)||((e=new r(i,e)).relativePath=t||"",o.push(e))}function u(e,t){var i=[];c.each(e,function(n){i.push(function(e){var t,i;i=e,(t=n).isFile?t.file(function(e){a(e,t.fullPath),i()},function(){i()}):t.isDirectory?function(e,t){var n=[],r=e.createReader();!function t(i){r.readEntries(function(e){e.length?([].push.apply(n,e),t(i)):i()},i)}(function(){u(n,t)})}(t,i):i()})}),c.inSeries(i,function(){t()})}c.extend(this,{init:function(e){var r=this;t=e,i=r.ruid,n=function(e){for(var t=[],i=0;i=")&&p.verComp(p.version,7,"<"),o="Android Browser"===p.browser,s=!1;if(u=e.url.replace(/^.+?\/([\w\-\.]+)$/,"$1").toLowerCase(),(a=!window.XMLHttpRequest||"IE"===p.browser&&p.verComp(p.version,8,"<")?function(){for(var e=["Msxml2.XMLHTTP.6.0","Microsoft.XMLHTTP"],t=0;tthis.length())throw new Error("You are trying to read outside the source boundaries.");for(n=this.littleEndian?0:-8*(t-1),i=r=0;rthis.length())throw new Error("You are trying to write outside the source boundaries.");for(n=this.littleEndian?0:-8*(i-1),r=0;r>Math.abs(n+8*r)&255)},BYTE:function(e){return this.read(e,1)},SHORT:function(e){return this.read(e,2)},LONG:function(e){return this.read(e,4)},SLONG:function(e){e=this.read(e,4);return 2147483647=o.length));i++);},purge:function(){this.headers=s=[]}}}}),e("moxie/runtime/html5/image/ExifParser",["moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader","moxie/core/Exceptions"],function(g,o,x){function s(e){var t,l,f,p,i;if(o.call(this,e),l={tiff:{274:"Orientation",270:"ImageDescription",271:"Make",272:"Model",305:"Software",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer"},exif:{36864:"ExifVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",36867:"DateTimeOriginal",33434:"ExposureTime",33437:"FNumber",34855:"ISOSpeedRatings",37377:"ShutterSpeedValue",37378:"ApertureValue",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37386:"FocalLength",41986:"ExposureMode",41987:"WhiteBalance",41990:"SceneCaptureType",41988:"DigitalZoomRatio",41992:"Contrast",41993:"Saturation",41994:"Sharpness"},gps:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude"},thumb:{513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength"}},f={ColorSpace:{1:"sRGB",0:"Uncalibrated"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{1:"Daylight",2:"Fliorescent",3:"Tungsten",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 -5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},ExposureMode:{0:"Auto exposure",1:"Manual exposure",2:"Auto bracket"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},GPSLatitudeRef:{N:"North latitude",S:"South latitude"},GPSLongitudeRef:{E:"East longitude",W:"West longitude"}},n=(p={tiffHeader:10}).tiffHeader,t={clear:this.clear},g.extend(this,{read:function(){try{return s.prototype.read.apply(this,arguments)}catch(e){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}},write:function(){try{return s.prototype.write.apply(this,arguments)}catch(e){throw new x.ImageError(x.ImageError.INVALID_META_ERR)}},UNDEFINED:function(){return this.BYTE.apply(this,arguments)},RATIONAL:function(e){return this.LONG(e)/this.LONG(e+4)},SRATIONAL:function(e){return this.SLONG(e)/this.SLONG(e+4)},ASCII:function(e){return this.CHAR(e)},TIFF:function(){return i||null},EXIF:function(){var e=null;if(p.exifIFD){try{e=r.call(this,p.exifIFD,l.exif)}catch(e){return null}if(e.ExifVersion&&"array"===g.typeOf(e.ExifVersion)){for(var t=0,i="";t=this.length())throw new x.ImageError(x.ImageError.INVALID_META_ERR);"ASCII"!==s?(a=u.asArray(s,o,n),s=1==n?a[0]:a,f.hasOwnProperty(i)&&"object"!=typeof s?c[i]=f[i][s]:c[i]=s):c[i]=g.trim(u.STRING(o,n).replace(/\0$/,""))}return c}n&&(p.IFD1=p.tiffHeader+n)}return s.prototype=o.prototype,s}),e("moxie/runtime/html5/image/JPEG",["moxie/core/utils/Basic","moxie/core/Exceptions","moxie/runtime/html5/image/JPEGHeaders","moxie/runtime/html5/utils/BinaryReader","moxie/runtime/html5/image/ExifParser"],function(s,a,u,c,l){return function(e){var i,n,t,r=new c(e);if(65496!==r.SHORT(0))throw new a.ImageError(a.ImageError.WRONG_FORMAT);i=new u(e);try{n=new l(i.get("app1")[0])}catch(e){}function o(e){var t,i=0;for(e=e||r;i<=e.length();){if(65472<=(t=e.SHORT(i+=2))&&t<=65475)return i+=5,{height:e.SHORT(i),width:e.SHORT(i+=2)};t=e.SHORT(i+=2),i+=t-2}return null}t=o.call(this),s.extend(this,{type:"image/jpeg",size:r.length(),width:t&&t.width||0,height:t&&t.height||0,setExif:function(e,t){if(!n)return!1;"object"===s.typeOf(e)?s.each(e,function(e,t){n.setExif(t,e)}):n.setExif(e,t),i.set("app1",n.SEGMENT())},writeHeaders:function(){return arguments.length?i.restore(arguments[0]):i.restore(e)},stripHeaders:function(e){return i.strip(e)},purge:function(){!function(){n&&i&&r&&(n.clear(),i.purge(),r.clear(),t=i=n=r=null)}.call(this)}}),n&&(this.meta={tiff:n.TIFF(),exif:n.EXIF(),gps:n.GPS(),thumb:function(){var e,t,i=n.thumb();if(i&&(e=new c(i),t=o(e),e.clear(),t))return t.data=i,t;return null}()})}}),e("moxie/runtime/html5/image/PNG",["moxie/core/Exceptions","moxie/core/utils/Basic","moxie/runtime/html5/utils/BinaryReader"],function(n,o,s){return function(e){var r,t;function i(){r&&(r.clear(),e=t=r=null)}r=new s(e),function(){for(var e=0,t=0,i=[35152,20039,3338,6666],t=0;t>1;i=null;t=a/t;return 0==t?1:t}(e,r),f=0;f=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||"Safari"===a.browser&&a.verComp(a.version,7,">=")),resize_image:function(){return u.Image&&i.can("access_binary")&&a.can("create_canvas")},report_upload_progress:!1,return_response_headers:!1,return_response_type:function(e){return!("json"!==e||!window.JSON)||!!~o.inArray(e,["text","document",""])},return_status_code:function(e){return!o.arrayDiff(e,[200,404])},select_file:function(){return a.can("use_fileinput")},select_multiple:!1,send_binary_string:!1,send_custom_headers:!1,send_multipart:!0,slice_blob:!1,stream_upload:function(){return i.can("select_file")},summon_file_dialog:function(){return i.can("select_file")&&("Firefox"===a.browser&&a.verComp(a.version,4,">=")||"Opera"===a.browser&&a.verComp(a.version,12,">=")||"IE"===a.browser&&a.verComp(a.version,10,">=")||!!~o.inArray(a.browser,["Chrome","Safari"]))},upload_filesize:r,use_http_method:function(e){return!o.arrayDiff(e,["GET","POST"])}}),o.extend(this,{init:function(){this.trigger("Init")},destroy:(t=this.destroy,function(){t.call(i),t=i=null})}),o.extend(this.getShim(),u)}),u}),e("moxie/runtime/html4/file/FileInput",["moxie/runtime/html4/Runtime","moxie/file/File","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Events","moxie/core/utils/Mime","moxie/core/utils/Env"],function(e,m,h,f,p,s,g){return e.FileInput=function(){var u,c,l=[];function d(){var e,t,i,n,r=this,o=r.getRuntime(),s=h.guid("uid_"),a=o.getShimContainer();u&&(t=f.get(u+"_form"))&&h.extend(t.style,{top:"100%"}),(i=document.createElement("form")).setAttribute("id",s+"_form"),i.setAttribute("method","post"),i.setAttribute("enctype","multipart/form-data"),i.setAttribute("encoding","multipart/form-data"),h.extend(i.style,{overflow:"hidden",position:"absolute",top:0,left:0,width:"100%",height:"100%"}),(n=document.createElement("input")).setAttribute("id",s),n.setAttribute("type","file"),n.setAttribute("name",c.name||"Filedata"),n.setAttribute("accept",l.join(",")),h.extend(n.style,{fontSize:"999px",opacity:0}),i.appendChild(n),a.appendChild(i),h.extend(n.style,{position:"absolute",top:0,left:0,width:"100%",height:"100%"}),"IE"===g.browser&&g.verComp(g.version,10,"<")&&h.extend(n.style,{filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}),n.onchange=function(){var e;if(this.value){if(this.files){if(0===(e=this.files[0]).size)return void i.parentNode.removeChild(i)}else e={name:this.value};e=new m(o.uid,e),this.onchange=function(){},d.call(r),r.files=[e],n.setAttribute("id",e.uid),i.setAttribute("id",e.uid+"_form"),r.trigger("change"),n=i=null}},o.can("summon_file_dialog")&&(e=f.get(c.browse_button),p.removeEvent(e,"click",r.uid),p.addEvent(e,"click",function(e){n&&!n.disabled&&n.click(),e.preventDefault()},r.uid)),u=s,a=t=e=null}h.extend(this,{init:function(e){var t,i,n,r=this,o=r.getRuntime();l=(c=e).accept.mimes||s.extList2mimes(e.accept,o.can("filter_by_extension")),t=o.getShimContainer(),n=f.get(e.browse_button),o.can("summon_file_dialog")&&("static"===f.getStyle(n,"position")&&(n.style.position="relative"),i=parseInt(f.getStyle(n,"z-index"),10)||1,n.style.zIndex=i,t.style.zIndex=i-1),i=o.can("summon_file_dialog")?n:t,p.addEvent(i,"mouseover",function(){r.trigger("mouseenter")},r.uid),p.addEvent(i,"mouseout",function(){r.trigger("mouseleave")},r.uid),p.addEvent(i,"mousedown",function(){r.trigger("mousedown")},r.uid),p.addEvent(f.get(e.container),"mouseup",function(){r.trigger("mouseup")},r.uid),n=null,d.call(this),r.trigger({type:"ready",async:!(t=null)})},disable:function(e){var t;(t=f.get(u))&&(t.disabled=!!e)},destroy:function(){var e=this.getRuntime(),t=e.getShim(),e=e.getShimContainer();p.removeAllEvents(e,this.uid),p.removeAllEvents(c&&f.get(c.container),this.uid),p.removeAllEvents(c&&f.get(c.browse_button),this.uid),e&&(e.innerHTML=""),t.removeInstance(this.uid),u=l=c=e=t=null}})}}),e("moxie/runtime/html4/file/FileReader",["moxie/runtime/html4/Runtime","moxie/runtime/html5/file/FileReader"],function(e,t){return e.FileReader=t}),e("moxie/runtime/html4/xhr/XMLHttpRequest",["moxie/runtime/html4/Runtime","moxie/core/utils/Basic","moxie/core/utils/Dom","moxie/core/utils/Url","moxie/core/Exceptions","moxie/core/utils/Events","moxie/file/Blob","moxie/xhr/FormData"],function(e,f,p,g,x,E,y,w){return e.XMLHttpRequest=function(){var l,d,m;function h(t){var e,i,n,r=this,o=!1;if(m){if(e=m.id.replace(/_iframe$/,""),e=p.get(e+"_form")){for(n=(i=e.getElementsByTagName("input")).length;n--;)switch(i[n].getAttribute("type")){case"hidden":i[n].parentNode.removeChild(i[n]);break;case"file":o=!0}i=[],o||e.parentNode.removeChild(e),e=null}setTimeout(function(){E.removeEvent(m,"load",r.uid),m.parentNode&&m.parentNode.removeChild(m);var e=r.getRuntime().getShimContainer();e.children.length||e.parentNode.removeChild(e),e=m=null,t()},1)}}f.extend(this,{send:function(t,e){var i,n,r,o,s,a,u=this,c=u.getRuntime();if(l=d=null,e instanceof w&&e.hasBlob()){if(o=e.getBlob(),i=o.uid,r=p.get(i),!(n=p.get(i+"_form")))throw new x.DOMException(x.DOMException.NOT_FOUND_ERR)}else i=f.guid("uid_"),(n=document.createElement("form")).setAttribute("id",i+"_form"),n.setAttribute("method",t.method),n.setAttribute("enctype","multipart/form-data"),n.setAttribute("encoding","multipart/form-data"),c.getShimContainer().appendChild(n);n.setAttribute("target",i+"_iframe"),e instanceof w&&e.each(function(e,t){var i;e instanceof y?r&&r.setAttribute("name",t):(i=document.createElement("input"),f.extend(i,{type:"hidden",name:t,value:e}),r?n.insertBefore(i,r):n.appendChild(i))}),n.setAttribute("action",t.url),s=c.getShimContainer()||document.body,(a=document.createElement("div")).innerHTML='',m=a.firstChild,s.appendChild(m),E.addEvent(m,"load",function(){var e;try{e=m.contentWindow.document||m.contentDocument||window.frames[m.id].document,/^4(0[0-9]|1[0-7]|2[2346])\s/.test(e.title)?l=e.title.replace(/^(\d+).*$/,"$1"):(l=200,d=f.trim(e.body.innerHTML),u.trigger({type:"progress",loaded:d.length,total:d.length}),o&&u.trigger({type:"uploadprogress",loaded:o.size||1025,total:o.size||1025}))}catch(e){if(!g.hasSameOrigin(t.url))return void h.call(u,function(){u.trigger("error")});l=404}h.call(u,function(){u.trigger("load")})},u.uid),n.submit(),u.trigger("loadstart")},getStatus:function(){return l},getResponse:function(e){if("json"===e&&"string"===f.typeOf(d)&&window.JSON)try{return JSON.parse(d.replace(/^\s*]*>/,"").replace(/<\/pre>\s*$/,""))}catch(e){return null}return d},abort:function(){var e=this;m&&m.contentWindow&&(m.contentWindow.stop?m.contentWindow.stop():m.contentWindow.document.execCommand?m.contentWindow.document.execCommand ("Stop"):m.src="about:blank"),h.call(this,function(){e.dispatchEvent("abort")})}})}}),e("moxie/runtime/html4/image/Image",["moxie/runtime/html4/Runtime","moxie/runtime/html5/image/Image"],function(e,t){return e.Image=t}),function(e){for(var t=0;t":"gt","&":"amp",'"':"quot","'":"#39"};return e&&(""+e).replace(/[<>&\"\']/g,function(e){return t[e]?"&"+t[e]+";":e})},toArray:I.toArray,inArray:I.inArray,addI18n:I.addI18n,translate:I.translate,isEmptyObj:I.isEmptyObj,hasClass:I.hasClass,addClass:I.addClass,removeClass:I.removeClass,getStyle:I.getStyle,addEvent:I.addEvent,removeEvent:I.removeEvent,removeAllEvents:I.removeAllEvents,cleanName:function(e){for(var t=[/[\300-\306]/g,"A",/[\340-\346]/g,"a",/\307/g,"C",/\347/g,"c",/[\310-\313]/g,"E",/[\350-\353]/g,"e",/[\314-\317]/g,"I",/[\354-\357]/g,"i",/\321/g,"N",/\361/g,"n",/[\322-\330]/g,"O",/[\362-\370]/g,"o",/[\331-\334]/g,"U",/[\371-\374]/g,"u"],i=0;i(i/=1024)?t(e/i,1)+" "+F.translate("gb"):e>(i/=1024)?t(e/i,1)+" "+F.translate("mb"):1024e?(this.trigger("Error",{code:F.FILE_SIZE_ERROR,message:F.translate("File size error."),file:t}),i(!1)):i(!0)}),F.addFileFilter("prevent_duplicates",function(e,t,i){if(e)for(var n=this.files.length;n--;)if(t.name===this.files[n].name&&t.size===this.files[n].size)return this.trigger("Error",{code:F.FILE_DUPLICATE_ERROR,message:F.translate("Duplicate file error."),file:t}),void i(!1);i(!0)}),F.Uploader=function(e){var u,i,n,p,t=F.guid(),l=[],h={},o=[],d=[],c=!1;function r(){var e,t,i=0;if(this.state==F.STARTED){for(t=0;tu?(t=Math.min(u,a.size-c),a.slice(c,c+t)):(t=a.size,a),u&&d.chunks&&(r.settings.send_chunk_number?(n.chunk=Math.ceil(c/u),n.chunks=Math.ceil(a.size/u)):(n.offset=c,n.total=a.size)),(p=new I.XMLHttpRequest).upload&&(p.upload.onprogress=function(e){s.loaded=Math.min(s.size,c+e.loaded),r.trigger("UploadProgress",s)}),p.onload=function(){400<=p.status?f():(l=r.settings.max_retries,t=a.size?(s.size!=s.origSize&&(a.destroy(),a=null),r.trigger("UploadProgress",s),s.status=F.DONE,r.trigger("FileUploaded",s,{response:p.responseText,status:p.status,responseHeaders:p.getAllResponseHeaders()})):T(g,1))},p.onerror=function(){f()},p.onloadend=function(){this.destroy(),p=null},r.settings.multipart&&d.multipart?(p.open("post",o,!0),F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)}),i=new I.FormData,F.each(F.extend(n,r.settings.multipart_params),function(e,t){i.append(t,e)}),i.append(r.settings.file_data_name,e),p.send(i,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h})):(o=F.buildUrl(r.settings.url,F.extend(n,r.settings.multipart_params)),p.open("post",o,!0),p.setRequestHeader("Content-Type","application/octet-stream"),F.each(r.settings.headers,function(e,t){p.setRequestHeader(t,e)}),p.send(e,{runtime_order:r.settings.runtimes,required_caps:r.settings.required_features,preferred_caps:h})))}s.loaded&&(c=s.loaded=u?u*Math.floor(s.loaded/u):0),a=s.getSource(),r.settings.resize.enabled&&function(e,t){if(e.ruid){e=I.Runtime.getInfo(e.ruid);if(e)return e.can(t)}}(a,"send_binary_string")&&~I.inArray(a.type,["image/jpeg","image/png"])?function(t,e,i){var n=new I.Image;try{n.onload=function(){if(e.width>this.width&&e.height>this.height&&e.quality===S&&e.preserve_headers&&!e.crop)return this.destroy(),i(t);n.downsize(e.width,e.height,e.crop,e.preserve_headers)},n.onresize=function(){i(this.getAsBlob(t.type,e.quality)),this.destroy()},n.onerror=function(){i(t)},n.load(t)}catch(e){i(t)}}.call(this,a,r.settings.resize,function(e){a=e,s.size=e.size,g()}):g()}function R(e,t){s(t)}function E(e){if(e.state==F.STARTED)i=+new Date;else if(e.state==F.STOPPED)for(var t=e.files.length-1;0<=t;t--)e.files[t].status==F.UPLOADING&&(e.files[t].status=F.QUEUED,a())}function y(){p&&p.abort()}function v(e){a(),T(function(){r.call(e)},1)}function z(e,t){t.code===F.INIT_ERROR?e.destroy():t.code===F.HTTP_ERROR&&(t.file.status=F.FAILED,s(t.file),e.state==F.STARTED&&(e.trigger("CancelUpload"),T(function(){r.call(e)},1)))}function O(e){e.stop(),F.each(l,function(e){e.destroy()}),l=[],o.length&&(F.each(o,function(e){e.destroy()}),o=[]),d.length&&(F.each(d,function(e){e.destroy()}),d=[]),c=!(h={}),i=p=null,n.reset()}u={runtimes:I.Runtime.order,max_retries:0,chunk_size:0,multipart:!0,multi_selection:!0,file_data_name:"file",filters:{mime_types:[],prevent_duplicates:!1,max_file_size:0},resize:{enabled:!1,preserve_headers:!0,crop:!1},send_file_name:!0,send_chunk_number:!0},_.call(this,e,null,!0),n=new F.QueueProgress,F.extend(this,{id:t,uid:t,state:F.STOPPED,features:{},runtime:null,files:l,settings:u,total:n,init:function(){var t,i=this,e=i.getOption("preinit");return"function"==typeof e?e(i):F.each(e,function(e,t){i.bind(t,e)}),function(){this.bind("FilesAdded FilesRemoved",function(e){e.trigger("QueueChanged"),e.refresh()}),this.bind("CancelUpload",y),this.bind("BeforeUpload",m),this.bind("UploadFile",b),this.bind("UploadProgress",R),this.bind("StateChanged",E),this.bind("QueueChanged",a),this.bind("Error",z),this.bind("FileUploaded",v),this.bind("Destroy",O)}.call(i),F.each(["container","browse_button","drop_element"],function(e){if(null===i.getOption(e))return!(t={code:F.INIT_ERROR,message:F.translate("'%' specified, but cannot be found.")})}),t?i.trigger("Error",t):u.browse_button||u.drop_element?void g.call(i,u,function(e){var t=i.getOption("init");"function"==typeof t?t(i):F.each(t,function(e,t){i.bind(t,e)}),e?(i.runtime=I.Runtime.getInfo(f()).type,i.trigger("Init",{runtime:i.runtime}),i.trigger("PostInit")):i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("Init error.")})}):i.trigger("Error",{code:F.INIT_ERROR,message:F.translate("You must specify either 'browse_button' or 'drop_element'.")})},setOption:function(e,t){_.call(this,e,t,!this.runtime)},getOption:function(e){return e?u[e]:u},refresh:function(){o.length&&F.each(o,function(e){e.trigger("Refresh")}),this.trigger("Refresh")},start:function(){this.state!=F.STARTED&&(this.state=F.STARTED,this.trigger("StateChanged"),r.call(this))},stop:function(){this.state!=F.STOPPED&&(this.state=F.STOPPED,this.trigger("StateChanged"),this.trigger("CancelUpload"))},disableBrowse:function(){c=arguments[0]===S||arguments[0],o.length&&F.each(o,function(e){e.disable(c)}),this.trigger("DisableBrowse",c)},getFile:function(e){for(var t=l.length-1;0<=t;t--)if(l[t].id===e)return l[t]},addFile:function(e,n){var r,s=this,a=[],o=[];r=f(),function e(i){var t=I.typeOf(i);if(i instanceof I.File){if(!i.ruid&&!i.isDetached()){if(!r)return!1;i.ruid=r,i.connectRuntime(r)}e(new F.File(i))}else i instanceof I.Blob?(e(i.getSource()),i.destroy()):i instanceof F.File?(n&&(i.name=n),a.push(function(t){var n,e,r;n=i,e=function(e){e||(l.push(i),o.push(i),s.trigger("FileFiltered",i)),T(t,1)},r=[],I.each(s.settings.filters,function(e,i){D[i]&&r.push(function(t){D[i].call(s,e,n,function(e){t(!e)})})}),I.inSeries(r,e)})):-1!==I.inArray(t,["file","blob"])?e(new I.File(null,i)):"node"===t&&"filelist"===I.typeOf(i.files)?I.each(i.files,e):"array"===t&&(n=null,I.each(i,e))}(e),a.length&&I.inSeries(a,function(){o.length&&s.trigger("FilesAdded",o)})},removeFile:function(e){for(var t="string"==typeof e?e:e.id,i=l.length-1;0<=i;i--)if(l[i].id===t)return this.splice(i,1)[0]},splice:function(e,t){var t=l.splice(e===S?0:e,t===S?l.length:t),i=!1;return this.state==F.STARTED&&(F.each(t,function(e){if(e.status===F.UPLOADING)return!(i=!0)}),i&&this.stop()),this.trigger("FilesRemoved",t),F.each(t,function(e){e.destroy()}),i&&this.start(),t},dispatchEvent:function(e){var t,i;if(e=e.toLowerCase(),t=this.hasEventListener(e)){t.sort(function(e,t){return t.priority-e.priority}),(i=[].slice.call(arguments)).shift(),i.unshift(this);for(var n=0;nthis.length?this.length:n)<0&&(n+=this.length+1);for(var s=[],r=[],o=[],h=[],a={},u=e.add,c=e.merge,l=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;g").outerWidth(1).jquery||a.each(["Width","Height"],function(e,n){var r="Width"===n?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),o={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function s(e,t,n,i){return a.each(r,function(){t-=parseFloat(a.css(e,"padding"+this))||0,n&&(t-=parseFloat(a.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(a.css(e,"margin"+this))||0)}),t}a.fn["inner"+n]=function(e){return void 0===e?o["inner"+n].call(this):this.each(function(){a(this).css(i,s(this,e)+"px")})},a.fn["outer"+n]=function(e,t){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){a(this).css(i,s(this,e,!0,t)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),a("").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=(t=a.fn.removeData,function(e){return arguments.length?t.call(this,a.camelCase(e)):t.call(this)})),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:(i=a.fn.focus,function(t,n){return"number"==typeof t?this.each(function(){var e=this;setTimeout(function(){a(e).focus(),n&&n.call(e)},t)}):i.apply(this,arguments)}),disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.bind(n+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var t,n,i=a(this[0]);i.length&&i[0]!==document;){if(t=i.css("position"),("absolute"===t||"relative"===t||"fixed"===t)&&(n=parseInt(i.css("zIndex"),10),!isNaN(n)&&0!==n))return n;i=i.parent()}return 0}}),a.ui.plugin={add:function(e,t,n){var i,r=a.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(e,t,n,i){var r,o=e.plugins[t];if(o&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(r=0;r",options:{disabled:!1,create:null},_createWidget:function(t,e){e=d(e||this.defaultElement||this)[0],this.element=d(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=d(),this.hoverable=d(),this.focusable=d(),e!==this&&(d.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=d(e.style?e.ownerDocument:e.document||e),this.window=d(this.document[0].defaultView||this.document[0].parentWindow)),this.options=d.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:d.noop,_getCreateEventData:d.noop,_create:d.noop,_init:d.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(d.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:d.noop,widget:function(){return this.element},option:function(t,e){var i,n,s,o=t;if(0===arguments.length)return d.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(n=o[t]=d.widget.extend({},this.options[t]),s=0;s=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})}); !function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(r){return r.widget("ui.slider",r.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,t=this.options,i=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),s=[],a=t.values&&t.values.length||1;for(i.length>a&&(i.slice(a).remove(),i=i.slice(0,a)),e=i.length;e");this.handles=i.add(r(s.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){r(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,t="";e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:r.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=r("
").appendTo(this.element),t="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(t+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,a,n,t,h,l=this,o=this.options;return!o.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),h={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(h),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var t=Math.abs(i-l.values(e));(t=this._valueMax())return this._valueMax();var t=0=t&&(e+=0").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=this.document[0];if(this.handleElement.is(t.target))try{e.activeElement&&"body"!==e.activeElement.nodeName.toLowerCase()&&P(e.activeElement).blur()}catch(t){}},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),P.ui.ddmanager&&(P.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0s[2]&&(n=s[2]+this.offset.click.left),t.pageY-this.offset.click.top>s[3]&&(r=s[3]+this.offset.click.top)),i.grid&&(t=i.grid[1]?this.originalPageY+Math.round((r-this.originalPageY)/i.grid[1])*i.grid[1]:this.originalPageY,r=!s||t-this.offset.click.top>=s[1]||t-this.offset.click.top>s[3]?t:t-this.offset.click.top>=s[1]?t-i.grid[1]:t+i.grid[1],t=i.grid[0]?this.originalPageX+Math.round((n-this.originalPageX)/i.grid[0])*i.grid[0]:this.originalPageX,n=!s||t-this.offset.click.left>=s[0]||t-this.offset.click.left>s[2]?t:t-this.offset.click.left>=s[0]?t-i.grid[0]:t+i.grid[0]),"y"===i.axis&&(n=this.originalPageX),"x"===i.axis&&(r=this.originalPageY)),{top:r-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:o?0:this.offset.scroll.top),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:o?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,e,s){return s=s||this._uiHash(),P.ui.plugin.call(this,t,[e,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),P.Widget.prototype._trigger.call(this,t,e,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),P.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,s){var i=P.extend({},t,{item:s.element});s.sortables=[],P(s.options.connectToSortable).each(function(){var t=P(this).sortable("instance");t&&!t.options.disabled&&(s.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,i))})},stop:function(e,t,s){var i=P.extend({},t,{item:s.element});s.cancelHelperRemoval=!1,P.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,i))})},drag:function(s,i,o){P.each(o.sortables,function(){var t=!1,e=this;e.positionAbs=o.positionAbs,e.helperProportions=o.helperProportions,e.offset.click=o.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,P.each(o.sortables,function(){return this.positionAbs=o.positionAbs,this.helperProportions=o.helperProportions,this.offset.click=o.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&P.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,o._parent=i.helper.parent(),e.currentItem=i.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return i.helper[0]},s.target=e.currentItem[0],e._mouseCapture(s,!0),e._mouseStart(s,!0,!0),e.offset.click.top=o.offset.click.top,e.offset.click.left=o.offset.click.left,e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top,o._trigger("toSortable",s),o.dropped=e.element,P.each(o.sortables,function(){this.refreshPositions()}),o.currentItem=o.element,e.fromOutside=o),e.currentItem&&(e._mouseDrag(s),i.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",s,e._uiHash(e)),e._mouseStop(s,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),i.helper.appendTo(o._parent),o._refreshOffsets(s),i.position=o._generatePosition(s,!0),o._trigger("fromSortable",s),o.dropped=!1,P.each(o.sortables,function(){this.refreshPositions()}))})}}),P.ui.plugin.add("draggable","cursor",{start:function(t,e,s){var i=P("body"),s=s.options;i.css("cursor")&&(s._cursor=i.css("cursor")),i.css("cursor",s.cursor)},stop:function(t,e,s){s=s.options;s._cursor&&P("body").css("cursor",s._cursor)}}),P.ui.plugin.add("draggable","opacity",{start:function(t,e,s){e=P(e.helper),s=s.options;e.css("opacity")&&(s._opacity=e.css("opacity")),e.css("opacity",s.opacity)},stop:function(t,e,s){s=s.options;s._opacity&&P(e.helper).css("opacity",s._opacity)}}),P.ui.plugin.add("draggable","scroll",{start:function(t,e,s){s.scrollParentNotHidden||(s.scrollParentNotHidden=s.helper.scrollParent(!1)),s.scrollParentNotHidden[0]!==s.document[0]&&"HTML"!==s.scrollParentNotHidden[0].tagName&&(s.overflowOffset=s.scrollParentNotHidden.offset())},drag:function(t,e,s){var i=s.options,o=!1,n=s.scrollParentNotHidden[0],r=s.document[0];n!==r&&"HTML"!==n.tagName?(i.axis&&"x"===i.axis||(s.overflowOffset.top+n.offsetHeight-t.pageY1){return}g.preventDefault();var i=g.originalEvent.changedTouches[0],f=document.createEvent("MouseEvents");f.initMouseEvent(h,true,true,window,1,i.screenX,i.screenY,i.clientX,i.clientY,false,false,false,false,0,null);g.target.dispatchEvent(f)}c._touchStart=function(g){var f=this;if(a||!f._mouseCapture(g.originalEvent.changedTouches[0])){return}a=true;f._touchMoved=false;d(g,"mouseover");d(g,"mousemove");d(g,"mousedown")};c._touchMove=function(f){if(!a){return}this._touchMoved=true;d(f,"mousemove")};c._touchEnd=function(f){if(!a){return}d(f,"mouseup");d(f,"mouseout");if(!this._touchMoved){d(f,"click")}a=false};c._mouseInit=function(){var f=this;f.element.bind("touchstart",b.proxy(f,"_touchStart")).bind("touchmove",b.proxy(f,"_touchMove")).bind("touchend",b.proxy(f,"_touchEnd"));e.call(f)}})(jQuery); ;(function ($){ 'use strict'; var UserProfile=function (args){ this.view=new UserProfile.View({ model: new UserProfile.Model(args) }); } UserProfile.View=Backbone.View.extend({ events: { 'click #lp-remove-upload-photo': '_removePhoto', 'click #lp-upload-photo': '_upload', 'click .lp-cancel-upload': '_cancel' }, el: '#lp-user-edit-avatar', uploader: null, initialize: function (){ _.bindAll(this, 'filesAdded', 'uploadProgress', 'uploadError', 'fileUploaded', 'crop'); this._getUploader(); }, _removePhoto: function (e){ e.preventDefault(); this.$('.profile-picture').toggle().filter('.profile-avatar-current').remove(); this.$('#lp-remove-upload-photo').hide(); this.$('#submit').prop('disabled', false); }, _upload: function (e){ e.preventDefault(); }, _cancel: function (e){ e.preventDefault(); this.$crop&&this.$crop.remove(); this.$('.lp-avatar-preview').removeClass('croping'); }, filesAdded: function (up, files){ var that=this; up.files.splice(0, up.files.length - 1); that.$('.lp-avatar-preview').addClass('uploading'); that.$('.lp-avatar-upload-progress-value').width(0); that.uploader.start(); }, uploadProgress: function (up, file){ this.$('.lp-avatar-upload-progress-value').css('width', file.percent + "%"); }, uploadError: function (up, err){ this.$('.lp-avatar-preview').addClass('upload-error').removeClass('uploading'); this.$('.lp-avatar-upload-error').html(err); }, fileUploaded: function (up, file, info){ this.$('.lp-avatar-preview').removeClass('upload-error').removeClass('uploading'); var that=this, response=LP.parseJSON(info.response); if(response.url){ this.avatar=response.url; $("") .attr("src", response.url) .load(function (){ that.model.set($.extend(response, { width: this.width, height: this.height })); that.crop() }); }}, crop: function (){ this.model.set('r', Math.random()) new UserProfile.Crop(this); this.$('#submit').prop('disabled', false); }, _getUploader: function (){ if(this.uploader){ return this.uploader; } this.uploader=new plupload.Uploader({ runtimes: 'html5,flash,silverlight,html4', browse_button: 'lp-upload-photo', container: $('#lp-user-edit-avatar').get(0), url: (typeof lpGlobalSettings!=='undefined' ? lpGlobalSettings.ajax:'').addQueryVar('action', 'learnpress_upload-user-avatar'), filters: { max_file_size: '10mb', mime_types: [ {title: "Image", extensions: "png,jpg,bmp,gif"} ] }, file_data_name: 'lp-upload-avatar', init: { PostInit: function (){ }, FilesAdded: this.filesAdded, UploadProgress: this.uploadProgress, FileUploaded: this.fileUploaded, Error: this.uploadError }}); this.uploader.init(); return this.uploader; }}); UserProfile.Model=Backbone.Model.extend({}); UserProfile.Crop=function ($view){ var self=this, data=$view.model.toJSON(), $crop=$(LP.template('tmpl-crop-user-avatar')(data)); $crop.appendTo($view.$('.lp-avatar-preview').addClass('croping')); $view.$crop=$crop; var $img=$crop.find('img'), wx=0, hx=0, lx=0, tx=0, nw=0, nh=0; this.initCrop=function (){ var r1=data.viewWidth / data.viewHeight, r2=data.width / data.height; if(r1 >=r2){ wx=data.viewWidth; hx=data.height * data.viewWidth / data.width; lx=0; tx=-(hx - data.viewHeight) / 2 }else{ hx=data.viewHeight; wx=data.width * data.viewHeight / data.height; tx=0; lx=-(wx - data.viewWidth) / 2; } nw=wx; nh=hx; $img.draggable({ drag: function (e, ui){ if(ui.position.left > 0){ ui.position.left=0; } if(ui.position.top > 0){ ui.position.top=0; } var xx=data.viewWidth - nw, yy=data.viewHeight - nh; if(xx > ui.position.left){ ui.position.left=xx; } if(yy > ui.position.top){ ui.position.top=yy; } $(document.body).addClass('profile-dragging'); }, stop: function (e, ui){ lx=parseInt($img.css('left')); tx=parseInt($img.css('top')); dd=(Math.abs(lx) + data.viewWidth / 2) / nw; bb=(Math.abs(tx) + data.viewHeight / 2) / nh; self.update({ width: nw, height: nh, top: tx, left: lx }); $(document.body).removeClass('profile-dragging'); }}); var dd=(Math.abs(lx) + data.viewWidth / 2) / wx, bb=(Math.abs(tx) + data.viewHeight / 2) / hx; $crop.find('.lp-zoom > div').slider({ create: function (){ self.update({ width: wx, height: hx, top: tx, left: lx }); }, slide: function (e, ui){ nw=wx + (ui.value / 100) * data.width * 2; nh=hx + (ui.value / 100) * data.height * 2; var nl=data.viewWidth / 2 - (nw * dd), nt=data.viewHeight / 2 - nh * bb; if(nl > 0){ nl=0; } if(nt > 0){ nt=0; } var xx=parseInt(data.viewWidth - nw), yy=parseInt(data.viewHeight - nh); if(xx > nl){ nl=lx=xx; } if(yy > nt){ nt=tx=yy; } self.update({ width: nw, height: nh, top: nt, left: nl }); $(document.body).addClass('profile-resizing'); console.log(ui.value, data) }, stop: function (){ $(document.body).removeClass('profile-resizing'); }}); } this.update=function (args){ $img.css({ width: args.width, height: args.height, top: args.top, left: args.left }); var r=args.width / data.width, left=parseInt(Math.abs(args.left / r)), top=parseInt(Math.abs(args.top / r)), right=left + parseInt(data.viewWidth / r), bottom=top + parseInt(data.viewHeight / r); var cropData=$.extend(args, { width: data.viewWidth, height: data.viewHeight, r: r, points: [left, top, right, bottom].join(',') }); $crop.find('input[name^="lp-user-avatar-crop"]').each(function (){ var $input=$(this), name=$input.data('name'); if(name!='name'){ $input.val(cropData[name]); }}); } this.initCrop(); } $(document).on('submit', '#learn-press-form-login', function (e){ var $form=$(this), data=$form.serialize(); $form.find('.learn-press-error, .learn-press-notice, .learn-press-message').fadeOut(); $form.find('input').attr('disabled', true); LP.doAjax({ data: { 'lp-ajax': 'login', data: data }, success: function (response, raw){ LP.showMessages(response.message, $form, 'LOGIN_ERROR'); if(response.result=='error'){ $form.find('input').attr('disabled', false); $('#learn-press-form-login input[type="text"]').focus(); } if(response.redirect){ LP.reload(response.redirect); }}, error: function (){ LP.showMessages('', $form, 'LOGIN_ERROR'); $form.find('input').attr('disabled', false); $('#learn-press-form-login input[type="text"]').focus(); }}); return false; }); $(document).on('click', '.table-orders .cancel-order', function (e){ e.preventDefault(); var _this=$(this), _href=_this.attr('href'); LP.alert(learn_press_js_localize.confirm_cancel_order, function (confirm){ if(confirm){ window.location.href=_href; }}); return false; }); $(document).ready(function (){ var $form=$('#lp-user-profile-form form'), oldData=$form.serialize(), timer=null, $passwordForm=$form.find('#lp-profile-edit-password-form'); function _checkData(){ return $form.serialize()!=oldData; } function _timerCallback(){ $form.find('#submit').prop('disabled', !_checkData()); } if($passwordForm.length==0){ $form.on('keyup change', 'input, textarea, select', function (){ timer&&clearTimeout(timer); timer=setTimeout(_timerCallback, 300); }); }else{ $passwordForm.on('change keyup', 'input', function (e){ var $target=$(e.target), targetName=$target.attr('name'), $oldPass=$form.find('#pass0'), $newPass=$form.find('#pass1'), $confirmPass=$form.find('#pass2'), match = !(($newPass.val()||$confirmPass.val())&&$newPass.val()!=$confirmPass.val()); $form.find('#lp-password-not-match').toggleClass('hide-if-js', match); $form.find('#submit').prop('disabled', !match||!$oldPass.val()||!$newPass.val()||!$confirmPass.val()); }); } var args={}; if(typeof lpProfileUserSettings!=='undefined'){ args.viewWidth=parseInt(lpProfileUserSettings.avatar_size['width']); args.viewHeight=parseInt(lpProfileUserSettings.avatar_size['height']); } new UserProfile(args); Profile.recoverOrder(); }); var Profile={ recoverOrder: function (e){ var $wrap=$('.order-recover'), $buttonRecoverOrder=$wrap.find('.button-recover-order'), $input=$wrap.find('input[name="order-key"]'); function recoverOrder(){ $buttonRecoverOrder.addClass('disabled').attr('disabled', 'disabled'); $wrap.find('.learn-press-message').remove(); $.post({ url: '', data: $wrap.serializeJSON(), success: function (response){ response=LP.parseJSON(response); if(response.message){ var $msg=$('
' + response.message + '
'); if(response.result=='error'){ $msg.addClass('error'); } $wrap.prepend($msg); } if(response.redirect){ window.location.href=response.redirect; } $buttonRecoverOrder.removeClass('disabled').removeAttr('disabled', ''); }}) } $buttonRecoverOrder.on('click', recoverOrder); $input.on('change', function (){ $buttonRecoverOrder.prop('disabled', !this.value); }) }} })(jQuery); if(typeof jQuery==='undefined'){ console.log('jQuery is not defined'); }else{ (function ($){ $(document).ready(function (){ $('form[name="become-teacher-form"]').each(function (){ var $form=$(this), $submit=$form.find('button[type="submit"]'), hideMessages=function (){ $('.learn-press-error, .learn-press-message').fadeOut('fast', function (){ $(this).remove() }); }, showMessages=function (messages){ var m=[]; if($.isPlainObject(messages)){ for (var i in messages){ m.push($(messages[i])); }}else if($.isArray(messages)){ m=messages.reverse(); }else{ m=[messages]; } for (var i=0; i < m.length; i++){ $(m[i]).insertBefore($form); }}, blockForm=function (block){ return $form.find('input, select, button, textarea') .prop('disabled', !!block) }, beforeSend=function (){ hideMessages(); blockForm(true) .filter($submit) .data('origin-text', $submit.text()) .html($submit.data('text')); }, ajaxSuccess=function (response){ response=LP.parseJSON(response); if(response.message){ showMessages(response.message) } blockForm().filter($submit).html($submit.data('origin-text')); if(response.result==='success'){ $form.remove(); }else{ $submit.prop('disabled', false); $submit.html($submit.data('text')); }}, ajaxError=function (response){ response=LP.parseJSON(response); if(response.message){ showMessages(response.message) } blockForm().filter($submit).html($submit.data('origin-text')); }; $form.submit(function (){ if($form.triggerHandler('become_teacher_send')!==false){ $.ajax({ url: window.location.href.addQueryVar('lp-ajax', 'request-become-a-teacher'), data: $form.serialize(), dataType: 'text', type: 'post', beforeSend: beforeSend, success: ajaxSuccess, error: ajaxError }); } return false; }); }) }); })(jQuery); };