0&&void 0!==arguments[0]?arguments[0]:250,e=arguments[1],n=arguments[2],i=arguments[3],a=n.querySelector(".alm-listing")||n.querySelector(".alm-comments");if(!a)return!1;switch(i){case"filter":var s=!0,c=!1,l=void 0;try{for(var u,d=Object.entries(e)[Symbol.iterator]();!(s=(u=d.next()).done);s=!0){var f=u.value,p=r(f,2),g=p[0],h=p[1];g=g.replace(/\W+/g,"-").replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),a.setAttribute("data-"+g,h)}}catch(t){c=!0,l=t}finally{try{!s&&d.return&&d.return()}finally{if(c)throw l}}(0,o.default)(n,t);break;case"tab":a.setAttribute("data-preloaded","false"),a.setAttribute("data-pause","false"),a.setAttribute("data-tab-template",e.tabTemplate)}var v="";switch(e.target?(v=document.querySelector('.ajax-load-more-wrap[data-id="'+e.target+'"]'))&&window.almInit(v):(v=document.querySelector(".ajax-load-more-wrap"))&&window.almInit(v),i){case"tab":"function"==typeof almTabsComplete&&almTabsComplete()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(""===e)return!1;e=e.replace(/(<\/p>)+/g,""),t.innerHTML=e}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){if(t&&t.debug){var e={query:t.debug,localize:t.localize};console.log("ALM Debug:",e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=function(t){if(!t)return!1;var e=-1!==t.scroll_distance_orig.toString().indexOf("-"),n=t.scroll_distance_orig.toString().replace("-","").replace("%",""),r=t.window.innerHeight,o=Math.floor(r/100*parseInt(n));return parseInt(e?"-"+o:o)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.showPlaceholder=function(t){if(!t||!t.main||t.addons.paging)return!1;t.placeholder&&(t.placeholder.style.display="block",(0,r.default)(t.placeholder,75))},e.hidePlaceholder=function(t){if(!t||!t.main||t.addons.paging)return!1;t.placeholder&&((0,o.default)(t.placeholder,75),setTimeout(function(){t.placeholder.style.display="none"},75))};var r=i(n(48)),o=i(n(63));function i(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){n(173)},function(t,e,n){"use strict";n(174),n(318),n(320),n(322),n(324),n(326),n(328),n(330),n(332),n(334),n(338)},function(t,e,n){n(175),n(178),n(179),n(180),n(181),n(182),n(183),n(184),n(185),n(186),n(187),n(188),n(189),n(190),n(191),n(192),n(193),n(194),n(195),n(196),n(197),n(198),n(199),n(200),n(201),n(202),n(203),n(204),n(205),n(206),n(207),n(208),n(209),n(210),n(211),n(212),n(213),n(214),n(215),n(216),n(217),n(218),n(219),n(221),n(222),n(223),n(224),n(225),n(226),n(227),n(228),n(229),n(230),n(231),n(232),n(233),n(234),n(235),n(236),n(237),n(238),n(239),n(240),n(241),n(242),n(243),n(244),n(245),n(246),n(247),n(248),n(249),n(250),n(251),n(252),n(253),n(254),n(256),n(257),n(259),n(260),n(261),n(262),n(263),n(264),n(265),n(268),n(269),n(270),n(271),n(272),n(273),n(274),n(275),n(276),n(277),n(278),n(279),n(280),n(85),n(281),n(120),n(282),n(121),n(283),n(284),n(285),n(286),n(122),n(289),n(290),n(291),n(292),n(293),n(294),n(295),n(296),n(297),n(298),n(299),n(300),n(301),n(302),n(303),n(304),n(305),n(306),n(307),n(308),n(309),n(310),n(311),n(312),n(313),n(314),n(315),n(316),n(317),t.exports=n(9)},function(t,e,n){"use strict";var r=n(1),o=n(14),i=n(8),a=n(0),s=n(10),c=n(28).KEY,l=n(2),u=n(49),d=n(38),f=n(30),p=n(5),g=n(65),h=n(102),v=n(177),m=n(68),y=n(3),_=n(4),x=n(16),b=n(27),w=n(29),S=n(34),A=n(105),j=n(19),E=n(7),P=n(32),L=j.f,O=E.f,M=A.f,T=r.Symbol,I=r.JSON,N=I&&I.stringify,F=p("_hidden"),C=p("toPrimitive"),k={}.propertyIsEnumerable,R=u("symbol-registry"),D=u("symbols"),q=u("op-symbols"),B=Object.prototype,z="function"==typeof T,U=r.QObject,W=!U||!U.prototype||!U.prototype.findChild,V=i&&l(function(){return 7!=S(O({},"a",{get:function(){return O(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=L(B,e);r&&delete B[e],O(t,e,n),r&&t!==B&&O(B,e,r)}:O,H=function(t){var e=D[t]=S(T.prototype);return e._k=t,e},G=z&&"symbol"==typeof T.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof T},Y=function(t,e,n){return t===B&&Y(q,e,n),y(t),e=b(e,!0),y(n),o(D,e)?(n.enumerable?(o(t,F)&&t[F][e]&&(t[F][e]=!1),n=S(n,{enumerable:w(0,!1)})):(o(t,F)||O(t,F,w(1,{})),t[F][e]=!0),V(t,e,n)):O(t,e,n)},X=function(t,e){y(t);for(var n,r=v(e=x(e)),o=0,i=r.length;i>o;)Y(t,n=r[o++],e[n]);return t},$=function(t){var e=k.call(this,t=b(t,!0));return!(this===B&&o(D,t)&&!o(q,t))&&(!(e||!o(this,t)||!o(D,t)||o(this,F)&&this[F][t])||e)},Q=function(t,e){if(t=x(t),e=b(e,!0),t!==B||!o(D,e)||o(q,e)){var n=L(t,e);return!n||!o(D,e)||o(t,F)&&t[F][e]||(n.enumerable=!0),n}},K=function(t){for(var e,n=M(x(t)),r=[],i=0;n.length>i;)o(D,e=n[i++])||e==F||e==c||r.push(e);return r},J=function(t){for(var e,n=t===B,r=M(n?q:x(t)),i=[],a=0;r.length>a;)!o(D,e=r[a++])||n&&!o(B,e)||i.push(D[e]);return i};z||(s((T=function(){if(this instanceof T)throw TypeError("Symbol is not a constructor!");var t=f(arguments.length>0?arguments[0]:void 0),e=function(n){this===B&&e.call(q,n),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),V(this,t,w(1,n))};return i&&W&&V(B,t,{configurable:!0,set:e}),H(t)}).prototype,"toString",function(){return this._k}),j.f=Q,E.f=Y,n(35).f=A.f=K,n(45).f=$,n(51).f=J,i&&!n(31)&&s(B,"propertyIsEnumerable",$,!0),g.f=function(t){return H(p(t))}),a(a.G+a.W+a.F*!z,{Symbol:T});for(var Z="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),tt=0;Z.length>tt;)p(Z[tt++]);for(var et=P(p.store),nt=0;et.length>nt;)h(et[nt++]);a(a.S+a.F*!z,"Symbol",{for:function(t){return o(R,t+="")?R[t]:R[t]=T(t)},keyFor:function(t){if(!G(t))throw TypeError(t+" is not a symbol!");for(var e in R)if(R[e]===t)return e},useSetter:function(){W=!0},useSimple:function(){W=!1}}),a(a.S+a.F*!z,"Object",{create:function(t,e){return void 0===e?S(t):X(S(t),e)},defineProperty:Y,defineProperties:X,getOwnPropertyDescriptor:Q,getOwnPropertyNames:K,getOwnPropertySymbols:J}),I&&a(a.S+a.F*(!z||l(function(){var t=T();return"[null]"!=N([t])||"{}"!=N({a:t})||"{}"!=N(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],o=1;arguments.length>o;)r.push(arguments[o++]);if(n=e=r[1],(_(e)||void 0!==t)&&!G(t))return m(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!G(e))return e}),r[1]=e,N.apply(I,r)}}),T.prototype[C]||n(15)(T.prototype,C,T.prototype.valueOf),d(T,"Symbol"),d(Math,"Math",!0),d(r.JSON,"JSON",!0)},function(t,e,n){t.exports=n(49)("native-function-to-string",Function.toString)},function(t,e,n){var r=n(32),o=n(51),i=n(45);t.exports=function(t){var e=r(t),n=o.f;if(n)for(var a,s=n(t),c=i.f,l=0;s.length>l;)c.call(t,a=s[l++])&&e.push(a);return e}},function(t,e,n){var r=n(0);r(r.S,"Object",{create:n(34)})},function(t,e,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperty:n(7).f})},function(t,e,n){var r=n(0);r(r.S+r.F*!n(8),"Object",{defineProperties:n(104)})},function(t,e,n){var r=n(16),o=n(19).f;n(20)("getOwnPropertyDescriptor",function(){return function(t,e){return o(r(t),e)}})},function(t,e,n){var r=n(11),o=n(36);n(20)("getPrototypeOf",function(){return function(t){return o(r(t))}})},function(t,e,n){var r=n(11),o=n(32);n(20)("keys",function(){return function(t){return o(r(t))}})},function(t,e,n){n(20)("getOwnPropertyNames",function(){return n(105).f})},function(t,e,n){var r=n(4),o=n(28).onFreeze;n(20)("freeze",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(t,e,n){var r=n(4),o=n(28).onFreeze;n(20)("seal",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(t,e,n){var r=n(4),o=n(28).onFreeze;n(20)("preventExtensions",function(t){return function(e){return t&&r(e)?t(o(e)):e}})},function(t,e,n){var r=n(4);n(20)("isFrozen",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(t,e,n){var r=n(4);n(20)("isSealed",function(t){return function(e){return!r(e)||!!t&&t(e)}})},function(t,e,n){var r=n(4);n(20)("isExtensible",function(t){return function(e){return!!r(e)&&(!t||t(e))}})},function(t,e,n){var r=n(0);r(r.S+r.F,"Object",{assign:n(106)})},function(t,e,n){var r=n(0);r(r.S,"Object",{is:n(107)})},function(t,e,n){var r=n(0);r(r.S,"Object",{setPrototypeOf:n(70).set})},function(t,e,n){"use strict";var r=n(46),o={};o[n(5)("toStringTag")]="z",o+""!="[object z]"&&n(10)(Object.prototype,"toString",function(){return"[object "+r(this)+"]"},!0)},function(t,e,n){var r=n(0);r(r.P,"Function",{bind:n(108)})},function(t,e,n){var r=n(7).f,o=Function.prototype,i=/^\s*function ([^ (]*)/;"name"in o||n(8)&&r(o,"name",{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},function(t,e,n){"use strict";var r=n(4),o=n(36),i=n(5)("hasInstance"),a=Function.prototype;i in a||n(7).f(a,i,{value:function(t){if("function"!=typeof this||!r(t))return!1;if(!r(this.prototype))return t instanceof this;for(;t=o(t);)if(this.prototype===t)return!0;return!1}})},function(t,e,n){var r=n(0),o=n(110);r(r.G+r.F*(parseInt!=o),{parseInt:o})},function(t,e,n){var r=n(0),o=n(111);r(r.G+r.F*(parseFloat!=o),{parseFloat:o})},function(t,e,n){"use strict";var r=n(1),o=n(14),i=n(24),a=n(72),s=n(27),c=n(2),l=n(35).f,u=n(19).f,d=n(7).f,f=n(52).trim,p=r.Number,g=p,h=p.prototype,v="Number"==i(n(34)(h)),m="trim"in String.prototype,y=function(t){var e=s(t,!1);if("string"==typeof e&&e.length>2){var n,r,o,i=(e=m?e.trim():f(e,3)).charCodeAt(0);if(43===i||45===i){if(88===(n=e.charCodeAt(2))||120===n)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+e}for(var a,c=e.slice(2),l=0,u=c.length;lo)return NaN;return parseInt(c,r)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof p&&(v?c(function(){h.valueOf.call(n)}):"Number"!=i(n))?a(new g(y(e)),n,p):y(e)};for(var _,x=n(8)?l(g):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),b=0;x.length>b;b++)o(g,_=x[b])&&!o(p,_)&&d(p,_,u(g,_));p.prototype=h,h.constructor=p,n(10)(r,"Number",p)}},function(t,e,n){"use strict";var r=n(0),o=n(18),i=n(112),a=n(73),s=1..toFixed,c=Math.floor,l=[0,0,0,0,0,0],u="Number.toFixed: incorrect invocation!",d=function(t,e){for(var n=-1,r=e;++n<6;)r+=t*l[n],l[n]=r%1e7,r=c(r/1e7)},f=function(t){for(var e=6,n=0;--e>=0;)n+=l[e],l[e]=c(n/t),n=n%t*1e7},p=function(){for(var t=6,e="";--t>=0;)if(""!==e||0===t||0!==l[t]){var n=String(l[t]);e=""===e?n:e+a.call("0",7-n.length)+n}return e},g=function(t,e,n){return 0===e?n:e%2==1?g(t,e-1,n*t):g(t*t,e/2,n)};r(r.P+r.F*(!!s&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!n(2)(function(){s.call({})})),"Number",{toFixed:function(t){var e,n,r,s,c=i(this,u),l=o(t),h="",v="0";if(l<0||l>20)throw RangeError(u);if(c!=c)return"NaN";if(c<=-1e21||c>=1e21)return String(c);if(c<0&&(h="-",c=-c),c>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(c*g(2,69,1))-69)<0?c*g(2,-e,1):c/g(2,e,1),n*=4503599627370496,(e=52-e)>0){for(d(0,n),r=l;r>=7;)d(1e7,0),r-=7;for(d(g(10,r,1),0),r=e-1;r>=23;)f(1<<23),r-=23;f(1<0?h+((s=v.length)<=l?"0."+a.call("0",l-s)+v:v.slice(0,s-l)+"."+v.slice(s-l)):h+v}})},function(t,e,n){"use strict";var r=n(0),o=n(2),i=n(112),a=1..toPrecision;r(r.P+r.F*(o(function(){return"1"!==a.call(1,void 0)})||!o(function(){a.call({})})),"Number",{toPrecision:function(t){var e=i(this,"Number#toPrecision: incorrect invocation!");return void 0===t?a.call(e):a.call(e,t)}})},function(t,e,n){var r=n(0);r(r.S,"Number",{EPSILON:Math.pow(2,-52)})},function(t,e,n){var r=n(0),o=n(1).isFinite;r(r.S,"Number",{isFinite:function(t){return"number"==typeof t&&o(t)}})},function(t,e,n){var r=n(0);r(r.S,"Number",{isInteger:n(113)})},function(t,e,n){var r=n(0);r(r.S,"Number",{isNaN:function(t){return t!=t}})},function(t,e,n){var r=n(0),o=n(113),i=Math.abs;r(r.S,"Number",{isSafeInteger:function(t){return o(t)&&i(t)<=9007199254740991}})},function(t,e,n){var r=n(0);r(r.S,"Number",{MAX_SAFE_INTEGER:9007199254740991})},function(t,e,n){var r=n(0);r(r.S,"Number",{MIN_SAFE_INTEGER:-9007199254740991})},function(t,e,n){var r=n(0),o=n(111);r(r.S+r.F*(Number.parseFloat!=o),"Number",{parseFloat:o})},function(t,e,n){var r=n(0),o=n(110);r(r.S+r.F*(Number.parseInt!=o),"Number",{parseInt:o})},function(t,e,n){var r=n(0),o=n(114),i=Math.sqrt,a=Math.acosh;r(r.S+r.F*!(a&&710==Math.floor(a(Number.MAX_VALUE))&&a(1/0)==1/0),"Math",{acosh:function(t){return(t=+t)<1?NaN:t>94906265.62425156?Math.log(t)+Math.LN2:o(t-1+i(t-1)*i(t+1))}})},function(t,e,n){var r=n(0),o=Math.asinh;r(r.S+r.F*!(o&&1/o(0)>0),"Math",{asinh:function t(e){return isFinite(e=+e)&&0!=e?e<0?-t(-e):Math.log(e+Math.sqrt(e*e+1)):e}})},function(t,e,n){var r=n(0),o=Math.atanh;r(r.S+r.F*!(o&&1/o(-0)<0),"Math",{atanh:function(t){return 0==(t=+t)?t:Math.log((1+t)/(1-t))/2}})},function(t,e,n){var r=n(0),o=n(74);r(r.S,"Math",{cbrt:function(t){return o(t=+t)*Math.pow(Math.abs(t),1/3)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{clz32:function(t){return(t>>>=0)?31-Math.floor(Math.log(t+.5)*Math.LOG2E):32}})},function(t,e,n){var r=n(0),o=Math.exp;r(r.S,"Math",{cosh:function(t){return(o(t=+t)+o(-t))/2}})},function(t,e,n){var r=n(0),o=n(75);r(r.S+r.F*(o!=Math.expm1),"Math",{expm1:o})},function(t,e,n){var r=n(0);r(r.S,"Math",{fround:n(220)})},function(t,e,n){var r=n(74),o=Math.pow,i=o(2,-52),a=o(2,-23),s=o(2,127)*(2-a),c=o(2,-126);t.exports=Math.fround||function(t){var e,n,o=Math.abs(t),l=r(t);return os||n!=n?l*(1/0):l*n}},function(t,e,n){var r=n(0),o=Math.abs;r(r.S,"Math",{hypot:function(t,e){for(var n,r,i=0,a=0,s=arguments.length,c=0;a0?(r=n/c)*r:n;return c===1/0?1/0:c*Math.sqrt(i)}})},function(t,e,n){var r=n(0),o=Math.imul;r(r.S+r.F*n(2)(function(){return-5!=o(4294967295,5)||2!=o.length}),"Math",{imul:function(t,e){var n=+t,r=+e,o=65535&n,i=65535&r;return 0|o*i+((65535&n>>>16)*i+o*(65535&r>>>16)<<16>>>0)}})},function(t,e,n){var r=n(0);r(r.S,"Math",{log10:function(t){return Math.log(t)*Math.LOG10E}})},function(t,e,n){var r=n(0);r(r.S,"Math",{log1p:n(114)})},function(t,e,n){var r=n(0);r(r.S,"Math",{log2:function(t){return Math.log(t)/Math.LN2}})},function(t,e,n){var r=n(0);r(r.S,"Math",{sign:n(74)})},function(t,e,n){var r=n(0),o=n(75),i=Math.exp;r(r.S+r.F*n(2)(function(){return-2e-17!=!Math.sinh(-2e-17)}),"Math",{sinh:function(t){return Math.abs(t=+t)<1?(o(t)-o(-t))/2:(i(t-1)-i(-t-1))*(Math.E/2)}})},function(t,e,n){var r=n(0),o=n(75),i=Math.exp;r(r.S,"Math",{tanh:function(t){var e=o(t=+t),n=o(-t);return e==1/0?1:n==1/0?-1:(e-n)/(i(t)+i(-t))}})},function(t,e,n){var r=n(0);r(r.S,"Math",{trunc:function(t){return(t>0?Math.floor:Math.ceil)(t)}})},function(t,e,n){var r=n(0),o=n(33),i=String.fromCharCode,a=String.fromCodePoint;r(r.S+r.F*(!!a&&1!=a.length),"String",{fromCodePoint:function(t){for(var e,n=[],r=arguments.length,a=0;r>a;){if(e=+arguments[a++],o(e,1114111)!==e)throw RangeError(e+" is not a valid code point");n.push(e<65536?i(e):i(55296+((e-=65536)>>10),e%1024+56320))}return n.join("")}})},function(t,e,n){var r=n(0),o=n(16),i=n(6);r(r.S,"String",{raw:function(t){for(var e=o(t.raw),n=i(e.length),r=arguments.length,a=[],s=0;n>s;)a.push(String(e[s++])),s=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},function(t,e,n){"use strict";var r=n(0),o=n(76)(!1);r(r.P,"String",{codePointAt:function(t){return o(this,t)}})},function(t,e,n){"use strict";var r=n(0),o=n(6),i=n(78),a="".endsWith;r(r.P+r.F*n(80)("endsWith"),"String",{endsWith:function(t){var e=i(this,t,"endsWith"),n=arguments.length>1?arguments[1]:void 0,r=o(e.length),s=void 0===n?r:Math.min(o(n),r),c=String(t);return a?a.call(e,c,s):e.slice(s-c.length,s)===c}})},function(t,e,n){"use strict";var r=n(0),o=n(78);r(r.P+r.F*n(80)("includes"),"String",{includes:function(t){return!!~o(this,t,"includes").indexOf(t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,n){var r=n(0);r(r.P,"String",{repeat:n(73)})},function(t,e,n){"use strict";var r=n(0),o=n(6),i=n(78),a="".startsWith;r(r.P+r.F*n(80)("startsWith"),"String",{startsWith:function(t){var e=i(this,t,"startsWith"),n=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return a?a.call(e,r,n):e.slice(n,n+r.length)===r}})},function(t,e,n){"use strict";n(12)("anchor",function(t){return function(e){return t(this,"a","name",e)}})},function(t,e,n){"use strict";n(12)("big",function(t){return function(){return t(this,"big","","")}})},function(t,e,n){"use strict";n(12)("blink",function(t){return function(){return t(this,"blink","","")}})},function(t,e,n){"use strict";n(12)("bold",function(t){return function(){return t(this,"b","","")}})},function(t,e,n){"use strict";n(12)("fixed",function(t){return function(){return t(this,"tt","","")}})},function(t,e,n){"use strict";n(12)("fontcolor",function(t){return function(e){return t(this,"font","color",e)}})},function(t,e,n){"use strict";n(12)("fontsize",function(t){return function(e){return t(this,"font","size",e)}})},function(t,e,n){"use strict";n(12)("italics",function(t){return function(){return t(this,"i","","")}})},function(t,e,n){"use strict";n(12)("link",function(t){return function(e){return t(this,"a","href",e)}})},function(t,e,n){"use strict";n(12)("small",function(t){return function(){return t(this,"small","","")}})},function(t,e,n){"use strict";n(12)("strike",function(t){return function(){return t(this,"strike","","")}})},function(t,e,n){"use strict";n(12)("sub",function(t){return function(){return t(this,"sub","","")}})},function(t,e,n){"use strict";n(12)("sup",function(t){return function(){return t(this,"sup","","")}})},function(t,e,n){var r=n(0);r(r.S,"Date",{now:function(){return(new Date).getTime()}})},function(t,e,n){"use strict";var r=n(0),o=n(11),i=n(27);r(r.P+r.F*n(2)(function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}),"Date",{toJSON:function(t){var e=o(this),n=i(e);return"number"!=typeof n||isFinite(n)?e.toISOString():null}})},function(t,e,n){var r=n(0),o=n(255);r(r.P+r.F*(Date.prototype.toISOString!==o),"Date",{toISOString:o})},function(t,e,n){"use strict";var r=n(2),o=Date.prototype.getTime,i=Date.prototype.toISOString,a=function(t){return t>9?t:"0"+t};t.exports=r(function(){return"0385-07-25T07:06:39.999Z"!=i.call(new Date(-5e13-1))})||!r(function(){i.call(new Date(NaN))})?function(){if(!isFinite(o.call(this)))throw RangeError("Invalid time value");var t=this,e=t.getUTCFullYear(),n=t.getUTCMilliseconds(),r=e<0?"-":e>9999?"+":"";return r+("00000"+Math.abs(e)).slice(r?-6:-4)+"-"+a(t.getUTCMonth()+1)+"-"+a(t.getUTCDate())+"T"+a(t.getUTCHours())+":"+a(t.getUTCMinutes())+":"+a(t.getUTCSeconds())+"."+(n>99?n:"0"+a(n))+"Z"}:i},function(t,e,n){var r=Date.prototype,o=r.toString,i=r.getTime;new Date(NaN)+""!="Invalid Date"&&n(10)(r,"toString",function(){var t=i.call(this);return t==t?o.call(this):"Invalid Date"})},function(t,e,n){var r=n(5)("toPrimitive"),o=Date.prototype;r in o||n(15)(o,r,n(258))},function(t,e,n){"use strict";var r=n(3),o=n(27);t.exports=function(t){if("string"!==t&&"number"!==t&&"default"!==t)throw TypeError("Incorrect hint");return o(r(this),"number"!=t)}},function(t,e,n){var r=n(0);r(r.S,"Array",{isArray:n(68)})},function(t,e,n){"use strict";var r=n(22),o=n(0),i=n(11),a=n(116),s=n(81),c=n(6),l=n(82),u=n(83);o(o.S+o.F*!n(53)(function(t){Array.from(t)}),"Array",{from:function(t){var e,n,o,d,f=i(t),p="function"==typeof this?this:Array,g=arguments.length,h=g>1?arguments[1]:void 0,v=void 0!==h,m=0,y=u(f);if(v&&(h=r(h,g>2?arguments[2]:void 0,2)),null==y||p==Array&&s(y))for(n=new p(e=c(f.length));e>m;m++)l(n,m,v?h(f[m],m):f[m]);else for(d=y.call(f),n=new p;!(o=d.next()).done;m++)l(n,m,v?a(d,h,[o.value,m],!0):o.value);return n.length=m,n}})},function(t,e,n){"use strict";var r=n(0),o=n(82);r(r.S+r.F*n(2)(function(){function t(){}return!(Array.of.call(t)instanceof t)}),"Array",{of:function(){for(var t=0,e=arguments.length,n=new("function"==typeof this?this:Array)(e);e>t;)o(n,t,arguments[t++]);return n.length=e,n}})},function(t,e,n){"use strict";var r=n(0),o=n(16),i=[].join;r(r.P+r.F*(n(44)!=Object||!n(17)(i)),"Array",{join:function(t){return i.call(o(this),void 0===t?",":t)}})},function(t,e,n){"use strict";var r=n(0),o=n(69),i=n(24),a=n(33),s=n(6),c=[].slice;r(r.P+r.F*n(2)(function(){o&&c.call(o)}),"Array",{slice:function(t,e){var n=s(this.length),r=i(this);if(e=void 0===e?n:e,"Array"==r)return c.call(this,t,e);for(var o=a(t,n),l=a(e,n),u=s(l-o),d=new Array(u),f=0;f1&&(r=Math.min(r,i(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in e&&e[r]===t)return r||0;return-1}})},function(t,e,n){var r=n(0);r(r.P,"Array",{copyWithin:n(118)}),n(40)("copyWithin")},function(t,e,n){var r=n(0);r(r.P,"Array",{fill:n(84)}),n(40)("fill")},function(t,e,n){"use strict";var r=n(0),o=n(21)(5),i=!0;"find"in[]&&Array(1).find(function(){i=!1}),r(r.P+r.F*i,"Array",{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(40)("find")},function(t,e,n){"use strict";var r=n(0),o=n(21)(6),i="findIndex",a=!0;i in[]&&Array(1)[i](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(40)(i)},function(t,e,n){n(41)("Array")},function(t,e,n){var r=n(1),o=n(72),i=n(7).f,a=n(35).f,s=n(79),c=n(54),l=r.RegExp,u=l,d=l.prototype,f=/a/g,p=/a/g,g=new l(f)!==f;if(n(8)&&(!g||n(2)(function(){return p[n(5)("match")]=!1,l(f)!=f||l(p)==p||"/a/i"!=l(f,"i")}))){l=function(t,e){var n=this instanceof l,r=s(t),i=void 0===e;return!n&&r&&t.constructor===l&&i?t:o(g?new u(r&&!i?t.source:t,e):u((r=t instanceof l)?t.source:t,r&&i?c.call(t):e),n?this:d,l)};for(var h=function(t){t in l||i(l,t,{configurable:!0,get:function(){return u[t]},set:function(e){u[t]=e}})},v=a(u),m=0;v.length>m;)h(v[m++]);d.constructor=l,l.prototype=d,n(10)(r,"RegExp",l)}n(41)("RegExp")},function(t,e,n){"use strict";n(121);var r=n(3),o=n(54),i=n(8),a=/./.toString,s=function(t){n(10)(RegExp.prototype,"toString",t,!0)};n(2)(function(){return"/a/b"!=a.call({source:"a",flags:"b"})})?s(function(){var t=r(this);return"/".concat(t.source,"/","flags"in t?t.flags:!i&&t instanceof RegExp?o.call(t):void 0)}):"toString"!=a.name&&s(function(){return a.call(this)})},function(t,e,n){"use strict";var r=n(3),o=n(6),i=n(87),a=n(55);n(56)("match",1,function(t,e,n,s){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=s(n,t,this);if(e.done)return e.value;var c=r(t),l=String(this);if(!c.global)return a(c,l);var u=c.unicode;c.lastIndex=0;for(var d,f=[],p=0;null!==(d=a(c,l));){var g=String(d[0]);f[p]=g,""===g&&(c.lastIndex=i(l,o(c.lastIndex),u)),p++}return 0===p?null:f}]})},function(t,e,n){"use strict";var r=n(3),o=n(11),i=n(6),a=n(18),s=n(87),c=n(55),l=Math.max,u=Math.min,d=Math.floor,f=/\$([$&`']|\d\d?|<[^>]*>)/g,p=/\$([$&`']|\d\d?)/g;n(56)("replace",2,function(t,e,n,g){return[function(r,o){var i=t(this),a=null==r?void 0:r[e];return void 0!==a?a.call(r,i,o):n.call(String(i),r,o)},function(t,e){var o=g(n,t,this,e);if(o.done)return o.value;var d=r(t),f=String(this),p="function"==typeof e;p||(e=String(e));var v=d.global;if(v){var m=d.unicode;d.lastIndex=0}for(var y=[];;){var _=c(d,f);if(null===_)break;if(y.push(_),!v)break;""===String(_[0])&&(d.lastIndex=s(f,i(d.lastIndex),m))}for(var x,b="",w=0,S=0;S=w&&(b+=f.slice(w,j)+M,w=j+A.length)}return b+f.slice(w)}];function h(t,e,r,i,a,s){var c=r+t.length,l=i.length,u=p;return void 0!==a&&(a=o(a),u=f),n.call(s,u,function(n,o){var s;switch(o.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(c);case"<":s=a[o.slice(1,-1)];break;default:var u=+o;if(0===u)return n;if(u>l){var f=d(u/10);return 0===f?n:f<=l?void 0===i[f-1]?o.charAt(1):i[f-1]+o.charAt(1):n}s=i[u-1]}return void 0===s?"":s})}})},function(t,e,n){"use strict";var r=n(3),o=n(107),i=n(55);n(56)("search",1,function(t,e,n,a){return[function(n){var r=t(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,r):new RegExp(n)[e](String(r))},function(t){var e=a(n,t,this);if(e.done)return e.value;var s=r(t),c=String(this),l=s.lastIndex;o(l,0)||(s.lastIndex=0);var u=i(s,c);return o(s.lastIndex,l)||(s.lastIndex=l),null===u?-1:u.index}]})},function(t,e,n){"use strict";var r=n(79),o=n(3),i=n(47),a=n(87),s=n(6),c=n(55),l=n(86),u=n(2),d=Math.min,f=[].push,p=!u(function(){RegExp(4294967295,"y")});n(56)("split",2,function(t,e,n,u){var g;return g="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var o=String(this);if(void 0===t&&0===e)return[];if(!r(t))return n.call(o,t,e);for(var i,a,s,c=[],u=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,p=void 0===e?4294967295:e>>>0,g=new RegExp(t.source,u+"g");(i=l.call(g,o))&&!((a=g.lastIndex)>d&&(c.push(o.slice(d,i.index)),i.length>1&&i.index=p));)g.lastIndex===i.index&&g.lastIndex++;return d===o.length?!s&&g.test("")||c.push(""):c.push(o.slice(d)),c.length>p?c.slice(0,p):c}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:n.call(this,t,e)}:n,[function(n,r){var o=t(this),i=null==n?void 0:n[e];return void 0!==i?i.call(n,o,r):g.call(String(o),n,r)},function(t,e){var r=u(g,t,this,e,g!==n);if(r.done)return r.value;var l=o(t),f=String(this),h=i(l,RegExp),v=l.unicode,m=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(p?"y":"g"),y=new h(p?l:"^(?:"+l.source+")",m),_=void 0===e?4294967295:e>>>0;if(0===_)return[];if(0===f.length)return null===c(y,f)?[f]:[];for(var x=0,b=0,w=[];b0?arguments[0]:void 0)}},{get:function(t){var e=r.getEntry(o(this,"Map"),t);return e&&e.v},set:function(t,e){return r.def(o(this,"Map"),0===t?0:t,e)}},r,!0)},function(t,e,n){"use strict";var r=n(125),o=n(37);t.exports=n(59)("Set",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return r.def(o(this,"Set"),t=0===t?0:t,t)}},r)},function(t,e,n){"use strict";var r,o=n(1),i=n(21)(0),a=n(10),s=n(28),c=n(106),l=n(126),u=n(4),d=n(37),f=n(37),p=!o.ActiveXObject&&"ActiveXObject"in o,g=s.getWeak,h=Object.isExtensible,v=l.ufstore,m=function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},y={get:function(t){if(u(t)){var e=g(t);return!0===e?v(d(this,"WeakMap")).get(t):e?e[this._i]:void 0}},set:function(t,e){return l.def(d(this,"WeakMap"),t,e)}},_=t.exports=n(59)("WeakMap",m,y,l,!0,!0);f&&p&&(c((r=l.getConstructor(m,"WeakMap")).prototype,y),s.NEED=!0,i(["delete","has","get","set"],function(t){var e=_.prototype,n=e[t];a(e,t,function(e,o){if(u(e)&&!h(e)){this._f||(this._f=new r);var i=this._f[t](e,o);return"set"==t?this:i}return n.call(this,e,o)})}))},function(t,e,n){"use strict";var r=n(126),o=n(37);n(59)("WeakSet",function(t){return function(){return t(this,arguments.length>0?arguments[0]:void 0)}},{add:function(t){return r.def(o(this,"WeakSet"),t,!0)}},r,!1,!0)},function(t,e,n){"use strict";var r=n(0),o=n(60),i=n(89),a=n(3),s=n(33),c=n(6),l=n(4),u=n(1).ArrayBuffer,d=n(47),f=i.ArrayBuffer,p=i.DataView,g=o.ABV&&u.isView,h=f.prototype.slice,v=o.VIEW;r(r.G+r.W+r.F*(u!==f),{ArrayBuffer:f}),r(r.S+r.F*!o.CONSTR,"ArrayBuffer",{isView:function(t){return g&&g(t)||l(t)&&v in t}}),r(r.P+r.U+r.F*n(2)(function(){return!new f(2).slice(1,void 0).byteLength}),"ArrayBuffer",{slice:function(t,e){if(void 0!==h&&void 0===e)return h.call(a(this),t);for(var n=a(this).byteLength,r=s(t,n),o=s(void 0===e?n:e,n),i=new(d(this,f))(c(o-r)),l=new p(this),u=new p(i),g=0;r=e.length)return{value:void 0,done:!0}}while(!((t=e[this._i++])in this._t));return{value:t,done:!1}}),r(r.S,"Reflect",{enumerate:function(t){return new i(t)}})},function(t,e,n){var r=n(19),o=n(36),i=n(14),a=n(0),s=n(4),c=n(3);a(a.S,"Reflect",{get:function t(e,n){var a,l,u=arguments.length<3?e:arguments[2];return c(e)===u?e[n]:(a=r.f(e,n))?i(a,"value")?a.value:void 0!==a.get?a.get.call(u):void 0:s(l=o(e))?t(l,n,u):void 0}})},function(t,e,n){var r=n(19),o=n(0),i=n(3);o(o.S,"Reflect",{getOwnPropertyDescriptor:function(t,e){return r.f(i(t),e)}})},function(t,e,n){var r=n(0),o=n(36),i=n(3);r(r.S,"Reflect",{getPrototypeOf:function(t){return o(i(t))}})},function(t,e,n){var r=n(0);r(r.S,"Reflect",{has:function(t,e){return e in t}})},function(t,e,n){var r=n(0),o=n(3),i=Object.isExtensible;r(r.S,"Reflect",{isExtensible:function(t){return o(t),!i||i(t)}})},function(t,e,n){var r=n(0);r(r.S,"Reflect",{ownKeys:n(128)})},function(t,e,n){var r=n(0),o=n(3),i=Object.preventExtensions;r(r.S,"Reflect",{preventExtensions:function(t){o(t);try{return i&&i(t),!0}catch(t){return!1}}})},function(t,e,n){var r=n(7),o=n(19),i=n(36),a=n(14),s=n(0),c=n(29),l=n(3),u=n(4);s(s.S,"Reflect",{set:function t(e,n,s){var d,f,p=arguments.length<4?e:arguments[3],g=o.f(l(e),n);if(!g){if(u(f=i(e)))return t(f,n,s,p);g=c(0)}if(a(g,"value")){if(!1===g.writable||!u(p))return!1;if(d=o.f(p,n)){if(d.get||d.set||!1===d.writable)return!1;d.value=s,r.f(p,n,d)}else r.f(p,n,c(0,s));return!0}return void 0!==g.set&&(g.set.call(p,s),!0)}})},function(t,e,n){var r=n(0),o=n(70);o&&r(r.S,"Reflect",{setPrototypeOf:function(t,e){o.check(t,e);try{return o.set(t,e),!0}catch(t){return!1}}})},function(t,e,n){n(319),t.exports=n(9).Array.includes},function(t,e,n){"use strict";var r=n(0),o=n(50)(!0);r(r.P,"Array",{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),n(40)("includes")},function(t,e,n){n(321),t.exports=n(9).String.padStart},function(t,e,n){"use strict";var r=n(0),o=n(129),i=n(58),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!0)}})},function(t,e,n){n(323),t.exports=n(9).String.padEnd},function(t,e,n){"use strict";var r=n(0),o=n(129),i=n(58),a=/Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(i);r(r.P+r.F*a,"String",{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0,!1)}})},function(t,e,n){n(325),t.exports=n(65).f("asyncIterator")},function(t,e,n){n(102)("asyncIterator")},function(t,e,n){n(327),t.exports=n(9).Object.getOwnPropertyDescriptors},function(t,e,n){var r=n(0),o=n(128),i=n(16),a=n(19),s=n(82);r(r.S,"Object",{getOwnPropertyDescriptors:function(t){for(var e,n,r=i(t),c=a.f,l=o(r),u={},d=0;l.length>d;)void 0!==(n=c(r,e=l[d++]))&&s(u,e,n);return u}})},function(t,e,n){n(329),t.exports=n(9).Object.values},function(t,e,n){var r=n(0),o=n(130)(!1);r(r.S,"Object",{values:function(t){return o(t)}})},function(t,e,n){n(331),t.exports=n(9).Object.entries},function(t,e,n){var r=n(0),o=n(130)(!0);r(r.S,"Object",{entries:function(t){return o(t)}})},function(t,e,n){"use strict";n(122),n(333),t.exports=n(9).Promise.finally},function(t,e,n){"use strict";var r=n(0),o=n(9),i=n(1),a=n(47),s=n(124);r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},function(t,e,n){n(335),n(336),n(337),t.exports=n(9)},function(t,e,n){var r=n(1),o=n(0),i=n(58),a=[].slice,s=/MSIE .\./.test(i),c=function(t){return function(e,n){var r=arguments.length>2,o=!!r&&a.call(arguments,2);return t(r?function(){("function"==typeof e?e:Function(e)).apply(this,o)}:e,n)}};o(o.G+o.B+o.F*s,{setTimeout:c(r.setTimeout),setInterval:c(r.setInterval)})},function(t,e,n){var r=n(0),o=n(88);r(r.G+r.B,{setImmediate:o.set,clearImmediate:o.clear})},function(t,e,n){for(var r=n(85),o=n(32),i=n(10),a=n(1),s=n(15),c=n(39),l=n(5),u=l("iterator"),d=l("toStringTag"),f=c.Array,p={CSSRuleList:!0,CSSStyleDeclaration:!1,CSSValueList:!1,ClientRectList:!1,DOMRectList:!1,DOMStringList:!1,DOMTokenList:!0,DataTransferItemList:!1,FileList:!1,HTMLAllCollection:!1,HTMLCollection:!1,HTMLFormElement:!1,HTMLSelectElement:!1,MediaList:!0,MimeTypeArray:!1,NamedNodeMap:!1,NodeList:!0,PaintRequestList:!1,Plugin:!1,PluginArray:!1,SVGLengthList:!1,SVGNumberList:!1,SVGPathSegList:!1,SVGPointList:!1,SVGStringList:!1,SVGTransformList:!1,SourceBufferList:!1,StyleSheetList:!0,TextTrackCueList:!1,TextTrackList:!1,TouchList:!1},g=o(p),h=0;h=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),l=o.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),O(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),h}}}function x(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(t,e,n){var r=d;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===g){if("throw"===o)throw i;return I()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=P(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=b(t,e,n);if("normal"===c.type){if(r=n.done?g:f,c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=g,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function b(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function w(){}function S(){}function A(){}function j(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var s=b(t[n],t,r);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&o.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(l).then(function(t){c.value=t,i(c)},function(t){return e("throw",t,i,a)})}a(s.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function P(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,P(t,e),"throw"===e.method))return h;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=b(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function O(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r0?O+L:""}},function(t,e,n){"use strict";var r=n(131),o=Object.prototype.hasOwnProperty,i={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,decoder:r.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},a=function(t){return t.replace(/(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},s=function(t,e,n){if(t){var r=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),s=a?r.slice(0,a.index):r,c=[];if(s){if(!n.plainObjects&&o.call(Object.prototype,s)&&!n.allowPrototypes)return;c.push(s)}for(var l=0;null!==(a=i.exec(r))&&l=0;--o){var i,a=t[o];if("[]"===a&&n.parseArrays)i=[].concat(r);else{i=n.plainObjects?Object.create(null):{};var s="["===a.charAt(0)&&"]"===a.charAt(a.length-1)?a.slice(1,-1):a,c=parseInt(s,10);n.parseArrays||""!==s?!isNaN(c)&&a!==s&&String(c)===s&&c>=0&&n.parseArrays&&c<=n.arrayLimit?(i=[])[c]=r:i[s]=r:i={0:r}}r=i}return r}(c,e,n)}};t.exports=function(t,e){var n=e?r.assign({},e):{};if(null!==n.decoder&&void 0!==n.decoder&&"function"!=typeof n.decoder)throw new TypeError("Decoder has to be a function.");if(n.ignoreQueryPrefix=!0===n.ignoreQueryPrefix,n.delimiter="string"==typeof n.delimiter||r.isRegExp(n.delimiter)?n.delimiter:i.delimiter,n.depth="number"==typeof n.depth?n.depth:i.depth,n.arrayLimit="number"==typeof n.arrayLimit?n.arrayLimit:i.arrayLimit,n.parseArrays=!1!==n.parseArrays,n.decoder="function"==typeof n.decoder?n.decoder:i.decoder,n.allowDots=void 0===n.allowDots?i.allowDots:!!n.allowDots,n.plainObjects="boolean"==typeof n.plainObjects?n.plainObjects:i.plainObjects,n.allowPrototypes="boolean"==typeof n.allowPrototypes?n.allowPrototypes:i.allowPrototypes,n.parameterLimit="number"==typeof n.parameterLimit?n.parameterLimit:i.parameterLimit,n.strictNullHandling="boolean"==typeof n.strictNullHandling?n.strictNullHandling:i.strictNullHandling,void 0!==n.charset&&"utf-8"!==n.charset&&"iso-8859-1"!==n.charset)throw new Error("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0===n.charset&&(n.charset=i.charset),""===t||null==t)return n.plainObjects?Object.create(null):{};for(var c="string"==typeof t?function(t,e){var n,s={},c=e.ignoreQueryPrefix?t.replace(/^\?/,""):t,l=e.parameterLimit===1/0?void 0:e.parameterLimit,u=c.split(e.delimiter,l),d=-1,f=e.charset;if(e.charsetSentinel)for(n=0;n https://better-than-ever.com/wp-content/plugins/js_composer/assets/js/dist/js_composer_front.min.js?ver=5.0.1
function vc_js(){vc_toggleBehaviour(),vc_tabsBehaviour(),vc_accordionBehaviour(),vc_teaserGrid(),vc_carouselBehaviour(),vc_slidersBehaviour(),vc_prettyPhoto(),vc_googleplus(),vc_pinterest(),vc_progress_bar(),vc_plugin_flexslider(),vc_google_fonts(),vc_gridBehaviour(),vc_rowBehaviour(),vc_googleMapsPointer(),vc_ttaActivation(),jQuery(document).trigger("vc_js"),window.setTimeout(vc_waypoints,500)}function getSizeName(){var screen_w=jQuery(window).width();return 1170screen_w?"desktop":768screen_w?"tablet":300screen_w?"mobile":300>screen_w?"mobile_portrait":""}function loadScript(url,$obj,callback){var script=document.createElement("script");script.type="text/javascript",script.readyState&&(script.onreadystatechange=function(){"loaded"!==script.readyState&&"complete"!==script.readyState||(script.onreadystatechange=null,callback())}),script.src=url,$obj.get(0).appendChild(script)}function vc_ttaActivation(){jQuery("[data-vc-accordion]").on("show.vc.accordion",function(e){var $=window.jQuery,ui={};ui.newPanel=$(this).data("vc.accordion").getTarget(),window.wpb_prepare_tab_content(e,ui)})}function vc_accordionActivate(event,ui){if(ui.newPanel.length&&ui.newHeader.length){var $pie_charts=ui.newPanel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=ui.newPanel.find(".vc_round-chart"),$line_charts=ui.newPanel.find(".vc_line-chart"),$carousel=ui.newPanel.find('[data-ride="vc_carousel"]');"undefined"!=typeof jQuery.fn.isotope&&ui.newPanel.find(".isotope, .wpb_image_grid_ul").isotope("layout"),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),vc_carouselBehaviour(ui.newPanel),vc_plugin_flexslider(ui.newPanel),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),ui.newPanel.parents(".isotope").length&&ui.newPanel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}}function initVideoBackgrounds(){return window.console&&window.console.warn&&window.console.warn("this function is deprecated use vc_initVideoBackgrounds"),vc_initVideoBackgrounds()}function vc_initVideoBackgrounds(){jQuery("[data-vc-video-bg]").each(function(){var youtubeUrl,youtubeId,$element=jQuery(this);$element.data("vcVideoBg")?(youtubeUrl=$element.data("vcVideoBg"),youtubeId=vcExtractYoutubeId(youtubeUrl),youtubeId&&($element.find(".vc_video-bg").remove(),insertYoutubeVideoAsBackground($element,youtubeId)),jQuery(window).on("grid:items:added",function(event,$grid){$element.has($grid).length&&vcResizeVideoBackground($element)})):$element.find(".vc_video-bg").remove()})}function insertYoutubeVideoAsBackground($element,youtubeId,counter){if("undefined"==typeof YT||"undefined"==typeof YT.Player)return counter="undefined"==typeof counter?0:counter,100
').find(".inner");new YT.Player($container[0],{width:"100%",height:"100%",videoId:youtubeId,playerVars:{playlist:youtubeId,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1,wmode:"transparent"},events:{onReady:function(event){event.target.mute().setLoop(!0)}}}),vcResizeVideoBackground($element),jQuery(window).bind("resize",function(){vcResizeVideoBackground($element)})}function vcResizeVideoBackground($element){var iframeW,iframeH,marginLeft,marginTop,containerW=$element.innerWidth(),containerH=$element.innerHeight(),ratio1=16,ratio2=9;containerW/containerHparseInt(ver[1]);$call.each(function(index){var $tabs,interval=jQuery(this).attr("data-interval"),tabs_array=[];if($tabs=jQuery(this).find(".wpb_tour_tabs_wrapper").tabs({show:function(event,ui){wpb_prepare_tab_content(event,ui)},beforeActivate:function(event,ui){1!==ui.newPanel.index()&&ui.newPanel.find(".vc_pie_chart:not(.vc_ready)")},activate:function(event,ui){wpb_prepare_tab_content(event,ui)}}),interval&&0index?index=$tabs.tabs("length")-1:index>=$tabs.tabs("length")&&(index=0),$tabs.tabs("select",index)}else{var index=$tabs.tabs("option","active"),length=$tabs.find(".wpb_tab").length;index=jQuery(this).parent().hasClass("wpb_next_slide")?index+1>=length?0:index+1:0>index-1?length-1:index-1,$tabs.tabs("option","active",index)}})})}}),"function"!=typeof window.vc_accordionBehaviour&&(window.vc_accordionBehaviour=function(){jQuery(".wpb_accordion").each(function(index){var $tabs,$this=jQuery(this),active_tab=($this.attr("data-interval"),!isNaN(jQuery(this).data("active-tab"))&&0 div > h3",autoHeight:!1,heightStyle:"content",active:active_tab,collapsible:collapsible,navigation:!0,activate:vc_accordionActivate,change:function(event,ui){"undefined"!=typeof jQuery.fn.isotope&&ui.newContent.find(".isotope").isotope("layout"),vc_carouselBehaviour(ui.newPanel)}}),!0===$this.data("vcDisableKeydown")&&($tabs.data("uiAccordion")._keydown=function(){})})}),"function"!=typeof window.vc_teaserGrid&&(window.vc_teaserGrid=function(){var layout_modes={fitrows:"fitRows",masonry:"masonry"};jQuery(".wpb_grid .teaser_grid_container:not(.wpb_carousel), .wpb_filtered_grid .teaser_grid_container:not(.wpb_carousel)").each(function(){var $container=jQuery(this),$thumbs=$container.find(".wpb_thumbnails"),layout_mode=$thumbs.attr("data-layout-mode");$thumbs.isotope({itemSelector:".isotope-item",layoutMode:"undefined"==typeof layout_modes[layout_mode]?"fitRows":layout_modes[layout_mode]}),$container.find(".categories_filter a").data("isotope",$thumbs).click(function(e){e.preventDefault();var $thumbs=jQuery(this).data("isotope");jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"),$thumbs.isotope({filter:jQuery(this).attr("data-filter")})}),jQuery(window).bind("load resize",function(){$thumbs.isotope("layout")})})}),"function"!=typeof window.vc_carouselBehaviour&&(window.vc_carouselBehaviour=function($parent){var $carousel=$parent?$parent.find(".wpb_carousel"):jQuery(".wpb_carousel");$carousel.each(function(){var $this=jQuery(this);if(!0!==$this.data("carousel_enabled")&&$this.is(":visible")){$this.data("carousel_enabled",!0);var carousel_speed=(getColumnsCount(jQuery(this)),500);jQuery(this).hasClass("columns_count_1")&&(carousel_speed=900);var carousele_li=jQuery(this).find(".wpb_thumbnails-fluid li");carousele_li.css({"margin-right":carousele_li.css("margin-left"),"margin-left":0});var fluid_ul=jQuery(this).find("ul.wpb_thumbnails-fluid");fluid_ul.width(fluid_ul.width()+300),jQuery(window).resize(function(){var before_resize=screen_size;screen_size=getSizeName(),before_resize!=screen_size&&window.setTimeout("location.reload()",20)})}})}),"function"!=typeof window.vc_slidersBehaviour&&(window.vc_slidersBehaviour=function(){jQuery(".wpb_gallery_slides").each(function(index){var $imagesGrid,this_element=jQuery(this);if(this_element.hasClass("wpb_slider_nivo")){var sliderSpeed=800,sliderTimeout=1e3*this_element.attr("data-interval");0===sliderTimeout&&(sliderTimeout=9999999999),this_element.find(".nivoSlider").nivoSlider({effect:"boxRainGrow,boxRain,boxRainReverse,boxRainGrowReverse",slices:15,boxCols:8,boxRows:4,animSpeed:sliderSpeed,pauseTime:sliderTimeout,startSlide:0,directionNav:!0,directionNavHide:!0,controlNav:!0,keyboardNav:!1,pauseOnHover:!0,manualAdvance:!1,prevText:"Prev",nextText:"Next"})}else this_element.hasClass("wpb_image_grid")&&(jQuery.fn.imagesLoaded?$imagesGrid=this_element.find(".wpb_image_grid_ul").imagesLoaded(function(){$imagesGrid.isotope({itemSelector:".isotope-item",layoutMode:"fitRows"})}):this_element.find(".wpb_image_grid_ul").isotope({itemSelector:".isotope-item",layoutMode:"fitRows"}))})}),"function"!=typeof window.vc_prettyPhoto&&(window.vc_prettyPhoto=function(){try{jQuery&&jQuery.fn&&jQuery.fn.prettyPhoto&&jQuery('a.prettyphoto, .gallery-icon a[href*=".jpg"]').prettyPhoto({animationSpeed:"normal",hook:"data-rel",padding:15,opacity:.7,showTitle:!0,allowresize:!0,counter_separator_label:"/",hideflash:!1,deeplinking:!1,modal:!1,callback:function(){var url=location.href;url.indexOf("#!prettyPhoto")>-1&&(location.hash="")},social_tools:""})}catch(err){window.console&&window.console.log&&console.log(err)}}),"function"!=typeof window.vc_google_fonts&&(window.vc_google_fonts=function(){return!1}),window.vcParallaxSkroll=!1,"function"!=typeof window.vc_rowBehaviour&&(window.vc_rowBehaviour=function(){function fullWidthRow(){var $elements=$('[data-vc-full-width="true"]');$.each($elements,function(key,item){var $el=$(this);$el.addClass("vc_hidden");var $el_full=$el.next(".vc_row-full-width");if($el_full.length||($el_full=$el.parent().next(".vc_row-full-width")),$el_full.length){var el_margin_left=parseInt($el.css("margin-left"),10),el_margin_right=parseInt($el.css("margin-right"),10),offset=0-$el_full.offset().left-el_margin_left,width=$(window).width();if($el.css({position:"relative",left:offset,"box-sizing":"border-box",width:$(window).width()}),!$el.data("vcStretchContent")){var padding=-1*offset;0>padding&&(padding=0);var paddingRight=width-padding-$el_full.width()+el_margin_left+el_margin_right;0>paddingRight&&(paddingRight=0),$el.css({"padding-left":padding+"px","padding-right":paddingRight+"px"})}$el.attr("data-vc-full-width-init","true"),$el.removeClass("vc_hidden"),$(document).trigger("vc-full-width-row-single",{el:$el,offset:offset,marginLeft:el_margin_left,marginRight:el_margin_right,elFull:$el_full,width:width})}}),$(document).trigger("vc-full-width-row",$elements)}function parallaxRow(){var vcSkrollrOptions,callSkrollInit=!1;return window.vcParallaxSkroll&&window.vcParallaxSkroll.destroy(),$(".vc_parallax-inner").remove(),$("[data-5p-top-bottom]").removeAttr("data-5p-top-bottom data-30p-top-bottom"),$("[data-vc-parallax]").each(function(){var skrollrSpeed,skrollrSize,skrollrStart,skrollrEnd,$parallaxElement,parallaxImage,youtubeId;callSkrollInit=!0,"on"===$(this).data("vcParallaxOFade")&&$(this).children().attr("data-5p-top-bottom","opacity:0;").attr("data-30p-top-bottom","opacity:1;"),skrollrSize=100*$(this).data("vcParallax"),$parallaxElement=$("
").addClass("vc_parallax-inner").appendTo($(this)),$parallaxElement.height(skrollrSize+"%"),parallaxImage=$(this).data("vcParallaxImage"),youtubeId=vcExtractYoutubeId(parallaxImage),youtubeId?insertYoutubeVideoAsBackground($parallaxElement,youtubeId):"undefined"!=typeof parallaxImage&&$parallaxElement.css("background-image","url("+parallaxImage+")"),skrollrSpeed=skrollrSize-100,skrollrStart=-skrollrSpeed,skrollrEnd=0,$parallaxElement.attr("data-bottom-top","top: "+skrollrStart+"%;").attr("data-top-bottom","top: "+skrollrEnd+"%;")}),!(!callSkrollInit||!window.skrollr)&&(vcSkrollrOptions={forceHeight:!1,smoothScrolling:!1,mobileCheck:function(){return!1}},window.vcParallaxSkroll=skrollr.init(vcSkrollrOptions),window.vcParallaxSkroll)}function fullHeightRow(){var $element=$(".vc_row-o-full-height:first");if($element.length){var $window,windowHeight,offsetTop,fullHeight;$window=$(window),windowHeight=$window.height(),offsetTop=$element.offset().top,offsetTop0||navigator.userAgent.match(/Trident.*rv\:11\./))&&$(".vc_row-o-full-height").each(function(){"flex"===$(this).css("display")&&$(this).wrap('
')})}var $=window.jQuery;$(window).off("resize.vcRowBehaviour").on("resize.vcRowBehaviour",fullWidthRow).on("resize.vcRowBehaviour",fullHeightRow),fullWidthRow(),fullHeightRow(),fixIeFlexbox(),vc_initVideoBackgrounds(),parallaxRow()}),"function"!=typeof window.vc_gridBehaviour&&(window.vc_gridBehaviour=function(){jQuery.fn.vcGrid&&jQuery("[data-vc-grid]").vcGrid()}),"function"!=typeof window.getColumnsCount&&(window.getColumnsCount=function(el){for(var find=!1,i=1;!1===find;){if(el.hasClass("columns_count_"+i))return find=!0,i;i++}});var screen_size=getSizeName();"function"!=typeof window.wpb_prepare_tab_content&&(window.wpb_prepare_tab_content=function(event,ui){var $ui_panel,$google_maps,panel=ui.panel||ui.newPanel,$pie_charts=panel.find(".vc_pie_chart:not(.vc_ready)"),$round_charts=panel.find(".vc_round-chart"),$line_charts=panel.find(".vc_line-chart"),$carousel=panel.find('[data-ride="vc_carousel"]');if(vc_carouselBehaviour(),vc_plugin_flexslider(panel),ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&ui.newPanel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),panel.find(".vc_masonry_media_grid, .vc_masonry_grid").length&&panel.find(".vc_masonry_media_grid, .vc_masonry_grid").each(function(){var grid=jQuery(this).data("vcGrid");grid&&grid.gridBuilder&&grid.gridBuilder.setMasonry&&grid.gridBuilder.setMasonry()}),$pie_charts.length&&jQuery.fn.vcChat&&$pie_charts.vcChat(),$round_charts.length&&jQuery.fn.vcRoundChart&&$round_charts.vcRoundChart({reload:!1}),$line_charts.length&&jQuery.fn.vcLineChart&&$line_charts.vcLineChart({reload:!1}),$carousel.length&&jQuery.fn.carousel&&$carousel.carousel("resizeAction"),$ui_panel=panel.find(".isotope, .wpb_image_grid_ul"),$google_maps=panel.find(".wpb_gmaps_widget"),0<$ui_panel.length&&$ui_panel.isotope("layout"),$google_maps.length&&!$google_maps.is(".map_ready")){var $frame=$google_maps.find("iframe");$frame.attr("src",$frame.attr("src")),$google_maps.addClass("map_ready")}panel.parents(".isotope").length&&panel.parents(".isotope").each(function(){jQuery(this).isotope("layout")})}),"function"!=typeof window.vc_googleMapsPointer,jQuery(document).ready(function($){window.vc_js()});
// source --> https://better-than-ever.com/wp-includes/js/jquery/ui/core.min.js?ver=1.11.4
/*!
* jQuery UI Core 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(a){var e,t,n,i;function r(e,t){var n,i,r=e.nodeName.toLowerCase();return"area"===r?(i=(n=e.parentNode).name,!(!e.href||!i||"map"!==n.nodeName.toLowerCase())&&(!!(i=a("img[usemap='#"+i+"']")[0])&&o(i))):(/^(input|select|textarea|button|object)$/.test(r)?!e.disabled:"a"===r&&e.href||t)&&o(e)}function o(e){return a.expr.filters.visible(e)&&!a(e).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(e){var t=this.css("position"),n="absolute"===t,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,e=this.parents().filter(function(){var e=a(this);return(!n||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==t&&e.length?e:a(this[0].ownerDocument||document)},uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(t){return function(e){return!!a.data(e,t)}}):function(e,t,n){return!!a.data(e,n[3])},focusable:function(e){return r(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(e){var t=a.attr(e,"tabindex"),n=isNaN(t);return(n||0<=t)&&r(e,!n)}}),a("").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 https://better-than-ever.com/wp-includes/js/jquery/ui/widget.min.js?ver=1.11.4
/*!
* jQuery UI Widget 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(d){var s,i=0,a=Array.prototype.slice;return d.cleanData=(s=d.cleanData,function(t){for(var e,i,n=0;null!=(i=t[n]);n++)try{(e=d._data(i,"events"))&&e.remove&&d(i).triggerHandler("remove")}catch(t){}s(t)}),d.widget=function(t,i,e){var n,s,o,r,a={},u=t.split(".")[0];return t=t.split(".")[1],n=u+"-"+t,e||(e=i,i=d.Widget),d.expr[":"][n.toLowerCase()]=function(t){return!!d.data(t,n)},d[u]=d[u]||{},s=d[u][t],o=d[u][t]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},d.extend(o,s,{version:e.version,_proto:d.extend({},e),_childConstructors:[]}),(r=new i).options=d.widget.extend({},r.options),d.each(e,function(e,n){function s(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}d.isFunction(n)?a[e]=function(){var t,e=this._super,i=this._superApply;return this._super=s,this._superApply=o,t=n.apply(this,arguments),this._super=e,this._superApply=i,t}:a[e]=n}),o.prototype=d.widget.extend(r,{widgetEventPrefix:s&&r.widgetEventPrefix||t},a,{constructor:o,namespace:u,widgetName:t,widgetFullName:n}),s?(d.each(s._childConstructors,function(t,e){var i=e.prototype;d.widget(i.namespace+"."+i.widgetName,o,e._proto)}),delete s._childConstructors):i._childConstructors.push(o),d.widget.bridge(t,o),o},d.widget.extend=function(t){for(var e,i,n=a.call(arguments,1),s=0,o=n.length;s",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 https://better-than-ever.com/wp-includes/js/jquery/ui/tabs.min.js?ver=1.11.4
/*!
* jQuery UI Tabs 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/tabs/
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery","./core","./widget"],t):t(jQuery)}(function(l){return l.widget("ui.tabs",{version:"1.11.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(a=/#.*$/,function(t){var e=(t=t.cloneNode(!1)).href.replace(a,""),i=location.href.replace(a,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=l.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!l.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=l()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=l()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var o=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist").delegate("> li","mousedown"+this.eventNamespace,function(t){l(this).is(".ui-state-disabled")&&t.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){l(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return l("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=l(),this.anchors.each(function(t,e){var i,a,s,n=l(e).uniqueId().attr("id"),r=l(e).closest("li"),h=r.attr("aria-controls");o._isLocal(e)?(s=(i=e.hash).substring(1),a=o.element.find(o._sanitizeSelector(i))):(i="#"+(s=r.attr("aria-controls")||l({}).uniqueId()[0].id),(a=o.element.find(i)).length||(a=o._createPanel(s)).insertAfter(o.panels[t-1]||o.tablist),a.attr("aria-live","polite")),a.length&&(o.panels=o.panels.add(a)),h&&r.data("ui-tabs-aria-controls",h),r.attr({"aria-controls":s,"aria-labelledby":n}),a.attr("aria-labelledby",n)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(t){return l("").attr("id",t).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(t){l.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1);for(var e,i=0;e=this.tabs[i];i++)!0===t||-1!==l.inArray(i,t)?l(e).addClass("ui-state-disabled").attr("aria-disabled","true"):l(e).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=t},_setupEvents:function(t){var i={};t&&l.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=l(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=l(this).outerHeight(!0)}),this.panels.each(function(){l(this).height(Math.max(0,i-l(this).innerHeight()+l(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,l(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,a=l(t.currentTarget).closest("li"),s=a[0]===i[0],n=s&&e.collapsible,r=n?l():this._getPanelForTab(a),h=i.length?this._getPanelForTab(i):l(),i={oldTab:i,oldPanel:h,newTab:n?l():a,newPanel:r};t.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||s&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!n&&this.tabs.index(a),this.active=s?l():a,this.xhr&&this.xhr.abort(),h.length||r.length||l.error("jQuery UI Tabs: Mismatching fragment identifier."),r.length&&this.load(this.tabs.index(a),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,a=e.newPanel,s=e.oldPanel;function n(){i.running=!1,i._trigger("activate",t,e)}function r(){e.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&i.options.show?i._show(a,i.options.show,n):(a.show(),n())}this.running=!0,s.length&&this.options.hide?this._hide(s,this.options.hide,function(){e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r()}):(e.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),s.hide(),r()),s.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&s.length?e.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===l(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=!t.length?this.active:t).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:l.noop}))},_findActive:function(t){return!1===t?l():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+t+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tablist.unbind(this.eventNamespace),this.tabs.add(this.panels).each(function(){l.data(this,"ui-tabs-destroy")?l(this).remove():l(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var t=l(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),l.isArray(t)?l.map(t,function(t){return t!==i?t:null}):l.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==l.inArray(t,e))return;e=l.isArray(e)?l.merge([t],e).sort():[t]}this._setupDisabled(e)}},load:function(t,a){t=this._getIndex(t);function s(t,e){"abort"===e&&n.panels.stop(!1,!0),i.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr}var n=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),r=this._getPanelForTab(i),h={tab:i,panel:r};this._isLocal(t[0])||(this.xhr=l.ajax(this._ajaxSettings(t,a,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(i.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){r.html(t),n._trigger("load",a,h),s(i,e)},1)}).fail(function(t,e){setTimeout(function(){s(t,e)},1)})))},_ajaxSettings:function(t,i,a){var s=this;return{url:t.attr("href"),beforeSend:function(t,e){return s._trigger("beforeLoad",i,l.extend({jqXHR:t,ajaxSettings:e},a))}}},_getPanelForTab:function(t){t=l(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+t))}});var a});
// source --> https://better-than-ever.com/wp-content/plugins/js_composer/assets/lib/bower/jquery-ui-tabs-rotate/jquery-ui-tabs-rotate.min.js?ver=5.0.1
!function($){$.extend($.ui.tabs.prototype,{rotation:null,rotationDelay:null,continuing:null,rotate:function(ms,continuing){var self=this,o=this.options;(ms>1||null===self.rotationDelay)&&void 0!==ms&&(self.rotationDelay=ms),void 0!==continuing&&(self.continuing=continuing);var rotate=self._rotate||(self._rotate=function(e){clearTimeout(self.rotation),self.rotation=setTimeout(function(){var t=o.active;self.option("active",++t
https://better-than-ever.com/wp-content/plugins/vibe-course-module/includes/js/course-module-js.min.js?ver=1.9.6
/*
html2canvas 0.5.0-alpha1
Copyright (c) 2015 Niklas von Hertzen
Released under MIT License
*/
(function(window, document, exports, global, define, undefined){
/*!
* @overview es6-promise - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/jakearchibald/es6-promise/master/LICENSE
* @version 2.0.1
*/
(function(){function r(a,b){n[l]=a;n[l+1]=b;l+=2;2===l&&A()}function s(a){return"function"===typeof a}function F(){return function(){process.nextTick(t)}}function G(){var a=0,b=new B(t),c=document.createTextNode("");b.observe(c,{characterData:!0});return function(){c.data=a=++a%2}}function H(){var a=new MessageChannel;a.port1.onmessage=t;return function(){a.port2.postMessage(0)}}function I(){return function(){setTimeout(t,1)}}function t(){for(var a=0;a= 0x80 (not a basic code point)',
'invalid-input': 'Invalid input'
},
/** Convenience shortcuts */
baseMinusTMin = base - tMin,
floor = Math.floor,
stringFromCharCode = String.fromCharCode,
/** Temporary variable */
key;
/*--------------------------------------------------------------------------*/
/**
* A generic error utility function.
* @private
* @param {String} type The error type.
* @returns {Error} Throws a `RangeError` with the applicable error message.
*/
function error(type) {
throw RangeError(errors[type]);
}
/**
* A generic `Array#map` utility function.
* @private
* @param {Array} array The array to iterate over.
* @param {Function} callback The function that gets called for every array
* item.
* @returns {Array} A new array of values returned by the callback function.
*/
function map(array, fn) {
var length = array.length;
var result = [];
while (length--) {
result[length] = fn(array[length]);
}
return result;
}
/**
* A simple `Array#map`-like wrapper to work with domain name strings or email
* addresses.
* @private
* @param {String} domain The domain name or email address.
* @param {Function} callback The function that gets called for every
* character.
* @returns {Array} A new string of characters returned by the callback
* function.
*/
function mapDomain(string, fn) {
var parts = string.split('@');
var result = '';
if (parts.length > 1) {
// In email addresses, only the domain name should be punycoded. Leave
// the local part (i.e. everything up to `@`) intact.
result = parts[0] + '@';
string = parts[1];
}
var labels = string.split(regexSeparators);
var encoded = map(labels, fn).join('.');
return result + encoded;
}
/**
* Creates an array containing the numeric code points of each Unicode
* character in the string. While JavaScript uses UCS-2 internally,
* this function will convert a pair of surrogate halves (each of which
* UCS-2 exposes as separate characters) into a single code point,
* matching UTF-16.
* @see `punycode.ucs2.encode`
* @see
* @memberOf punycode.ucs2
* @name decode
* @param {String} string The Unicode input string (UCS-2).
* @returns {Array} The new array of code points.
*/
function ucs2decode(string) {
var output = [],
counter = 0,
length = string.length,
value,
extra;
while (counter < length) {
value = string.charCodeAt(counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// high surrogate, and there is a next character
extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) { // low surrogate
output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
// unmatched surrogate; only append this code unit, in case the next
// code unit is the high surrogate of a surrogate pair
output.push(value);
counter--;
}
} else {
output.push(value);
}
}
return output;
}
/**
* Creates a string based on an array of numeric code points.
* @see `punycode.ucs2.decode`
* @memberOf punycode.ucs2
* @name encode
* @param {Array} codePoints The array of numeric code points.
* @returns {String} The new Unicode string (UCS-2).
*/
function ucs2encode(array) {
return map(array, function(value) {
var output = '';
if (value > 0xFFFF) {
value -= 0x10000;
output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
value = 0xDC00 | value & 0x3FF;
}
output += stringFromCharCode(value);
return output;
}).join('');
}
/**
* Converts a basic code point into a digit/integer.
* @see `digitToBasic()`
* @private
* @param {Number} codePoint The basic numeric code point value.
* @returns {Number} The numeric value of a basic code point (for use in
* representing integers) in the range `0` to `base - 1`, or `base` if
* the code point does not represent a value.
*/
function basicToDigit(codePoint) {
if (codePoint - 48 < 10) {
return codePoint - 22;
}
if (codePoint - 65 < 26) {
return codePoint - 65;
}
if (codePoint - 97 < 26) {
return codePoint - 97;
}
return base;
}
/**
* Converts a digit/integer into a basic code point.
* @see `basicToDigit()`
* @private
* @param {Number} digit The numeric value of a basic code point.
* @returns {Number} The basic code point whose value (when used for
* representing integers) is `digit`, which needs to be in the range
* `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
* used; else, the lowercase form is used. The behavior is undefined
* if `flag` is non-zero and `digit` has no uppercase form.
*/
function digitToBasic(digit, flag) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
}
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* http://tools.ietf.org/html/rfc3492#section-3.4
* @private
*/
function adapt(delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
delta = floor(delta / baseMinusTMin);
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
}
/**
* Converts a Punycode string of ASCII-only symbols to a string of Unicode
* symbols.
* @memberOf punycode
* @param {String} input The Punycode string of ASCII-only symbols.
* @returns {String} The resulting string of Unicode symbols.
*/
function decode(input) {
// Don't use UCS-2
var output = [],
inputLength = input.length,
out,
i = 0,
n = initialN,
bias = initialBias,
basic,
j,
index,
oldi,
w,
k,
digit,
t,
/** Cached calculation results */
baseMinusT;
// Handle the basic code points: let `basic` be the number of input code
// points before the last delimiter, or `0` if there is none, then copy
// the first basic code points to the output.
basic = input.lastIndexOf(delimiter);
if (basic < 0) {
basic = 0;
}
for (j = 0; j < basic; ++j) {
// if it's not a basic code point
if (input.charCodeAt(j) >= 0x80) {
error('not-basic');
}
output.push(input.charCodeAt(j));
}
// Main decoding loop: start just after the last delimiter if any basic code
// points were copied; start at the beginning otherwise.
for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
// `index` is the index of the next character to be consumed.
// Decode a generalized variable-length integer into `delta`,
// which gets added to `i`. The overflow checking is easier
// if we increase `i` as we go, then subtract off its starting
// value at the end to obtain `delta`.
for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
if (index >= inputLength) {
error('invalid-input');
}
digit = basicToDigit(input.charCodeAt(index++));
if (digit >= base || digit > floor((maxInt - i) / w)) {
error('overflow');
}
i += digit * w;
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (digit < t) {
break;
}
baseMinusT = base - t;
if (w > floor(maxInt / baseMinusT)) {
error('overflow');
}
w *= baseMinusT;
}
out = output.length + 1;
bias = adapt(i - oldi, out, oldi == 0);
// `i` was supposed to wrap around from `out` to `0`,
// incrementing `n` each time, so we'll fix that now:
if (floor(i / out) > maxInt - n) {
error('overflow');
}
n += floor(i / out);
i %= out;
// Insert `n` at position `i` of the output
output.splice(i++, 0, n);
}
return ucs2encode(output);
}
/**
* Converts a string of Unicode symbols (e.g. a domain name label) to a
* Punycode string of ASCII-only symbols.
* @memberOf punycode
* @param {String} input The string of Unicode symbols.
* @returns {String} The resulting Punycode string of ASCII-only symbols.
*/
function encode(input) {
var n,
delta,
handledCPCount,
basicLength,
bias,
j,
m,
q,
k,
t,
currentValue,
output = [],
/** `inputLength` will hold the number of code points in `input`. */
inputLength,
/** Cached calculation results */
handledCPCountPlusOne,
baseMinusT,
qMinusT;
// Convert the input in UCS-2 to Unicode
input = ucs2decode(input);
// Cache the length
inputLength = input.length;
// Initialize the state
n = initialN;
delta = 0;
bias = initialBias;
// Handle the basic code points
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < 0x80) {
output.push(stringFromCharCode(currentValue));
}
}
handledCPCount = basicLength = output.length;
// `handledCPCount` is the number of code points that have been handled;
// `basicLength` is the number of basic code points.
// Finish the basic string - if it is not empty - with a delimiter
if (basicLength) {
output.push(delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handled already. Find the next
// larger one:
for (m = maxInt, j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decoder's state to ,
// but guard against overflow
handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
error('overflow');
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (j = 0; j < inputLength; ++j) {
currentValue = input[j];
if (currentValue < n && ++delta > maxInt) {
error('overflow');
}
if (currentValue == n) {
// Represent delta as a generalized variable-length integer
for (q = delta, k = base; /* no condition */; k += base) {
t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
if (q < t) {
break;
}
qMinusT = q - t;
baseMinusT = base - t;
output.push(
stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
);
q = floor(qMinusT / baseMinusT);
}
output.push(stringFromCharCode(digitToBasic(q, 0)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
delta = 0;
++handledCPCount;
}
}
++delta;
++n;
}
return output.join('');
}
/**
* Converts a Punycode string representing a domain name or an email address
* to Unicode. Only the Punycoded parts of the input will be converted, i.e.
* it doesn't matter if you call it on a string that has already been
* converted to Unicode.
* @memberOf punycode
* @param {String} input The Punycoded domain name or email address to
* convert to Unicode.
* @returns {String} The Unicode representation of the given Punycode
* string.
*/
function toUnicode(input) {
return mapDomain(input, function(string) {
return regexPunycode.test(string)
? decode(string.slice(4).toLowerCase())
: string;
});
}
/**
* Converts a Unicode string representing a domain name or an email address to
* Punycode. Only the non-ASCII parts of the domain name will be converted,
* i.e. it doesn't matter if you call it with a domain that's already in
* ASCII.
* @memberOf punycode
* @param {String} input The domain name or email address to convert, as a
* Unicode string.
* @returns {String} The Punycode representation of the given domain name or
* email address.
*/
function toASCII(input) {
return mapDomain(input, function(string) {
return regexNonASCII.test(string)
? 'xn--' + encode(string)
: string;
});
}
/*--------------------------------------------------------------------------*/
/** Define the public API */
punycode = {
/**
* A string representing the current Punycode.js version number.
* @memberOf punycode
* @type String
*/
'version': '1.3.1',
/**
* An object of methods to convert from JavaScript's internal character
* representation (UCS-2) to Unicode code points, and back.
* @see
* @memberOf punycode
* @type Object
*/
'ucs2': {
'decode': ucs2decode,
'encode': ucs2encode
},
'decode': decode,
'encode': encode,
'toASCII': toASCII,
'toUnicode': toUnicode
};
/** Expose `punycode` */
// Some AMD build optimizers, like r.js, check for specific condition patterns
// like the following:
if (
typeof define == 'function' &&
typeof define.amd == 'object' &&
define.amd
) {
define('punycode', function() {
return punycode;
});
} else if (freeExports && freeModule) {
if (module.exports == freeExports) { // in Node.js or RingoJS v0.8.0+
freeModule.exports = punycode;
} else { // in Narwhal or RingoJS v0.7.0-
for (key in punycode) {
punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
}
}
} else { // in Rhino or a web browser
root.punycode = punycode;
}
}(this));
var html2canvasNodeAttribute = "data-html2canvas-node";
var html2canvasCanvasCloneAttribute = "data-html2canvas-canvas-clone";
var html2canvasCanvasCloneIndex = 0;
var html2canvasCloneIndex = 0;
window.html2canvas = function(nodeList, options) {
var index = html2canvasCloneIndex++;
options = options || {};
if (options.logging) {
window.html2canvas.logging = true;
window.html2canvas.start = Date.now();
}
options.async = typeof(options.async) === "undefined" ? true : options.async;
options.allowTaint = typeof(options.allowTaint) === "undefined" ? false : options.allowTaint;
options.removeContainer = typeof(options.removeContainer) === "undefined" ? true : options.removeContainer;
options.javascriptEnabled = typeof(options.javascriptEnabled) === "undefined" ? false : options.javascriptEnabled;
options.imageTimeout = typeof(options.imageTimeout) === "undefined" ? 10000 : options.imageTimeout;
options.renderer = typeof(options.renderer) === "function" ? options.renderer : CanvasRenderer;
options.strict = !!options.strict;
if (typeof(nodeList) === "string") {
if (typeof(options.proxy) !== "string") {
return Promise.reject("Proxy must be used when rendering url");
}
var width = options.width != null ? options.width : window.innerWidth;
var height = options.height != null ? options.height : window.innerHeight;
return loadUrlDocument(absoluteUrl(nodeList), options.proxy, document, width, height, options).then(function(container) {
return renderWindow(container.contentWindow.document.documentElement, container, options, width, height);
});
}
var node = ((nodeList === undefined) ? [document.documentElement] : ((nodeList.length) ? nodeList : [nodeList]))[0];
node.setAttribute(html2canvasNodeAttribute + index, index);
return renderDocument(node.ownerDocument, options, node.ownerDocument.defaultView.innerWidth, node.ownerDocument.defaultView.innerHeight, index).then(function(canvas) {
if (typeof(options.onrendered) === "function") {
log("options.onrendered is deprecated, html2canvas returns a Promise containing the canvas");
options.onrendered(canvas);
}
return canvas;
});
};
window.html2canvas.punycode = this.punycode;
window.html2canvas.proxy = {};
function renderDocument(document, options, windowWidth, windowHeight, html2canvasIndex) {
return createWindowClone(document, document, windowWidth, windowHeight, options, document.defaultView.pageXOffset, document.defaultView.pageYOffset).then(function(container) {
log("Document cloned");
var attributeName = html2canvasNodeAttribute + html2canvasIndex;
var selector = "[" + attributeName + "='" + html2canvasIndex + "']";
document.querySelector(selector).removeAttribute(attributeName);
var clonedWindow = container.contentWindow;
var node = clonedWindow.document.querySelector(selector);
var oncloneHandler = (typeof(options.onclone) === "function") ? Promise.resolve(options.onclone(clonedWindow.document)) : Promise.resolve(true);
return oncloneHandler.then(function() {
return renderWindow(node, container, options, windowWidth, windowHeight);
});
});
}
function renderWindow(node, container, options, windowWidth, windowHeight) {
var clonedWindow = container.contentWindow;
var support = new Support(clonedWindow.document);
var imageLoader = new ImageLoader(options, support);
var bounds = getBounds(node);
var width = options.type === "view" ? windowWidth : documentWidth(clonedWindow.document);
var height = options.type === "view" ? windowHeight : documentHeight(clonedWindow.document);
var renderer = new options.renderer(width, height, imageLoader, options, document);
var parser = new NodeParser(node, renderer, support, imageLoader, options);
return parser.ready.then(function() {
log("Finished rendering");
var canvas;
if (options.type === "view") {
canvas = crop(renderer.canvas, {width: renderer.canvas.width, height: renderer.canvas.height, top: 0, left: 0, x: 0, y: 0});
} else if (node === clonedWindow.document.body || node === clonedWindow.document.documentElement || options.canvas != null) {
canvas = renderer.canvas;
} else {
canvas = crop(renderer.canvas, {width: options.width != null ? options.width : bounds.width, height: options.height != null ? options.height : bounds.height, top: bounds.top, left: bounds.left, x: clonedWindow.pageXOffset, y: clonedWindow.pageYOffset});
}
cleanupContainer(container, options);
return canvas;
});
}
function cleanupContainer(container, options) {
if (options.removeContainer) {
container.parentNode.removeChild(container);
log("Cleaned up container");
}
}
function crop(canvas, bounds) {
var croppedCanvas = document.createElement("canvas");
var x1 = Math.min(canvas.width - 1, Math.max(0, bounds.left));
var x2 = Math.min(canvas.width, Math.max(1, bounds.left + bounds.width));
var y1 = Math.min(canvas.height - 1, Math.max(0, bounds.top));
var y2 = Math.min(canvas.height, Math.max(1, bounds.top + bounds.height));
croppedCanvas.width = bounds.width;
croppedCanvas.height = bounds.height;
log("Cropping canvas at:", "left:", bounds.left, "top:", bounds.top, "width:", (x2-x1), "height:", (y2-y1));
log("Resulting crop with width", bounds.width, "and height", bounds.height, " with x", x1, "and y", y1);
croppedCanvas.getContext("2d").drawImage(canvas, x1, y1, x2-x1, y2-y1, bounds.x, bounds.y, x2-x1, y2-y1);
return croppedCanvas;
}
function documentWidth (doc) {
return Math.max(
Math.max(doc.body.scrollWidth, doc.documentElement.scrollWidth),
Math.max(doc.body.offsetWidth, doc.documentElement.offsetWidth),
Math.max(doc.body.clientWidth, doc.documentElement.clientWidth)
);
}
function documentHeight (doc) {
return Math.max(
Math.max(doc.body.scrollHeight, doc.documentElement.scrollHeight),
Math.max(doc.body.offsetHeight, doc.documentElement.offsetHeight),
Math.max(doc.body.clientHeight, doc.documentElement.clientHeight)
);
}
function smallImage() {
return "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
}
function isIE9() {
return document.documentMode && document.documentMode <= 9;
}
// https://github.com/niklasvh/html2canvas/issues/503
function cloneNodeIE9(node, javascriptEnabled) {
var clone = node.nodeType === 3 ? document.createTextNode(node.nodeValue) : node.cloneNode(false);
var child = node.firstChild;
while(child) {
if (javascriptEnabled === true || child.nodeType !== 1 || child.nodeName !== 'SCRIPT') {
clone.appendChild(cloneNodeIE9(child, javascriptEnabled));
}
child = child.nextSibling;
}
return clone;
}
function createWindowClone(ownerDocument, containerDocument, width, height, options, x ,y) {
labelCanvasElements(ownerDocument);
var documentElement = isIE9() ? cloneNodeIE9(ownerDocument.documentElement, options.javascriptEnabled) : ownerDocument.documentElement.cloneNode(true);
var container = containerDocument.createElement("iframe");
container.className = "html2canvas-container";
container.style.visibility = "hidden";
container.style.position = "fixed";
container.style.left = "-10000px";
container.style.top = "0px";
container.style.border = "0";
container.width = width;
container.height = height;
container.scrolling = "no"; // ios won't scroll without it
containerDocument.body.appendChild(container);
return new Promise(function(resolve) {
var documentClone = container.contentWindow.document;
cloneNodeValues(ownerDocument.documentElement, documentElement, "textarea");
cloneNodeValues(ownerDocument.documentElement, documentElement, "select");
/* Chrome doesn't detect relative background-images assigned in inline ").appendTo(o)),r.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",r.opacity)),r.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",r.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return u.ui.ddmanager&&(u.ui.ddmanager.current=this),u.ui.ddmanager&&!r.dropBehaviour&&u.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,o,r=this.options,n=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageYt[this.floating?"width":"height"]?c:r",i.document[0]).addClass(s||i.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),u("",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=u(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){u(" ",i.document[0]).attr("colspan",u(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,o,r,n,h,a,l,c=null,p=null,f=this.containers.length-1;0<=f;f--)u.contains(this.currentItem[0],this.containers[f].element[0])||(this._intersectsWith(this.containers[f].containerCache)?c&&u.contains(this.containers[f].element[0],c.element[0])||(c=this.containers[f],p=f):this.containers[f].containerCache.over&&(this.containers[f]._trigger("out",t,this._uiHash(this)),this.containers[f].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",t,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(i=1e4,s=null,o=(a=c.floating||this._isFloating(this.currentItem))?"left":"top",r=a?"width":"height",l=a?"clientX":"clientY",e=this.items.length-1;0<=e;e--)u.contains(this.containers[p].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(n=this.items[e].item.offset()[o],h=!1,t[l]-n>this.items[e][r]/2&&(h=!0),Math.abs(t[l]-n)this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(s=this.containment[3]+this.offset.click.top)),e.grid&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0])),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:o.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:o.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var o=this.counter;this._delay(function(){o===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();function o(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(o("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(o("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i https://better-than-ever.com/wp-includes/js/jquery/ui/draggable.min.js?ver=1.11.4
/*!
* jQuery UI Draggable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/draggable/
*/
!function(t){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],t):t(jQuery)}(function(P){return P.widget("ui.draggable",P.ui.mouse,{version:"1.11.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){(this.helper||this.element).is(".ui-draggable-dragging")?this.destroyOnClear=!0:(this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._removeHandleClassName(),this._mouseDestroy())},_mouseCapture:function(t){var e=this.options;return this._blurActiveElement(t),!(this.helper||e.disabled||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.pageY https://better-than-ever.com/wp-includes/js/jquery/ui/droppable.min.js?ver=1.11.4
/*!
* jQuery UI Droppable 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/droppable/
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./widget","./mouse","./draggable"],e):e(jQuery)}(function(a){function d(e,t,i){return t<=e&&e https://better-than-ever.com/wp-content/plugins/vibe-course-module/includes/js/course.js?ver=1.9.6
;(function($) {
!function(t){t.fn.liveEdit=function(e){var n,o,i,a,s,l,u=t.extend({afterSaveAll:function(){},doubleClick:function(){}},t.fn.liveEdit.defaults,e),c=[],d=function(e){t(e).attr("contenteditable","true")},r=function(e){t(e).find("a").click(function(t){t.preventDefault()})},f=function(){var t=window.getSelection(),e=t.getRangeAt(0),n=e.getBoundingClientRect();i.addClass("appear"),i.css("top",n.top-(i.height()+8)+window.pageYOffset+"px"),i.css("left",(n.left+n.right)/2-i.width()/2+"px")},h=function(){i.removeClass("appear"),i.css("top","-999px"),i.css("left","-999px")},g=function(e){t(e.focusNode).closest("b").length>0?i.addClass("bold"):i.removeClass("bold"),t(e.focusNode).closest("i").length>0?i.addClass("italic"):i.removeClass("italic"),t(e.focusNode).closest("li").length>0?i.addClass("unorderedlist"):i.removeClass("unorderedlist"),t(e.focusNode).closest("strike").length>0?i.addClass("strikethrough"):i.removeClass("strikethrough"),t(e.focusNode).closest("a").length>0?i.addClass("url"):i.removeClass("url")},b=function(){var t=document.getSelection().anchorNode,e=t&&3===t.nodeType?t.parentNode:t;return e},m=function(e){var n=window.getSelection();return y(),D(t(n.focusNode).closest("[data-editable=true]")),t(e.target).closest(".text-options").length>0?void g(n):(t(n.focusNode).closest("[data-editable=true]").length>0&&0==t(n.focusNode).closest("figure").length?(0===b().children.length&&t(n.focusNode).closest("[data-text-options=true]").length>0&&0==t(n.focusNode).closest("li").length&&0==t(n.focusNode).closest(".caption").length&&document.execCommand("formatBlock",!1,"p"),n.isCollapsed===!0&&l===!1&&h(),n.isCollapsed===!1?t(n.focusNode).closest("[data-text-options=true]").length>0&&(f(),g(n)):h()):h(),void(l=n.isCollapsed))},v=function(){document.execCommand("strong",!1,null)},C=function(){document.execCommand("italic",!1)},x=function(){document.execCommand("strikethrough",!1)},k=function(){document.execCommand("insertunorderedlist",!1),h(),E()},B=function(){i.hasClass("edit-url")?i.removeClass("edit-url"):(i.addClass("edit-url"),setTimeout(function(){var e=window.getSelection();t(e.focusNode).closest("a").length>0?t(urlField).find("input").val(t(e.focusNode).closest("a").attr("href")):document.execCommand("createLink",!1,"/"),lastSelection=window.getSelection().getRangeAt(0),l=!1,t(urlField).find("input").focus()},100))},w=function(){window.getSelection().addRange(lastSelection)},L=function(t){w(),document.execCommand("unlink",!1),""!==t&&(t.match("^(http|https)://")||(t="http://"+t),document.execCommand("createLink",!1,t))},N=function(e){t(e).on("paste",function(t){if(t.preventDefault(),t.originalEvent.clipboardData&&t.originalEvent.clipboardData.getData){var n="",o=t.originalEvent.clipboardData.getData("text/plain").split(/[\r\n]/g);for(p=0;p"+o[p]+"
");document.execCommand("insertHTML",!1,n),setTimeout(function(){D(e)},10)}})},S=function(e){t(e).on("dblclick",function(){setTimeout(function(){var t=window.getSelection();return t.isCollapsed===!0?u.doubleClick.call(this,e,t):void 0},10)})},y=function(){t.each(c,function(e,n){t(n).find("[data-editable=true]").each(function(){1==t(this).data("text-options")&&t(this).find("figure").each(function(){0===t(this).next("p").length&&t(this).after("
")})})})},D=function(e){t(e).find("span").each(function(){t(this).hasClass("caption")||t(this).contents().unwrap()})},E=function(){t.each(c,function(e,n){t(n).find("[data-editable=true]").each(function(){t(this).find("ul").each(function(){t(this).parent("p").length&&t(this).parent("p").contents().unwrap()})})})},T=function(){var e=[];return t.each(c,function(n,o){var i={},a=t(o).data("model"),s=t(o).data("id").toString(),l=t(o).data("url");i.model=a,i.id=s,i.url=l,t(o).find("[data-editable=true]").each(function(){var e=t(this).data("name"),n=t(this).html().replace(/\n/g,"").trim();i[e]=n}),e.push(i)}),u.afterSaveAll.call(this,e)},A=function(){sidebarInterface='",textOptionsInterface=''+u.urlButtonLabel+' '+u.boldButtonLabel+' '+u.italicButtonLabel+' '+u.strikethroughButtonLabel+' '+u.unorderedlistButtonLabel+" ",t("body").append(textOptionsInterface)},F=function(){n=t(".live-edit-sidebar"),o=t(".live-edit-sidebar .save-button"),i=t(".text-options"),urlButton=t(".text-options .url-button"),urlField=t(".text-options span.input-text"),a=t(".text-options .bold-button"),s=t(".text-options .italic-button"),strikethroughButton=t(".text-options .strikethrough-button"),unorderedListButton=t(".text-options .unorderedlist-button")},I=function(){o.on("click",T),urlButton.on("click",B),a.on("click",v),s.on("click",C),strikethroughButton.on("click",x),unorderedListButton.on("click",k),t(urlField).find("input").on("keydown",function(e){13===e.keyCode&&(e.preventDefault(),L(t(this).val()),t(this).blur())}),t(urlField).find("input").on("blur",function(){i.removeClass("edit-url"),L(t(this).val()),t(this).val(""),g(window.getSelection().focusNode)}),t(document).on("keyup",m),t(document).on("mousedown",m),t(document).on("mouseup",function(t){setTimeout(function(){m(t)},1)})};A(),F(),I();var R=function(e){var n=t(e).data("max-length");n&&t(e).on("keypress",function(t){(t.target.innerText.length>n||13===t.keyCode)&&t.preventDefault()})};return t.fn.liveEdit.loadingState=function(t){"on"==t?n.addClass("loading-state"):n.removeClass("loading-state")},this.each(function(){c.push(this),t(this).find("[data-editable=true]").each(function(){d(this),r(this),R(this),N(this),S(this)})})},t.fn.liveEdit.defaults={saveButtonLabel:"S",urlButtonLabel:"U",boldButtonLabel:"B",italicButtonLabel:"I",strikethroughButtonLabel:"ABC",unorderedlistButtonLabel:"L"}}(jQuery);
(function(e){"use strict";function t(t){var n=e("");try{n=e(t).clone()}catch(r){n=e(" ").html(t)}return n}function n(e){return!!(typeof Node==="object"?e instanceof Node:e&&typeof e==="object"&&typeof e.nodeType==="number"&&typeof e.nodeName==="string")}e.print=e.fn.print=function(){var r,i,s=this;if(s instanceof e){s=s.get(0)}if(n(s)){i=e(s);if(arguments.length>0){r=arguments[0]}}else{if(arguments.length>0){i=e(arguments[0]);if(n(i[0])){if(arguments.length>1){r=arguments[1]}}else{r=arguments[0];i=e("html")}}else{i=e("html")}}var o={globalStyles:true,mediaPrint:false,stylesheet:null,noPrintSelector:".no-print",iframe:true,append:null,prepend:null};r=e.extend({},o,r||{});var u=e("");if(r.globalStyles){u=e("style, link, meta, title")}else if(r.mediaPrint){u=e("link[media=print]")}if(r.stylesheet){u=e.merge(u,e(' '))}var a=i.clone();a=e(" ").append(a);a.find(r.noPrintSelector).remove();a.append(u.clone());a.append(t(r.append));a.prepend(t(r.prepend));var f=a.html();a.remove();var l,c;if(r.iframe){try{var h=e(r.iframe+"");var p=h.length;if(p===0){h=e('').prependTo("body").css({position:"absolute",top:-999,left:-999})}l=h.get(0);l=l.contentWindow||l.contentDocument||l;c=l.document||l.contentDocument||l;c.open();c.write(f);c.close();setTimeout(function(){l.focus();l.print();setTimeout(function(){if(p===0){h.remove()}},100)},250)}catch(d){console.error("Failed to print from iframe",d.stack,d.message);l=window.open();l.document.write(f);l.document.close();l.focus();l.print();l.close()}}else{l=window.open();l.document.write(f);l.document.close();l.focus();l.print();l.close()}return this}})(jQuery);
$.fn.timer = function( useroptions ){
var $this = $(this), opt,newVal, count = 0;
opt = $.extend( {
// Config
'timer' : 300, // 300 second default
'width' : 24 ,
'height' : 24 ,
'fgColor' : "#ED7A53" ,
'bgColor' : "#232323"
}, useroptions
);
$this.knob({
'min':0,
'max': opt.timer,
'readOnly': true,
'width': opt.width,
'height': opt.height,
'fgColor': opt.fgColor,
'bgColor': opt.bgColor,
'displayInput' : false,
'dynamicDraw': false,
'ticks': 0,
'thickness': 0.1
});
setInterval(function(){
newVal = ++count;
$this.val(newVal).trigger('change');
}, 1000);
};
$.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^]*)').exec(window.location.href);
if (results==null){
return null;
}
else{
return results[1] || 0;
}
}
// Necessary functions
function runnecessaryfunctions(){
jQuery('.fitvids').fitVids();
jQuery('.tip').tooltip();
jQuery('.nav-tabs li:first a').tab('show');
jQuery('.nav-tabs li a').click(function(event){
event.preventDefault();
$(this).tab('show');
});
$('audio,video').mediaelementplayer();
jQuery('.gallery').magnificPopup({
delegate: 'a',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the current image
},
image: {
tError: 'The image #%curr% could not be loaded.',
titleSrc: function(item) {
return item.el.attr('title');
}
}
});
$('.open_popup_link').magnificPopup({
type:'inline',
midClick: true
});
$('.ajax-popup-link').magnificPopup({
type: 'ajax',
alignTop: true,
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in'
});
$('.quiz_results_popup').magnificPopup({
type: 'ajax',
alignTop: true,
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in',
callbacks: {
parseAjax: function( mfpResponse ) {
mfpResponse.data = $(mfpResponse.data).find('#item-body');
},
ajaxContentAdded: function(){
$('.show_explaination').on('click',function(event){
event.preventDefault();
var $this = $(this);
$this.toggleClass('active');
$this.closest('li').find('.explaination').toggle();
});
$('#prev_results a').on('click',function(event){
event.preventDefault();
$(this).toggleClass('show');
$('.prev_quiz_results').toggleClass('show');
});
$('.print_results').click(function(event){
event.preventDefault();
$('.quiz_result').print();
});
$('.quiz_retake_form.start_quiz').on('click',function(e){
e.preventDefault();
var qid=$('#unit.quiz_title').attr('data-unit');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'retake_inquiz',
security: $('#hash').val(),
quiz_id:qid,
},
cache: false,
success: function (html) {
$('a.unit[data-unit="'+qid+'"]').trigger('click');
$.magnificPopup.close();
$('#unit'+qid).removeClass('done');
var i = sessionStorage.length;
while(i--) {
var key = sessionStorage.key(i);
if($.isNumeric(key)) {
sessionStorage.removeItem(key);
}
}
$('body').find('.course_progressbar').removeClass('increment_complete');
$('body').find('.course_progressbar').trigger('decrement');
}
});
});
}
}
});
if ( typeof vc_js == 'function' ) {
window.vc_js();
}
}
//AJAX Comments
function ajaxsubmit_comments(){
$('#question').each(function(){
var $this=$(this);
$('#submit').click(function(event){
event.preventDefault();
var value = '';
$('#ajaxloader').removeClass('disabled');
$('#question').css('opacity',0.2);
if($this.find('input[type="radio"]:checked').length)
$this.find('input[type="radio"]:checked').each(function(){
value = $(this).val();
});
if($this.find('input[type="checkbox"]:checked').length)
$this.find('input[type="checkbox"]:checked').each(function(){
value= $(this).val()+','+value;
});
if($this.find('.vibe_fillblank').length)
$this.find('.vibe_fillblank').each(function(){
value += $(this).text();
});
if($this.find('#vibe_select_dropdown').length)
value = $this.find('#vibe_select_dropdown').val();
if($this.find('.matchgrid_options li.match_option').length){
$('.matchgrid_options li.match_option').each(function(){
var id = $(this).attr('id');
if( jQuery.isNumeric(id))
value +=id+',';
});
}
if($('#comment').hasClass('option_value'))
$('#comment.option_value').val(value);
$('#commentform').submit();
});
var commentform=$('#commentform'); // find the comment form
var statusdiv=$('#comment-status'); // define the infopanel
var qid = statusdiv.attr('data-quesid');
commentform.submit(function(){
var formdata=commentform.serialize();
statusdiv.html(''+vibe_course_module_strings.processing+'
');
var formurl=commentform.attr('action');
$.ajax({
type: 'post',
url: formurl,
data: formdata,
error: function(XMLHttpRequest, textStatus, errorThrown){
$('#ajaxloader').addClass('disabled');
$('#question').css('opacity',1);
statusdiv.html(''+vibe_course_module_strings.too_fast_answer+'
');
setTimeout(function(){statusdiv.hide(300).html('').show();}, 2000);
},
success: function(data, textStatus){
$('#question').css('opacity',1);
$('#ajaxloader').addClass('disabled');
if(data=="success"){
statusdiv.html(''+vibe_course_module_strings.answer_saved+'
');
setTimeout(function(){statusdiv.hide(300).html('').show();}, 2000);
$('#ques'+qid).addClass('done');
$('.reset_answer').removeClass('hide');
}
else{
statusdiv.html(''+vibe_course_module_strings.saving_answer+'
');
setTimeout(function(){statusdiv.hide(300).html('').show();}, 2000);
}
}
});
return false;
});
});
} // END Function
//Cookie evaluation
jQuery(document).ready( function($) {
$('.open_popup_link').magnificPopup({
type:'inline',
midClick: true
});
$('.item-list').each(function(){
var cookie_name = 'bp-'+$('.item-list').attr('id');
var cookieValue = $.cookie(cookie_name);
if ((cookieValue !== null) && cookieValue == 'grid') {
$('.item-list').addClass('grid');
$('#list_view').removeClass('active');
$('#grid_view').addClass('active');
}
});
function bp_course_extras_cookies(){
$('.category_filter .bp-course-category-filter,.type_filter .bp-course-free-filter,.level_filter .bp-course-level-filter,.instructor_filter .bp-course-instructor-filter').on('click',function(){
var category_filter=[];
$('.bp-course-category-filter:checked').each(function(){
var category={'type':'course-cat','value':$(this).val()};
category_filter.push(category);
});
$('.bp-course-free-filter:checked').each(function(){
var free={'type':'free','value':$(this).val()};
category_filter.push(free);
});
$('.bp-course-level-filter:checked').each(function(){
var level={'type':'level','value':$(this).val()};
category_filter.push(level);
});
$('.bp-course-instructor-filter:checked').each(function(){
var level={'type':'instructor','value':$(this).val()};
category_filter.push(level);
});
$.cookie('bp-course-extras', JSON.stringify(category_filter), { expires: 1 ,path: '/'});
});
}
function bp_course_category_filter_cookie(){
var category_filter_cookie = $.cookie("bp-course-extras");
if ((category_filter_cookie !== null)) {
var category_filter = JSON.parse(category_filter_cookie);
if($('#active_filters').length){
$('#active_filters').fadeIn(200);
}else{
$('#course-dir-list').before(''+vibe_course_module_strings.active_filters+' ');
}
//Detect and activate specific filters
jQuery.each(category_filter, function(index, item) {
$('input[value="'+item['value']+'"]').prop('checked', true);
var id = $('input[value="'+item['value']+'"]').attr('id');
var text = $('label[for="'+id+'"]').text();
if(!$('#active_filters span[data-id="'+id+'"]').length)
$('#active_filters').append(''+text+' ');
});
// Delete a specific filter
$('#active_filters li span').on('click',function(){
var id = $(this).attr('data-id');
$(this).parent().fadeOut(200,function(){
$(this).remove();
if($('#active_filters li').length < 3)
$('#active_filters').fadeOut(200);
else
$('#active_filters').fadeIn(200);
});
$('#'+id).prop('checked',false);
/*===== */
var category_filter=[];
$('.bp-course-category-filter:checked').each(function(){
var category={'type':'course-cat','value':$(this).val()};
category_filter.push(category);
});
$('.bp-course-free-filter:checked').each(function(){
var free={'type':'free','value':$(this).val()};
category_filter.push(free);
});
$('.bp-course-level-filter:checked').each(function(){
var level={'type':'level','value':$(this).val()};
category_filter.push(level);
});
$('.bp-course-instructor-filter:checked').each(function(){
var level={'type':'instructor','value':$(this).val()};
category_filter.push(level);
});
$.cookie('bp-course-extras', JSON.stringify(category_filter), { expires: 1 ,path: '/'});
$('#submit_filters').trigger('click');
/* ==== */
});
if(!$('#active_filters .all-filter-clear').length)
$('#active_filters').append(''+vibe_course_module_strings.clear_filters+' ');
// Clear all Filters link
$('#active_filters li.all-filter-clear').click(function(){
$('#active_filters li').each(function(){
var span = $(this).find('span');
var id = span.attr('data-id');
span.parent().fadeOut(200,function(){
$(this).remove(); });
$('#'+id).prop('checked',false);
$('#active_filters').fadeOut(200,function(){
$(this).remove();
});
$.removeCookie('bp-course-extras', { path: '/' });
$('#submit_filters').trigger('click');
});
});
// End Clear All
// Hide is no filter active
if($('#active_filters li').length < 3)
$('#active_filters').fadeOut(200);
else
$('#active_filters').fadeIn(200);
}
}
bp_course_category_filter_cookie();
bp_course_extras_cookies();
/*=========================================================================*/
$('.category_filter li > span,.category_filter li > label').click(function(event){
var parent= $(this).parent();
$('.category_filter li > span').toggleClass('active');
parent.find('ul.sub_categories').toggle(300);
});
$('#submit_filters').on('click',function(){
if ( jq('.item-list-tabs li.selected').length )
var el = jq('.item-list-tabs li.selected');
else
var el = jq(this);
var css_id = el.attr('id').split('-');
var object = css_id[0];
var scope = css_id[1];
var filter = jq(this).val();
var search_terms = false;
if ( jq('.dir-search input').length )
search_terms = jq('.dir-search input').val();
if ( 'friends' == object )
object = 'members';
bp_course_extras_cookies();
bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
bp_course_category_filter_cookie();
return false;
});
$('.quiz_results_popup').magnificPopup({
type: 'ajax',
alignTop: true,
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in',
callbacks: {
parseAjax: function( mfpResponse ) {
mfpResponse.data = $(mfpResponse.data).find('#item-body');
},
ajaxContentAdded: function() {
$('#prev_results a').on('click',function(event){
event.preventDefault();
$(this).toggleClass('show');
$('.prev_quiz_results').toggleClass('show');
});
$('.print_results').click(function(event){
event.preventDefault();
$('.quiz_result').print();
});
$('.quiz_retake_form.start_quiz').on('click',function(e){
e.preventDefault();
var qid=$('#unit.quiz_title').attr('data-unit');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'retake_inquiz',
security: $('#hash').val(),
quiz_id:qid,
},
cache: false,
success: function (html) {
$('a.unit[data-unit="'+qid+'"]').trigger('click');
$.magnificPopup.close();
$('#unit'+qid).removeClass('done');
$('body').find('.course_progressbar').removeClass('increment_complete');
$('body').find('.course_progressbar').trigger('decrement');
}
});
});
}
}
});
$('#grid_view').click(function(){
if(!$('.item-list').hasClass('grid')){
$('.item-list').addClass('grid');
}
var cookie_name = 'bp-'+$('.item-list').attr('id');
$.cookie(cookie_name, 'grid', { expires: 2 ,path: '/'});
$('#list_view').removeClass('active');
$(this).addClass('active');
});
$('#list_view').click(function(){
$('.item-list').removeClass('grid');
var cookie_name = 'bp-'+$('.item-list').attr('id');
$.cookie(cookie_name, 'list', { expires: 2 ,path: '/'});
$('#grid_view').removeClass('active');
$(this).addClass('active');
});
$("#average .dial").knob({
'readOnly': true,
'width': 120,
'height': 120,
'fgColor': vibe_course_module_strings.theme_color,
'bgColor': '#f6f6f6',
'thickness': 0.1
});
$("#pass .dial").knob({
'readOnly': true,
'width': 120,
'height': 120,
'fgColor': vibe_course_module_strings.theme_color,
'bgColor': '#f6f6f6',
'thickness': 0.1
});
$("#badge .dial").knob({
'readOnly': true,
'width': 120,
'height': 120,
'fgColor': vibe_course_module_strings.theme_color,
'bgColor': '#f6f6f6',
'thickness': 0.1
});
$(".course_quiz .dial").knob({
'readOnly': true,
'width': 120,
'height': 120,
'fgColor': vibe_course_module_strings.theme_color,
'bgColor': '#f6f6f6',
'thickness': 0.1
});
//RESET Ajx
$( 'body' ).delegate( '.remove_user_course','click',function(event){
event.preventDefault();
var course_id=$(this).attr('data-course');
var user_id=$(this).attr('data-user');
$(this).addClass('animated spin');
var $this = $(this);
$.confirm({
text: vibe_course_module_strings.remove_user_text,
confirm: function() {
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'remove_user_course',
security: $('#security').val(),
id: course_id,
user: user_id
},
cache: false,
success: function (html) {
$(this).removeClass('animated');
$(this).removeClass('spin');
runnecessaryfunctions();
$('#message').html(html);
$('#s'+user_id).fadeOut('fast');
}
});
},
cancel: function() {
$this.removeClass('animated');
$this.removeClass('spin');
},
confirmButton: vibe_course_module_strings.remove_user_button,
cancelButton: vibe_course_module_strings.cancel
});
});
$( 'body' ).delegate( '.reset_course_user','click',function(event){
event.preventDefault();
var course_id=$(this).attr('data-course');
var user_id=$(this).attr('data-user');
$(this).addClass('animated spin');
var $this = $(this);
$.confirm({
text: vibe_course_module_strings.reset_user_text,
confirm: function() {
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'reset_course_user',
security: $('#security').val(),
id: course_id,
user: user_id
},
cache: false,
success: function (html) {
$this.removeClass('animated');
$this.removeClass('spin');
var cookie_id = 'course_progress'+course_id;
$.removeCookie(cookie_id,{ path: '/' });
$('#message').html(html);
}
});
},
cancel: function() {
$this.removeClass('animated');
$this.removeClass('spin');
},
confirmButton: vibe_course_module_strings.reset_user_button,
cancelButton: vibe_course_module_strings.cancel
});
});
$( 'body' ).delegate( '.course_stats_user', 'click', function(event){
event.preventDefault();
var $this=$(this);
var course_id=$this.attr('data-course');
var user_id=$this.attr('data-user');
if($this.hasClass('already')){
$('#s'+user_id).find('.course_stats_user').fadeIn('fast');
}else{
$this.addClass('animated spin');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'course_stats_user',
security: $('#security').val(),
id: course_id,
user: user_id
},
cache: false,
success: function (html) {
$this.removeClass('animated');
$this.removeClass('spin');
$this.addClass('already');
$('#s'+user_id).append(html);
$(".dial").knob({
'readOnly': true,
'width': 160,
'height': 160,
'fgColor': vibe_course_module_strings.theme_color,
'bgColor': '#f6f6f6',
'thickness': 0.3
});
}
});
}
});
$('.data_stats li').click(function(event){
event.preventDefault();
var defaultxt = $(this).html();
var content = $('.content');
var $this = $(this);
var id = $(this).attr('id');
if(id == 'desc'){
$('.main_content').show();
$('.stats_content').hide();
}else{
if($(this).hasClass('loaded')){
$('.main_content').hide();
$('.stats_content').show();
}else{
$this.addClass('loaded');
$('.main_content').hide();
$(this).html(' ');
var quiz_id = $this.parent().attr('data-id');
var cpttype = $this.parent().attr('data-type');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'load_stats',
cpttype: cpttype,
id: quiz_id
},
cache: false,
success: function (html) {
$('.main_content').after(html);
setTimeout(function(){$this.html(defaultxt); }, 1000);
}
});
}
}
$this.parent().find('.active').removeClass('active');
$this.addClass('active');
});
$('#calculate_avg_course').click(function(event){
event.preventDefault();
var course_id=$(this).attr('data-courseid');
$(this).addClass('animated spin');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'calculate_stats_course',
security: $('#security').val(),
id: course_id
},
cache: false,
success: function (html) {
$(this).removeClass('animated');
$(this).removeClass('spin');
$('#message').html(html);
setTimeout(function(){location.reload();}, 3000);
}
});
});
$('.reset_quiz_user').click(function(event){
event.preventDefault();
var course_id=$(this).attr('data-quiz');
var user_id=$(this).attr('data-user');
$(this).addClass('animated spin');
var $this = $(this);
$.confirm({
text: vibe_course_module_strings.quiz_rest,
confirm: function() {
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'reset_quiz',
security: $('#qsecurity').val(),
id: course_id,
user: user_id
},
cache: false,
success: function (html) {
$(this).removeClass('animated');
$(this).removeClass('spin');
$('#message').html(html);
$('#qs'+user_id).fadeOut('fast');
}
});
},
cancel: function() {
$this.removeClass('animated');
$this.removeClass('spin');
},
confirmButton: vibe_course_module_strings.quiz_rest_button,
cancelButton: vibe_course_module_strings.cancel
});
});
$('.evaluate_quiz_user').click(function(event){
event.preventDefault();
var quiz_id=$(this).attr('data-quiz');
var user_id=$(this).attr('data-user');
$(this).addClass('animated spin');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'evaluate_quiz',
security: $('#qsecurity').val(),
id: quiz_id,
user: user_id
},
cache: false,
success: function (html) {
$(this).removeClass('animated');
$(this).removeClass('spin');
$('.quiz_students').html(html);
calculate_total_marks();
}
});
});
$('.evaluate_course_user').click(function(event){
event.preventDefault();
var course_id=$(this).attr('data-course');
var user_id=$(this).attr('data-user');
$(this).addClass('animated spin');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'evaluate_course',
security: $('#security').val(),
id: course_id,
user: user_id
},
cache: false,
success: function (html) {
$(this).removeClass('animated');
$(this).removeClass('spin');
$('.course_students').html(html);
calculate_total_marks();
}
});
});
$( 'body' ).delegate( '.reset_answer', 'click', function(event){
event.preventDefault();
var ques_id=$('#comment-status').attr('data-quesid');
var $this = $(this);
var qid = $('#comment-status').attr('data-quesid');
$this.prepend(' ');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'reset_question_answer',
security: $this.attr('data-security'),
ques_id: ques_id,
},
cache: false,
success: function (html) {
$this.find('i').remove();
$('#comment-status').html(html);
$('#ques'+qid).removeClass('done');
setTimeout(function(){ $this.addClass('hide');}, 500);
}
});
});
$( 'body' ).delegate( '#course_complete', 'click', function(event){
event.preventDefault();
var $this=$(this);
var user_id=$this.attr('data-user');
var course = $this.attr('data-course');
var marks = parseInt($('#course_marks_field').val());
if(marks <= 0){
alert('Enter Marks for User');
return;
}
$this.prepend(' ');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'complete_course_marks',
security: $('#security').val(),
course: course,
user: user_id,
marks:marks
},
cache: false,
success: function (html) {
$this.find('i').remove();
$this.html(html);
}
});
});
// Registeration BuddyPress
$('.register-section h4').click(function(){
$(this).toggleClass('show');
$(this).parent().find('.editfield').toggle('fast');
});
});
$( 'body' ).delegate( '.hide_parent', 'click', function(event){
$(this).parent().fadeOut('fast');
});
$( 'body' ).delegate( '.give_marks', 'click', function(event){
event.preventDefault();
var $this=$(this);
var ansid=$this.attr('data-ans-id');
var aval = $('#'+ansid).val();
$this.prepend(' ');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'give_marks',
aid: ansid,
aval: aval
},
cache: false,
success: function (html) {
$this.find('i').remove();
$this.html(vibe_course_module_strings.marks_saved);
}
});
});
$( 'body' ).delegate( '#mark_complete', 'click', function(event){
event.preventDefault();
var $this=$(this);
var quiz_id=$this.attr('data-quiz');
var user_id = $this.attr('data-user');
var marks = parseInt($('#total_marks strong > span').text());
$this.prepend(' ');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'save_quiz_marks',
quiz_id: quiz_id,
user_id: user_id,
marks: marks,
},
cache: false,
success: function (html) {
$this.find('i').remove();
$this.html(vibe_course_module_strings.quiz_marks_saved);
}
});
});
function calculate_total_marks(){
$('.question_marks').blur(function(){
var marks=parseInt(0);
var $this = $('#total_marks strong > span');
$('.question_marks').each(function(){
if($(this).val())
marks = marks + parseInt($(this).val());
});
$this.html(marks);
});
}
$( 'body' ).delegate( '.submit_quiz', 'click', function(event){
event.preventDefault();
$('#ajaxloader').removeClass('disabled');
if($(this).hasClass('disabled')){
return false;
}
var $this = $(this);
var quiz_id=$(this).attr('data-quiz');
$this.prepend(' ');
$('#question').addClass('quiz_submitted_fade');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'submit_quiz',
start_quiz: $('#start_quiz').val(),
id: quiz_id
},
cache: false,
success: function (html) {
$('#question').css('opacity',0.2);
$this.find('i').remove();
window.location.assign(document.URL);
}
});
});
// QUIZ RELATED FUCNTIONS
// START QUIZ AJAX
jQuery(document).ready( function($) {
$('.begin_quiz').click(function(event){
event.preventDefault();
var $this = $(this);
var quiz_id=$(this).attr('data-quiz');
$this.prepend(' ');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'begin_quiz',
start_quiz: $('#start_quiz').val(),
id: quiz_id
},
cache: false,
success: function (html) {
$this.find('i').remove();
$('.content').fadeOut("fast");
$('.content').html(html);
$('.content').fadeIn("fast");
ajaxsubmit_comments();
var ques=$($.parseHTML(html)).filter("#question");
var q='#ques'+ques.attr('data-ques');
$('.quiz_timeline').find('.active').removeClass('active');
$(q).addClass('active');
$('#question').trigger('question_loaded');
if(ques != 'undefined'){
$('.quiz_timer').trigger('activate');
}
runnecessaryfunctions();
$('.begin_quiz').each(function(){
$(this).removeClass('begin_quiz');
$(this).addClass('submit_quiz');
$(this).text(vibe_course_module_strings.submit_quiz);
});
}
});
});
});
$( 'body' ).delegate( '.show_hint', 'click', function(event){
event.preventDefault();
$(this).toggleClass('active');
$(this).parent().find('.hint').toggle(400);
});
$('.show_explaination').click(function(event){
event.preventDefault();
var $this = $(this);
$this.toggleClass('active');
$this.closest('li').find('.explaination').toggle();
});
$( 'body' ).delegate( '.quiz_question', 'click', function(event){
event.preventDefault();
var $this = $(this);
var quiz_id=$(this).attr('data-quiz');
var ques_id=$(this).attr('data-qid');
$this.prepend(' ');
$('#ajaxloader').removeClass('disabled');
$('#question').css('opacity',0.2);
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'quiz_question',
start_quiz: $('#start_quiz').val(),
quiz_id: quiz_id,
ques_id: ques_id
},
cache: false,
success: function (html) {
$this.find('i').remove();
$('.content').html(html);
$('#ajaxloader').addClass('disabled');
$('#question').css('opacity',1);
ajaxsubmit_comments();
var ques=$($.parseHTML(html)).filter("#question");
var q='#ques'+ques.attr('data-ques');
$('.quiz_timeline').find('.active').removeClass('active');
$(q).addClass('active');
$('#question').trigger('question_loaded');
$('.tip').tooltip();
//if(ques != 'undefined')
//$('.quiz_timer').trigger('activate');
$('audio,video').mediaelementplayer();
//END Match question type
//
if($('.timeline_wrapper').height() > $('.quiz_timeline').height()){
$('.quiz_timeline').animate({scrollTop: $(q).position().top}, 'slow');
}
}
});
});
$( 'body' ).delegate( '#question', 'question_loaded',function(){
runnecessaryfunctions();
jQuery('.question_options.sort').each(function(){
var defaultanswer='1';
var lastindex = $('ul.question_options li').size();
if(lastindex>1)
for(var i=2;i<=lastindex;i++){
defaultanswer = defaultanswer+','+i;
}
$('#comment').val(defaultanswer);
$('#comment').trigger('change');
jQuery('.question_options.sort').sortable({
revert: true,
cursor: 'move',
refreshPositions: true,
opacity: 0.6,
scroll:true,
containment: 'parent',
placeholder: 'placeholder',
tolerance: 'pointer',
update: function( event, ui ) {
var order = $('.question_options.sort').sortable('toArray').toString();
$('#comment').val(order);
$('#comment').trigger('change');
}
}).disableSelection();
});
//Fill in the Blank Live EDIT
$(".live-edit").liveEdit({
afterSaveAll: function(params) {
return false;
}
});
//Match question type
$('.question_options.match').droppable({
drop: function( event, ui ){
$(ui.draggable).removeAttr('style');
$( this )
.addClass( "ui-state-highlight" )
.append($(ui.draggable))
}
});
$('.question_options.match li').draggable({
revert: "invalid",
containment:'#question'
});
$( ".matchgrid_options li" ).droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
drop: function( event, ui ){
childCount = $(this).find('li').length;
$(ui.draggable).removeAttr('style');
if (childCount !=0){
return;
}
$( this )
.addClass( "ui-state-highlight" )
.append($(ui.draggable))
}
});
if($('.matchgrid_options').hasClass('saved_answer')){
var id;
$('.matchgrid_options li').each(function(index,value){
id = $('.matchgrid_options').attr('data-match'+index);
$(this).append($('#'+id));
});
}
});
jQuery(document).ready( function($) {
$('.quiz_timer').one('activate',function(){
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.timer({
'timer': qtime,
'width' : 200 ,
'height' : 200 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'bgColor' : vibe_course_module_strings.single_dark_color
});
var $timer =$(this).find('.timer');
$timer.on('change',function(){
var countdown= $this.find('.countdown');
var val = parseInt($timer.attr('data-timer'));
if(val > 0){
val--;
$timer.attr('data-timer',val);
var $text='';
if(val > 60){
$text = Math.floor(val/60) + ':' + ((parseInt(val%60) < 10)?'0'+parseInt(val%60):parseInt(val%60)) + '';
}else{
$text = '00:'+ ((val < 10)?'0'+val:val);
}
countdown.html($text);
}else{
countdown.html(vibe_course_module_strings.theme_color);
if(!$('.submit_quiz').hasClass('triggerred')){
$('.submit_quiz').trigger('click');
$('.submit_quiz').addClass('triggerred');
}
$('.quiz_timer').trigger('end');
}
});
});
$('.quiz_timer').one('deactivate',function(){
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 200 ,
'height' : 200 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'bgColor' : vibe_course_module_strings.single_dark_color,
'thickness': 0.2 ,
'readonly':true
});
event.stopPropagation();
});
$('.quiz_timer').one('end',function(event){
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 200 ,
'height' : 200 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'bgColor' : vibe_course_module_strings.single_dark_color,
'thickness': 0.2 ,
'readonly':true
});
event.stopPropagation();
});
// Timer function runs after Trigger event definition
$('.quiz_timer').each(function(){
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 200 ,
'height' : 200 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'bgColor' : vibe_course_module_strings.single_dark_color,
'thickness': 0.2 ,
'readonly':true
});
if($(this).hasClass('start')){
$('.quiz_timer').trigger('activate');
}
});
jQuery('.question_options.sort').each(function(){
var defaultanswer='1';
var lastindex = $('ul.question_options li').size();
if(lastindex>1)
for(var i=2;i<=lastindex;i++){
defaultanswer = defaultanswer+','+i;
}
$('#comment').val(defaultanswer);
$('#comment').trigger('change');
jQuery('.question_options.sort').sortable({
revert: true,
cursor: 'move',
refreshPositions: true,
opacity: 0.6,
scroll:true,
containment: 'parent',
placeholder: 'placeholder',
tolerance: 'pointer',
update: function( event, ui ) {
var order = $('.question_options.sort').sortable('toArray').toString();
$('#comment').val(order);
$('#comment').trigger('change');
}
}).disableSelection();
});
});
$( 'body' ).on( 'click','.expand_message',function(event){
event.preventDefault();
$('.bulk_message').toggle('slow');
});
$('body').on('click','.expand_change_status',function(event){
event.preventDefault();
$('.bulk_change_status').toggle('slow');
$('#status_action').on('change',function(){
if($(this).val() === 'finish_course' ){
$('#finish_marks').removeClass('hide');
}else{
$('#finish_marks').addClass('hide');
}
});
});
$( 'body' ).on( 'click','.expand_add_students',function(event){
event.preventDefault();
$('.bulk_add_students').toggle('slow');
});
$( 'body' ).on( 'click','.expand_assign_students', function(event){
event.preventDefault();
$('.bulk_assign_students').toggle('slow');
});
$( 'body' ).on( 'click','.extend_subscription_students', function(event){
event.preventDefault();
$('.bulk_extend_subscription_students').toggle('slow');
});
$( 'body' ).delegate( '#send_course_message', 'click', function(event){
event.preventDefault();
var members=[];
var $this = $(this);
var defaultxt=$this.html();
$this.html(' '+vibe_course_module_strings.sending_messages);
var i=0;
$('.member').each(function(){
if($(this).is(':checked')){
members[i]=$(this).val();
i++;
}
});
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'send_bulk_message',
security: $('#buk_action').val(),
course:$this.attr('data-course'),
sender: $('#sender').val(),
members: JSON.stringify(members),
subject: $('#bulk_subject').val(),
message: $('#bulk_message').val(),
},
cache: false,
success: function (html) {
$('#send_course_message').html(html);
setTimeout(function(){$this.html(defaultxt);}, 5000);
}
});
});
$( 'body' ).delegate( '#add_student_to_course', 'click', function(event){
event.preventDefault();
var $this = $(this);
var defaultxt=$this.html();
var students = $('#student_usernames').val();
if(students.length <= 0){
$('#add_student_to_course').html(vibe_course_module_strings.unable_add_students);
setTimeout(function(){$this.html(defaultxt);}, 2000);
return;
}
$this.html(' '+vibe_course_module_strings.adding_students);
var i=0;
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'add_bulk_students',
security: $('#buk_action').val(),
course:$this.attr('data-course'),
members: students,
},
cache: false,
success: function (html) {
if(html.length && html !== '0'){
$('#add_student_to_course').html(vibe_course_module_strings.successfuly_added_students);
$('ul.course_students').append(html);
}else{
$('#add_student_to_course').html(vibe_course_module_strings.unable_add_students);
}
setTimeout(function(){$this.html(defaultxt);}, 3000);
}
});
});
$( 'body' ).delegate( '#download_stats', 'click', function(event){
event.preventDefault();
var $this = $(this);
var defaultxt=$this.html();
var i=0;
var fields=[];
$('.field:checked').each(function(){
fields[i]=$(this).attr('id');//$(this).val();
i++;
});
if(i==0){
$this.html(vibe_course_module_strings.select_fields);
setTimeout(function(){$this.html(defaultxt);}, 13000);
return false;
}else{
$this.html(' '+vibe_course_module_strings.processing);
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'download_stats',
security: $('#stats_security').val(),
course:$this.attr('data-course'),
fields: JSON.stringify(fields),
type:$('#stats_students').val()
},
cache: false,
success: function (html) {
$this.attr('href',html);
$this.attr('id','download');
$this.html(vibe_course_module_strings.download)
//setTimeout(function(){$this.html(defaultxt);}, 5000);
}
});
}
});
$('body').delegate('#download_mod_stats','click',function(event){
event.preventDefault();
var $this = $(this);
var defaultxt=$this.html();
var i=0;
var fields=[];
$('.field:checked').each(function(){
fields[i]=$(this).attr('id');//$(this).val();
i++;
});
if(i==0){
$this.html(vibe_course_module_strings.select_fields);
setTimeout(function(){$this.html(defaultxt);}, 13000);
return false;
}else{
$this.html(' '+vibe_course_module_strings.processing);
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'download_mod_stats',
security: $('#stats_security').val(),
type:$this.attr('data-type'),
id:$this.attr('data-id'),
fields: JSON.stringify(fields),
select:$('#stats_students').val()
},
cache: false,
success: function (html) {
$this.attr('href',html);
$this.attr('id','download');
$this.html(vibe_course_module_strings.download)
//setTimeout(function(){$this.html(defaultxt);}, 5000);
}
});
}
});
$( 'body' ).delegate( '#assign_course_badge_certificate', 'click', function(event){
event.preventDefault();
var members=[];
var $this = $(this);
var defaultxt=$this.html();
$this.html(' '+vibe_course_module_strings.processing);
var i=0;
$('.member').each(function(){
if($(this).is(':checked')){
members[i]=$(this).val();
i++;
}
});
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'assign_badge_certificates',
security: $('#buk_action').val(),
course: $this.attr('data-course'),
members: JSON.stringify(members),
assign_action: $('#assign_action').val(),
},
cache: false,
success: function (html) {
$this.html(html);
setTimeout(function(){$this.html(defaultxt);}, 5000);
}
});
});
$( 'body' ).delegate( '#change_course_status', 'click', function(event){
event.preventDefault();
var members=[];
var $this = $(this);
var defaultxt=$this.html();
$this.html(' '+vibe_course_module_strings.processing);
var i=0;
$('.member').each(function(){
if($(this).is(':checked')){
members[i]=$(this).val();
i++;
}
});
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'change_course_status',
security: $('#buk_action').val(),
course: $this.attr('data-course'),
members: JSON.stringify(members),
status_action: $('#status_action').val(),
data: $('#finish_marks').val()
},
cache: false,
success: function (html) {
$this.html(html);
setTimeout(function(){$this.html(defaultxt);}, 5000);
}
});
});
$( 'body' ).delegate( '#extend_course_subscription', 'click', function(event){
event.preventDefault();
var members=[];
var $this = $(this);
var defaultxt=$this.html();
$this.html(' '+vibe_course_module_strings.processing);
var i=0;
$('.member').each(function(){
if($(this).is(':checked')){
members[i]=$(this).val();
i++;
}
});
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'extend_course_subscription',
security: $('#buk_action').val(),
course: $this.attr('data-course'),
members: JSON.stringify(members),
extend_amount: $('#extend_amount').val(),
},
cache: false,
success: function (html) {
$this.html(html);
setTimeout(function(){$this.html(defaultxt);}, 5000);
}
});
});
$( 'body' ).delegate( '#mark-complete', 'media_loaded', function(event){
event.preventDefault();
if($(this).hasClass('tip')){
$(this).addClass('disabled');
}
});
$( 'body' ).delegate( '#mark-complete', 'media_complete', function(event){
event.preventDefault();
if($(this).hasClass('tip')){
$(this).removeClass('disabled');
$(this).removeClass('tip');
$(this).tooltip('destroy');
jQuery('.tip').tooltip();
}
});
$( 'body' ).delegate( '#mark-complete', 'click', function(event){
event.preventDefault();
if($(this).hasClass('disabled')){
return false;
}
var $this = $(this);
var unit_id=$(this).attr('data-unit');
$this.prepend(' ');
$('body').find('.course_progressbar').removeClass('increment_complete');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'complete_unit',
security: $('#hash').val(),
course_id: $('#course_id').val(),
id: unit_id
},
cache: false,
success: function (html) {
$this.find('i').remove();
$this.html(' ');
$('.course_timeline').find('.active').addClass('done');
$('body').find('.course_progressbar').trigger('increment');
$('#mark-complete').addClass('disabled');
var cookie_id = 'course_progress'+$('#course_id').val();
var value= $('.course_progressbar').attr('data-value');
$.cookie(cookie_id,value, { expires: 1 ,path: '/'});
if(html.length > 0){
$('#next_unit').removeClass('hide');
$('#next_unit').attr('data-unit',html);
$('#next_quiz').removeClass('hide');
$('#next_quiz').attr('data-unit',html);
$('#unit'+html).find('a').addClass('unit');
$('#unit'+html).find('a').attr('data-unit',html);
}
if(typeof unit != 'undefined')
$('.unit_timer').trigger('finish');
}
});
});
$('.course_progressbar').on('increment',function(event){
if($(this).hasClass('increment_complete')){
event.stopPropagation();
return false;
}else{
var iunit = parseFloat($(this).attr('data-increase-unit'));
var per = parseFloat($(this).attr('data-value'));
newper = iunit + per;
newper = newper.toFixed(2);
var amountunits = 100/iunit;
amountunits = amountunits.toFixed(2);
var maxper = iunit*amountunits;
maxper = maxper.toFixed(2);
if (newper == maxper) {
newper = 100;
}
//Boundary Conditions
if(newper>100)
newper=100;
$(this).find('.bar').css('width',newper+'%');
$(this).find('.bar span').html(newper + '%');
$(this).addClass('increment_complete');
$(this).attr('data-value',newper);
$.ajax({
type: "POST",
url: ajaxurl,
async:true,
data: { action: 'record_course_progress',
security: $('#hash').val(),
course_id: $('#course_id').val(),
progress: newper
},
cache: false,
cache: false,
success: function (html) {
var cookie_id ='course_progress'+$('#course_id').val();
$.cookie(cookie_id,newper, { path: '/' });
}
});
}
event.stopPropagation();
return false;
});
$('.course_progressbar').on('decrement',function(event){
if($(this).hasClass('increment_complete')){
event.stopPropagation();
return false;
}else{
var iunit = parseFloat($(this).attr('data-increase-unit'));
var per = parseFloat($(this).attr('data-value'));
newper = per-iunit;
if(newper<0)
newper=0;
$(this).find('.bar').css('width',newper+'%');
$(this).find('.bar span').html(newper + '%');
$(this).addClass('increment_complete');
$(this).attr('data-value',newper);
$.ajax({
type: "POST",
url: ajaxurl,
async:true,
data: { action: 'record_course_progress',
security: $('#hash').val(),
course_id: $('#course_id').val(),
progress: newper
},
cache: false,
success: function (html) {
var cookie_id ='course_progress'+$('#course_id').val();
$.cookie(cookie_id,newper, { path: '/' });
}
});
}
event.stopPropagation();
return false;
});
jQuery(document).ready(function($){
$('.showhide_indetails').click(function(event){
event.preventDefault();
$(this).find('i').toggleClass('icon-minus');
$(this).parent().find('.in_details').toggle();
});
$('.ajax-certificate').each(function(){
$(this).magnificPopup({
type: 'ajax',
fixedContentPos: true,
alignTop:true,
preloader: false,
midClick: true,
removalDelay: 300,
showCloseBtn:false,
mainClass: 'mfp-with-zoom',
callbacks: {
parseAjax: function( mfpResponse ) {
mfpResponse.data = $(mfpResponse.data).find('#certificate');
},
ajaxContentAdded: function() {
html2canvas($('#certificate'), {
backgrounnd:'#ffffff',
onrendered: function(canvas) {
var data = canvas.toDataURL("image/jpeg");
$('#certificate .certificate_content').html(' ');
$('#certificate').trigger('generate_certificate');
var doc = new jsPDF();
var width = 210;
var height = 80;
if($('#certificate .certificate_content').attr('data-width').length){
height = Math.round(210*parseInt($('#certificate .certificate_content').attr('data-height'))/parseInt($('#certificate .certificate_content').attr('data-width')));
}
doc.addImage(data, 'JPEG',0,0, 210,height);
$('.certificate_pdf').click(function(){
doc.output('dataurlnewwindow');
});
}
});
}
}
});
});
$('.ajax-badge').each(function(){
var $this=$(this);
var img=$this.find('img');
$(this).magnificPopup({
items: {
src: '',
type: 'inline'
},
fixedContentPos: false,
alignTop:false,
preloader: false,
midClick: true,
removalDelay: 300,
showCloseBtn:false,
mainClass: 'mfp-with-zoom center-aligned'
});
});
$( 'body' ).delegate( '.print_unit', 'click', function(event){
$('.unit_content').print();
});
$( 'body' ).delegate( '.printthis', 'click', function(event){
$(this).parent().print();
});
$( 'body' ).delegate( '#certificate', 'generate_certificate', function(event){
$(this).addClass('certificate_generated');
});
$( 'body' ).delegate( '.certificate_print', 'click', function(event){
event.preventDefault();
$(this).parent().parent().print();
});
$('.widget_carousel').flexslider({
animation: "slide",
controlNav: false,
directionNav: true,
animationLoop: true,
slideshow: false,
prevText: " ",
nextText: " ",
});
/*=== Quick tags ===*/
$( 'body' ).delegate( '.unit-page-links a', 'click', function(event){
if($('body').hasClass('single-unit'))
return;
event.preventDefault();
var $this=$(this);
$this.prepend(' ');
$( ".main_unit_content" ).load( $this.attr('href') +" .single_unit_content" ,function(){
$('.unit_content').trigger('unit_traverse');
$('body').trigger('unit_loaded');
});
$this.find('i').remove();
$( ".main_unit_content" ).trigger('unit_reload');
});
$( 'body' ).delegate('.pricing_course', 'click', function(event){
$(this).toggleClass('active');
});
$( 'body' ).delegate( '.pricing_course li', 'click', function(event){
var parent = $(this).parent();
var $this = $(this);
parent.find('.active').removeClass('active');
$this.addClass('active');
if($('.course_button').length){
var value = $(this).attr('data-value');
$('.course_button').attr('href',value);
}
});
});
$('.unit_content').on('unit_traverse',function(){
runnecessaryfunctions();
});
// Course Unit Traverse
$( 'body' ).delegate( '.unit', 'click', function(event){
event.preventDefault();
if($(this).hasClass('disabled')){
return false;
}
var $this = $(this);
var unit_id=$(this).attr('data-unit');
if($this.prev().is('span')){
$this.prev().addClass('loading');
}else{
$this.prepend(' ');
}
$('#ajaxloader').removeClass('disabled');
$('.unit_content').addClass("loading");
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'unit_traverse',
security: $('#hash').val(),
course_id: $('#course_id').val(),
id: unit_id
},
cache: false,
success: function (html) {
$('body,html').animate({
scrollTop: 0
}, 1200);
if($this.prev().is('span')){
$this.prev().removeClass('loading');
}else{
$this.find('i').remove();
}
$('#ajaxloader').addClass('disabled');
$('.unit_content').removeClass("loading");
$('.unit_content').html(html);
var unit=$($.parseHTML(html)).filter("#unit");
var u='#unit'+unit.attr('data-unit');
$('.course_timeline').find('.active').removeClass('active');
$(u).addClass('active');
$('.unit_content').trigger('unit_traverse');
$('audio,video').mediaelementplayer({
success: function(media,node,player) {
$('#mark-complete').trigger('media_loaded');
$('.mejs-container').each(function(){
$(this).addClass('mejs-mejskin');
});
media.addEventListener('ended', function (e) {
$('#mark-complete').trigger('media_complete');
});
}
});
runnecessaryfunctions();
//=== UNIT COMMENTS ======
if($('.unit_wrap').hasClass('enable_comments')){
$('.unit_content').trigger('load_comments');
}
if(typeof unit != 'undefined')
$('.unit_timer').trigger('activate');
}
});
});
/*==============================================================*/
/*======================= UNIT COMMENTS ========================*/
/*==============================================================*/
$( 'body' ).delegate( '.unit_content', 'load_comments', function(event){
if($(this).find('.main_unit_content').hasClass('stop_notes') || $('body').hasClass('wp-fee-body'))
return;
var unit_id=$('#unit').attr('data-unit');
$('.unit_content p').each(function(index){
if (!$(this).parents('.question').length){
$(this).attr('data-section-id',index);
$(this).append('');
}
});
unitComments();
$.ajax({
type: "POST",
dataType: "json",
url: ajaxurl,
data: { action: 'get_unit_comment_count',
security: $('#hash').val(),
unit_id: unit_id,
},
cache: false,
success: function (response) {
$.each(response, function(idx, obj) {
$('#'+obj.id).text(obj.count);
});
}
});
$('.side_comment').on('click',function(){
if($(this).hasClass('active'))
return false;
var $this = $(this);
var section = $('.side_comment.active').attr('id');
$('.side_comment').removeClass('active');
$('.side_comments .main_comments>li:not(".hide")').remove();
$(this).addClass('active');
var id = $(this).attr('id');
$('.add-comment').fadeIn();
$('.add-comment').next().fadeOut();
var check = $(this).text();
var href='#';
$('.side_comments .main_comments').find('.loaded').remove();
if( jQuery.isNumeric(check)){
var comment_html ='';
var cookie_id='unit_comments'+unit_id;
//var unit_comments = $.cookie(cookie_id);
var unit_comments = sessionStorage.getItem(cookie_id);
//CHeck cookie
if (unit_comments !== null){
unit_comments = JSON.parse(unit_comments);
$.each(unit_comments, function(idxx, objStr) {
$.each(objStr, function(idx, obj){
if(id == idx){
comment_html += '';
jQuery.each(obj.controls, function(i,o) {
if(o>1){
jQuery('.side_comments li.hide').find('.'+i).addClass('meta_info').attr('data-meta',o);
}
var control = jQuery('.side_comments li.hide').find('.'+i).parent()[0].outerHTML;
if(o>1){
jQuery('.side_comments li.hide').find('.'+i).removeClass('meta_info').removeAttr('data-meta');
}
comment_html +=control;
});
comment_html +=' ';
href=$(comment_html).find('.popup_unit_comment').removeClass('meta_info').attr('data-href');
href +='?unit_id='+unit_id+'§ion='+idx;
}
});
});
$('.side_comments .main_comments').append(comment_html);
$('.side_comments .main_comments .popup_unit_comment').attr('href',href);
jQuery('.tip').tooltip();
$('.popup_unit_comment').magnificPopup({
type: 'ajax',
alignTop: true,
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in',
callbacks: {
parseAjax: function( mfpResponse ) {
mfpResponse.data = $(mfpResponse.data).find('.content');
}
}
});
}else{ //ajax request and grab the json from ajax
section =$('.side_comment.active').attr('id');
$.ajax({
type: "POST",
dataType: "json",
url: ajaxurl,
data: { action: 'unit_section_comments',
security: $('#hash').val(),
unit_id: unit_id,
section: section,
num:$('.side_comment').length
},
cache: false,
success: function (jsonStr){
var cookie_value =JSON.stringify(jsonStr);
sessionStorage.setItem(cookie_id,cookie_value);
$.each(jsonStr, function(idxx, objStr){
$.each(objStr, function(idx, obj){
if(id == idx){
comment_html += '';
jQuery.each(obj.controls, function(i,o) {
if(o>1){
jQuery('.side_comments li.hide').find('.'+i).addClass('meta_info').attr('data-meta',o);
}
var control = jQuery('.side_comments li.hide').find('.'+i).parent()[0].outerHTML;
if(o>1){
jQuery('.side_comments li.hide').find('.'+i).removeClass('meta_info').removeAttr('data-meta');
}
comment_html +=control;
});
comment_html +=' ';
var href=$(comment_html).find('.popup_unit_comment').attr('href');
href +='?unit_id='+unit_id+'§ion='+idx;
$(comment_html).find('.popup_unit_comment').attr('href',href);
}
});
});
$('.side_comments .main_comments').append(comment_html);
jQuery('.tip').tooltip();
$('.popup_unit_comment').magnificPopup({
type: 'ajax',
alignTop: true,
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in',
callbacks: {
parseAjax: function( mfpResponse ) {
mfpResponse.data = $(mfpResponse.data).find('.content');
}
}
});
}
});
} //end else
} // end if numeric check
var all_href=$('#all_comments_link').attr('data-href');
all_href +='?unit_id='+unit_id+'§ion='+$('.side_comment.active').attr('id');
$('#all_comments_link').attr('href',all_href);
var top = $(this).offset().top;
var content_top=$('#unit_content').offset().top;
var height = $('.side_comments').height();
var limit = $('.unit_prevnext').offset().top;
if((top+height) > limit){
top = limit - content_top - height;
}else{
top = top - content_top;
}
if(top >0){
$('.side_comments').css('top',top+'px');
$('.side_comments').removeClass('scroll');
}else{
$('.side_comments').addClass('scroll');
var h=$('.main_unit_content').height();
$('.side_comments').css('height',h+'px');
}
});
/*=== END UNIT COMMENTS ======*/
});
/* ===== UNIT COMMENTS =====*/
jQuery(document).ready(function($){
$('.add-comment').on('click',function(){
$(this).fadeOut(0);
$(this).next('.comment-form').fadeIn(100);
});
$('.new_side_comment').on('click',function(){
if(!$(this).hasClass('cleared')){
$(this).html('');$(this).addClass('cleared');
$(this).parent().parent().addClass('active');
$(this).parent().parent().parent().find('.add-comment').addClass('deactive');
}
});
$('.remove_side_comment').on('click',function(){
$(this).closest('.side_comments').find('.add-comment').fadeIn(100);
$(this).closest('.comment-form').fadeOut();
$('.new_side_comment').removeClass('cleared');
$('.new_side_comment').text(vibe_course_module_strings.add_comment);
});
});
$( 'body' ).delegate( '.public_unit_comment', 'click', function(event){
event.preventDefault();
var $this = $(this);
var id =$this.closest('li.loaded>div').attr('data-id');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'public_user_comment',
security: $('#hash').val(),
id: id
},
cache: false,
success: function (html) {
$this.removeClass('public_unit_comment');
$this.addClass('private_unit_comment');
$this.find('i').removeClass().addClass('icon-fontawesome-webfont-4');
$this.attr('data-original-title',vibe_course_module_strings.private_comment);
var unit_id = $('#unit').attr('data-unit');
var cookie_id='unit_comments'+unit_id;
sessionStorage.removeItem(cookie_id);
}
});
});
$( 'body' ).delegate( '.private_unit_comment', 'click', function(event){
event.preventDefault();
var $this = $(this);
var id =$this.closest('li.loaded>div').attr('data-id');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'private_user_comment',
security: $('#hash').val(),
id: id
},
cache: false,
success: function (html) {
$this.removeClass('private_unit_comment');
$this.addClass('public_unit_comment');
$this.find('i').removeClass().addClass('icon-fontawesome-webfont-3');
$this.attr('data-original-title',vibe_course_module_strings.public_comment);
var unit_id = $('#unit').attr('data-unit');
var cookie_id='unit_comments'+unit_id;
sessionStorage.removeItem(cookie_id);
}
});
});
$( 'body' ).delegate( '.edit_unit_comment', 'click', function(event){
event.preventDefault();
var $this = $(this);
var content = $this.parent().parent().parent();
var form = $('.comment-form').first().clone();
var img = content.find('img').clone();
var unit_comment_author = content.find('.unit_comment_author').clone();
var id = content.attr('data-id');
form.find('img').replaceWith(function(){return img;});
form.find('span').replaceWith(function(){return unit_comment_author;});
var new_content = content.find('.unit_comment_content');
form.find('.new_side_comment').html(new_content.html());
//console.log(id+'#');
form.find('.post_unit_comment').removeClass().addClass('edit_form_unit_comment').attr('data-id',id);
form.find('.remove_side_comment').removeClass().addClass('remove_form_edit_unit_comment');
content.parent().append(form);
content.hide();
content.parent().find('.comment-form').show();
});
$( 'body' ).delegate( '.remove_form_edit_unit_comment', 'click', function(event){
$(this).parent().parent().parent().parent().find('.note,.public').show();
$(this).closest('.comment-form').remove();
$('.new_side_comment').removeClass('cleared');
});
$( 'body' ).delegate( '.reply_unit_comment', 'click', function(event){
event.preventDefault();
var parent_li = $(this).parent().parent().parent().parent();
if($(this).hasClass('meta_info')){
var id =$(this).attr('data-meta');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'get_user_reply',
security: $('#hash').val(),
id: id
},
cache: false,
success: function (html) {
if(!jQuery.isNumeric(html)){
parent_li.after(html);
}
}
});
}else{
$('.add-comment').trigger('click');
$('.comment-form').addClass('creply');
$('.comment-form').attr('data-cid',$(this).closest('.actions').parent().attr('data-id'));
}
});
$( 'body' ).delegate( '.instructor_reply_unit_comment', 'click', function(event){
event.preventDefault();
if($(this).hasClass('call'))
return false;
var $ithis=$(this);
var message = $ithis.parent().parent().parent().find('.unit_comment_content').html();
var unit_id =$('#unit').attr('data-unit');
//console.log(unit_id);
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'instructor_reply_user_comment',
security: $('#hash').val(),
message:message,
id: unit_id,
section:$('.side_comment.active').attr('id')
},
cache: false,
success: function (html) {
$ithis.addClass('call');
}
});
});
$( 'body' ).delegate( '.edit_form_unit_comment', 'click', function(event){
event.preventDefault();
var $new_this = $(this);
var id =$new_this.attr('data-id');
var new_content = $('.new_side_comment').html();
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'edit_user_comment',
security: $('#hash').val(),
content:new_content,
id: id
},
cache: false,
success: function (html) {
var unit_id = $('#unit').attr('data-unit');
var cookie_id='unit_comments'+unit_id;
sessionStorage.removeItem(cookie_id);
var new_parent =$new_this.closest('.comment-form').prev().parent();
new_parent.find('.unit_comment_content').html(new_content);
$new_this.closest('.comment-form').remove();
new_parent.find('.note,.public').show();
}
});
});
$( 'body' ).delegate( '.remove_unit_comment', 'click', function(event){
event.preventDefault();
var $this = $(this);
var id =$this.parent().parent().closest('li>div').attr('data-id');
$this.addClass('animated spin');
$.confirm({
text: vibe_course_module_strings.remove_comment,
confirm: function() {
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'remove_user_comment',
security: $('#hash').val(),
id: id
},
cache: false,
success: function (html) {
$this.removeClass('animated');
$this.removeClass('spin');
var cid = $this.closest('.actions').attr('data-pid');
var count=parseInt($('#'+cid).text());
count--;
$('#'+cid).text(count);
$this.closest('li.loaded').fadeOut(200,function(){$(this).remove();});
var unit_id = $('#unit').attr('data-unit');
var cookie_id='unit_comments'+unit_id;
$('.new_side_comment').removeClass('cleared');
sessionStorage.removeItem(cookie_id);
}
});
},
cancel: function() {
$this.removeClass('animated');
$this.removeClass('spin');
},
confirmButton: vibe_course_module_strings.remove_comment_button,
cancelButton: vibe_course_module_strings.cancel
});
});
$( 'body' ).delegate( '.post_unit_comment', 'click', function(event){
event.preventDefault();
if($(this).hasClass('disabled')){
return false;
}
var reply =0;
if($(this).closest('.comment-form').hasClass('creply')){
reply = $(this).closest('.comment-form').attr('data-cid');
}
var $this = $(this);
var section = $('.side_comment.active').attr('id');
var unit_id = $('#unit').attr('data-unit');
var list =$this.closest('.side_comments').find('ul.main_comments');
var list_html = list.find('li.hide').clone();
var content = $(this).closest('.comment-form').find('.new_side_comment').html();
var cookie_id='unit_comments'+unit_id;
$this.addClass('disabled');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'post_unit_comment',
security: $('#hash').val(),
course_id: $('#course_id').val(),
unit_id: unit_id,
content:content,
section:section,
reply:reply
},
cache: false,
success: function (id) {
$this.removeClass('disabled');
if( jQuery.isNumeric(id)){
var cookie_id='unit_comments'+unit_id;
var unit_comments = $.cookie(cookie_id);
var comment={
section:{
'content':content,
'type':'note',
'author':{
'img':list_html.find('img').attr('src'),
'name':list_html.find('.unit_comment_author').text(),
'link':list_html.find('.unit_comment_author').attr('href'),
},
'controls':{
'edit_unit_comment':1,
'public_unit_comment':1,
'instructor_reply_unit_comment':1,
'popup_unit_comment':1,
'remove_unit_comment':1
}
}
};
sessionStorage.removeItem(cookie_id);
list_html.find('.unit_comment_content').html(content);
list_html.removeClass();
list_html.find('.actions .private_unit_comment').parent().remove();
list.append(list_html);
var href=$(list_html).find('.popup_unit_comment').attr('data-href');
href +='?unit_id='+unit_id+'§ion='+$('.side_comment.active').attr('id');
$(list_html).find('.popup_unit_comment').attr('href',href);
jQuery('.tip').tooltip();
var count=$('#'+section).text();
if( jQuery.isNumeric(count)){
count=parseInt(count)+1;
}else{
count=1;
}
$('.new_side_comment').removeClass('cleared');
$('#'+section).text(count);
$('.add-comment').fadeIn();
$('.comment-form').removeClass('active').fadeOut();
$('.new_side_comment').text(vibe_course_module_strings.add_comment);
$('.popup_unit_comment').magnificPopup({
type: 'ajax',
alignTop: true,
fixedContentPos: true,
fixedBgPos: true,
overflowY: 'auto',
closeBtnInside: true,
preloader: false,
midClick: true,
removalDelay: 300,
mainClass: 'my-mfp-zoom-in',
callbacks: {
parseAjax: function( mfpResponse ) {
mfpResponse.data = $(mfpResponse.data).find('.content');
}
}
});
}else{
$this.closest('.comment-form').append(''+id+'
');
}
}
});
});
$( 'body' ).delegate( '.note-tabs li', 'click', function(event){
event.preventDefault();
$(this).parent().find('.selected').removeClass('selected');
$(this).addClass('selected');
var action = $(this).attr('id');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: action,
security: $('#hash').val(),
unit_id:$.urlParam('unit_id'),
section:$.urlParam('section')
},
cache: false,
success: function (html) {
$('.content').html(html);
$(".live-edit").liveEdit({
afterSaveAll: function(params) {
return false;
}
});
}
});
});
$( 'body' ).delegate( '#load_more_notes', 'click', function(event){
var json = $('#notes_query').html();
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'load_more_notes',
security: $('#hash').val(),
json:json
},
cache: false,
success: function (html) {
if( jQuery.isNumeric(html)){
$('#load_more_notes').hide();
}else{
var newjson = $(html).filter('#new_notes_query').html();
$('#notes_query').html(newjson);
$('#notes_discussions .notes_list').append(html);
$('#new_notes_query').remove();
}
$(".live-edit").liveEdit({
afterSaveAll: function(params) {
return false;
}
});
}
});
});
jQuery(document).ready(function(){
jQuery('.course_curriculum.accordion .course_section').click(function(event){
jQuery(this).toggleClass('show');
jQuery(this).nextUntil('.course_section').toggleClass('show');
});
jQuery('.course_timeline.accordion .section').on('click',function(event){
jQuery(this).toggleClass('show');
jQuery(this).nextUntil('.section').toggleClass('show');
});
jQuery('.course_timeline.accordion').each(function(){
var $this = $(this);
$this.find('.unit_line.active').prevAll('.section').trigger('click');
});
$('.unit_content').on('unit_traverse',function(){
var section =$('.course_timeline.accordion').find('.unit_line.active').prev('.section');
if($('.course_timeline.accordion').find('.unit_line.active').prev().hasClass('section')){
jQuery('.course_timeline.accordion .section.show').trigger('click'); // Close the open one
}
if(!section.hasClass('show'))
section.trigger('click');
});
$('.retake_submit').click(function(){
$(this).parent().submit();
});
});
/*==============================================================*/
/*======================= In Course Quiz ========================*/
/*==============================================================*/
$(document).ready(function(){
$('.inquiz_timer').each(function(){
$('.inquiz_timer').one('activate',function(){
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.timer({
'timer': qtime,
'width' : 72 ,
'height' : 72 ,
'fgColor' : vibe_course_module_strings.theme_color
});
$timer.on('change',function(){
var countdown= $this.find('.countdown');
var val = parseInt($timer.attr('data-timer'));
if(val > 0){
val--;
$timer.attr('data-timer',val);
var $text='';
if(val > 60){
$text = Math.floor(val/60) + ':' + ((parseInt(val%60) < 10)?'0'+parseInt(val%60):parseInt(val%60)) + '';
}else{
$text = '00:'+ ((val < 10)?'0'+val:val);
}
countdown.html($text);
}else{
countdown.html(vibe_course_module_strings.timeout);
if(!$('.submit_inquiz').hasClass('triggerred')){
$('.submit_inquiz').addClass('triggerred');
$('.submit_inquiz').trigger('click');
}
$('.inquiz_timer').trigger('deactivate');
}
});
});
$('.inquiz_timer').one('deactivate',function(event){
var qtime = 0;
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 72 ,
'height' : 72 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'readonly':true
});
event.stopPropagation();
});
// END IN QUIZ TIMER
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 72 ,
'height' : 72 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'thickness': 0.1 ,
'readonly':true
});
if($(this).hasClass('start')){
$('.inquiz_timer').trigger('activate');
}
});
});
// IN QUIZ TIMER
$('.unit_content').on('unit_traverse',function(){
$('.inquiz_timer').each(function(){
$('.inquiz_timer').one('activate',function(){
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.timer({
'timer': qtime,
'width' : 72 ,
'height' : 72 ,
'fgColor' : vibe_course_module_strings.theme_color
});
$timer.on('change',function(){
var countdown= $this.find('.countdown');
var val = parseInt($timer.attr('data-timer'));
if(val > 0){
val--;
$timer.attr('data-timer',val);
var $text='';
if(val > 60){
$text = Math.floor(val/60) + ':' + ((parseInt(val%60) < 10)?'0'+parseInt(val%60):parseInt(val%60)) + '';
}else{
$text = '00:'+ ((val < 10)?'0'+val:val);
}
countdown.html($text);
}else{
countdown.html(vibe_course_module_strings.timeout);
if(!$('.submit_inquiz').hasClass('triggerred')){
$('.submit_inquiz').addClass('triggerred');
$('.submit_inquiz').trigger('click');
}
$('.inquiz_timer').trigger('deactivate');
}
});
});
$('.inquiz_timer').one('deactivate',function(event){
var qtime = 0;
var $timer =$(this).find('.timer');
var $this=$(this);
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 72 ,
'height' : 72 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'readonly':true
});
event.stopPropagation();
});
// END IN QUIZ TIMER
var qtime = parseInt($(this).attr('data-time'));
var $timer =$(this).find('.timer');
$timer.knob({
'readonly':true,
'max': qtime,
'width' : 72 ,
'height' : 72 ,
'fgColor' : vibe_course_module_strings.theme_color ,
'thickness': 0.1 ,
'readonly':true
});
if($(this).hasClass('start')){
$('.inquiz_timer').trigger('activate');
}
});
});
$( 'body' ).delegate( '.unit_button.start_quiz', 'click', function(event){
event.preventDefault();
var $this=$(this);
$('#ajaxloader').removeClass('disabled');
$('#unit_content').addClass('loading');
if($this.hasClass('continue')){
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'in_start_quiz',
security: $('#hash').val(),
quiz_id:$('#unit.quiz_title').attr('data-unit'),
},
cache: false,
success: function (html) {
$('.main_unit_content').html(html);
$('.in_quiz').trigger('question_loaded');
$this.removeClass('start_quiz continue');
$this.attr('href','#');
$this.addClass('submit_inquiz');
runnecessaryfunctions();
$this.text(vibe_course_module_strings.submit_quiz);
$('.quiz_title .inquiz_timer').trigger('activate');
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
}
});
}else{
$.confirm({
text: vibe_course_module_strings.start_quiz_notification,
confirm: function() {
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'in_start_quiz',
security: $('#hash').val(),
quiz_id:$('#unit.quiz_title').attr('data-unit'),
},
cache: false,
success: function (html) {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
$('.main_unit_content').html(html);
$('.in_quiz').trigger('question_loaded');
$this.removeClass('start_quiz');
$this.attr('href','#');
$this.addClass('submit_inquiz');
runnecessaryfunctions();
$this.text(vibe_course_module_strings.submit_quiz);
$('.quiz_title .inquiz_timer').trigger('activate');
}
});
},
cancel: function() {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
},
confirmButton: vibe_course_module_strings.confirm,
cancelButton: vibe_course_module_strings.cancel
});
}
});
$( 'body' ).delegate( '.unit_button.submit_inquiz', 'click', function(event){
event.preventDefault();
var $this=$(this);
var answers=[];
$('#ajaxloader').removeClass('disabled');
$('#unit_content').addClass('loading');
if(typeof all_questions_json !== 'undefined') {
var unanswered_flag=0;
$.each(all_questions_json, function(key, value) {
var ans = sessionStorage.getItem(value);
if(ans){
var answer={'id':value,'value':ans};
answers.push(answer);
}else{
unanswered_flag++;
}
});
if($this.hasClass('triggerred')){ // Auto Submit
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'in_submit_quiz',
security: $('#hash').val(),
quiz_id:$('#unit.quiz_title').attr('data-unit'),
answers:JSON.stringify(answers)
},
cache: false,
success: function (html) {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
if(html.indexOf('##')>=0){
var nextunit = html.substr(0, html.indexOf('##'));
html = html.substr(html.indexOf('##'));
if(nextunit.length>0){
$('#next_unit').removeClass('hide');
$('#next_unit').attr('data-unit',nextunit);
$('#next_quiz').removeClass('hide');
$('#next_quiz').attr('data-unit',nextunit);
$('#unit'+nextunit).find('a').addClass('unit');
$('#unit'+nextunit).find('a').attr('data-unit',nextunit);
}
}else{
if(html.indexOf('##') == 0){
html = html.substr(2);
console.log(html);
}
$('#next_unit').removeClass('hide');
}
$('.main_unit_content').html(html);
$('.quiz_title .inquiz_timer').trigger('deactivate');
$('.in_quiz').trigger('question_loaded');
$this.removeClass('submit_inquiz');
$('.quiz_title .quiz_meta').addClass('hide');
$this.addClass('quiz_results_popup');
$this.attr('href',$('#results_link').val());
runnecessaryfunctions();
$this.text(vibe_course_module_strings.check_results);
$('#unit'+$('#unit.quiz_title').attr('data-unit')).addClass('done');
$('body').find('.course_progressbar').removeClass('increment_complete');
$('body').find('.course_progressbar').trigger('increment');
}
});
}else{
if(unanswered_flag){
$.confirm({
text: vibe_course_module_strings.unanswered_questions,
confirm: function() {
$.confirm({
text: vibe_course_module_strings.submit_quiz_notification,
confirm: function() {
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'in_submit_quiz',
security: $('#hash').val(),
quiz_id:$('#unit.quiz_title').attr('data-unit'),
answers:JSON.stringify(answers)
},
cache: false,
success: function (html) {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
if(html.indexOf('##')>=0){
var nextunit = html.substr(0, html.indexOf('##'));
html = html.substr((html.indexOf('##')+2));
if(nextunit.length>0){
$('#next_unit').removeClass('hide');
$('#next_unit').attr('data-unit',nextunit);
$('#next_quiz').removeClass('hide');
$('#next_quiz').attr('data-unit',nextunit);
$('#unit'+nextunit).find('a').addClass('unit');
$('#unit'+nextunit).find('a').attr('data-unit',nextunit);
}
}else{
if(html.indexOf('##') == 0){
html = html.substr(2);
console.log(html);
}
$('#next_unit').removeClass('hide');
}
$('.main_unit_content').html(html);
$('.quiz_title .inquiz_timer').trigger('deactivate');
$('.in_quiz').trigger('question_loaded');
$this.removeClass('submit_inquiz');
$('.quiz_title .quiz_meta').addClass('hide');
$this.addClass('quiz_results_popup');
$this.attr('href',$('#results_link').val());
runnecessaryfunctions();
$this.text(vibe_course_module_strings.check_results);
$('#unit'+$('#unit.quiz_title').attr('data-unit')).addClass('done');
$('body').find('.course_progressbar').removeClass('increment_complete');
$('body').find('.course_progressbar').trigger('increment');
}
});
},
cancel: function() {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
},
confirmButton: vibe_course_module_strings.confirm,
cancelButton: vibe_course_module_strings.cancel
});
},
cancel: function() {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
return false;
},
confirmButton: vibe_course_module_strings.confirm,
cancelButton: vibe_course_module_strings.cancel
});
}else{
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'in_submit_quiz',
security: $('#hash').val(),
quiz_id:$('#unit.quiz_title').attr('data-unit'),
answers:JSON.stringify(answers)
},
cache: false,
success: function (html) {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
if(html.indexOf('##')){
var nextunit = html.substr(0, html.indexOf('##'));
html = html.substr((html.indexOf('##')+2));
if(nextunit.length>0){
$('#next_unit').removeClass('hide');
$('#next_unit').attr('data-unit',nextunit);
$('#next_quiz').removeClass('hide');
$('#next_quiz').attr('data-unit',nextunit);
$('#unit'+nextunit).find('a').addClass('unit');
$('#unit'+nextunit).find('a').attr('data-unit',nextunit);
}
}
$('.main_unit_content').html(html);
$('.quiz_title .inquiz_timer').trigger('deactivate');
$('.in_quiz').trigger('question_loaded');
$this.removeClass('submit_inquiz');
$('.quiz_title .quiz_meta').addClass('hide');
$this.addClass('quiz_results_popup');
$this.attr('href',$('#results_link').val());
runnecessaryfunctions();
$this.text(vibe_course_module_strings.check_results);
$('#unit'+$('#unit.quiz_title').attr('data-unit')).addClass('done');
$('body').find('.course_progressbar').removeClass('increment_complete');
$('body').find('.course_progressbar').trigger('increment');
}
});
}
}
}else{
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
alert(vibe_course_module_strings.submit_quiz_error);
}
});
$( 'body' ).delegate( '.in_quiz .pagination ul li a.quiz_page', 'click', function(event){
event.preventDefault();
var $this=$(this);
var page = $(this).text();
$('#ajaxloader').removeClass('disabled');
$('#unit_content').addClass('loading');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'in_start_quiz',
security: $('#hash').val(),
quiz_id:$('#unit.quiz_title').attr('data-unit'),
page: page
},
cache: false,
success: function (html) {
$('#ajaxloader').addClass('disabled');
$('#unit_content').removeClass('loading');
$('.main_unit_content').html(html);
$('.in_quiz').trigger('question_loaded');
$this.removeClass('start_quiz');
$this.addClass('submit_quiz');
runnecessaryfunctions();
$this.text(vibe_course_module_strings.submit_quiz);
}
});
});
$( 'body' ).delegate( '.in_quiz', 'question_loaded',function(){
runnecessaryfunctions();
$('.quiz_meta').trigger('progress_check');
if($('.matchgrid_options').hasClass('saved_answer')){
var id;
$('.matchgrid_options li').each(function(index,value){
id = $('.matchgrid_options').attr('data-match'+index);
$(this).append($('#'+id));
});
}
jQuery('.in_question .question_options.sort').each(function(){
var defaultanswer='1';
var lastindex = $('ul.question_options li').size();
if(lastindex>1)
for(var i=2;i<=lastindex;i++){
defaultanswer = defaultanswer+','+i;
}
jQuery(this).sortable({
revert: true,
cursor: 'move',
refreshPositions: true,
opacity: 0.6,
scroll:true,
containment: 'parent',
placeholder: 'placeholder',
tolerance: 'pointer',
update: function( event, ui ) {
var order = $('.question_options.sort').sortable('toArray').toString();
var id = $(this).parent().attr('data-ques');
sessionStorage.setItem(id,order);
$('.quiz_meta').trigger('progress_check');
}
}).disableSelection();
});
//Fill in the Blank Live EDIT
$(".live-edit").liveEdit({
afterSaveAll: function(params) {
return false;
}
});
$(".vibe_fillblank").on('blur',function(){
var value = $(this).text();
var id = $(this).parent().parent().parent().parent().attr('data-ques');
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
//Match question type
$('.in_question .question_options.match').each(function(){
$(this).droppable({
drop: function( event, ui ){
$(ui.draggable).removeAttr('style');
$( this )
.addClass( "ui-state-highlight" )
.append($(ui.draggable))
}
});
$(this).find('li').draggable({
revert: "invalid",
containment:$(this).parent()
});
});
$( ".matchgrid_options li" ).droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
drop: function( event, ui ){
childCount = $(this).find('li').length;
$(ui.draggable).removeAttr('style');
if (childCount !=0){
return;
}
$( this )
.addClass( "ui-state-highlight" )
.append($(ui.draggable));
var value='';
$(this).parent().find('li.match_option').each(function(){
var id = $(this).attr('id');
if( jQuery.isNumeric(id))
value +=id+',';
});
var id = $(this).parent().parent().parent().parent().attr('data-ques');
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
}
});
$('.question.largetext+textarea').on('blur',function(){
var value = $(this).val();
var id = $(this).parent().attr('data-ques');
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
$('.question.smalltext+input').on('blur',function(){
var value = $(this).val();
var id = $(this).parent().attr('data-ques');
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
$('#vibe_select_dropdown').change(function(){
var id = $(this).parent().parent().parent().attr('data-ques');
var value = $(this).val();
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
$('.question_options.truefalse li').click(function(){
var id = $(this).find('input:checked').attr('name');
var value = $(this).find('input:checked').val();
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
$('.question_options.single li').click(function(){
var id = $(this).find('input:checked').attr('name');
var value = $(this).find('input:checked').val();
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
$('.question_options.multiple li').click(function(){
var iclass= $(this).find('input:checked').attr('class');
var id=$(this).parent().parent().attr('data-ques');
var value = '';
$(this).parent().find('input:checked').each(function(){
value += $(this).val()+',';
});
sessionStorage.setItem(id,value);
$('.quiz_meta').trigger('progress_check');
});
});
$( 'body' ).delegate( '.in_quiz', 'question_loaded',function(){
if(typeof questions_json !== 'undefined') {
$.each(questions_json, function(key, value) {
$('.in_question[data-ques='+value+']').each(function(){
var $this = $(this);
var type = $(this).find('.question').attr('class');
switch(type){
case 'question match':
var sval =sessionStorage.getItem(value);
if(sval !== null){
var new_vals = sval.split(',');
$.each(new_vals,function(k,vals){
if($.isNumeric(vals))
$this.find('.matchgrid_options>ul>li').eq(k).append($('#'+vals+'.ques'+value));
});
}
break;
case 'question sort':
var sval =sessionStorage.getItem(value);
if(sval !== null){
var new_vals = sval.split(',');
$.each(new_vals,function(k,vals){
if($.isNumeric(vals))
$this.find('.question_options.sort>li#'+vals+'.ques'+value).remove().appendTo('.question_options.sort');
});
}
break;
case 'question single':
var sval =sessionStorage.getItem(value);
if(sval !== null)
$(this).find('input[value="'+sval+'"]').prop( "checked", true );
break;
case 'question multiple':
var sval =sessionStorage.getItem(value);
if(sval !== null){
var new_vals = sval.split(',');
$.each(new_vals,function(k,vals){
$this.find('input[value="'+vals+'"]').prop( "checked", true );
});
}
break;
case 'question select':
$(this).find('select').val(sessionStorage.getItem(value));
break;
case 'question truefalse':
var sval =sessionStorage.getItem(value);
if(sval !== null)
$(this).find('input[value="'+sval+'"]').prop( "checked", true );
break;
case 'question fillblank':
var saved = sessionStorage.getItem(value);
if(saved !== 'null' && saved){
$(this).find('.vibe_fillblank').text(saved);
}
break;
case 'question smalltext':
$(this).find('input').val(sessionStorage.getItem(value));
break;
case 'question largetext':
$(this).find('textarea').val(sessionStorage.getItem(value));
break;
}
});
});
}
});
$( 'body' ).delegate( '.quiz_meta', 'progress_check',function(){
if(typeof all_questions_json !== 'undefined') {
var num = all_questions_json.length;
var progress=0;
$.each(all_questions_json, function(key, value) {
if(sessionStorage.getItem(value) !== null){
progress++;
}
});
if(!$('.quiz_meta').hasClass('show_progress')){
$('.quiz_meta').addClass('show_progress');
}
$('.quiz_meta i span').text(progress+'/'+num);
var percentage = Math.round(100*(progress/num));
$('.quiz_meta .progress .bar').css('width',percentage+'%');
}
});
/*=== In Unit Questions ===*/
$(document).ready(function($){
$('.unit_content').on('unit_traverse',function(){
$('.question').each(function(){
var $this = $(this);
jQuery('.question_options.sort').each(function(){
jQuery(this).sortable({
revert: true,
cursor: 'move',
refreshPositions: true,
opacity: 0.6,
scroll:true,
containment: 'parent',
placeholder: 'placeholder',
tolerance: 'pointer',
}).disableSelection();
});
//Fill in the Blank Live EDIT
$(".live-edit").liveEdit({
afterSaveAll: function(params) {
return false;
}
});
//Match question type
$('.question_options.match').droppable({
drop: function( event, ui ){
$(ui.draggable).removeAttr('style');
$( this )
.addClass( "ui-state-highlight" )
.append($(ui.draggable))
}
});
$('.question_options.match li').draggable({
revert: "invalid",
containment:'#question'
});
$( ".matchgrid_options li" ).droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
drop: function( event, ui ){
childCount = $(this).find('li').length;
$(ui.draggable).removeAttr('style');
if (childCount !=0){
return;
}
$( this )
.addClass( "ui-state-highlight" )
.append($(ui.draggable))
}
});
$this.find('.check_answer').click(function(){
$this.find('.message').remove();
var id = $(this).attr('data-id');
var answers = eval('ans_json'+id);
switch(answers['type']){
case 'select':
case 'truefalse':
case 'single':
case 'sort':
case 'match':
value ='';
if($this.find('input[type="radio"]:checked').length){
value = $this.find('input[type="radio"]:checked').val();
}
if($this.find('select').length){
value = $this.find('option:selected').val();
}
$this.find('.question_options.sort li.sort_option').each(function(){
var id = $(this).attr('id');
if( jQuery.isNumeric(id))
value +=id+',';
});
$this.find('.matchgrid_options li.match_option').each(function(){
var id = $(this).attr('id');
if( jQuery.isNumeric(id))
value +=id+',';
});
if(answers['type'] == 'sort' || answers['type'] == 'match'){
value = value.slice(0,-1);
}
if( value == answers['answer']){
$this.append(''+vibe_course_module_strings.correct+'
');
}else{
$this.append(''+vibe_course_module_strings.incorrect+'
');
}
break;
case 'multiple':
if($this.find('input[type="checkbox"]:checked').length){
if($this.find('input[type="checkbox"]:checked').length == answers['answer'].length){
$this.find('input[type="checkbox"]:checked').each(function(){
if ($.inArray($(this).val(), answers['answer']) == -1){
$this.append(''+vibe_course_module_strings.incorrect+'
');
return false;
}
});
$this.append(''+vibe_course_module_strings.correct+'
');
}else{
$this.append(''+vibe_course_module_strings.incorrect+'
');
}
}
break;
}
});
});
});
/* === simple notes and discussion ===*/
$('.unit_content').on('unit_traverse',function(){
$('#discussion').each(function(){
var $this = $(this);
$('.add_comment').click(function(){
$('.add_unit_comment_text').toggleClass('hide');
});
$('body').delegate('.post_question','click',function(e){
e.preventDefault();
var textarea=$(this).parent().find('textarea');
var val = textarea.val();
var parent = '';
if($(this).hasClass('comment_reply'))
parent = $(this).attr('data-parent');
$this.addClass('loading');
if(val.length){
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'add_unit_comment',
security: $('#hash').val(),
text: val,
parent:parent,
unit_id: $this.attr('data-unit')
},
cache: false,
success: function (html) {
$this.removeClass('loading');
if(html.indexOf(''+html+'');
$('#comment-'+parent +' .add_unit_comment_text').remove();
$('.unit_content .commentlist li .reply').removeClass('hide');
}else{
$this.find('ol.commentlist').append(html);
}
textarea.val('');
$('.add_unit_comment_text').addClass('hide');
}else{
$this.append(html);
}
}
});
}else{
$this.append(''+vibe_course_module_strings.incorrect+'
');
}
});
$('.load_more_comments').click(function(){
var page = parseInt($(this).attr('data-page'));
var max = parseInt($(this).attr('data-max'));
var $load = $(this);
$this.addClass('loading');
$.ajax({
type: "POST",
url: ajaxurl,
data: { action: 'load_unit_comments',
security: $('#hash').val(),
page: page,
unit_id: $this.attr('data-unit')
},
cache: false,
success: function (html) {
$this.removeClass('loading');
$this.find('.commentlist').append(html);
var count = parseInt($load.find('span').text());
var per = parseInt($load.attr('data-per'));
count = count -per;
page++;
$load.attr('data-page',page);
$load.find('span').text(count);
if(max <= page)
$load.hide(200);
}
});
});
$('body').delegate('.unit_content .commentlist li .reply','click',function(){
var $reply = $(this);
$reply.addClass('hide');
$('.unit_content .commentlist li .add_unit_comment_text').remove();
var form = $('#add_unit_comment').clone().removeClass('hide').attr('id','').appendTo($reply.parent());
form.find('.post_question').attr('data-parent',$reply.parent().parent().attr('data-id'));
form.find('.post_question').addClass('comment_reply').text($reply.text());
});
$('body').delegate('.unit_content .commentlist li .cancel','click',function(e){
if($(this).parent().parent().find('.reply').length){
$(this).parent().parent().find('.reply').removeClass('hide');
$(this).parent().parent().find('.add_unit_comment_text').remove();
}
});
$('#add_unit_comment .cancel').click(function(){
$('#add_unit_comment').addClass('hide');
});
});
});
if($('.unit_content').length){
$('.unit_content').trigger('unit_traverse');
}
});
})(jQuery);
// source --> https://better-than-ever.com/wp-content/themes/wplms/js/modernizr.custom.js?ver=4.9.29
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-csstransitions-shiv-cssclasses-prefixed-testprop-testallprops-domprefixes-load
*/
;window.Modernizr=function(a,b,c){function x(a){j.cssText=a}function y(a,b){return x(prefixes.join(a+";")+(b||""))}function z(a,b){return typeof a===b}function A(a,b){return!!~(""+a).indexOf(b)}function B(a,b){for(var d in a){var e=a[d];if(!A(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function C(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:z(f,"function")?f.bind(d||b):f}return!1}function D(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+n.join(d+" ")+d).split(" ");return z(b,"string")||z(b,"undefined")?B(e,b):(e=(a+" "+o.join(d+" ")+d).split(" "),C(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m="Webkit Moz O ms",n=m.split(" "),o=m.toLowerCase().split(" "),p={},q={},r={},s=[],t=s.slice,u,v={}.hasOwnProperty,w;!z(v,"undefined")&&!z(v.call,"undefined")?w=function(a,b){return v.call(a,b)}:w=function(a,b){return b in a&&z(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=t.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(t.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(t.call(arguments)))};return e}),p.csstransitions=function(){return D("transition")};for(var E in p)w(p,E)&&(u=E.toLowerCase(),e[u]=p[E](),s.push((e[u]?"":"no-")+u));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)w(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},x(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._domPrefixes=o,e._cssomPrefixes=n,e.testProp=function(a){return B([a])},e.testAllProps=D,e.prefixed=function(a,b,c){return b?D(a,b,c):D(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+s.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f https://better-than-ever.com/wp-content/themes/wplms/js/sidebarEffects.js?ver=4.9.29
/*!
* classie - class helper functions
* from bonzo https://github.com/ded/bonzo
*
* classie.has( elem, 'my-class' ) -> true/false
* classie.add( elem, 'my-new-class' )
* classie.remove( elem, 'my-unwanted-class' )
* classie.toggle( elem, 'my-class' )
*/
/*jshint browser: true, strict: true, undef: true */
/*global define: false */
( function( window ) {
'use strict';
// class helper functions from bonzo https://github.com/ded/bonzo
function classReg( className ) {
return new RegExp("(^|\\s+)" + className + "(\\s+|$)");
}
// classList support for class management
// altho to be fair, the api sucks because it won't accept multiple classes at once
var hasClass, addClass, removeClass;
if ( 'classList' in document.documentElement ) {
hasClass = function( elem, c ) {
return elem.classList.contains( c );
};
addClass = function( elem, c ) {
elem.classList.add( c );
};
removeClass = function( elem, c ) {
elem.classList.remove( c );
};
}
else {
hasClass = function( elem, c ) {
return classReg( c ).test( elem.className );
};
addClass = function( elem, c ) {
if ( !hasClass( elem, c ) ) {
elem.className = elem.className + ' ' + c;
}
};
removeClass = function( elem, c ) {
elem.className = elem.className.replace( classReg( c ), ' ' );
};
}
function toggleClass( elem, c ) {
var fn = hasClass( elem, c ) ? removeClass : addClass;
fn( elem, c );
}
var classie = {
// full names
hasClass: hasClass,
addClass: addClass,
removeClass: removeClass,
toggleClass: toggleClass,
// short names
has: hasClass,
add: addClass,
remove: removeClass,
toggle: toggleClass
};
// transport
if ( typeof define === 'function' && define.amd ) {
// AMD
define( classie );
} else {
// browser global
window.classie = classie;
}
})( window );
/**
* sidebarEffects.js v1.0.0
* http://www.codrops.com
*
* Licensed under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
* Copyright 2013, Codrops
* http://www.codrops.com
*/
function SidebarMenuEffects() {
function hasParentClass( e, classname ) {
if(e === document) return false;
if( classie.has( e, classname ) ) {
return true;
}
return e.parentNode && hasParentClass( e.parentNode, classname );
}
function mobilecheck() {
var check = false;
(function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
return check;
}
function init() {
var container = document.getElementById( 'global' ),
buttons = Array.prototype.slice.call( document.querySelectorAll( '#trigger' ) ),
// event type (if mobile use touch events)
eventtype = mobilecheck() ? 'touchstart' : 'click',
resetMenu = function() {
classie.remove( container, 'open' );
},
bodyClickFn = function(evt) {
if( !hasParentClass( evt.target, 'sidemenu' ) ) {
resetMenu();
document.removeEventListener( eventtype, bodyClickFn );
}
};
buttons.forEach( function( el, i ) {
el.addEventListener( eventtype, function( ev ) {
ev.stopPropagation();
ev.preventDefault();
container.className = 'global'; // clear
setTimeout( function() {
classie.add( container, 'open' );
}, 25 );
document.addEventListener( eventtype, bodyClickFn );
});
} );
}
init();
};
function unitComments() {
function hasParentClass( e, classname ) {
if(e === document) return false;
if( classie.has( e, classname ) ) {
return true;
}
return e.parentNode && hasParentClass( e.parentNode, classname );
}
function mobilecheck() {
var check = false;
(function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);
return check;
}
function init() {
var container = document.getElementById( 'unit_content' ),
buttons = Array.prototype.slice.call( document.querySelectorAll( '.side_comment' ) ),
// event type (if mobile use touch events)
eventtype = mobilecheck() ? 'touchstart' : 'click',
resetMenu = function() {
classie.remove( container, 'open' );
},
bodyClickFn = function(evt) {
var x = evt.target;
console.log(hasParentClass( x, 'unit'));
if( ((!hasParentClass( x, 'side_comments') ) && (x.tagName != 'A') && (x.tagName != 'BUTTON')) || (hasParentClass( x, 'unit') )){
resetMenu();
document.removeEventListener( eventtype, bodyClickFn );
}
};
buttons.forEach( function( el, i ) {
el.addEventListener( eventtype, function( ev ) {
ev.stopPropagation();
ev.preventDefault();
container.className = 'unit_content'; // clear
setTimeout( function() {
classie.add( container, 'open' );
}, 25 );
document.addEventListener( eventtype, bodyClickFn );
});
} );
}
init();
};
// source --> https://better-than-ever.com/wp-content/themes/wplms/js/buddypress.js?ver=0.1
/* ScrollTo plugin - just inline and minified */
;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='object'){g=f;f=0}if(typeof g=='function')g={onAfter:g};if(e=='max')e=9e9;g=$.extend({},h.defaults,g);f=f||g.duration;g.queue=g.queue&&g.axis.length>1;if(g.queue)f/=2;g.offset=both(g.offset);g.over=both(g.over);return this._scrollable().each(function(){if(e==null)return;var d=this,$elem=$(d),targ=e,toff,attr={},win=$elem.is('html,body');switch(typeof targ){case'number':case'string':if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)){targ=both(targ);break}targ=$(targ,this);if(!targ.length)return;case'object':if(targ.is||targ.style)toff=(targ=$(targ)).offset()}$.each(g.axis.split(''),function(i,a){var b=a=='x'?'Left':'Top',pos=b.toLowerCase(),key='scroll'+b,old=d[key],max=h.max(d,a);if(toff){attr[key]=toff[pos]+(win?0:old-$elem.offset()[pos]);if(g.margin){attr[key]-=parseInt(targ.css('margin'+b))||0;attr[key]-=parseInt(targ.css('border'+b+'Width'))||0}attr[key]+=g.offset[pos]||0;if(g.over[pos])attr[key]+=targ[a=='x'?'width':'height']()*g.over[pos]}else{var c=targ[pos];attr[key]=c.slice&&c.slice(-1)=='%'?parseFloat(c)/100*max:c}if(g.limit&&/^\d+$/.test(attr[key]))attr[key]=attr[key]<=0?0:Math.min(attr[key],max);if(!i&&g.queue){if(old!=attr[key])animate(g.onAfterFirst);delete attr[key]}});animate(g.onAfter);function animate(a){$elem.animate(attr,f,g.easing,a&&function(){a.call(this,e,g)})}}).end()};h.max=function(a,b){var c=b=='x'?'Width':'Height',scroll='scroll'+c;if(!$(a).is('html,body'))return a[scroll]-$(a)[c.toLowerCase()]();var d='client'+c,html=a.ownerDocument.documentElement,body=a.ownerDocument.body;return Math.max(html[scroll],body[scroll])-Math.min(html[d],body[d])};function both(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
/* jQuery Easing Plugin, v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ */
jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('M 6(A){4 $11=A.11||\'&\';4 $V=A.V===r?r:j;4 $1p=A.1p===r?\'\':\'[]\';4 $13=A.13===r?r:j;4 $D=$13?A.D===j?"#":"?":"";4 $15=A.15===r?r:j;v.1o=M 6(){4 f=6(o,t){8 o!=1v&&o!==x&&(!!t?o.1t==t:j)};4 14=6(1m){4 m,1l=/\\[([^[]*)\\]/g,T=/^([^[]+)(\\[.*\\])?$/.1r(1m),k=T[1],e=[];19(m=1l.1r(T[2]))e.u(m[1]);8[k,e]};4 w=6(3,e,7){4 o,y=e.1b();b(I 3!=\'X\')3=x;b(y===""){b(!3)3=[];b(f(3,L)){3.u(e.h==0?7:w(x,e.z(0),7))}n b(f(3,1a)){4 i=0;19(3[i++]!=x);3[--i]=e.h==0?7:w(3[i],e.z(0),7)}n{3=[];3.u(e.h==0?7:w(x,e.z(0),7))}}n b(y&&y.T(/^\\s*[0-9]+\\s*$/)){4 H=1c(y,10);b(!3)3=[];3[H]=e.h==0?7:w(3[H],e.z(0),7)}n b(y){4 H=y.B(/^\\s*|\\s*$/g,"");b(!3)3={};b(f(3,L)){4 18={};1w(4 i=0;i<3.h;++i){18[i]=3[i]}3=18}3[H]=e.h==0?7:w(3[H],e.z(0),7)}n{8 7}8 3};4 C=6(a){4 p=d;p.l={};b(a.C){v.J(a.Z(),6(5,c){p.O(5,c)})}n{v.J(1u,6(){4 q=""+d;q=q.B(/^[?#]/,\'\');q=q.B(/[;&]$/,\'\');b($V)q=q.B(/[+]/g,\' \');v.J(q.Y(/[&;]/),6(){4 5=1e(d.Y(\'=\')[0]||"");4 c=1e(d.Y(\'=\')[1]||"");b(!5)8;b($15){b(/^[+-]?[0-9]+\\.[0-9]*$/.1d(c))c=1A(c);n b(/^[+-]?[0-9]+$/.1d(c))c=1c(c,10)}c=(!c&&c!==0)?j:c;b(c!==r&&c!==j&&I c!=\'1g\')c=c;p.O(5,c)})})}8 p};C.1H={C:j,1G:6(5,1f){4 7=d.Z(5);8 f(7,1f)},1h:6(5){b(!f(5))8 d.l;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];19(3!=x&&e.h!=0){3=3[e.1b()]}8 I 3==\'1g\'?3:3||""},Z:6(5){4 3=d.1h(5);b(f(3,1a))8 v.1E(j,{},3);n b(f(3,L))8 3.z(0);8 3},O:6(5,c){4 7=!f(c)?x:c;4 K=14(5),k=K[0],e=K[1];4 3=d.l[k];d.l[k]=w(3,e.z(0),7);8 d},w:6(5,c){8 d.N().O(5,c)},1s:6(5){8 d.O(5,x).17()},1z:6(5){8 d.N().1s(5)},1j:6(){4 p=d;v.J(p.l,6(5,7){1y p.l[5]});8 p},1F:6(Q){4 D=Q.B(/^.*?[#](.+?)(?:\\?.+)?$/,"$1");4 S=Q.B(/^.*?[?](.+?)(?:#.+)?$/,"$1");8 M C(Q.h==S.h?\'\':S,Q.h==D.h?\'\':D)},1x:6(){8 d.N().1j()},N:6(){8 M C(d)},17:6(){6 F(G){4 R=I G=="X"?f(G,L)?[]:{}:G;b(I G==\'X\'){6 1k(o,5,7){b(f(o,L))o.u(7);n o[5]=7}v.J(G,6(5,7){b(!f(7))8 j;1k(R,5,F(7))})}8 R}d.l=F(d.l);8 d},1B:6(){8 d.N().17()},1D:6(){4 i=0,U=[],W=[],p=d;4 16=6(E){E=E+"";b($V)E=E.B(/ /g,"+");8 1C(E)};4 1n=6(1i,5,7){b(!f(7)||7===r)8;4 o=[16(5)];b(7!==j){o.u("=");o.u(16(7))}1i.u(o.P(""))};4 F=6(R,k){4 12=6(5){8!k||k==""?[5].P(""):[k,"[",5,"]"].P("")};v.J(R,6(5,7){b(I 7==\'X\')F(7,12(5));n 1n(W,12(5),7)})};F(d.l);b(W.h>0)U.u($D);U.u(W.P($11));8 U.P("")}};8 M C(1q.S,1q.D)}}(v.1o||{});',62,106,'|||target|var|key|function|value|return|||if|val|this|tokens|is||length||true|base|keys||else||self||false|||push|jQuery|set|null|token|slice|settings|replace|queryObject|hash|str|build|orig|index|typeof|each|parsed|Array|new|copy|SET|join|url|obj|search|match|queryString|spaces|chunks|object|split|get||separator|newKey|prefix|parse|numbers|encode|COMPACT|temp|while|Object|shift|parseInt|test|decodeURIComponent|type|number|GET|arr|EMPTY|add|rx|path|addFields|query|suffix|location|exec|REMOVE|constructor|arguments|undefined|for|empty|delete|remove|parseFloat|compact|encodeURIComponent|toString|extend|load|has|prototype'.split('|'),0,{}))
/*!
* jQuery UI Touch Punch 0.2.3
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
// AJAX Functions
var jq = jQuery;
// Global variable to prevent multiple AJAX requests
var bp_ajax_request = null;
jq(document).ready( function() {
/**** Page Load Actions *******************************************************/
/* Hide Forums Post Form */
if ( '-1' == window.location.search.indexOf('new') && jq('div.forums').length )
jq('#new-topic-post').hide();
else
jq('#new-topic-post').show();
/* Activity filter and scope set */
bp_init_activity();
/* Object filter and scope set. */
var objects = [ 'members', 'groups', 'blogs', 'forums','course' ];
bp_init_objects( objects );
/* @mention Compose Scrolling */
var $whats_new = jq('#whats-new');
if ( jq.query.get('r') && $whats_new.length ) {
jq('#whats-new-options').animate({
height:'50px'
});
jq("#whats-new-form textarea").animate({
height:'50px'
});
jq.scrollTo( $whats_new, 500, {
offset:-125,
easing:'easeOutQuad'
} );
var whats_new_content = $whats_new.val();
$whats_new.val('').focus().val(whats_new_content);
}
/**** Activity Posting ********************************************************/
/* Textarea focus */
$whats_new.focus( function(){
jq("#whats-new-options").animate({
height:'40px'
});
jq("#whats-new-form textarea").animate({
height:'50px'
});
jq("#aw-whats-new-submit").prop("disabled", false);
var $whats_new_form = jq("form#whats-new-form");
if ( $whats_new_form.hasClass("submitted") ) {
$whats_new_form.removeClass("submitted");
}
});
/* On blur, shrink if it's empty */
$whats_new.blur( function(){
if (!this.value.match(/\S+/)) {
this.value = "";
jq("#whats-new-options").animate({
height:'40px'
});
jq("form#whats-new-form textarea").animate({
height:'30px'
});
jq("#aw-whats-new-submit").prop("disabled", true);
}
});
/* New posts */
jq("#aw-whats-new-submit").on( 'click', function() {
var button = jq(this);
var form = button.closest("form#whats-new-form");
form.children().each( function() {
if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") )
jq(this).prop( 'disabled', true );
});
/* Remove any errors */
jq('div.error').remove();
button.addClass('loading');
button.prop('disabled', true);
form.addClass("submitted");
/* Default POST values */
var object = '';
var item_id = jq("#whats-new-post-in").val();
var content = jq("#whats-new").val();
/* Set object for non-profile posts */
if ( item_id > 0 ) {
object = jq("#whats-new-post-object").val();
}
jq.post( ajaxurl, {
action: 'post_update',
'cookie': bp_get_cookies(),
'_wpnonce_post_update': jq("#_wpnonce_post_update").val(),
'content': content,
'object': object,
'item_id': item_id,
'_bp_as_nonce': jq('#_bp_as_nonce').val() || ''
},
function(response) {
form.children().each( function() {
if ( jq.nodeName(this, "textarea") || jq.nodeName(this, "input") ) {
jq(this).prop( 'disabled', false );
}
});
/* Check for errors and append if found. */
if ( response[0] + response[1] == '-1' ) {
form.prepend( response.substr( 2, response.length ) );
jq( '#' + form.attr('id') + ' div.error').hide().fadeIn( 200 );
} else {
if ( 0 == jq("ul.activity-list").length ) {
jq("div.error").slideUp(100).remove();
jq("#message").slideUp(100).remove();
jq("div.activity").append( '' );
}
jq("#activity-stream").prepend(response);
jq("#activity-stream li:first").addClass('new-update just-posted');
if ( 0 != jq("#latest-update").length ) {
var l = jq("#activity-stream li.new-update .activity-content .activity-inner p").html();
var v = jq("#activity-stream li.new-update .activity-content .activity-header p a.view").attr('href');
var ltext = jq("#activity-stream li.new-update .activity-content .activity-inner p").text();
var u = '';
if ( ltext != '' )
u = l + ' ';
u += '' + BP_DTheme.view + ' ';
jq("#latest-update").slideUp(300,function(){
jq("#latest-update").html( u );
jq("#latest-update").slideDown(300);
});
}
jq("li.new-update").hide().slideDown( 300 );
jq("li.new-update").removeClass( 'new-update' );
jq("#whats-new").val('');
}
jq("#whats-new-options").animate({
height:'0px'
});
jq("#whats-new-form textarea").animate({
height:'20px'
});
jq("#aw-whats-new-submit").prop("disabled", true).removeClass('loading');
});
return false;
});
/* List tabs event delegation */
jq('div.activity-type-tabs').on( 'click', function(event) {
var target = jq(event.target).parent();
if ( event.target.nodeName == 'STRONG' || event.target.nodeName == 'SPAN' )
target = target.parent();
else if ( event.target.nodeName != 'A' )
return false;
/* Reset the page */
jq.cookie( 'bp-activity-oldestpage', 1, {
path: '/'
} );
/* Activity Stream Tabs */
var scope = target.attr('id').substr( 9, target.attr('id').length );
var filter = jq("#activity-filter-select select").val();
if ( scope == 'mentions' )
jq( '#' + target.attr('id') + ' a strong' ).remove();
bp_activity_request(scope, filter);
return false;
});
/* Activity filter select */
jq('#activity-filter-select select').change( function() {
var selected_tab = jq( 'div.activity-type-tabs li.selected' );
if ( !selected_tab.length )
var scope = null;
else
var scope = selected_tab.attr('id').substr( 9, selected_tab.attr('id').length );
var filter = jq(this).val();
bp_activity_request(scope, filter);
return false;
});
/* Stream event delegation */
jq('div.activity').on( 'click', function(event) {
var target = jq(event.target);
/* Favoriting activity stream items */
if ( target.hasClass('fav') || target.hasClass('unfav') ) {
var type = target.hasClass('fav') ? 'fav' : 'unfav';
var parent = target.closest('.activity-item');
var parent_id = parent.attr('id').substr( 9, parent.attr('id').length );
target.addClass('loading');
jq.post( ajaxurl, {
action: 'activity_mark_' + type,
'cookie': bp_get_cookies(),
'id': parent_id
},
function(response) {
target.removeClass('loading');
target.fadeOut( 200, function() {
jq(this).html(response);
jq(this).attr('title', 'fav' == type ? BP_DTheme.remove_fav : BP_DTheme.mark_as_fav);
jq(this).fadeIn(200);
});
if ( 'fav' == type ) {
if ( !jq('.item-list-tabs #activity-favs-personal-li').length ) {
if ( !jq('.item-list-tabs #activity-favorites').length )
jq('.item-list-tabs ul #activity-mentions').before( '' + BP_DTheme.my_favs + ' 0 ');
jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) + 1 );
}
target.removeClass('fav');
target.addClass('unfav');
} else {
target.removeClass('unfav');
target.addClass('fav');
jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) - 1 );
if ( !Number( jq('.item-list-tabs ul #activity-favorites span').html() ) ) {
if ( jq('.item-list-tabs ul #activity-favorites').hasClass('selected') )
bp_activity_request( null, null );
jq('.item-list-tabs ul #activity-favorites').remove();
}
}
if ( 'activity-favorites' == jq( '.item-list-tabs li.selected').attr('id') )
target.parent().parent().parent().slideUp(100);
});
return false;
}
/* Delete activity stream items */
if ( target.hasClass('delete-activity') ) {
var li = target.parents('div.activity ul li');
var id = li.attr('id').substr( 9, li.attr('id').length );
var link_href = target.attr('href');
var nonce = link_href.split('_wpnonce=');
nonce = nonce[1];
target.addClass('loading');
jq.post( ajaxurl, {
action: 'delete_activity',
'cookie': bp_get_cookies(),
'id': id,
'_wpnonce': nonce
},
function(response) {
if ( response[0] + response[1] == '-1' ) {
li.prepend( response.substr( 2, response.length ) );
li.children('#message').hide().fadeIn(300);
} else {
li.slideUp(300);
}
});
return false;
}
// Spam activity stream items
if ( target.hasClass( 'spam-activity' ) ) {
var li = target.parents( 'div.activity ul li' );
target.addClass( 'loading' );
jq.post( ajaxurl, {
action: 'bp_spam_activity',
'cookie': encodeURIComponent( document.cookie ),
'id': li.attr( 'id' ).substr( 9, li.attr( 'id' ).length ),
'_wpnonce': target.attr( 'href' ).split( '_wpnonce=' )[1]
},
function(response) {
if ( response[0] + response[1] === '-1' ) {
li.prepend( response.substr( 2, response.length ) );
li.children( '#message' ).hide().fadeIn(300);
} else {
li.slideUp( 300 );
}
});
return false;
}
/* Load more updates at the end of the page */
if ( target.parent().hasClass('load-more') ) {
jq("#buddypress li.load-more").addClass('loading');
if ( null == jq.cookie('bp-activity-oldestpage') )
jq.cookie('bp-activity-oldestpage', 1, {
path: '/'
} );
var oldest_page = ( jq.cookie('bp-activity-oldestpage') * 1 ) + 1;
var just_posted = [];
jq('.activity-list li.just-posted').each( function(){
just_posted.push( jq(this).attr('id').replace( 'activity-','' ) );
});
jq.post( ajaxurl, {
action: 'activity_get_older_updates',
'cookie': bp_get_cookies(),
'page': oldest_page,
'exclude_just_posted': just_posted.join(',')
},
function(response)
{
jq("#buddypress li.load-more").removeClass('loading');
jq.cookie( 'bp-activity-oldestpage', oldest_page, {
path: '/'
} );
jq("#buddypress ul.activity-list").append(response.contents);
target.parent().hide();
}, 'json' );
return false;
}
});
// Activity "Read More" links
jq('div.activity').on('click', '.activity-read-more a', function(event) {
var target = jq(event.target);
var link_id = target.parent().attr('id').split('-');
var a_id = link_id[3];
var type = link_id[0]; /* activity or acomment */
var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner';
var a_inner = jq('#' + type + '-' + a_id + ' .' + inner_class + ':first' );
jq(target).addClass('loading');
jq.post( ajaxurl, {
action: 'get_single_activity_content',
'activity_id': a_id
},
function(response) {
jq(a_inner).slideUp(300).html(response).slideDown(300);
});
return false;
});
/**** Activity Comments *******************************************************/
/* Hide all activity comment forms */
jq('form.ac-form').hide();
/* Hide excess comments */
if ( jq('.activity-comments').length )
bp_legacy_theme_hide_comments();
/* Activity list event delegation */
jq('div.activity').on( 'click', function(event) {
var target = jq(event.target);
/* Comment / comment reply links */
if ( target.hasClass('acomment-reply') || target.parent().hasClass('acomment-reply') ) {
if ( target.parent().hasClass('acomment-reply') )
target = target.parent();
var id = target.attr('id');
ids = id.split('-');
var a_id = ids[2]
var c_id = target.attr('href').substr( 10, target.attr('href').length );
var form = jq( '#ac-form-' + a_id );
form.css( 'display', 'none' );
form.removeClass('root');
jq('.ac-form').hide();
/* Hide any error messages */
form.children('div').each( function() {
if ( jq(this).hasClass( 'error' ) )
jq(this).hide();
});
if ( ids[1] != 'comment' ) {
jq('#acomment-' + c_id).append( form );
} else {
jq('#activity-' + a_id + ' .activity-comments').append( form );
}
if ( form.parent().hasClass( 'activity-comments' ) )
form.addClass('root');
form.slideDown( 200 );
jq.scrollTo( form, 500, {
offset:-100,
easing:'easeOutQuad'
} );
jq('#ac-form-' + ids[2] + ' textarea').focus();
return false;
}
/* Activity comment posting */
if ( target.attr('name') == 'ac_form_submit' ) {
var form = target.parents( 'form' );
var form_parent = form.parent();
var form_id = form.attr('id').split('-');
if ( !form_parent.hasClass('activity-comments') ) {
var tmp_id = form_parent.attr('id').split('-');
var comment_id = tmp_id[1];
} else {
var comment_id = form_id[2];
}
var content = jq( '#' + form.attr('id') + ' textarea' );
/* Hide any error messages */
jq( '#' + form.attr('id') + ' div.error').hide();
target.addClass('loading').prop('disabled', true);
content.addClass('loading').prop('disabled', true);
var ajaxdata = {
action: 'new_activity_comment',
'cookie': bp_get_cookies(),
'_wpnonce_new_activity_comment': jq("#_wpnonce_new_activity_comment").val(),
'comment_id': comment_id,
'form_id': form_id[2],
'content': content.val()
};
// Akismet
var ak_nonce = jq('#_bp_as_nonce_' + comment_id).val();
if ( ak_nonce ) {
ajaxdata['_bp_as_nonce_' + comment_id] = ak_nonce;
}
jq.post( ajaxurl, ajaxdata, function(response) {
target.removeClass('loading');
content.removeClass('loading');
/* Check for errors and append if found. */
if ( response[0] + response[1] == '-1' ) {
form.append( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) );
} else {
var activity_comments = form.parent();
form.fadeOut( 200, function() {
if ( 0 == activity_comments.children('ul').length ) {
if ( activity_comments.hasClass('activity-comments') ) {
activity_comments.prepend('');
} else {
activity_comments.append('');
}
}
/* Preceeding whitespace breaks output with jQuery 1.9.0 */
var the_comment = jq.trim( response );
activity_comments.children('ul').append( jq( the_comment ).hide().fadeIn( 200 ) );
form.children('textarea').val('');
activity_comments.parent().addClass('has-comments');
} );
jq( '#' + form.attr('id') + ' textarea').val('');
/* Increase the "Reply (X)" button count */
jq('#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
// Increment the 'Show all x comments' string, if present
var show_all_a = activity_comments.find('.show-all').find('a');
if ( show_all_a ) {
var new_count = jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html();
show_all_a.html( BP_DTheme.show_x_comments.replace( '%d', new_count ) );
}
}
jq(target).prop("disabled", false);
jq(content).prop("disabled", false);
});
return false;
}
/* Deleting an activity comment */
if ( target.hasClass('acomment-delete') ) {
var link_href = target.attr('href');
var comment_li = target.parent().parent();
var form = comment_li.parents('div.activity-comments').children('form');
var nonce = link_href.split('_wpnonce=');
nonce = nonce[1];
var comment_id = link_href.split('cid=');
comment_id = comment_id[1].split('&');
comment_id = comment_id[0];
target.addClass('loading');
/* Remove any error messages */
jq('.activity-comments ul .error').remove();
/* Reset the form position */
comment_li.parents('.activity-comments').append(form);
jq.post( ajaxurl, {
action: 'delete_activity_comment',
'cookie': bp_get_cookies(),
'_wpnonce': nonce,
'id': comment_id
},
function(response) {
/* Check for errors and append if found. */
if ( response[0] + response[1] == '-1' ) {
comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) );
} else {
var children = jq( '#' + comment_li.attr('id') + ' ul' ).children('li');
var child_count = 0;
jq(children).each( function() {
if ( !jq(this).is(':hidden') )
child_count++;
});
comment_li.fadeOut(200, function() {
comment_li.remove();
});
/* Decrease the "Reply (X)" button count */
var count_span = jq('#' + comment_li.parents('#activity-stream > li').attr('id') + ' a.acomment-reply span');
var new_count = count_span.html() - ( 1 + child_count );
count_span.html(new_count);
// Change the 'Show all x comments' text
var show_all_a = comment_li.siblings('.show-all').find('a');
if ( show_all_a ) {
show_all_a.html( BP_DTheme.show_x_comments.replace( '%d', new_count ) );
}
/* If that was the last comment for the item, remove the has-comments class to clean up the styling */
if ( 0 == new_count ) {
jq(comment_li.parents('#activity-stream > li')).removeClass('has-comments');
}
}
});
return false;
}
// Spam an activity stream comment
if ( target.hasClass( 'spam-activity-comment' ) ) {
var link_href = target.attr( 'href' );
var comment_li = target.parent().parent();
target.addClass('loading');
// Remove any error messages
jq( '.activity-comments ul div.error' ).remove();
// Reset the form position
comment_li.parents( '.activity-comments' ).append( comment_li.parents( '.activity-comments' ).children( 'form' ) );
jq.post( ajaxurl, {
action: 'bp_spam_activity_comment',
'cookie': encodeURIComponent( document.cookie ),
'_wpnonce': link_href.split( '_wpnonce=' )[1],
'id': link_href.split( 'cid=' )[1].split( '&' )[0]
},
function ( response ) {
// Check for errors and append if found.
if ( response[0] + response[1] == '-1' ) {
comment_li.prepend( jq( response.substr( 2, response.length ) ).hide().fadeIn( 200 ) );
} else {
var children = jq( '#' + comment_li.attr( 'id' ) + ' ul' ).children( 'li' );
var child_count = 0;
jq(children).each( function() {
if ( !jq( this ).is( ':hidden' ) ) {
child_count++;
}
});
comment_li.fadeOut( 200 );
// Decrease the "Reply (X)" button count
var parent_li = comment_li.parents( '#activity-stream > li' );
jq( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html( jq( '#' + parent_li.attr( 'id' ) + ' a.acomment-reply span' ).html() - ( 1 + child_count ) );
}
});
return false;
}
/* Showing hidden comments - pause for half a second */
if ( target.parent().hasClass('show-all') ) {
target.parent().addClass('loading');
setTimeout( function() {
target.parent().parent().children('li').fadeIn(200, function() {
target.parent().remove();
});
}, 600 );
return false;
}
// Canceling an activity comment
if ( target.hasClass( 'ac-reply-cancel' ) ) {
jq(target).closest('.ac-form').slideUp( 200 );
return false;
};
});
/* Escape Key Press for cancelling comment forms */
jq(document).keydown( function(e) {
e = e || window.event;
if (e.target)
element = e.target;
else if (e.srcElement)
element = e.srcElement;
if( element.nodeType == 3)
element = element.parentNode;
if( e.ctrlKey == true || e.altKey == true || e.metaKey == true )
return;
var keyCode = (e.keyCode) ? e.keyCode : e.which;
if ( keyCode == 27 ) {
if (element.tagName == 'TEXTAREA') {
if ( jq(element).hasClass('ac-input') )
jq(element).parent().parent().parent().slideUp( 200 );
}
}
});
/**** Directory Search ****************************************************/
/* The search form on all directory pages */
jq('.dir-search').on( 'click', function(event) {
if ( jq(this).hasClass('no-ajax') )
return;
var target = jq(event.target);
if ( target.attr('type') == 'submit' ) {
if(jq('.item-list-tabs li.selected').attr('id').indexOf('-')>=0){
var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
var object = css_id[0];
bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') );
}
return false;
}
});
/**** Tabs and Filters ****************************************************/
/* When a navigation tab is clicked - e.g. | All Groups | My Groups | */
jq('div.item-list-tabs').click( function(event) {
if ( jq(this).hasClass('no-ajax') )
return;
var targetElem = ( event.target.nodeName == 'SPAN' ) ? event.target.parentNode : event.target;
var target = jq( targetElem ).parent();
if ( 'LI' == target[0].nodeName && !target.hasClass('last') ) {
var css_id = target.attr('id').split( '-' );
var object = css_id[0];
if ( 'activity' == object )
return false;
var scope = css_id[1];
var filter = jq("#" + object + "-order-select select").val();
var search_terms = jq("#" + object + "_search").val();
bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
return false;
}
});
/* When the filter select box is changed re-query */
jq('li.filter select').change( function() {
if ( jq('.item-list-tabs li.selected').length )
var el = jq('.item-list-tabs li.selected');
else
var el = jq(this);
var css_id = el.attr('id').split('-');
var object = css_id[0];
var scope = css_id[1];
var filter = jq(this).val();
var search_terms = false;
if ( jq('.dir-search input').length )
search_terms = jq('.dir-search input').val();
if ( 'friends' == object )
object = 'members';
bp_filter_request( object, filter, scope, 'div.' + object, search_terms, 1, jq.cookie('bp-' + object + '-extras') );
return false;
});
/* All pagination links run through this function */
jq('#buddypress').on( 'click', function(event) {
var target = jq(event.target);
if ( target.hasClass('button') )
return true;
if ( target.parent().parent().hasClass('pagination') && !target.parent().parent().hasClass('no-ajax') ) {
if ( target.hasClass('dots') || target.hasClass('current') )
return false;
if ( jq('.item-list-tabs li.selected').length )
var el = jq('.item-list-tabs li.selected');
else
var el = jq('li.filter select');
var page_number = 1;
var css_id = el.attr('id').split( '-' );
var object = css_id[0];
var search_terms = false;
var pagination_id = jq(target).closest('.pagination-links').attr('id');
if ( jq('div.dir-search input').length )
search_terms = jq('.dir-search input').val();
if ( jq(target).hasClass('next') )
var page_number = Number( jq('.pagination span.current').html() ) + 1;
else if ( jq(target).hasClass('prev') )
var page_number = Number( jq('.pagination span.current').html() ) - 1;
else
var page_number = Number( jq(target).html() );
if ( pagination_id.indexOf( 'pag-bottom' ) !== -1 ) {
var caller = 'pag-bottom';
} else {
var caller = null;
}
bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope'), 'div.' + object, search_terms, page_number, jq.cookie('bp-' + object + '-extras'), caller );
return false;
}
});
/**** New Forum Directory Post **************************************/
/* Hit the "New Topic" button on the forums directory page */
jq('a.show-hide-new').on( 'click', function() {
if ( !jq('#new-topic-post').length )
return false;
if ( jq('#new-topic-post').is(":visible") )
jq('#new-topic-post').slideUp(200);
else
jq('#new-topic-post').slideDown(200, function() {
jq('#topic_title').focus();
} );
return false;
});
/* Cancel the posting of a new forum topic */
jq('#submit_topic_cancel').on( 'click', function() {
if ( !jq('#new-topic-post').length )
return false;
jq('#new-topic-post').slideUp(200);
return false;
});
/* Clicking a forum tag */
jq('#forum-directory-tags a').on( 'click', function() {
bp_filter_request( 'forums', 'tags', jq.cookie('bp-forums-scope'), 'div.forums', jq(this).html().replace( / /g, '-' ), 1, jq.cookie('bp-forums-extras') );
return false;
});
/** Invite Friends Interface ****************************************/
/* Select a user from the list of friends and add them to the invite list */
jq("#invite-list input").on( 'click', function() {
jq('.ajax-loader').toggle();
var friend_id = jq(this).val();
if ( jq(this).prop('checked') == true )
var friend_action = 'invite';
else
var friend_action = 'uninvite';
jq('.item-list-tabs li.selected').addClass('loading');
jq.post( ajaxurl, {
action: 'groups_invite_user',
'friend_action': friend_action,
'cookie': bp_get_cookies(),
'_wpnonce': jq("#_wpnonce_invite_uninvite_user").val(),
'friend_id': friend_id,
'group_id': jq("#group_id").val()
},
function(response)
{
if ( jq("#message") )
jq("#message").hide();
jq('.ajax-loader').toggle();
if ( friend_action == 'invite' ) {
jq('#friend-list').append(response);
} else if ( friend_action == 'uninvite' ) {
jq('#friend-list li#uid-' + friend_id).remove();
}
jq('.item-list-tabs li.selected').removeClass('loading');
});
});
/* Remove a user from the list of users to invite to a group */
jq("#friend-list").on('click', 'li a.remove', function() {
jq('.ajax-loader').toggle();
var friend_id = jq(this).attr('id');
friend_id = friend_id.split('-');
friend_id = friend_id[1];
jq.post( ajaxurl, {
action: 'groups_invite_user',
'friend_action': 'uninvite',
'cookie': bp_get_cookies(),
'_wpnonce': jq("#_wpnonce_invite_uninvite_user").val(),
'friend_id': friend_id,
'group_id': jq("#group_id").val()
},
function(response)
{
jq('.ajax-loader').toggle();
jq('#friend-list #uid-' + friend_id).remove();
jq('#invite-list #f-' + friend_id).prop('checked', false);
});
return false;
});
/** Profile Visibility Settings *********************************/
jq('.field-visibility-settings').hide();
jq('.visibility-toggle-link').on( 'click', function() {
var toggle_div = jq(this).parent();
jq(toggle_div).fadeOut( 600, function(){
jq(toggle_div).siblings('.field-visibility-settings').slideDown(400);
});
return false;
} );
jq('.field-visibility-settings-close').on( 'click', function() {
var settings_div = jq(this).parent();
var vis_setting_text = settings_div.find('input:checked').parent().text();
settings_div.slideUp( 400, function() {
settings_div.siblings('.field-visibility-settings-toggle').fadeIn(800);
settings_div.siblings('.field-visibility-settings-toggle').children('.current-visibility-level').html(vis_setting_text);
} );
return false;
} );
jq("#profile-edit-form input:not(:submit), #profile-edit-form textarea, #profile-edit-form select, #signup_form input:not(:submit), #signup_form textarea, #signup_form select").change( function() {
var shouldconfirm = true;
jq('#profile-edit-form input:submit, #signup_form input:submit').on( 'click', function() {
shouldconfirm = false;
});
window.onbeforeunload = function(e) {
if ( shouldconfirm ) {
return BP_DTheme.unsaved_changes;
}
};
});
/** Friendship Requests **************************************/
/* Accept and Reject friendship request buttons */
jq("#friend-list a.accept, #friend-list a.reject").on( 'click', function() {
var button = jq(this);
var li = jq(this).parents('#friend-list li');
var action_div = jq(this).parents('li div.action');
var id = li.attr('id').substr( 11, li.attr('id').length );
var link_href = button.attr('href');
var nonce = link_href.split('_wpnonce=');
nonce = nonce[1];
if ( jq(this).hasClass('accepted') || jq(this).hasClass('rejected') )
return false;
if ( jq(this).hasClass('accept') ) {
var action = 'accept_friendship';
action_div.children('a.reject').css( 'visibility', 'hidden' );
} else {
var action = 'reject_friendship';
action_div.children('a.accept').css( 'visibility', 'hidden' );
}
button.addClass('loading');
jq.post( ajaxurl, {
action: action,
'cookie': bp_get_cookies(),
'id': id,
'_wpnonce': nonce
},
function(response) {
button.removeClass('loading');
if ( response[0] + response[1] == '-1' ) {
li.prepend( response.substr( 2, response.length ) );
li.children('#message').hide().fadeIn(200);
} else {
button.fadeOut( 100, function() {
if ( jq(this).hasClass('accept') ) {
action_div.children('a.reject').hide();
jq(this).html( BP_DTheme.accepted ).contents().unwrap();
} else {
action_div.children('a.accept').hide();
jq(this).html( BP_DTheme.rejected ).contents().unwrap();
}
});
}
});
return false;
});
/* Add / Remove friendship buttons */
jq('#members-dir-list').on('click', '.friendship-button a', function() {
jq(this).parent().addClass('loading');
var fid = jq(this).attr('id');
fid = fid.split('-');
fid = fid[1];
var nonce = jq(this).attr('href');
nonce = nonce.split('?_wpnonce=');
nonce = nonce[1].split('&');
nonce = nonce[0];
var thelink = jq(this);
jq.post( ajaxurl, {
action: 'addremove_friend',
'cookie': bp_get_cookies(),
'fid': fid,
'_wpnonce': nonce
},
function(response)
{
var action = thelink.attr('rel');
var parentdiv = thelink.parent();
if ( action == 'add' ) {
jq(parentdiv).fadeOut(200,
function() {
parentdiv.removeClass('add_friend');
parentdiv.removeClass('loading');
parentdiv.addClass('pending_friend');
parentdiv.fadeIn(200).html(response);
}
);
} else if ( action == 'remove' ) {
jq(parentdiv).fadeOut(200,
function() {
parentdiv.removeClass('remove_friend');
parentdiv.removeClass('loading');
parentdiv.addClass('add');
parentdiv.fadeIn(200).html(response);
}
);
}
});
return false;
} );
/** Group Join / Leave Buttons **************************************/
// Confirmation when clicking Leave Group in group headers
jq('#buddypress').on('click', '.group-button .leave-group', function() {
if ( false == confirm( BP_DTheme.leave_group_confirm ) ) {
return false;
}
});
jq('#groups-dir-list').on('click', '.group-button a', function() {
var gid = jq(this).parent().attr('id');
gid = gid.split('-');
gid = gid[1];
var nonce = jq(this).attr('href');
nonce = nonce.split('?_wpnonce=');
nonce = nonce[1].split('&');
nonce = nonce[0];
var thelink = jq(this);
// Leave Group confirmation within directories - must intercept
// AJAX request
if ( thelink.hasClass( 'leave-group' ) && false == confirm( BP_DTheme.leave_group_confirm ) ) {
return false;
}
jq.post( ajaxurl, {
action: 'joinleave_group',
'cookie': bp_get_cookies(),
'gid': gid,
'_wpnonce': nonce
},
function(response)
{
var parentdiv = thelink.parent();
// user groups page
if ( ! jq('body.directory').length ) {
location.href = location.href;
// groups directory
} else {
jq(parentdiv).fadeOut(200,
function() {
parentdiv.fadeIn(200).html(response);
var mygroups = jq('#groups-personal span');
var add = 1;
if( thelink.hasClass( 'leave-group' ) ) {
// hidden groups slide up
if ( parentdiv.hasClass( 'hidden' ) ) {
parentdiv.closest('li').slideUp( 200 );
}
add = 0;
} else if ( thelink.hasClass( 'request-membership' ) ) {
add = false;
}
// change the "My Groups" value
if ( mygroups.length && add !== false ) {
if ( add ) {
mygroups.text( ( mygroups.text() >> 0 ) + 1 );
} else {
mygroups.text( ( mygroups.text() >> 0 ) - 1 );
}
}
}
);
}
});
return false;
} );
/** Button disabling ************************************************/
jq('#buddypress').on( 'click', '.pending', function() {
return false;
});
/** Private Messaging ******************************************/
/** Message search*/
jq('.message-search').on( 'click', function(event) {
if ( jq(this).hasClass('no-ajax') )
return;
var target = jq(event.target);
if ( target.attr('type') == 'submit' ) {
//var css_id = jq('.item-list-tabs li.selected').attr('id').split( '-' );
var object = 'messages';
bp_filter_request( object, jq.cookie('bp-' + object + '-filter'), jq.cookie('bp-' + object + '-scope') , 'div.' + object, target.parent().children('label').children('input').val(), 1, jq.cookie('bp-' + object + '-extras') );
return false;
}
});
/* AJAX send reply functionality */
jq("#send_reply_button").click(
function() {
var order = jq('#messages_order').val() || 'ASC',
offset = jq('#message-recipients').offset();
var button = jq("#send_reply_button");
jq(button).addClass('loading');
jq.post( ajaxurl, {
action: 'messages_send_reply',
'cookie': bp_get_cookies(),
'_wpnonce': jq("#send_message_nonce").val(),
'content': jq("#message_content").val(),
'send_to': jq("#send_to").val(),
'subject': jq("#subject").val(),
'thread_id': jq("#thread_id").val()
},
function(response)
{
if ( response[0] + response[1] == "-1" ) {
jq('#send-reply').prepend( response.substr( 2, response.length ) );
} else {
jq('#send-reply #message').remove();
jq("#message_content").val('');
if ( 'ASC' == order ) {
jq('#send-reply').before( response );
} else {
jq('#message-recipients').after( response );
jq(window).scrollTop(offset.top);
}
jq(".new-message").hide().slideDown( 200, function() {
jq('.new-message').removeClass('new-message');
});
}
jq(button).removeClass('loading');
});
return false;
}
);
/* Marking private messages as read and unread */
jq("#mark_as_read, #mark_as_unread").click(function() {
var checkboxes_tosend = '';
var checkboxes = jq("#message-threads tr td input[type='checkbox']");
if ( 'mark_as_unread' == jq(this).attr('id') ) {
var currentClass = 'read'
var newClass = 'unread'
var unreadCount = 1;
var inboxCount = 0;
var unreadCountDisplay = 'inline';
var action = 'messages_markunread';
} else {
var currentClass = 'unread'
var newClass = 'read'
var unreadCount = 0;
var inboxCount = 1;
var unreadCountDisplay = 'none';
var action = 'messages_markread';
}
checkboxes.each( function(i) {
if(jq(this).is(':checked')) {
if ( jq('#m-' + jq(this).attr('value')).hasClass(currentClass) ) {
checkboxes_tosend += jq(this).attr('value');
jq('#m-' + jq(this).attr('value')).removeClass(currentClass);
jq('#m-' + jq(this).attr('value')).addClass(newClass);
var thread_count = jq('#m-' + jq(this).attr('value') + ' td span.unread-count').html();
jq('#m-' + jq(this).attr('value') + ' td span.unread-count').html(unreadCount);
jq('#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
var inboxcount = jq('tr.unread').length;
jq('#user-messages span').html( inboxcount );
if ( i != checkboxes.length - 1 ) {
checkboxes_tosend += ','
}
}
}
});
jq.post( ajaxurl, {
action: action,
'thread_ids': checkboxes_tosend
});
return false;
});
/* Selecting unread and read messages in inbox */
jq( 'body.messages #item-body div.messages' ).on( 'change', '#message-type-select', function() {
var selection = this.value;
var checkboxes = jq( "td input[type='checkbox']" );
checkboxes.each( function(i) {
checkboxes[i].checked = "";
});
var checked_value = "checked";
switch ( selection ) {
case 'unread' :
checkboxes = jq("tr.unread td input[type='checkbox']");
break;
case 'read' :
checkboxes = jq("tr.read td input[type='checkbox']");
break;
case '' :
checked_value = "";
break;
}
checkboxes.each( function(i) {
checkboxes[i].checked = checked_value;
});
});
/* Bulk delete messages */
jq( 'body.messages #item-body div.messages' ).on( 'click', '.messages-options-nav a', function(event) {
event.preventDefault();
if ( -1 == jq.inArray( this.id , Array( 'delete_sentbox_messages', 'delete_inbox_messages' ) )) {
return;
}
checkboxes_tosend = '';
checkboxes = jq("#message-threads tr td input[type='checkbox']");
jq('#message').remove();
jq(this).addClass('loading');
jq(checkboxes).each( function(i) {
if( jq(this).is(':checked') )
checkboxes_tosend += jq(this).attr('value') + ',';
});
if ( '' == checkboxes_tosend ) {
jq(this).removeClass('loading');
return false;
}
jq.post( ajaxurl, {
action: 'messages_delete',
'thread_ids': checkboxes_tosend
}, function(response) {
if ( response[0] + response[1] == "-1" ) {
jq('#message-threads').prepend( response.substr( 2, response.length ) );
} else {
jq('#message-threads').before( '' );
jq(checkboxes).each( function(i) {
if( jq(this).is(':checked') ) {
// We need to uncheck because message is only hidden
// Otherwise, AJAX will be fired again with same data
jq(this).attr( 'checked', false );
jq(this).parent().parent().fadeOut(150);
}
});
}
jq('#message').hide().slideDown(150);
jq("#delete_inbox_messages, #delete_sentbox_messages").removeClass('loading');
});
return false;
});
/* Star action function */
starAction = function() {
var link = jq(this);
jq.post( ajaxurl, {
action: 'messages_star',
'message_id': link.data('message-id'),
'star_status': link.data('star-status'),
'nonce': link.data('star-nonce'),
'bulk': link.data('star-bulk')
},
function(response) {
if ( 1 === parseInt( response, 10 ) ) {
if ( 'unstar' === link.data('star-status') ) {
link.data('star-status', 'star');
link.removeClass('message-action-unstar').addClass('message-action-star');
link.find('.bp-screen-reader-text').text( BP_PM_Star.strings.text_star );
if ( 1 === BP_PM_Star.is_single_thread ) {
link.prop('title', BP_PM_Star.strings.title_star );
} else {
link.prop('title', BP_PM_Star.strings.title_star_thread );
}
} else {
link.data('star-status', 'unstar');
link.removeClass('message-action-star').addClass('message-action-unstar');
link.find('.bp-screen-reader-text').text(BP_PM_Star.strings.text_unstar);
if ( 1 === BP_PM_Star.is_single_thread ) {
link.prop('title', BP_PM_Star.strings.title_unstar );
} else {
link.prop('title', BP_PM_Star.strings.title_unstar_thread );
}
}
}
});
return false;
};
/* Star actions */
jq('#message-threads').on('click', 'td.thread-star a', starAction );
jq('#message-thread').on('click', '.message-star-actions a', starAction );
/* Star bulk manage - Show only the valid action based on the starred item. */
jq('#message-threads td.bulk-select-check :checkbox').on('change', function() {
var box = jq(this),
star = box.closest('tr').find('.thread-star a');
if ( box.prop('checked') ) {
if( 'unstar' === star.data('star-status') ) {
BP_PM_Star.star_counter++;
} else {
BP_PM_Star.unstar_counter++;
}
} else {
if( 'unstar' === star.data('star-status') ) {
BP_PM_Star.star_counter--;
} else {
BP_PM_Star.unstar_counter--;
}
}
if ( BP_PM_Star.star_counter > 0 && parseInt( BP_PM_Star.unstar_counter, 10 ) === 0 ) {
jq('option[value="star"]').hide();
} else {
jq('option[value="star"]').show();
}
if ( BP_PM_Star.unstar_counter > 0 && parseInt( BP_PM_Star.star_counter, 10 ) === 0 ) {
jq('option[value="unstar"]').hide();
} else {
jq('option[value="unstar"]').show();
}
});
/** Notifications **********************************************/
/* Selecting/Deselecting all notifications */
jq('#select-all-notifications').click(function(event) {
if( this.checked ) {
jq('.notification-check').each(function() {
this.checked = true;
});
} else {
jq('.notification-check').each(function() {
this.checked = false;
});
}
});
/* Make sure a 'Bulk Action' is selected before submitting the form */
jq('#notification-bulk-manage').attr('disabled', 'disabled');
/* Remove the disabled attribute from the form submit button when bulk action has a value */
jq('#notification-select').on('change', function(){
jq('#notification-bulk-manage').attr('disabled', jq(this).val().length <= 0);
});
/* Close site wide notices in the sidebar */
jq("#close-notice").on( 'click', function() {
jq(this).addClass('loading');
jq('#sidebar div.error').remove();
jq.post( ajaxurl, {
action: 'messages_close_notice',
'notice_id': jq('.notice').attr('rel').substr( 2, jq('.notice').attr('rel').length )
},
function(response) {
jq("#close-notice").removeClass('loading');
if ( response[0] + response[1] == '-1' ) {
jq('.notice').prepend( response.substr( 2, response.length ) );
jq( '#sidebar div.error').hide().fadeIn( 200 );
} else {
jq('.notice').slideUp( 100 );
}
});
return false;
});
/* Toolbar & wp_list_pages Javascript IE6 hover class */
jq("#wp-admin-bar ul.main-nav li, #nav li").mouseover( function() {
jq(this).addClass('sfhover');
});
jq("#wp-admin-bar ul.main-nav li, #nav li").mouseout( function() {
jq(this).removeClass('sfhover');
});
/* Clear BP cookies on logout */
jq('a.logout').on( 'click', function() {
jq.cookie('bp-activity-scope', null, {
path: '/'
});
jq.cookie('bp-activity-filter', null, {
path: '/'
});
jq.cookie('bp-activity-oldestpage', null, {
path: '/'
});
var objects = [ 'members', 'groups', 'blogs', 'forums' ];
jq(objects).each( function(i) {
jq.cookie('bp-' + objects[i] + '-scope', null, {
path: '/'
} );
jq.cookie('bp-' + objects[i] + '-filter', null, {
path: '/'
} );
jq.cookie('bp-' + objects[i] + '-extras', null, {
path: '/'
} );
});
});
/* if js is enabled then replace the no-js class by a js one */
if( jq('body').hasClass('no-js') )
jq('body').attr('class', jq('body').attr('class').replace( /no-js/,'js' ) );
});
/* Setup activity scope and filter based on the current cookie settings. */
function bp_init_activity() {
/* Reset the page */
jq.cookie( 'bp-activity-oldestpage', 1, {
path: '/'
} );
if ( null != jq.cookie('bp-activity-filter') && jq('#activity-filter-select').length )
jq('#activity-filter-select select option[value="' + jq.cookie('bp-activity-filter') + '"]').prop( 'selected', true );
/* Activity Tab Set */
if ( null != jq.cookie('bp-activity-scope') && jq('.activity-type-tabs').length ) {
jq('.activity-type-tabs li').each( function() {
jq(this).removeClass('selected');
});
jq('#activity-' + jq.cookie('bp-activity-scope') + ', .item-list-tabs li.current').addClass('selected');
}
}
/* Setup object scope and filter based on the current cookie settings for the object. */
function bp_init_objects(objects) {
jq(objects).each( function(i) {
if ( null != jq.cookie('bp-' + objects[i] + '-filter') && jq('#' + objects[i] + '-order-select select').length )
jq('#' + objects[i] + '-order-select select option[value="' + jq.cookie('bp-' + objects[i] + '-filter') + '"]').prop( 'selected', true );
if ( null != jq.cookie('bp-' + objects[i] + '-scope') && jq('div.' + objects[i]).length ) {
jq('.item-list-tabs li').each( function() {
jq(this).removeClass('selected');
});
jq('#' + objects[i] + '-' + jq.cookie('bp-' + objects[i] + '-scope') + ', #object-nav li.current').addClass('selected');
}
});
}
/* Filter the current content list (groups/members/blogs/topics) */
function bp_filter_request( object, filter, scope, target, search_terms, page, extras, caller ) {
if ( 'activity' == object )
return false;
if ( jq.query.get('s') && !search_terms )
search_terms = jq.query.get('s');
if ( null == scope )
scope = 'all';
/* Save the settings we want to remain persistent to a cookie */
jq.cookie( 'bp-' + object + '-scope', scope, {
path: '/'
} );
jq.cookie( 'bp-' + object + '-filter', filter, {
path: '/'
} );
jq.cookie( 'bp-' + object + '-extras', extras, {
path: '/'
} );
/* Set the correct selected nav and filter */
jq('.item-list-tabs li').each( function() {
jq(this).removeClass('selected');
});
jq('#' + object + '-' + scope + ', #object-nav li.current').addClass('selected');
jq('.item-list-tabs li.selected').addClass('loading');
jq('.item-list-tabs select option[value="' + filter + '"]').prop( 'selected', true );
if ( 'friends' == object )
object = 'members';
if ( bp_ajax_request )
bp_ajax_request.abort();
bp_ajax_request = jq.post( ajaxurl, {
action: object + '_filter',
'cookie': bp_get_cookies(),
'object': object,
'filter': filter,
'search_terms': search_terms,
'scope': scope,
'page': page,
'extras': extras
},
function(response)
{
/* animate to top if called from bottom pagination */
if ( caller == 'pag-bottom' && jq('#subnav').length ) {
var top = jq('#subnav').parent();
jq('html,body').animate({scrollTop: top.offset().top}, 'slow', function() {
jq(target).fadeOut( 100, function() {
jq(this).html(response);
jq(this).fadeIn(100);
});
});
} else {
jq(target).fadeOut( 100, function() {
jq(this).html(response);
jq(this).fadeIn(100);
});
}
jq('.item-list-tabs li.selected').removeClass('loading');
});
}
/* Activity Loop Requesting */
function bp_activity_request(scope, filter) {
/* Save the type and filter to a session cookie */
jq.cookie( 'bp-activity-scope', scope, {
path: '/'
} );
jq.cookie( 'bp-activity-filter', filter, {
path: '/'
} );
jq.cookie( 'bp-activity-oldestpage', 1, {
path: '/'
} );
/* Remove selected and loading classes from tabs */
jq('.item-list-tabs li').each( function() {
jq(this).removeClass('selected loading');
});
/* Set the correct selected nav and filter */
jq('#activity-' + scope + ', .item-list-tabs li.current').addClass('selected');
jq('#object-nav.item-list-tabs li.selected, div.activity-type-tabs li.selected').addClass('loading');
jq('#activity-filter-select select option[value="' + filter + '"]').prop( 'selected', true );
/* Reload the activity stream based on the selection */
jq('.widget_bp_activity_widget h2 span.ajax-loader').show();
if ( bp_ajax_request )
bp_ajax_request.abort();
bp_ajax_request = jq.post( ajaxurl, {
action: 'activity_widget_filter',
'cookie': bp_get_cookies(),
'_wpnonce_activity_filter': jq("#_wpnonce_activity_filter").val(),
'scope': scope,
'filter': filter
},
function(response)
{
jq('.widget_bp_activity_widget h2 span.ajax-loader').hide();
jq('div.activity').fadeOut( 100, function() {
jq(this).html(response.contents);
jq(this).fadeIn(100);
/* Selectively hide comments */
bp_legacy_theme_hide_comments();
});
/* Update the feed link */
if ( null != response.feed_url )
jq('.directory #subnav li.feed a, .home-page #subnav li.feed a').attr('href', response.feed_url);
jq('.item-list-tabs li.selected').removeClass('loading');
}, 'json' );
}
/* Hide long lists of activity comments, only show the latest five root comments. */
function bp_legacy_theme_hide_comments() {
var comments_divs = jq('div.activity-comments');
if ( !comments_divs.length )
return false;
comments_divs.each( function() {
if ( jq(this).children('ul').children('li').length < 5 ) return;
var comments_div = jq(this);
var parent_li = comments_div.parents('#activity-stream > li');
var comment_lis = jq(this).children('ul').children('li');
var comment_count = ' ';
if ( jq('#' + parent_li.attr('id') + ' a.acomment-reply span').length )
var comment_count = jq('#' + parent_li.attr('id') + ' a.acomment-reply span').html();
comment_lis.each( function(i) {
/* Show the latest 5 root comments */
if ( i < comment_lis.length - 5 ) {
jq(this).addClass('hidden');
jq(this).toggle();
if ( !i )
jq(this).before( '' + BP_DTheme.show_x_comments.replace( '%d', comment_count ) + ' ' );
}
});
});
}
/* Helper Functions */
function checkAll() {
var checkboxes = document.getElementsByTagName("input");
for(var i=0; i';
jQuery('.footerwidget ul#members-list,.widget ul#members-list').html(message);
jQuery('.footerwidget ul#members-list,.widget ul#members-list').fadeIn(200);
}
);
}
}
jQuery(document).ready( function() {
jQuery('.footerwidget div#groups-list-options a,.widget div#groups-list-options a').on('click',
function() {
var link = this;
jQuery(link).addClass('loading');
jQuery('.footerwidget div#groups-list-options a,.widget div#groups-list-options a').removeClass('selected');
jQuery(this).addClass('selected');
jQuery.post( ajaxurl, {
action: 'widget_groups_list',
'cookie': encodeURIComponent(document.cookie),
'_wpnonce': jQuery('input#_wpnonce-groups').val(),
'max_groups': jQuery('input#groups_widget_max').val(),
'filter': jQuery(this).attr('id')
},
function(response)
{
jQuery(link).removeClass('loading');
footergroups_wiget_response(response);
});
return false;
}
);
});
function footergroups_wiget_response(response) {
response = response.substr(0, response.length-1);
response = response.split('[[SPLIT]]');
if ( response[0] !== '-1' ) {
jQuery('.footerwidget ul#groups-list,.widget ul#groups-list').fadeOut(200,
function() {
jQuery('.footerwidget ul#groups-list,.widget ul#groups-list').html(response[1]);
jQuery('.footerwidget ul#groups-list,.widget ul#groups-list').fadeIn(200);
}
);
} else {
jQuery('.footerwidget ul#groups-list,.widget ul#groups-list').fadeOut(200,
function() {
var message = '' + response[1] + '
';
jQuery('.footerwidget ul#groups-list,.widget ul#groups-list').html(message);
jQuery('.footerwidget ul#groups-list,.widget ul#groups-list').fadeIn(200);
}
);
}
};
// source --> https://better-than-ever.com/wp-content/themes/wplms/js/custom.js?ver=4.9.29
(function($) {
$.expr[":"].onScreen = function(elem) {
var $window = $(window);
var viewport_top = $window.scrollTop();
var viewport_height = $window.height();
var viewport_bottom = viewport_top + viewport_height;
var $elem = $(elem);
var top = $elem.offset().top;
var height = $elem.height();
var bottom = top + height;
return (top >= viewport_top && top < viewport_bottom) ||
(bottom > viewport_top && bottom <= viewport_bottom) ||
(height > viewport_height && top <= viewport_top && bottom >= viewport_bottom);
};
})(jQuery);
(function($) {
jQuery(document).ready(function($) {
NProgress.inc();
SidebarMenuEffects();
$('.pagesidebar li.menu-item-has-children').click(function(){
var $ul = $(this).find('ul:first');
$ul.toggle(200);
$ul.addClass('active');
});
$('nav .menu-item').has('.sub-menu').each(function() {
if($(this).find('.megadrop').length > 0 ){
}else{
$(this).addClass('hasmenu');
}
});
$('.vbplogin').click(function(event) {
event.preventDefault();
$('#vibe_bp_login').fadeIn(300);
$('#vibe_bp_login').toggleClass('active');
event.stopPropagation();
});
$('#searchicon').click(function(event) {
$('#searchdiv').toggleClass('active');
});
$(document).mouseup(function (e) {
var container = $("#searchdiv");
if (!container.is(e.target) && container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.hide();
container.removeClass('active');
}
container = $("#vibe_bp_login");
if (!container.is(e.target) && container.has(e.target).length === 0) // ... nor a descendant of the container
{
container.hide();
}
});
$('#headernotification').each(function() {
var cookieValue = $.cookie("closed");
if ((cookieValue !== null) && cookieValue == 'headernotification') {
$(this).hide();
}
});
$('#widget-tabs a').click(function (e) {
e.preventDefault();
$(this).tab('show');
});
$('#footernotification').each(function() {
var cookieValue = $.cookie("closed");
if ((cookieValue !== null) && cookieValue == 'footernotification') {
$(this).hide();
}
});
$('.close').click(function(){
var parent=$(this).parent().parent();
var id=parent.attr('id');
parent.hide(200);
$.cookie('closed', id, { expires: 2 ,path: '/'});
});
jQuery('#scrolltop a').click(function(event) {
event.preventDefault();
$('body,html').animate({
scrollTop: 0
}, 1200);
return false;
});
$('body').delegate('.woocommerce-error','click',function(event){
event.preventDefault();
$(this).fadeOut(200);
})
$('.tip').tooltip();
$('.nav-tabs li:first a').tab('show');
$('.course_description').on('click','#more_desc',function(event) {
event.preventDefault();
$(this).fadeOut('fast');
$('.full_desc').fadeIn('fast');
});
$('.course_description').on('click','#less_desc',function(event) {
event.preventDefault();
$('.full_desc').fadeOut('fast');
$('#more_desc').fadeIn('fast');
});
$('#signup_password, #account_password').each(function(){
var label;
var $this = $(this);
if($(this).hasClass('form_field')){
label = $('label[for="signup_password"]');
}else{
label = $('label[for="account_password"]');
}
$(this).keyup(function() {
if(label.find('span').length){
label.find('span').html((checkStrength($this.val(),label)));
}else{
label.append(''+(checkStrength($this.val(),label))+' ');
}
});
function checkStrength(password,label) {
var strength = 0
if (password.length < 6) {
label.removeClass();
label.addClass('short');
return BP_DTheme.too_short
}
if (password.length > 7) strength += 1
// If password contains both lower and uppercase characters, increase strength value.
if (password.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) strength += 1
// If it has numbers and characters, increase strength value.
if (password.match(/([a-zA-Z])/) && password.match(/([0-9])/)) strength += 1
// If it has one special character, increase strength value.
if (password.match(/([!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
// If it has two special characters, increase strength value.
if (password.match(/(.*[!,%,&,@,#,$,^,*,?,_,~].*[!,%,&,@,#,$,^,*,?,_,~])/)) strength += 1
// Calculated strength value, we can return messages
// If value is less than 2
if (strength < 2) {
label.removeClass();
label.addClass('weak');
return BP_DTheme.weak
} else if (strength == 2) {
label.removeClass();
label.addClass('good');
return BP_DTheme.good
} else {
label.removeClass()
label.addClass('strong')
return BP_DTheme.strong
}
}
});
}); // END ready
jQuery(document).ready(function($){
if(jQuery().chosen) {
$('.form select').chosen({
allow_single_deselect: true,
disable_search_threshold: 8});
$('.chosen').chosen({
allow_single_deselect: true,
disable_search_threshold: 8});
}
$(window).scroll(function(event){
var st = $(this).scrollTop();
if($('#headertop').hasClass('fix')){
var headerheight=$('header').height();
if(st > headerheight){
$('#headertop').addClass('fixed');
}else{
$('#headertop').removeClass('fixed');
}
}
if(st > 700){
$('#scrolltop').addClass('fix');
}else{
$('#scrolltop').removeClass('fix');
}
});
$('.twitter_carousel').each(function(){
var $this = $(this);
$this.flexslider({
animation: "slide",
controlNav: false,
directionNav: false,
animationLoop: true,
slideshow: true,
prevText: " ",
nextText: " ",
start: function() {
$this.removeClass('loading');
}
});
});
/*$('.certifications').flexslider({
animation: "slide",
controlNav: false,
directionNav: true,
animationLoop: true,
slideshow: false,
itemWidth: 212,
itemMargin:10,
maxItems:4,
minItems:1,
prevText: " ",
nextText: " ",
});*/
});// END ready
//* To be Removed in next update
jQuery(document).ready(function($){
$('.v_parallax_block').each(function(){
var $bgobj = $(this);
var i = parseInt($bgobj.attr('data-scroll'));
var rev = parseInt($bgobj.attr('data-rev'));
var ptop = $bgobj.parent().position().top;
var adjust = parseInt($bgobj.attr('data-adjust'));
var height = $bgobj.height();
var v_parallax_block_height = $bgobj.find('.parallax_content').height();
if(heightli').click(function(){
var $this = $(this);
$('.payment_methods.methods >li').find('div').hide(0,function(){$this.find('div').show(0);});
});
function v_carousel_fx($this){
var direction,control,itemwidth,maxitem,minitem,scroll,vmargin;
direction=control=false;vmargin=margin=30;
scroll='horizontal';
$this.find('li.product').removeClass().addClass('product');
if($this.parent().hasClass('direction'))
direction = true;
else
direction = false;
if($this.parent().hasClass('control'))
control = true;
else
control = false;
if($this.parent().hasClass('columns1')){
itemwidth=true;
maxitem=1;
minitem=1;
margin=0;
}
if($this.parent().hasClass('columns2')){
itemwidth = 420;
maxitem=2;
minitem=2;
}
if($this.parent().hasClass('columns3')){
itemwidth=320;
maxitem=3;
minitem=2;
}
if($this.parent().hasClass('columns4')){
itemwidth=200;
maxitem=4;
minitem=2;
}
if($this.parent().hasClass('columns5')){
itemwidth=180;
maxitem=5;
minitem=2;
}
if($this.parent().hasClass('columns6')){
itemwidth=140;
maxitem=6;
minitem=2;
}
$this.flexslider({
animation: "slide",
selector: ".products > li",
controlNav: control,
directionNav: direction,
animationLoop: false,
slideshow: false,
itemWidth: itemwidth,
itemMargin:margin,
maxItems:maxitem,
minItems:minitem,
prevText: " ",
nextText: " ",
});
}
$('.vibe_carousel.flexslider .woocommerce').each(function(){
var $this= $(this);
if($this.is(":visible")){
v_carousel_fx($this);
}
});
$('#prev_results a').on('click',function(event){
event.preventDefault();
$(this).toggleClass('show');
$('.prev_quiz_results').toggleClass('show');
});
});
jQuery(document).ready(function($){
$('#filtercontainer').each(function(){
var $container = $('#filtercontainer'),
filters = {};
$container.isotope({
itemSelector : '.filteritem',
});
// filter buttons
$('.filters a').click(function(){
var $this = $(this);
// don't proceed if already selected
if ( $this.hasClass('active') ) {
return;
}
var $optionSet = $this.parents('.option-set');
// change selected class
$optionSet.find('.active').removeClass('active');
$this.addClass('active');
// store filter value in object
// i.e. filters.color = 'red'
var group = $optionSet.attr('data-filter-group');
filters[ group ] = $this.attr('data-filter-value');
// convert object into array
var isoFilters = [];
for ( var prop in filters ) {
isoFilters.push( filters[ prop ] );
}
var selector = isoFilters.join('');
$container.isotope({ filter: selector });
return false;
});
});
});// END ready
jQuery(document).ready(function($){
//inscroll menu
$('.inmenu').each(function(){
var inmenu_top = $('.inmenu').offset().top - 40;
var footer_top = $('footer').offset().top - Math.round($(window).height()/2) - 90;
$(window).scroll(function(){
var top=$(window).scrollTop();
if(top > inmenu_top && top < footer_top){
$('.inmenu').addClass('affix');
}else{
$('.inmenu').removeClass('affix');
}
});
});
});// END ready
jQuery(document).ready(function($) {
// Cache selectors
var lastId;
var topMenu = $(".scrollmenu");
var topMenuHeight = 0;//topMenu.outerHeight()+15
// All list items
var menuItems = topMenu.find("a"),
// Anchors corresponding to menu items
scrollItems = menuItems.map(function(){
var item = $($(this).attr("href"));
if (item.length) { return item; }
});
// Bind click handler to menu items
// so we can get a fancy scroll animation
menuItems.click(function(e){
e.preventDefault();
var href = $(this).attr("href"),
offsetTop = href === "#" ? 0 : $(href).offset().top-topMenuHeight+1;
$('html, body').stop().animate({
scrollTop: offsetTop
}, 800);
//return false;
});
$(window).scroll( function ()
{
var fromTop = $(this).scrollTop()+25;
var cur = scrollItems.map(function(){
if ($(this).offset().top < fromTop)
return this;
});
cur = cur[cur.length-1];
var id = cur && cur.length ? cur[0].id : "";
if (lastId !== id) {
lastId = id;
menuItems
.parent().removeClass("active");
menuItems.filter("[href*=\\#"+id+"]").parent().addClass("active");
}
// Animation function
$('.animate').filter(":onScreen").not('.load').each(function(i){
var $this=$(this);
var ind = i * 100;
var docViewTop = $(window).scrollTop();
var docViewBottom = docViewTop + $(window).height();
var elemTop = $this.offset().top;
if (docViewBottom >= elemTop) {
setTimeout(function(){
$this.addClass('load');
}, ind);
}
});
//End function
});
});// END ready
//CHECKOUT FORM
jQuery(document).ready(function ($) {
$('.minmax').click(function(event){
event.preventDefault();
$(this).parent().toggleClass('show');
$(this).find('i').toggleClass('icon-minus');
});
});// END ready
// ADD Question Form
jQuery(document).ready(function($){
$( ".repeatablelist" ).each(function(){
$(this).sortable({ handle: '.sort_handle' });
});
$('.add_repeatable').click(function(){
var repeatablelist=$(this).parent().find('.repeatablelist');
var lastitem=$(this).parent().find('.repeatablelist li:last-child');
var cloneditem=lastitem.clone();
var name= cloneditem.find('.option_text').attr('rel-name');
cloneditem.find('.option_text').attr('name',name);
repeatablelist.append(cloneditem);
});
$('.print_results').click(function(event){
event.preventDefault();
$('.quiz_result').print();
});
});// END ready
jQuery(window).load(function($){
NProgress.done();
});
})(jQuery);
/*!
* Bootstrap v3.1.0 (http://getbootstrap.com)
* Copyright 2011-2014 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.isLoading=!1};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",f.resetText||d.data("resetText",d[e]()),d[e](f[b]||this.options[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},b.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});return this.$element.trigger(j),j.isDefaultPrevented()?void 0:(this.sliding=!0,f&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")),f&&this.cycle(),this)};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("collapse in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(b){a(d).remove(),a(e).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;f.toggleClass("open").trigger("shown.bs.dropdown",h),e.focus()}return!1}},f.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var f=c(d),g=f.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&f.find(e).focus(),d.click();var h=" li:not(.divider):visible a",i=f.find("[role=menu]"+h+", [role=listbox]"+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j ').appendTo(document.body),this.$element.on("click.dismiss.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),d&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;d?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b).emulateTransitionEnd(150):b()):b&&b()};var c=a.fn.modal;a.fn.modal=function(c,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},b.DEFAULTS,e.data(),"object"==typeof c&&c);f||e.data("bs.modal",f=new b(this,g)),"string"==typeof c?f[c](d):g.show&&f.show(d)})},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());c.is("a")&&b.preventDefault(),e.modal(f,this).one("hide",function(){c.is(":visible")&&c.focus()})}),a(document).on("show.bs.modal",".modal",function(){a(document.body).addClass("modal-open")}).on("hidden.bs.modal",".modal",function(){a(document.body).removeClass("modal-open")})}(jQuery),+function(a){"use strict";var b=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};b.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},b.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},b.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},b.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show),void 0):c.show()},b.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget)[this.type](this.getDelegateOptions()).data("bs."+this.type);return clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide),void 0):c.hide()},b.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){if(this.$element.trigger(b),b.isDefaultPrevented())return;var c=this,d=this.tip();this.setContent(),this.options.animation&&d.addClass("fade");var e="function"==typeof this.options.placement?this.options.placement.call(this,d[0],this.$element[0]):this.options.placement,f=/\s?auto?\s?/i,g=f.test(e);g&&(e=e.replace(f,"")||"top"),d.detach().css({top:0,left:0,display:"block"}).addClass(e),this.options.container?d.appendTo(this.options.container):d.insertAfter(this.$element);var h=this.getPosition(),i=d[0].offsetWidth,j=d[0].offsetHeight;if(g){var k=this.$element.parent(),l=e,m=document.documentElement.scrollTop||document.body.scrollTop,n="body"==this.options.container?window.innerWidth:k.outerWidth(),o="body"==this.options.container?window.innerHeight:k.outerHeight(),p="body"==this.options.container?0:k.offset().left;e="bottom"==e&&h.top+h.height+j-m>o?"top":"top"==e&&h.top-m-j<0?"bottom":"right"==e&&h.right+i>n?"left":"left"==e&&h.left-i
'}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;(e||"destroy"!=c)&&(e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]())})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);{var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})}},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(b.RESET).addClass("affix");var a=this.$window.scrollTop(),c=this.$element.offset();return this.pinnedOffset=c.top-a},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"top"==this.affixed&&(e.top+=d),"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(b.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:c-h-this.$element.height()}))}}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery);
// source --> https://better-than-ever.com/wp-content/plugins/mailchimp-for-wp/assets/js/forms-api.min.js?ver=4.5.3
!function(){var s=void 0;!function o(u,s,a){function c(e,t){if(!s[e]){if(!u[e]){var n=!1;if(!t&&n)return n(e,!0);if(f)return f(e,!0);var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[e]={exports:{}};u[e][0].call(i.exports,function(t){return c(u[e][1][t]||t)},i,i.exports,o,u,s,a)}return s[e].exports}for(var f=!1,t=0;t