Difference between revisions of "MediaWiki:Common.js"

m
test
m (test)
m (test)
Line 4: Line 4:
mw.loader.load( 'https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js' );
mw.loader.load( 'https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js' );


$(document).ready(function () {
$(function() {
    var clipboard = new ClipboardJS('.copy-to-clipboard-button');
$(document).on("click", ".copy-to-clipboard-button", function() {
 
    var clipboard = new Clipboard(".copy-to-clipboard-button");  
      clipboard.on('success', function (e) {
    clipboard.destroy();
        console.log(e);
  });
      });
 
      clipboard.on('error', function (e) {
        console.log(e);
      });
});
});