PluginProbe ʕ •ᴥ•ʔ
Code Manager / 1.0.35
Code Manager v1.0.35
1.0.47 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 1.0.34 1.0.35 1.0.36 1.0.37 1.0.38 1.0.39 1.0.4 1.0.40 1.0.41 1.0.42 1.0.43 1.0.44 1.0.45 1.0.46 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9
code-manager / freemius / assets / js / postmessage.js
code-manager / freemius / assets / js Last commit date
index.php 2 years ago nojquery.ba-postmessage.js 2 years ago postmessage.js 2 years ago
postmessage.js
1 lines
1 !function(e,t){var s,n,o,i,r,a,c,p,u=this;u.FS=u.FS||{},u.FS.PostMessage=(n=new NoJQueryPostMessageMixin("postMessage","receiveMessage"),o={},i=decodeURIComponent(document.location.hash.replace(/^#/,"")),r=i.substring(0,i.indexOf("/","https://"===i.substring(0,8)?8:7)),a=""!==i,c=e(window),p=e("html"),{init:function(e,t){s=e,n.receiveMessage((function(e){var t=JSON.parse(e.data);if(o[t.type])for(var s=0;s<o[t.type].length;s++)o[t.type][s](t.data)}),s),FS.PostMessage.receiveOnce("forward",(function(e){window.location=e.url})),(t=t||[]).length>0&&c.on("scroll",(function(){for(var e=0;e<t.length;e++)FS.PostMessage.postScroll(t[e])}))},init_child:function(){this.init(r),e(window).bind("load",(function(){FS.PostMessage.postHeight(),FS.PostMessage.post("loaded")}))},hasParent:function(){return a},postHeight:function(t,s){t=t||0,s=s||"#wrap_section",this.post("height",{height:t+e(s).outerHeight(!0)})},postScroll:function(e){this.post("scroll",{top:c.scrollTop(),height:c.height()-parseFloat(p.css("paddingTop"))-parseFloat(p.css("marginTop"))},e)},post:function(e,t,s){console.debug("PostMessage.post",e),s?n.postMessage(JSON.stringify({type:e,data:t}),s.src,s.contentWindow):n.postMessage(JSON.stringify({type:e,data:t}),i,window.parent)},receive:function(e,s){console.debug("PostMessage.receive",e),t===o[e]&&(o[e]=[]),o[e].push(s)},receiveOnce:function(e,t){this.is_set(e)||this.receive(e,t)},is_set:function(e){return t!=o[e]},parent_url:function(){return i},parent_subdomain:function(){return r}})}(jQuery);