← All changes
|
inc/freemius/assets/js/nojquery.ba-postmessage.js
+27
-27
4.2.13
→
4.3.17
View file →
| @@ -1,28 +1,28 @@ | ||
| 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 | - */ | |
| 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 | 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} |