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 / nojquery.ba-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
nojquery.ba-postmessage.js
28 lines
1 /*!
2 * jQuery postMessage - v0.5 - 9/11/2009
3 * http://benalman.com/projects/jquery-postmessage-plugin/
4 *
5 * Copyright (c) 2009 "Cowboy" Ben Alman
6 * Dual licensed under the MIT and GPL licenses.
7 * http://benalman.com/about/license/
8 *
9 * Non-jQuery fork by Jeff Lee
10 *
11 * This fork consists of the following changes:
12 * 1. Basic code cleanup and restructuring, for legibility.
13 * 2. The `postMessage` and `receiveMessage` functions can be bound arbitrarily,
14 * in terms of both function names and object scope. Scope is specified by
15 * the the "this" context of NoJQueryPostMessageMixin();
16 * 3. I've removed the check for Opera 9.64, which used `$.browser`. There were
17 * at least three different GitHub users requesting the removal of this
18 * "Opera sniff" on the original project's Issues page, so I figured this
19 * would be a relatively safe change.
20 * 4. `postMessage` no longer uses `$.param` to serialize messages that are not
21 * strings. I actually prefer this structure anyway. `receiveMessage` does
22 * not implement a corresponding deserialization step, and as such it seems
23 * cleaner and more symmetric to leave both data serialization and
24 * deserialization to the client.
25 * 5. The use of `$.isFunction` is replaced by a functionally-identical check.
26 * 6. The `$:nomunge` YUI option is no longer necessary.
27 */
28 function NoJQueryPostMessageMixin(n,e){var t,i,o,s,a,r=1;return window.postMessage?(window.addEventListener?(t=function(n){window.addEventListener("message",n,!1)},i=function(n){window.removeEventListener("message",n,!1)}):(t=function(n){window.attachEvent("onmessage",n)},i=function(n){window.detachEvent("onmessage",n)}),this[n]=function(n,e,t){e&&t.postMessage(n,e.replace(/([^:]+:\/\/[^\/]+).*/,"$1"))},this[e]=function(n,e,s){if(o&&(i(o),o=null),!n)return!1;o=t((function(t){switch(Object.prototype.toString.call(e)){case"[object String]":if(e!==t.origin)return!1;break;case"[object Function]":if(e(t.origin))return!1}n(t)}))}):(this[n]=function(n,e,t){e&&(t.location=e.replace(/#.*$/,"")+"#"+ +new Date+r+++"&"+n)},this[e]=function(n,e,t){s&&(clearInterval(s),s=null),n&&(t="number"==typeof e?e:"number"==typeof t?t:100,s=setInterval((function(){var e=document.location.hash,t=/^#?\d+&/;e!==a&&t.test(e)&&(a=e,n({data:e.replace(t,"")}))}),t))}),this}