User:Sock of Steel359/unblock.js: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
No edit summary |
||
Line 24: | Line 24: | ||
var f = document.editform, t = f.wpTextbox1; |
var f = document.editform, t = f.wpTextbox1; |
||
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:51, 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) {
// -----------------------------------------------------------------------------------------------------------
function declineunblock()
{
var reason1 = prompt("Reason for declining?");
if ( !reason1 ) {
return;
} else {
var url = wgServer + '/wiki/' + wgPageName + '?action=edit';
window.open(url);
var f = document.editform, t = f.wpTextbox1;
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', 'javascript:declineunblock()', "Decline unblock");
}
addOnloadHook(declineunblock_tagging);
// -----------------------------------------------------------------------------------------------------------
//}
// </pre>