Quantcast
Channel: , Author at Compass
Viewing all articles
Browse latest Browse all 840

20c95a4671e43e870a39d60c128041d2-scripts

$
0
0

/**handles:gform_masked_input,gform_placeholder,wp-embed**/
!function(e){“function”==typeof define&&define.amd?define([“jquery”],e):”object”==typeof exports?e(require(“jquery”)):e(jQuery)}(function(R){var a,e=navigator.userAgent,S=/iphone/i.test(e),i=/chrome/i.test(e),T=/android/i.test(e);R.mask={definitions:{9:”[0-9]”,a:”[A-Za-z]”,”*”:”[A-Za-z0-9]”},autoclear:!0,dataName:”rawMaskFn”,placeholder:”_”},R.fn.extend({caret:function(e,t){var n;if(0!==this.length&&!this.is(“:hidden”)&&this.get(0)===document.activeElement)return”number”==typeof e?(t=”number”==typeof t?t:e,this.each(function(){this.setSelectionRange?this.setSelectionRange(e,t):this.createTextRange&&((n=this.createTextRange()).collapse(!0),n.moveEnd(“character”,t),n.moveStart(“character”,e),n.select())})):(this[0].setSelectionRange?(e=this[0].selectionStart,t=this[0].selectionEnd):document.selection&&document.selection.createRange&&(n=document.selection.createRange(),e=0-n.duplicate().moveStart(“character”,-1e5),t=e+n.text.length),{begin:e,end:t})},unmask:function(){return this.trigger(“unmask”)},mask:function(t,v){var n,b,k,y,x,j,A;if(!t&&0<this.length){var e=R(this[0]).data(R.mask.dataName);return e?e():void 0}return v=R.extend({autoclear:R.mask.autoclear,placeholder:R.mask.placeholder,completed:null},v),n=R.mask.definitions,b=[],k=j=t.length,y=null,t=String(t),R.each(t.split(""),function(e,t){"?"==t?(j–,k=e):n[t]?(b.push(new RegExp(n[t])),null===y&&(y=b.length-1),e<k&&(x=b.length-1)):b.push(null)}),this.trigger("unmask").each(function(){var o=R(this),c=R.map(t.split(""),function(e,t){if("?"!=e)return n[e]?f(t):e}),l=c.join(""),r=o.val();function u(){if(v.completed){for(var e=y;e<=x;e++)if(b[e]&&c[e]===f(e))return;v.completed.call(o)}}function f(e){return e<v.placeholder.length?v.placeholder.charAt(e):v.placeholder.charAt(0)}function s(e){for(;++e<j&&!b[e];);return e}function h(e,t){var n,a;if(!(e<0)){for(n=e,a=s(t);n<j;n++)if(b[n]){if(!(a<j&&b[n].test(c[a])))break;c[n]=c[a],c[a]=f(a),a=s(a)}d(),o.caret(Math.max(y,e))}}function g(e){p(),o.val()!=r&&o.change()}function m(e,t){var n;for(n=e;n<t&&n<j;n++)b[n]&&(c[n]=f(n))}function d(){o.val(c.join(""))}function p(e){var t,n,a,i=o.val(),r=-1;for(a=t=0;t<j;t++)if(b[t]){for(c[t]=f(t);a++i.length){m(t+1,j);break}}else c[t]===i.charAt(a)&&a++,t<k&&(r=t);return e?d():r+1<k?v.autoclear||c.join("")===l?(o.val()&&o.val(""),m(0,j)):d():(d(),o.val(o.val().substring(0,r+1))),k?t:y}o.data(R.mask.dataName,function(){return R.map(c,function(e,t){return b[t]&&e!=f(t)?e:null}).join("")}),o.one("unmask",function(){o.off(".mask").removeData(R.mask.dataName)}).on("focus.mask",function(){var e;o.prop("readonly")||(clearTimeout(a),r=o.val(),e=p(),a=setTimeout(function(){o.get(0)===document.activeElement&&(d(),e==t.replace("?","").length?o.caret(0,e):o.caret(e))},10))}).on("blur.mask",g).on("keydown.mask",function(e){if(!o.prop("readonly")){var t,n,a,i=e.which||e.keyCode;A=o.val(),8===i||46===i||S&&127===i?(n=(t=o.caret()).begin,(a=t.end)-n==0&&(n=46!==i?function(e){for(;0<=–e&&!b[e];);return e}(n):a=s(n-1),a=46===i?s(a):a),m(n,a),h(n,a-1),e.preventDefault()):13===i?g.call(this,e):27===i&&(o.val(r),o.caret(0,p()),e.preventDefault())}}).on("keypress.mask",function(e){if(!o.prop("readonly")){var t,n,a,i=e.which||e.keyCode,r=o.caret();if(!(e.ctrlKey||e.altKey||e.metaKey||i<32)&&i&&13!==i){if(r.end-r.begin!=0&&(m(r.begin,r.end),h(r.begin,r.end-1)),(t=s(r.begin-1))<j&&(n=String.fromCharCode(i),b[t].test(n))){if(!function(e){var t,n,a,i;for(n=f(t=e);t<j;t++)if(b[t]){if(a=s(t),i=c[t],c[t]=n,!(a<j&&b[a].test(i)))break;n=i}}(t),c[t]=n,d(),a=s(t),T){setTimeout(function(){R.proxy(R.fn.caret,o,a)()},0)}else o.caret(a);r.beginn.length){for(p(!0);0<a.begin&&!b[a.begin-1];)a.begin–;if(0===a.begin)for(;a.begin<y&&!b[a.begin];)a.begin++;setTimeout(t,0)}else{var i=p(!0),r=n.charAt(a.begin);a.beginr;r++)if(t[r]===e)return!0;return!1}function n(t,e){var r;t.createTextRange?(r=t.createTextRange(),r.move(“character”,e),r.select()):t.selectionStart&&(t.focus(),t.setSelectionRange(e,e))}function a(t,e){try{return t.type=e,!0}catch(r){return!1}}t.Placeholders={Utils:{addEventListener:e,inArray:r,moveCaret:n,changeType:a}}})(this),function(t){“use strict”;function e(){}function r(){try{return document.activeElement}catch(t){}}function n(t,e){var r,n,a=!!e&&t.value!==e,u=t.value===t.getAttribute(V);return(a||u)&&”true”===t.getAttribute(P)?(t.removeAttribute(P),t.value=t.value.replace(t.getAttribute(V),””),t.className=t.className.replace(R,””),n=t.getAttribute(z),parseInt(n,10)>=0&&(t.setAttribute(“maxLength”,n),t.removeAttribute(z)),r=t.getAttribute(D),r&&(t.type=r),!0):!1}function a(t){var e,r,n=t.getAttribute(V);return””===t.value&&n?(t.setAttribute(P,”true”),t.value=n,t.className+=” “+I,r=t.getAttribute(z),r||(t.setAttribute(z,t.maxLength),t.removeAttribute(“maxLength”)),e=t.getAttribute(D),e?t.type=”text”:”password”===t.type&&K.changeType(t,”text”)&&t.setAttribute(D,”password”),!0):!1}function u(t,e){var r,n,a,u,i,l,o;if(t&&t.getAttribute(V))e(t);else for(a=t?t.getElementsByTagName(“input”):f,u=t?t.getElementsByTagName(“textarea”):h,r=a?a.length:0,n=u?u.length:0,o=0,l=r+n;l>o;o++)i=r>o?a[o]:u[o-r],e(i)}function i(t){u(t,n)}function l(t){u(t,a)}function o(t){return function(){b&&t.value===t.getAttribute(V)&&”true”===t.getAttribute(P)?K.moveCaret(t,0):n(t)}}function c(t){return function(){a(t)}}function s(t){return function(e){return A=t.value,”true”===t.getAttribute(P)&&A===t.getAttribute(V)&&K.inArray(C,e.keyCode)?(e.preventDefault&&e.preventDefault(),!1):void 0}}function d(t){return function(){n(t,A),””===t.value&&(t.blur(),K.moveCaret(t,0))}}function v(t){return function(){t===r()&&t.value===t.getAttribute(V)&&”true”===t.getAttribute(P)&&K.moveCaret(t,0)}}function g(t){return function(){i(t)}}function p(t){t.form&&(T=t.form,”string”==typeof T&&(T=document.getElementById(T)),T.getAttribute(U)||(K.addEventListener(T,”submit”,g(T)),T.setAttribute(U,”true”))),K.addEventListener(t,”focus”,o(t)),K.addEventListener(t,”blur”,c(t)),b&&(K.addEventListener(t,”keydown”,s(t)),K.addEventListener(t,”keyup”,d(t)),K.addEventListener(t,”click”,v(t))),t.setAttribute(j,”true”),t.setAttribute(V,x),(b||t!==r())&&a(t)}var f,h,b,m,A,y,E,x,L,T,S,N,w,B=[“text”,”search”,”url”,”tel”,”email”,”password”,”number”,”textarea”],C=[27,33,34,35,36,37,38,39,40,8,46],k=”#ccc”,I=”placeholdersjs”,R=RegExp(“(?:^|\\s)”+I+”(?!\\S)”),V=”data-placeholder-value”,P=”data-placeholder-active”,D=”data-placeholder-type”,U=”data-placeholder-submit”,j=”data-placeholder-bound”,q=”data-placeholder-focus”,Q=”data-placeholder-live”,z=”data-placeholder-maxlength”,F=document.createElement(“input”),G=document.getElementsByTagName(“head”)[0],H=document.documentElement,J=t.Placeholders,K=J.Utils;if(J.nativeSupport=void 0!==F.placeholder,!J.nativeSupport){for(f=document.getElementsByTagName(“input”),h=document.getElementsByTagName(“textarea”),b=”false”===H.getAttribute(q),m=”false”!==H.getAttribute(Q),y=document.createElement(“style”),y.type=”text/css”,E=document.createTextNode(“.”+I+” { color:”+k+”; }”),y.styleSheet?y.styleSheet.cssText=E.nodeValue:y.appendChild(E),G.insertBefore(y,G.firstChild),w=0,N=f.length+h.length;N>w;w++)S=f.length>w?f[w]:h[w-f.length],x=S.attributes.placeholder,x&&(x=x.nodeValue,x&&K.inArray(B,S.type)&&p(S));L=setInterval(function(){for(w=0,N=f.length+h.length;N>w;w++)S=f.length>w?f[w]:h[w-f.length],x=S.attributes.placeholder,x?(x=x.nodeValue,x&&K.inArray(B,S.type)&&(S.getAttribute(j)||p(S),(x!==S.getAttribute(V)||”password”===S.type&&!S.getAttribute(D))&&(“password”===S.type&&!S.getAttribute(D)&&K.changeType(S,”text”)&&S.setAttribute(D,”password”),S.value===S.getAttribute(V)&&(S.value=x),S.setAttribute(V,x)))):S.getAttribute(P)&&(n(S),S.removeAttribute(V));m||clearInterval(L)},100)}K.addEventListener(t,”beforeunload”,function(){J.disable()}),J.disable=J.nativeSupport?e:i,J.enable=J.nativeSupport?e:l}(this),function(t){“use strict”;var e=t.fn.val,r=t.fn.prop;Placeholders.nativeSupport||(t.fn.val=function(t){var r=e.apply(this,arguments),n=this.eq(0).data(“placeholder-value”);return void 0===t&&this.eq(0).data(“placeholder-active”)&&r===n?””:r},t.fn.prop=function(t,e){return void 0===e&&this.eq(0).data(“placeholder-active”)&&”value”===t?””:r.apply(this,arguments)})}(jQuery);
/*! This file is auto-generated */
!function(c,d){“use strict”;var e=!1,n=!1;if(d.querySelector)if(c.addEventListener)e=!0;if(c.wp=c.wp||{},!c.wp.receiveEmbedMessage)if(c.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){for(var r,a,i,s=d.querySelectorAll(‘iframe[data-secret=”‘+t.secret+'”]’),n=d.querySelectorAll(‘blockquote[data-secret=”‘+t.secret+'”]’),o=0;o<n.length;o++)n[o].style.display="none";for(o=0;o<s.length;o++)if(r=s[o],e.source===r.contentWindow){if(r.removeAttribute("style"),"height"===t.message){if(1e3<(i=parseInt(t.value,10)))i=1e3;else if(~~i<200)i=200;r.height=i}if("link"===t.message)if(a=d.createElement("a"),i=d.createElement("a"),a.href=r.getAttribute("src"),i.href=t.value,i.host===a.host)if(d.activeElement===r)c.top.location.href=t.value}}},e)c.addEventListener("message",c.wp.receiveEmbedMessage,!1),d.addEventListener("DOMContentLoaded",t,!1),c.addEventListener("load",t,!1);function t(){if(!n){n=!0;for(var e,t,r=-1!==navigator.appVersion.indexOf("MSIE 10"),a=!!navigator.userAgent.match(/Trident.*rv:11\./),i=d.querySelectorAll("iframe.wp-embedded-content"),s=0;s<i.length;s++){if(!(e=i[s]).getAttribute("data-secret"))t=Math.random().toString(36).substr(2,10),e.src+="#?secret="+t,e.setAttribute("data-secret",t);if(r||a)(t=e.cloneNode(!0)).removeAttribute("security"),e.parentNode.replaceChild(t,e)}}}}(window,document);

The post 20c95a4671e43e870a39d60c128041d2-scripts appeared first on Compass.


Viewing all articles
Browse latest Browse all 840

Trending Articles