| @@ -1,71 +1,76 @@ | ||
| 1 | 1 | (function($) { |
| 2 | 2 | |
| 3 | - CopyTheCodeNotice = { | |
| 4 | - | |
| 5 | - /** | |
| 6 | - * Init | |
| 7 | - */ | |
| 8 | - init: function() | |
| 9 | - { | |
| 10 | - this._bind(); | |
| 11 | - }, | |
| 3 | + CopyTheCodeNotice = { | |
| 12 | 4 | |
| 13 | - _bind: function() | |
| 14 | - { | |
| 15 | - $( document ).on('click', '.copy-the-code-allow-tracking', CopyTheCodeNotice.allow ); | |
| 16 | - $( document ).on('click', '.copy-the-code-not-allow-tracking, .copy-the-code-notice .notice-dismiss', CopyTheCodeNotice.not_allow ); | |
| 17 | - }, | |
| 5 | + /** | |
| 6 | + * Init | |
| 7 | + */ | |
| 8 | + init: function() | |
| 9 | + { | |
| 10 | + this._bind(); | |
| 11 | + }, | |
| 18 | 12 | |
| 19 | - /** | |
| 20 | - * Copy to Clipboard | |
| 21 | - */ | |
| 22 | - allow: function( event ) { | |
| 23 | - event.preventDefault(); | |
| 13 | + _bind: function() | |
| 14 | + { | |
| 15 | + $( document ).on( 'click', '.copy-the-code-allow-tracking', CopyTheCodeNotice.allow ); | |
| 16 | + $( document ).on( 'click', '.copy-the-code-not-allow-tracking, .copy-the-code-notice .notice-dismiss', CopyTheCodeNotice.not_allow ); | |
| 17 | + }, | |
| 24 | 18 | |
| 25 | - $.ajax({ | |
| 26 | - url: copy_the_code_notice.ajax_url, | |
| 27 | - type: 'POST', | |
| 28 | - data: { | |
| 29 | - action: 'copy_the_code_allow_tracking', | |
| 30 | - security: copy_the_code_notice.nonce, | |
| 31 | - }, | |
| 32 | - success: function( response ) { | |
| 33 | - if( response.success ) { | |
| 34 | - $('.copy-the-code-notice').remove(); | |
| 35 | - } | |
| 36 | - } | |
| 37 | - }); | |
| 38 | - }, | |
| 19 | + /** | |
| 20 | + * Copy to Clipboard | |
| 21 | + */ | |
| 22 | + allow: function( event ) { | |
| 23 | + event.preventDefault(); | |
| 39 | 24 | |
| 40 | - /** | |
| 41 | - * Copy to Clipboard | |
| 42 | - */ | |
| 43 | - not_allow: function( event ) { | |
| 44 | - event.preventDefault(); | |
| 25 | + $.ajax( | |
| 26 | + { | |
| 27 | + url: copy_the_code_notice.ajax_url, | |
| 28 | + type: 'POST', | |
| 29 | + data: { | |
| 30 | + action: 'copy_the_code_allow_tracking', | |
| 31 | + security: copy_the_code_notice.nonce, | |
| 32 | + }, | |
| 33 | + success: function( response ) { | |
| 34 | + if ( response.success ) { | |
| 35 | + $( '.copy-the-code-notice' ).remove(); | |
| 36 | + } | |
| 37 | + } | |
| 38 | + } | |
| 39 | + ); | |
| 40 | + }, | |
| 45 | 41 | |
| 46 | - $.ajax({ | |
| 47 | - url: copy_the_code_notice.ajax_url, | |
| 48 | - type: 'POST', | |
| 49 | - data: { | |
| 50 | - action: 'copy_the_code_dont_allow_tracking', | |
| 51 | - security: copy_the_code_notice.nonce, | |
| 52 | - }, | |
| 53 | - success: function( response ) { | |
| 54 | - if( response.success ) { | |
| 55 | - $('.copy-the-code-notice').remove(); | |
| 56 | - } | |
| 57 | - } | |
| 58 | - }); | |
| 59 | - } | |
| 42 | + /** | |
| 43 | + * Copy to Clipboard | |
| 44 | + */ | |
| 45 | + not_allow: function( event ) { | |
| 46 | + event.preventDefault(); | |
| 60 | 47 | |
| 61 | - }; | |
| 48 | + $.ajax( | |
| 49 | + { | |
| 50 | + url: copy_the_code_notice.ajax_url, | |
| 51 | + type: 'POST', | |
| 52 | + data: { | |
| 53 | + action: 'copy_the_code_dont_allow_tracking', | |
| 54 | + security: copy_the_code_notice.nonce, | |
| 55 | + }, | |
| 56 | + success: function( response ) { | |
| 57 | + if ( response.success ) { | |
| 58 | + $( '.copy-the-code-notice' ).remove(); | |
| 59 | + } | |
| 60 | + } | |
| 61 | + } | |
| 62 | + ); | |
| 63 | + } | |
| 62 | 64 | |
| 63 | - /** | |
| 64 | - * Initialization | |
| 65 | - */ | |
| 66 | - $(function() { | |
| 67 | - CopyTheCodeNotice.init(); | |
| 68 | - }); | |
| 65 | + }; | |
| 69 | 66 | |
| 70 | -})(jQuery); | |
| 67 | + /** | |
| 68 | + * Initialization | |
| 69 | + */ | |
| 70 | + $( | |
| 71 | + function() { | |
| 72 | + CopyTheCodeNotice.init(); | |
| 73 | + } | |
| 74 | + ); | |
| 71 | 75 | |
| 76 | +})( jQuery ); | |