User:Zackmann08/addcheckforunknownparameters.js: Difference between revisions

Content deleted Content added
test
No edit summary
 
(7 intermediate revisions by the same user not shown)
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 26 ⟶ 15:
function wpBuildCheckForUnknownParameters()
{
var templateTitle = document.title;
templateTitle = templateTitle.replace(/Editing\sTemplate\:(.*)\s\-\sWikipedia.*/, "{{unknown params category|$1}}");
var dummy = $('<input>').val(templateTitle).appendTo('body').select()
document.execCommand("'copy"');
 
var mycontent = document.getElementById('wpTextbox1');
// Copy the contents of the text window so we can modify it without problems
Line 146 ⟶ 140:
}
copyToClipboard('THIS IS A TEST');
// -------------------------------------------------------------------------------- //
});