mirror of
https://github.com/imapsync/imapsync.git
synced 2024-11-17 00:02:29 +01:00
1 line
3.8 KiB
JavaScript
1 line
3.8 KiB
JavaScript
(function(){var e,n,t,o;t=function(e,n){var t,o,a,r,i,s,c,d,u,m;return c=[null,null,!1],a=c[0],o=c[1],s=c[2],(a=window.jQuery)&&(u=parseInt(e.split(".")[0])||0,m=parseInt(e.split(".")[1])||0,r=parseInt(a.fn.jquery.split(".")[0])||0,i=parseInt(a.fn.jquery.split(".")[1])||0,t=r>u||r===u&&i>=m),a&&t?n(a):(d=document.createElement("script"),d.type="text/javascript",d.src="https://code.jquery.com/jquery-1.8.3.min.js",d.onload=d.onreadystatechange=function(){return s||(o=this.readyState)&&"loaded"!==o&&"complete"!==o?void 0:(n((a=window.jQuery).noConflict(1)),a(d).remove())},(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(d))},e=function(e){return"development"===e||"test"===e?document.location.protocol+"//"+document.location.host:"https://www.coinbase.com"},n=function(t,o){var a,r;return window.coinbaseCookieLoaded?o(t):window.coinbaseCookieLoading?setTimeout(function(){return n(t,o)},200):(a=e(t("body").data("env")),window.coinbaseCookieLoading=!0,r=document.createElement("script"),r.src=a+"/checkouts/get_cookie.js",r.onload=r.onreadystatechange=function(){return window.coinbaseCookieLoaded=!0,window.coinbaseCookieLoading=!1,t(r).remove(),o(t)},(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(r))},o=function(n){var t,o,a,r,i,s;return t=!1,o=!1,i=e(n("body").data("env")),s=function(e){var a,r,s;if(s=e.data.split("|"),r=s[0],a=s[1],a=escape(a),e.origin===i){if("show modal iframe"===r)return n("#coinbase_modal_iframe_"+a).show();if("coinbase_payment_complete"===r)return n("#coinbase_button_iframe_"+a).attr("src",i+"/buttons/paid"),n(document).trigger("coinbase_payment_complete",a);if("coinbase_payment_mispaid"===r)return n(document).trigger("coinbase_payment_mispaid",a);if("coinbase_payment_expired"===r)return n(document).trigger("coinbase_payment_expired",a);if("hide modal"===r)return n("#coinbase_modal_iframe_"+a).hide(),n(document).trigger("coinbase_modal_closed",a);if("signup redirect"===r)return document.location=i+"/users/verify";if("button frame loaded"===r){if(t=!0,o)return n(document).trigger("coinbase_button_loaded",a)}else if("checkouts frame loaded"===r&&(o=!0,t))return n(document).trigger("coinbase_button_loaded",a)}},r=function(e){switch(e){case"custom_large":return 276;case"custom_small":return 210;case"subscription_large":return 263;case"subscription_small":return 210;case"donation_large":return 189;case"donation_small":return 148;case"buy_now_large":return 211;case"buy_now_small":return 170;default:return 211}},a=function(e){switch(e){case"custom_large":return 62;case"custom_small":return 48;default:return 46}},window.addEventListener("message",s,!1),n(".coinbase-button").each(function(o){return function(o,s){var c,d,u,m,l,_,p,f;return c=n(s),m=c.data(),m.referrer=document.domain,p=n.param(m),u=c.data("code"),f=c.data("width")||r(c.data("button-style")),l=c.data("height")||a(c.data("button-style")),i=e(c.data("env")),d="<iframe src='"+i+"/buttons/"+u+"?"+p+"' id='coinbase_button_iframe_"+u+"' name='coinbase_button_iframe_"+u+"' style='width: "+f+"px; height: "+l+"px; border: none; overflow: hidden;' scrolling='no' allowtransparency='true' frameborder='0'></iframe>",_="<iframe src='"+i+"/checkouts/"+u+"/widget?"+p+"' id='coinbase_modal_iframe_"+u+"' name='coinbase_modal_iframe_"+u+"' style='background-color: transparent; border: 0px none transparent; display: none; position: fixed; visibility: visible; margin: 0px; padding: 0px; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 9999;' scrolling='no' allowtransparency='true' frameborder='0'></iframe>","none"===c.data("button-style")?t=!0:c.replaceWith(d),n("body").append(_)}}(this)),n(document).on("coinbase_show_modal",function(e,t){return n("#coinbase_modal_iframe_"+t).length>0?(n("#coinbase_modal_iframe_"+t).show(),frames["coinbase_modal_iframe_"+t].postMessage("show modal|"+t,i)):void 0})},t("1.7",function(e){return n(e,o)})}).call(this); |