User:Zackmann08/addcheckforunknownparameters.js: Difference between revisions

Content deleted Content added
test
No edit summary
Line 2:
// Shamelessly copied from User:Frietjes/addcheckforunknownparameters.js
jQuery(document).ready(function($) {
 
function copyToClipboard(val){
var dummy = document.createElement("input");
dummy.style.display = 'none';
document.body.appendChild(dummy);
dummy.setAttribute("id", "dummy_id");
document.getElementById("dummy_id").value=val;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
}
if(mw.config.get('wgNamespaceNumber') != -1 && document.getElementsByName('wpTextbox1')[0]) {
mw.loader.using(['mediawiki.util']).done( function() {
Line 146 ⟶ 135:
}
var dummyContent = "this is to be copied to clipboard";
copyToClipboard('THIS IS A TEST');
var dummy = $('<input>').val(dummyContent).appendTo('body').select();
document.execCommand("'copy"');
// -------------------------------------------------------------------------------- //
});