summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jetpack/_inc/build/postmessage.min.js')
-rw-r--r--plugins/jetpack/_inc/build/postmessage.min.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/jetpack/_inc/build/postmessage.min.js b/plugins/jetpack/_inc/build/postmessage.min.js
index 1c441a2d..ae926057 100644
--- a/plugins/jetpack/_inc/build/postmessage.min.js
+++ b/plugins/jetpack/_inc/build/postmessage.min.js
@@ -22,4 +22,4 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
**/
-var NO_JQUERY={};!function(e,t,n){if(!("console"in e)){var a=e.console={};a.log=a.warn=a.error=a.debug=function(){}}t===NO_JQUERY&&(t={fn:{},extend:function(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++){var a=arguments[t];for(var r in a)e[r]=a[r]}return e}}),t.fn.pm=function(){return console.log("usage: \nto send: $.pm(options)\nto receive: $.pm.bind(type, fn, [origin])"),this},t.pm=e.pm=function(e){r.send(e)},t.pm.bind=e.pm.bind=function(e,t,n,a,s){r.bind(e,t,n,a,!0===s)},t.pm.unbind=e.pm.unbind=function(e,t){r.unbind(e,t)},t.pm.origin=e.pm.origin=null,t.pm.poll=e.pm.poll=200;var r={send:function(e){var n=t.extend({},r.defaults,e),a=n.target;if(!n.target)return void console.warn("postmessage target window required");if(!n.type)return void console.warn("postmessage type required");var s={data:n.data,type:n.type};n.success&&(s.callback=r._callback(n.success)),n.error&&(s.errback=r._callback(n.error)),"postMessage"in a&&!n.hash?(r._bind(),a.postMessage(JSON.stringify(s),n.origin||"*")):(r.hash._bind(),r.hash.send(n,s))},bind:function(e,t,n,a,s){r._replyBind(e,t,n,a,s)},_replyBind:function(n,a,s,o,i){"postMessage"in e&&!o?r._bind():r.hash._bind();var u=r.data("listeners.postmessage");u||(u={},r.data("listeners.postmessage",u));var c=u[n];c||(c=[],u[n]=c),c.push({fn:a,callback:i,origin:s||t.pm.origin})},unbind:function(e,t){var n=r.data("listeners.postmessage");if(n)if(e)if(t){var a=n[e];if(a){for(var s=[],o=0,i=a.length;o<i;o++){var u=a[o];u.fn!==t&&s.push(u)}n[e]=s}}else delete n[e];else for(var o in n)delete n[o]},data:function(e,t){return void 0===t?r._data[e]:(r._data[e]=t,t)},_data:{},_CHARS:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),_random:function(){for(var e=[],t=0;t<32;t++)e[t]=r._CHARS[0|32*Math.random()];return e.join("")},_callback:function(e){var t=r.data("callbacks.postmessage");t||(t={},r.data("callbacks.postmessage",t));var n=r._random();return t[n]=e,n},_bind:function(){r.data("listening.postmessage")||(e.addEventListener?e.addEventListener("message",r._dispatch,!1):e.attachEvent&&e.attachEvent("onmessage",r._dispatch),r.data("listening.postmessage",1))},_dispatch:function(e){function t(t){n.callback&&r.send({target:e.source,data:t,type:n.callback})}try{var n=JSON.parse(e.data)}catch(e){return}if(n.type){var a=r.data("callbacks.postmessage")||{},s=a[n.type];if(s)s(n.data);else for(var o=r.data("listeners.postmessage")||{},i=o[n.type]||[],u=0,c=i.length;u<c;u++){var l=i[u];if(l.origin&&"*"!==l.origin&&e.origin!==l.origin){if(console.warn("postmessage message origin mismatch",e.origin,l.origin),n.errback){var f={message:"postmessage origin mismatch",origin:[e.origin,l.origin]};r.send({target:e.source,data:f,type:n.errback})}}else try{l.callback?l.fn(n.data,t,e):t(l.fn(n.data,e))}catch(t){if(!n.errback)throw t;r.send({target:e.source,data:t,type:n.errback})}}}}};r.hash={send:function(t,n){var a=t.target,s=t.url;if(!s)return void console.warn("postmessage target window url is required");s=r.hash._url(s);var o,i=r.hash._url(e.location.href);if(e==a.parent)o="parent";else try{for(var u=0,c=parent.frames.length;u<c;u++){if(parent.frames[u]==e){o=u;break}}}catch(t){o=e.name}if(null==o)return void console.warn("postmessage windows must be direct parent/child windows and the child must be available through the parent window.frames list");var l={"x-requested-with":"postmessage",source:{name:o,url:i},postmessage:n},f="#x-postmessage-id="+r._random();a.location=s+f+encodeURIComponent(JSON.stringify(l))},_regex:/^\#x\-postmessage\-id\=(\w{32})/,_regex_len:"#x-postmessage-id=".length+32,_bind:function(){r.data("polling.postmessage")||(setInterval(function(){var t=""+e.location.hash,n=r.hash._regex.exec(t);if(n){var a=n[1];r.hash._last!==a&&(r.hash._last=a,r.hash._dispatch(t.substring(r.hash._regex_len)))}},t.pm.poll||200),r.data("polling.postmessage",1))},_dispatch:function(t){function n(e){a.callback&&r.send({target:i,data:e,type:a.callback,hash:!0,url:t.source.url})}if(t){try{if(t=JSON.parse(decodeURIComponent(t)),!("postmessage"===t["x-requested-with"]&&t.source&&null!=t.source.name&&t.source.url&&t.postmessage))return}catch(e){return}var a=t.postmessage,s=r.data("callbacks.postmessage")||{},o=s[a.type];if(o)o(a.data);else{var i;i="parent"===t.source.name?e.parent:e.frames[t.source.name];for(var u=r.data("listeners.postmessage")||{},c=u[a.type]||[],l=0,f=c.length;l<f;l++){var p=c[l];if(p.origin){var g=/https?\:\/\/[^\/]*/.exec(t.source.url)[0];if("*"!==p.origin&&g!==p.origin){if(console.warn("postmessage message origin mismatch",g,p.origin),a.errback){var d={message:"postmessage origin mismatch",origin:[g,p.origin]};r.send({target:i,data:d,type:a.errback,hash:!0,url:t.source.url})}continue}}try{p.callback?p.fn(a.data,n):n(p.fn(a.data))}catch(e){if(!a.errback)throw e;r.send({target:i,data:e,type:a.errback,hash:!0,url:t.source.url})}}}}},_url:function(e){return(""+e).replace(/#.*$/,"")}},t.extend(r,{defaults:{target:null,url:null,type:null,data:null,success:null,error:null,origin:"*",hash:!1}})}(this,"undefined"==typeof jQuery?NO_JQUERY:jQuery),"JSON"in window&&window.JSON||(JSON={}),function(){function f(e){return e<10?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,a,r,s,o,i=gap,u=t[e];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(e)),"function"==typeof rep&&(u=rep.call(t,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(u)){for(s=u.length,n=0;n<s;n+=1)o[n]=str(n,u)||"null";return r=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+i+"]":"["+o.join(",")+"]",gap=i,r}if(rep&&"object"==typeof rep)for(s=rep.length,n=0;n<s;n+=1)"string"==typeof(a=rep[n])&&(r=str(a,u))&&o.push(quote(a)+(gap?": ":":")+r);else for(a in u)Object.hasOwnProperty.call(u,a)&&(r=str(a,u))&&o.push(quote(a)+(gap?": ":":")+r);return r=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+i+"}":"{"+o.join(",")+"}",gap=i,r}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(e){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var a;if(gap="",indent="","number"==typeof n)for(a=0;a<n;a+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,a,r=e[t];if(r&&"object"==typeof r)for(n in r)Object.hasOwnProperty.call(r,n)&&(a=walk(r,n),void 0!==a?r[n]=a:delete r[n]);return reviver.call(e,t,r)}var j;if(cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(); \ No newline at end of file
+var NO_JQUERY={};!function(e,t,a){if(!("console"in e)){var n=e.console={};n.log=n.warn=n.error=n.debug=function(){}}t===NO_JQUERY&&(t={fn:{},extend:function(){for(var e=arguments[0],t=1,a=arguments.length;t<a;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}}),t.fn.pm=function(){return console.log("usage: \nto send: $.pm(options)\nto receive: $.pm.bind(type, fn, [origin])"),this},t.pm=e.pm=function(e){r.send(e)},t.pm.bind=e.pm.bind=function(e,t,a,n,s){r.bind(e,t,a,n,!0===s)},t.pm.unbind=e.pm.unbind=function(e,t){r.unbind(e,t)},t.pm.origin=e.pm.origin=null,t.pm.poll=e.pm.poll=200;var r={send:function(e){var a=t.extend({},r.defaults,e),n=a.target;if(a.target)if(a.type){var s={data:a.data,type:a.type};a.success&&(s.callback=r._callback(a.success)),a.error&&(s.errback=r._callback(a.error)),"postMessage"in n&&!a.hash?(r._bind(),n.postMessage(JSON.stringify(s),a.origin||"*")):(r.hash._bind(),r.hash.send(a,s))}else console.warn("postmessage type required");else console.warn("postmessage target window required")},bind:function(e,t,a,n,s){r._replyBind(e,t,a,n,s)},_replyBind:function(a,n,s,o,i){"postMessage"in e&&!o?r._bind():r.hash._bind();var u=r.data("listeners.postmessage");u||(u={},r.data("listeners.postmessage",u));var c=u[a];c||(c=[],u[a]=c),c.push({fn:n,callback:i,origin:s||t.pm.origin})},unbind:function(e,t){var a=r.data("listeners.postmessage");if(a)if(e)if(t){var n=a[e];if(n){for(var s=[],o=0,i=n.length;o<i;o++){var u=n[o];u.fn!==t&&s.push(u)}a[e]=s}}else delete a[e];else for(var o in a)delete a[o]},data:function(e,t){return void 0===t?r._data[e]:(r._data[e]=t,t)},_data:{},_CHARS:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),_random:function(){for(var e=[],t=0;t<32;t++)e[t]=r._CHARS[0|32*Math.random()];return e.join("")},_callback:function(e){var t=r.data("callbacks.postmessage");t||(t={},r.data("callbacks.postmessage",t));var a=r._random();return t[a]=e,a},_bind:function(){r.data("listening.postmessage")||(e.addEventListener?e.addEventListener("message",r._dispatch,!1):e.attachEvent&&e.attachEvent("onmessage",r._dispatch),r.data("listening.postmessage",1))},_dispatch:function(e){try{var t=JSON.parse(e.data)}catch(e){return}if(t.type){var a=(r.data("callbacks.postmessage")||{})[t.type];if(a)a(t.data);else for(var n=(r.data("listeners.postmessage")||{})[t.type]||[],s=0,o=n.length;s<o;s++){var i=n[s];if(i.origin&&"*"!==i.origin&&e.origin!==i.origin){if(console.warn("postmessage message origin mismatch",e.origin,i.origin),t.errback){var u={message:"postmessage origin mismatch",origin:[e.origin,i.origin]};r.send({target:e.source,data:u,type:t.errback})}}else try{i.callback?i.fn(t.data,c,e):c(i.fn(t.data,e))}catch(a){if(!t.errback)throw a;r.send({target:e.source,data:a,type:t.errback})}function c(a){t.callback&&r.send({target:e.source,data:a,type:t.callback})}}}}};r.hash={send:function(t,a){var n=t.target,s=t.url;if(s){s=r.hash._url(s);var o,i=r.hash._url(e.location.href);if(e==n.parent)o="parent";else try{for(var u=0,c=parent.frames.length;u<c;u++){if(parent.frames[u]==e){o=u;break}}}catch(t){o=e.name}if(null!=o){var l={"x-requested-with":"postmessage",source:{name:o,url:i},postmessage:a},f="#x-postmessage-id="+r._random();n.location=s+f+encodeURIComponent(JSON.stringify(l))}else console.warn("postmessage windows must be direct parent/child windows and the child must be available through the parent window.frames list")}else console.warn("postmessage target window url is required")},_regex:/^\#x\-postmessage\-id\=(\w{32})/,_regex_len:"#x-postmessage-id=".length+32,_bind:function(){r.data("polling.postmessage")||(setInterval(function(){var t=""+e.location.hash,a=r.hash._regex.exec(t);if(a){var n=a[1];r.hash._last!==n&&(r.hash._last=n,r.hash._dispatch(t.substring(r.hash._regex_len)))}},t.pm.poll||200),r.data("polling.postmessage",1))},_dispatch:function(t){if(t){try{if(!("postmessage"===(t=JSON.parse(decodeURIComponent(t)))["x-requested-with"]&&t.source&&null!=t.source.name&&t.source.url&&t.postmessage))return}catch(e){return}var a=t.postmessage,n=(r.data("callbacks.postmessage")||{})[a.type];if(n)n(a.data);else{var s;s="parent"===t.source.name?e.parent:e.frames[t.source.name];for(var o=(r.data("listeners.postmessage")||{})[a.type]||[],i=0,u=o.length;i<u;i++){var c=o[i];if(c.origin){var l=/https?\:\/\/[^\/]*/.exec(t.source.url)[0];if("*"!==c.origin&&l!==c.origin){if(console.warn("postmessage message origin mismatch",l,c.origin),a.errback){var f={message:"postmessage origin mismatch",origin:[l,c.origin]};r.send({target:s,data:f,type:a.errback,hash:!0,url:t.source.url})}continue}}function p(e){a.callback&&r.send({target:s,data:e,type:a.callback,hash:!0,url:t.source.url})}try{c.callback?c.fn(a.data,p):p(c.fn(a.data))}catch(e){if(!a.errback)throw e;r.send({target:s,data:e,type:a.errback,hash:!0,url:t.source.url})}}}}},_url:function(e){return(""+e).replace(/#.*$/,"")}},t.extend(r,{defaults:{target:null,url:null,type:null,data:null,success:null,error:null,origin:"*",hash:!1}})}(this,"undefined"==typeof jQuery?NO_JQUERY:jQuery),"JSON"in window&&window.JSON||(JSON={}),function(){function f(e){return e<10?"0"+e:e}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(e){return this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(e){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var a,n,r,s,o,i=gap,u=t[e];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(e)),"function"==typeof rep&&(u=rep.call(t,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?String(u):"null";case"boolean":case"null":return String(u);case"object":if(!u)return"null";if(gap+=indent,o=[],"[object Array]"===Object.prototype.toString.apply(u)){for(s=u.length,a=0;a<s;a+=1)o[a]=str(a,u)||"null";return r=0===o.length?"[]":gap?"[\n"+gap+o.join(",\n"+gap)+"\n"+i+"]":"["+o.join(",")+"]",gap=i,r}if(rep&&"object"==typeof rep)for(s=rep.length,a=0;a<s;a+=1)"string"==typeof(n=rep[a])&&(r=str(n,u))&&o.push(quote(n)+(gap?": ":":")+r);else for(n in u)Object.hasOwnProperty.call(u,n)&&(r=str(n,u))&&o.push(quote(n)+(gap?": ":":")+r);return r=0===o.length?"{}":gap?"{\n"+gap+o.join(",\n"+gap)+"\n"+i+"}":"{"+o.join(",")+"}",gap=i,r}}"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,a){var n;if(gap="",indent="","number"==typeof a)for(n=0;n<a;n+=1)indent+=" ";else"string"==typeof a&&(indent=a);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){var j;function walk(e,t){var a,n,r=e[t];if(r&&"object"==typeof r)for(a in r)Object.hasOwnProperty.call(r,a)&&(void 0!==(n=walk(r,a))?r[a]=n:delete r[a]);return reviver.call(e,t,r)}if(cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(); \ No newline at end of file