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
*/
2017-06-19 11:49:34 +00:00
!function(e,t,a){"use strict";var n=!!t.ZeroClipboard;/*!
2016-03-12 08:14:37 +00:00
* 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(e,t){var a,n=e,r=n.document,o=n.navigator,i=n.setTimeout,l=n.encodeURIComponent,s=n.ActiveXObject,c=n.Number.parseInt||n.parseInt,u=n.Number.parseFloat||n.parseFloat,f=n.Number.isNaN||n.isNaN,p=n.Math.round,d=n.Date.now,v=n.Object.keys,y=n.Object.defineProperty,g=n.Object.prototype.hasOwnProperty,b=n.Array.prototype.slice,h=function(e){return b.call(e,0)},m=function(){var e,t,a,n,r,o=h(arguments),i=o[0]||{};for(e=1,t=o.length;e<t;e++)if(null!=(a=o[e]))for(n in a)g.call(a,n)&&(i[n],i!==(r=a[n])&&void 0!==r&&(i[n]=r));return i},w=function(e){var t,a,n,r;if("object"!=typeof e||null==e)t=e;else if("number"==typeof e.length)for(t=[],a=0,n=e.length;a<n;a++)g.call(e,a)&&(t[a]=w(e[a]));else{t={};for(r in e)g.call(e,r)&&(t[r]=w(e[r]))}return t},x=function(e,t){for(var a={},n=0,r=t.length;n<r;n++)t[n]in e&&(a[t[n]]=e[t[n]]);return a},C=function(e,t){var a={};for(var n in e)-1===t.indexOf(n)&&(a[n]=e[n]);return a},D=function(e){if(e)for(var t in e)g.call(e,t)&&delete e[t];return e},T=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},E={bridge:null,version:"0.0.0",pluginType:"unknown",disabled:null,outdated:null,unavailable:null,deactivated:null,overdue:null,ready:null},k={},j={},O=null,N={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"}},I={swfPath:function(){var e,t,a,n,o="ZeroClipboard.swf";if(!r.currentScript||!(n=r.currentScript.src)){var i=r.getElementsByTagName("script");if("readyState"in i[0])for(e=i.length;e--&&("interactive"!==i[e].readyState||!(n=i[e].src)););else if("loading"===r.readyState)n=i[i.length-1].src;else{for(e=i.length;e--;){if(!(a=i[e].src)){t=null;break}if(a=a.split("#")[0].split("?")[0],a=a.slice(0,a.lastIndexOf("/")+1),null==t)t=a;else if(t!==a){t=null;break}}null!==t&&(n=t)}}return n&&(o=(n=n.split("#")[0].split("?")[0]).slice(0,n.lastIndexOf("/")+1)+o),o}(),trustedDomains:e.location.host?[e.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},_=function(e){if("object"==typeof e&&null!==e)for(var t in e)if(g.call(e,t))if(/^(?:forceHandCursor|title|zIndex|bubbleEvents)$/.test(t))I[t]=e[t];else if(null==E.bridge)if("containerId"===t||"swfObjectId"===t){if(!K(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");I[t]=e[t]}else I[t]=e[t];{if("string"!=typeof e||!e)return w(I);if(g.call(I,e))return I[e]}},L=function(){return{browser:x(o,["userAgent","platform","appName"]),flash:C(E,["bridge"]),zeroclipboard:{version:we.version,config:we.config()}}},S=function(){return!!(E.disabled||E.outdated||E.unavailable||E.deactivated)},F=function(e,t){var a,n,r,o={};if("string"==typeof e&&e)r=e.toLowerCase().split(/\s+/);else if("object"==typeof e&&e&&void 0===t)for(a in e)g.call(e,a)&&"string"==typeof a&&a&&"function"==typeof e[a]&&we.on(a,e[a]);if(r&&r.length){for(a=0,n=r.length;a<n;a++)o[e=r[a].replace(/^on/,"")]=!0,k[e]||(k[e]=[]),k[e].push(t);if(o.ready&&E.ready&&we.emit({type:"ready"}),o.error){var i=["disabled","outdated","unavailable","deactivated","overdue"];for(a=0,n=i.length;a<n;a++)if(!0===E[i[a]]){we.emit({type:"error",name:"flash-"+i[a]});break}}}return we},z=function(e,t){var a,n,r,o,i;if(0===arguments.length)o=v(k);else if("string"==typeof e&&e)o=e.split(/\s+/);else