Jump to content

User:Dross/common.js: Difference between revisions

From ICANNWiki
Dross (talk | contribs)
sigh
Dross (talk | contribs)
skip purge confirmation dialogue
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
$(function() {
$('#p-navigation > div ul li:last-child').after('<li id="n-createcompany"><a href="#" onclick="crcom()">Create company page</a></li>');
$('#p-navigation > div ul li:last-child').after('<li id="n-createtld"><a href="#" onclick="crtld()">Create TLD page</a></li>');
});
function crcom() {
function crcom() {
window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter COMPANY page name") + "&action=edit&preload=User:Dross/Company";
window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter COMPANY page name") + "&action=edit&preload=User:Dross/Company";
}
}
$('#n-createcompany').onclick = crcom();


function crtld() {
function crtld() {
window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter TLD page name", ".com") + "&action=edit&preload=User:Dross/TLD";
window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter TLD page name", ".com") + "&action=edit&preload=User:Dross/TLD";
}
}
$('#n-createtld').onclick = crtld();


$(function() {
/* Automate purge confirmation dialog */
$('#p-navigation > div ul li:last-child').after('<li id="n-createcompany"><a href="#" onclick="crcom()">Create company page</a></li>');
if ( mw.config.get( 'wgAction' ) === 'purge' ) {
$('#p-navigation > div ul li:last-child').after('<li id="n-createtld"><a href="#" onclick="crtld()">Create TLD page</a></li>');
      $('form[action*="action=purge"]').submit();
});
}

Latest revision as of 22:03, 6 October 2018

$(function() {
	$('#p-navigation > div ul li:last-child').after('<li id="n-createcompany"><a href="#" onclick="crcom()">Create company page</a></li>');
	$('#p-navigation > div ul li:last-child').after('<li id="n-createtld"><a href="#" onclick="crtld()">Create TLD page</a></li>');
});

function crcom() {
	window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter COMPANY page name") + "&action=edit&preload=User:Dross/Company";
}

function crtld() {
	window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter TLD page name", ".com") + "&action=edit&preload=User:Dross/TLD";
}

/* Automate purge confirmation dialog */
if ( mw.config.get( 'wgAction' ) === 'purge' ) {
       $('form[action*="action=purge"]').submit();
}