Jump to content

User:Dross/common.js: Difference between revisions

From ICANNWiki
Dross (talk | contribs)
mNo edit summary
Dross (talk | contribs)
skip purge confirmation dialogue
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
$(function() {
$(function() {
$('div.body > ul li:last-child').after('<li id="n-createcompany">Create company page</li>');
$('#p-navigation > div ul li:last-child').after('<li id="n-createcompany"><a href="#" onclick="crcom()">Create company page</a></li>');
$('div.body > ul li:last-child').after('<li id="n-createtld">Create TLD page</li>');
$('#p-navigation > div ul li:last-child').after('<li id="n-createtld"><a href="#" onclick="crtld()">Create TLD page</a></li>');
});
});


$('#n-createcompany').onclick(function() {
function crcom() {
var pg = prompt('Enter company page name', 'pagename');
window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter COMPANY page name") + "&action=edit&preload=User:Dross/Company";
if (pg === 'pagename') {
}
var p = mw.config.get('wgPagename');
} else {
var p = pg;
}
window.location("//icannwiki.org/index.php?title=" + p + "&action=edit&preload=User:Dross/Company");
}
);


$('#n-createtld').onclick(function() {
function crtld() {
var pg = prompt('Enter TLD page name', 'pagename');
window.location.href = "//icannwiki.org/index.php?title=" + prompt("Enter TLD page name", ".com") + "&action=edit&preload=User:Dross/TLD";
if (pg === 'pagename') {
}
var p = mw.config.get('wgPagename');
 
} else {
/* Automate purge confirmation dialog */
var p = pg;
if ( mw.config.get( 'wgAction' ) === 'purge' ) {
}
      $('form[action*="action=purge"]').submit();
window.location("//icannwiki.org/index.php?title=" + p + "&action=edit&preload=User:Dross/TLD");
}
}
);

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();
}