User:Sock of Steel359/unblock.js: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
window.open(url); |
window.open(url); |
||
var unblock = RegExp("\{\{[U|u]nblock\|(.*?)\}\}"); |
var unblock = RegExp("\{\{[U|u]nblock\|(.*?)\}\}"); |
||
var reviewed = "{"+"{Unblock reviewed|1=$1|decline=" + reason1 + "}}"; |
var reviewed = ("{"+"{Unblock reviewed|1=$1|decline=" + reason1 + "}}"); |
||
t.value = t.value.split(unblock).join(reviewed); |
t.value = t.value.split(unblock).join(reviewed); |
||
document.forms[0].wpDiff.click(); |
document.forms[0].wpDiff.click(); |
Revision as of 14:39, 19 May 2007
// <pre>
function addLink(where, url, name, id, title, key, after) {
// addLink() accepts either an id or a DOM node, addPortletLink() only takes a node
if (after && !after.cloneNode)
after = document.getElementById(after);
return addPortletLink(where, url, name, id, title, key, after);
}
if (document.title.indexOf("Editing User talk:") != -1) {
var url = wgServer + '/wiki/' + wgPageName + '?action=edit';
var f = document.editform, t = f.wpTextbox1;
// -----------------------------------------------------------------------------------------------------------
function declineunblock()
{
var reason1 = prompt(Reason for declining?)
if ( !reason1 ) {
return;
} else {
window.open(url);
var unblock = RegExp("\{\{[U|u]nblock\|(.*?)\}\}");
var reviewed = ("{"+"{Unblock reviewed|1=$1|decline=" + reason1 + "}}");
t.value = t.value.split(unblock).join(reviewed);
document.forms[0].wpDiff.click();
}
}
function declineunblock_tagging()
{
addPortletLink('p-interaction', 'function declineunblock()', "Decline unblock");
}
// -----------------------------------------------------------------------------------------------------------
}
// </pre>