Difference between revisions of "MediaWiki:Common.js"
MediaWiki interface page
Views
Actions
Namespaces
Variants
Tools
(added ui kit) |
m (test) |
||
(12 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
mw.loader.load( 'https://cdn.jsdelivr.net/npm/uikit@3.5.8/dist/js/uikit.min.js' ); | mw.loader.load( 'https://cdn.jsdelivr.net/npm/uikit@3.5.8/dist/js/uikit.min.js' ); | ||
mw.loader.load( 'https://cdn.jsdelivr.net/npm/uikit@3.5.8/dist/js/uikit-icons.min.js' ); | mw.loader.load( 'https://cdn.jsdelivr.net/npm/uikit@3.5.8/dist/js/uikit-icons.min.js' ); | ||
mw.loader.load( 'https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js' ); | |||
$(function() { | |||
$(document).on("click", ".copy-to-clipboard-button", function() { | |||
var clipboard = new ClipboardJS('.copy-to-clipboard-button'); | |||
clipboard.on('success', function (e) { | |||
console.log(e); | |||
}); | |||
clipboard.on('error', function (e) { | |||
console.log(e); | |||
}); | |||
}); | |||
}); |
Latest revision as of 10:16, 26 September 2021
/* Any JavaScript here will be loaded for all users on every page load. */
mw.loader.load( 'https://cdn.jsdelivr.net/npm/uikit@3.5.8/dist/js/uikit.min.js' );
mw.loader.load( 'https://cdn.jsdelivr.net/npm/uikit@3.5.8/dist/js/uikit-icons.min.js' );
mw.loader.load( 'https://cdn.jsdelivr.net/npm/clipboard@2.0.8/dist/clipboard.min.js' );
$(function() {
$(document).on("click", ".copy-to-clipboard-button", function() {
var clipboard = new ClipboardJS('.copy-to-clipboard-button');
clipboard.on('success', function (e) {
console.log(e);
});
clipboard.on('error', function (e) {
console.log(e);
});
});
});