PluginProbe
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code / 5.5.4
Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code v5.5.4
5.5.4 5.5.3 3.1.0 3.2.0 3.2.1 3.3.0 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.6.0 3.7.0 3.8.0 3.8.1 3.8.2 3.8.3 4.0.0 4.0.2 4.0.3 4.0.4 4.0.5 4.1.0 All 79 releases
copy-the-code / includes / gutenberg / blocks / copy-button / js / frontend.js

frontend.js in Copy Anything to Clipboard for WordPress – Copy Button, Copy Text & Copy Code 5.5.4, at includes/gutenberg/blocks/copy-button/js/frontend.js

1 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 !function(){var e={"./includes/gutenberg/blocks/copy-button/src/frontend/clipboard.js":function(){window.CTCClipboard=function(e,t,o){var n;function c(){var c,r;o.userAgent.match(/ipad|iphone/i)?((c=t.createRange()).selectNodeContents(n),(r=e.getSelection()).removeAllRanges(),r.addRange(c),n.setSelectionRange(0,999999)):n.select()}return copySelection=function(n){var c=e.getSelection(),r=t.createRange();r.selectNodeContents(n[0]),c.removeAllRanges(),c.addRange(r);var i=c.toString();o.clipboard&&o.clipboard.writeText?o.clipboard.writeText(i).then((function(){c.removeAllRanges()})).catch((function(){t.execCommand("copy"),c.removeAllRanges()})):(t.execCommand("copy"),c.removeAllRanges())},{copy:function(r){!function(e){(n=t.createElement("textArea")).value=e,t.body.appendChild(n)}(r),c(),o.clipboard&&o.clipboard.writeText?o.clipboard.writeText(n.value).then((function(){t.body.removeChild(n),"undefined"!=typeof ctc&&ctc.redirect_url&&(e.location.href=ctc.redirect_url)})).catch((function(){t.execCommand("copy"),t.body.removeChild(n),"undefined"!=typeof ctc&&ctc.redirect_url&&(e.location.href=ctc.redirect_url)})):(t.execCommand("copy"),t.body.removeChild(n),"undefined"!=typeof ctc&&ctc.redirect_url&&(e.location.href=ctc.redirect_url))},copySelection:copySelection}}(window,document,navigator)}},t={};function o(n){var c=t[n];if(void 0!==c)return c.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};!function(){"use strict";o.r(n);var e,t;o("./includes/gutenberg/blocks/copy-button/src/frontend/clipboard.js");e=jQuery,t={init:function(){this._bind()},_bind:function(){e(document).on("click",".wp-block-ctc-copy-button",this.doCopy)},doCopy:function(t){t.preventDefault();var o=e(this),n=o.closest(".ctc-copy-button-wrap").find(".ctc-copy-button-textarea").val().trim()||"",c=o.text(),r=o.attr("data-copied-text")||"Copied!";n&&(n=n.replace(/<br\s*\/?>/gi,"\n")),CTCClipboard.copy(n),o.addClass("copied").text(r),setTimeout((function(){o.removeClass("copied").text(c)}),1e3)}},e((function(){t.init()}))}()}();