woocommerce/assets/js/zeroclipboard/jquery.zeroclipboard.min.js

17 lines
24 KiB
JavaScript
Raw Normal View History

2016-03-12 08:14:37 +00:00
/*!
* jquery.zeroclipboard
* Bind to the `beforecopy`, `copy`, `aftercopy`, and `copy-error` events, custom DOM-like events for clipboard injection generated using jQuery's Special Events API and ZeroClipboard's Core module.
* Copyright (c) 2014
* Licensed MIT
* https://github.com/zeroclipboard/jquery.zeroclipboard
* v0.2.0
*/
!function(a,b,c){"use strict";var d,e=!!b.ZeroClipboard;/*!
* ZeroClipboard
* The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface.
* Copyright (c) 2014 Jon Rohan, James M. Greene
* Licensed MIT
* http://zeroclipboard.org/
* v2.1.2
*/
!function(a,b){var c,e=a,f=e.document,g=e.navigator,h=e.setTimeout,i=e.encodeURIComponent,j=e.ActiveXObject,k=e.Number.parseInt||e.parseInt,l=e.Number.parseFloat||e.parseFloat,m=e.Number.isNaN||e.isNaN,n=e.Math.round,o=e.Date.now,p=e.Object.keys,q=e.Object.defineProperty,r=e.Object.prototype.hasOwnProperty,s=e.Array.prototype.slice,t=function(a){return s.call(a,0)},u=function(){var a,c,d,e,f,g,h=t(arguments),i=h[0]||{};for(a=1,c=h.length;c>a;a++)if(null!=(d=h[a]))for(e in d)r.call(d,e)&&(f=i[e],g=d[e],i!==g&&g!==b&&(i[e]=g));return i},v=function(a){var b,c,d,e;if("object"!=typeof a||null==a)b=a;else if("number"==typeof a.length)for(b=[],c=0,d=a.length;d>c;c++)r.call(a,c)&&(b[c]=v(a[c]));else{b={};for(e in a)r.call(a,e)&&(b[e]=v(a[e]))}return b},w=function(a,b){for(var c={},d=0,e=b.length;e>d;d++)b[d]in a&&(c[b[d]]=a[b[d]]);return c},x=function(a,b){var c={};for(var d in a)-1===b.indexOf(d)&&(c[d]=a[d]);return c},y=function(a){if(a)for(var b in a)r.call(a,b)&&delete a[b];return a},z=function(a,b){if(a&&1===a.nodeType&&a.ownerDocument&&b&&(1===b.nodeType&&b.ownerDocument&&b.ownerDocument===a.ownerDocument||9===b.nodeType&&!b.ownerDocument&&b===a.ownerDocument))do{if(a===b)return!0;a=a.parentNode}while(a);return!1},A={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,unavailable:null,deactivated:null,overdue:null,ready:null},B="11.0.0",C={},D={},E=null,F={ready:"Flash communication is established",error:{"flash-disabled":"Flash is disabled or not installed","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate","flash-overdue":"Flash communication was established but NOT within the acceptable time limit"}},G=function(){var a,b,c,d,e="ZeroClipboard.swf";if(!f.currentScript||!(d=f.currentScript.src)){var g=f.getElementsByTagName("script");if("readyState"in g[0])for(a=g.length;a--&&("interactive"!==g[a].readyState||!(d=g[a].src)););else if("loading"===f.readyState)d=g[g.length-1].src;else{for(a=g.length;a--;){if(c=g[a].src,!c){b=null;break}if(c=c.split("#")[0].split("?")[0],c=c.slice(0,c.lastIndexOf("/")+1),null==b)b=c;else if(b!==c){b=null;break}}null!==b&&(d=b)}}return d&&(d=d.split("#")[0].split("?")[0],e=d.slice(0,d.lastIndexOf("/")+1)+e),e}(),H={swfPath:G,trustedDomains:a.location.host?[a.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},I=function(a){if("object"==typeof a&&null!==a)for(var b in a)if(r.call(a,b))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(b))H[b]=a[b];else if(null==A.bridge)if("containerId"===b||"swfObjectId"===b){if(!X(a[b]))throw new Error("The specified `"+b+"` value is not valid as an HTML4 Element ID");H[b]=a[b]}else H[b]=a[b];{if("string"!=typeof a||!a)return v(H);if(r.call(H,a))return H[a]}},J=function(){return{browser:w(g,["userAgent","platform","appName"]),flash:x(A,["bridge"]),zeroclipboard:{version:ya.version,config:ya.config()}}},K=function(){return!!(A.disabled||A.outdated||A.unavailable||A.deactivated)},L=function(a,b){var c,d,e,f={};if("string"==typeof a&&a)e=a.toLowerCase().split(/\s+/);else if("object"==typeof a&&a&&"undefined"==typeof b)for(c in a)r.call(a,c)&&"string"==typeof c&&c&&"function"==typeof a[c]&&ya.on(c,a[c]);if(e&&e.length){for(c=0,d=e.length;d>c;c++)a=e[c].replace(/^on/,""),f[a]=!0,C[a]||(C[a]=[]),C[a].push(b);if(f.ready&&A.ready&&ya.emit({type:"ready"}),f.error){var g=["disabled","outdated","unavailable","deactivated","overdue"];for(c=0,d=g.length;d>c;c++)if(A[g[c]]===!0){ya.emit({type:"error",name:"flash-"+g[c]});break}}}return ya},M=function(a,b){var c,d,e,f,g;if(0===arguments.length)f=p(C);else if("string"==typeof