User:Acagastya/date.js

$.when( mw.loader.using( [ 'mediawiki.util'] ), $.ready ).done( function { var portletlink = mw.util.addPortletLink('p-tb', '#', '', 'ca-copyDate', 'Copy page date', 'v');  $(portletlink).click( function(e) { e.preventDefault; var range = document.createRange; range.selectNode(document.getElementById('publishDate')); window.getSelection.addRange(range); document.execCommand("copy"); }); });