diff --git a/dist/clipboard.min.js b/dist/clipboard.min.js index 33d9178..1a6ac2a 100644 --- a/dist/clipboard.min.js +++ b/dist/clipboard.min.js @@ -1 +1 @@ -!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;gd;d++)c[d].fn.apply(c[d].ctx,b);return this},off:function(a,b){var c=this.e||(this.e={}),d=c[a],e=[];if(d&&b)for(var f=0,g=d.length;g>f;f++)d[f].fn!==b&&e.push(d[f]);return e.length?c[a]=e:delete c[a],this}},b.exports=d},{}],6:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var e=function(){function a(a,b){for(var c=0;cd;d++)c[d].fn.apply(c[d].ctx,b);return this},off:function(a,b){var c=this.e||(this.e={}),d=c[a],e=[];if(d&&b)for(var f=0,g=d.length;g>f;f++)d[f].fn!==b&&e.push(d[f]);return e.length?c[a]=e:delete c[a],this}},b.exports=d},{}],6:[function(a,b,c){"use strict";function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}c.__esModule=!0;var e=function(){function a(a,b){for(var c=0;c<

Copy text from another element

-

A pretty common use case is to copy content from another element. You can do that by adding a data-target attribute in your trigger element.

+

A pretty common use case is to copy content from another element. You can do that by adding a data-clipboard-target attribute in your trigger element.

The value you include on this attribute needs to match another's element id attribute.

- @@ -87,13 +87,13 @@ allowtransparency="true" frameborder="0" scrolling="0" width="156" height="30">< <input id="foo" value="https://github.com/zenorocha/clipboard.js.git"> <!-- Trigger --> -<button class="btn" data-target="foo"> +<button class="btn" data-clipboard-target="foo"> <img src="assets/clippy.svg" alt="Copy to clipboard"> </button>

Cut text from another element

-

Additionally, you can define a data-action attribute to specify if you want to either copy or cut content.

+

Additionally, you can define a data-clipboard-action attribute to specify if you want to either copy or cut content.

If you omit this attribute, copy will be used by default.

@@ -101,7 +101,7 @@ allowtransparency="true" frameborder="0" scrolling="0" width="156" height="30"><
-
@@ -111,7 +111,7 @@ allowtransparency="true" frameborder="0" scrolling="0" width="156" height="30">< <textarea id="bar">Mussum ipsum cacilds...</textarea> <!-- Trigger --> -<button class="btn" data-action="cut" data-target="bar"> +<button class="btn" data-clipboard-action="cut" data-clipboard-target="bar"> Cut to clipboard </button> @@ -119,14 +119,14 @@ allowtransparency="true" frameborder="0" scrolling="0" width="156" height="30"><

Copy text from attribute

-

Truth is, you don't even need another element to copy its content from. You can just include a data-text attribute in your trigger element.

+

Truth is, you don't even need another element to copy its content from. You can just include a data-clipboard-text attribute in your trigger element.

- +
<!-- Trigger -->
-<button class="btn" data-text="Just because you can doesn't mean you should — clipboard.js">
+<button class="btn" data-clipboard-text="Just because you can doesn't mean you should — clipboard.js">
     Copy to clipboard
 </button>