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
← All changes | assets/js/copy-inline.js +43 -38 3.5.1 → 5.5.4 View file →
@@ -1,48 +1,53 @@
1 1 (function ($) {
2 - const CTCInline = {
2 + const CTCInline = {
3 3
4 - /**
5 - * Init
6 - */
7 - init: function () {
8 - this._bind();
9 - },
4 + /**
5 + * Init
6 + */
7 + init: function () {
8 + this._bind();
9 + },
10 10
11 - /**
12 - * Binds events
13 - */
14 - _bind: function () {
15 - $( document ).on( 'click', '.ctc-inline-copy', this.doCopy );
16 - },
11 + /**
12 + * Binds events
13 + */
14 + _bind: function () {
15 + $( document ).on( 'click', '.ctc-inline-copy', this.doCopy );
16 + },
17 17
18 - /**
19 - * Do Copy to Clipboard
20 - */
21 - doCopy: function (event) {
22 - event.preventDefault();
18 + /**
19 + * Do Copy to Clipboard
20 + */
21 + doCopy: function (event) {
22 + event.preventDefault();
23 23
24 - const self = $( this )
25 - let text = self.find( '.ctc-inline-copy-textarea' ).val() || ''
24 + const self = $( this )
25 + let text = self.find( '.ctc-inline-copy-textarea' ).val() || ''
26 26
27 - // Remove first and last new line.
28 - text = $.trim(text);
27 + // Remove first and last new line.
28 + text = $.trim( text );
29 29
30 - // Copy to clipboard.
31 - CTC.copy(text);
30 + // Copy to clipboard.
31 + CTCWP.copy( text );
32 32
33 - // Copied!
34 - self.addClass('copied');
35 - setTimeout(function () {
36 - self.removeClass('copied');
37 - }, 1000);
38 - }
39 - };
33 + // Copied!
34 + self.addClass( 'copied' );
35 + setTimeout(
36 + function () {
37 + self.removeClass( 'copied' );
38 + },
39 + 1000
40 + );
41 + }
42 + };
40 43
41 - /**
42 - * Initialization
43 - */
44 - $(function () {
45 - CTCInline.init();
46 - });
44 + /**
45 + * Initialization
46 + */
47 + $(
48 + function () {
49 + CTCInline.init();
50 + }
51 + );
47 52
48 -})(jQuery);
53 +})( jQuery );