| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/KnowledgeBase/wp-content/plugins/copy-the-code/assets/js/ |
Upload File : |
(function ($) {
const CTCInline = {
/**
* Init
*/
init: function () {
this._bind();
},
/**
* Binds events
*/
_bind: function () {
$( document ).on( 'click', '.ctc-inline-copy', this.doCopy );
},
/**
* Do Copy to Clipboard
*/
doCopy: function (event) {
event.preventDefault();
const self = $( this )
let text = self.find( '.ctc-inline-copy-textarea' ).val() || ''
// Remove first and last new line.
text = $.trim( text );
// Copy to clipboard.
CTCWP.copy( text );
// Copied!
self.addClass( 'copied' );
setTimeout(
function () {
self.removeClass( 'copied' );
},
1000
);
}
};
/**
* Initialization
*/
$(
function () {
CTCInline.init();
}
);
})( jQuery );