User:Alphachimp/Adminwarnings/monobook.js

//

function welcometn(num) { var varticle = ''; var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) {t.value += '\n';} if (num==1) { t.value += ". ~"; f.wpSummary.value = "Welcome to our free Encyclopedia!"; } else if (num==2) { t.value += "====Please consider creating an account====" + "\n" + ". ~"; f.wpSummary.value = "Welcome to our free Encyclopedia!"; } else if (num==3) { t.value += ""; f.wpSummary.value = "Welcome to our free Encyclopedia!"; } }

function testn(number) { var IPnote = ''; if (document.title.split(' - ')[0].split('.').length == 4) {IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";} var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "==" + "Regarding edits made during  " + varticle + "==" + "\n" + " " + IPnote + "~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " test" + number; }

function povn { var IPnote = ''; if (document.title.split(' - ')[0].split('.').length == 4) {IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";} var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += "==" + "Regarding edits made during  " + varticle + "==" + "\n" + " " + IPnote + "~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " NPOV0a"; }

function warningn { var IPnote = ''; if (document.title.split(' - ')[0].split('.').length == 4) {IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";} var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="==" + "Regarding edits made during  " + varticle + "==" + "\n" + " " + IPnote + "~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " bv"; }

function revertsn { var IPnoteR = ''; if (document.title.split(' - ')[0].split('.').length == 4) {IPnoteR = "If this is an IP address, and it is shared by multiple users, ignore this warning, but aviod making any reverts within 24 hours of this warning in order to avoid any confusion. ";} var article = prompt("Enter the page name where the 3RR violation occured:") articleh = article.replace(/ /g, '_'); var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="==" + "Regarding reversions" + "+ articleh + "&action=history " + "made on   to " + "" + article + "" + "==" + "\n" + " " + IPnoteR + "~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " 3rr"; }

function finalwn { var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += ": ~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " final warning"; }

function blockn { var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += ": ~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " temporary block"; }

function usern { var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value += ": ~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " username block"; }

function rrblockn { username_a = document.URL.match(/:.*:(.*)/); username=username_a[1]; var article = prompt("Enter the page name where the 3RR violation occured:"); articleh = article.replace(/ /g, '_'); var well = prompt("Warning is already in context (*y* or *n*)?") var time = prompt("Enter the duration of the block (in hours)") var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) {t.value += '\r';} t.value += ' ' + '\n'; if (well == 'y' || well == 'yes') { t.value += ": The duration of the + username + " block is " + time + " hours. + articleh + "&action=history Here are the reverts in question. ~" + "~" + "~" + "~" + " "; } else if (well == 'n' || well == 'no') { t.value += "==" + "Regarding reversions" + "+ articleh + "&action=history " + "made on    to " + "" + article + "" + "==" + "\n" + " The duration of the + username + " block is " + time + " hours. ~" + "~" + "~" + "~" + " "; } else { prompt("Error, enter *y* or *n*."); return; } f.wpSummary.value = "User notice:" + " temporary 3RR block"; }

function testbl { var IPnote = ''; if (document.title.split(' - ')[0].split('.').length == 4) {IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";} var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="==" + "Regarding edits made during  " + varticle + "==" + "\n" + " " + IPnote + "~" + "~" + "~" + "~"; f.wpSummary.value = "User notice:" + " test2a"; }

function spam(type) { if (type == 1){var temp = 'spam1'} else if (type == 2){var temp = 'spam2a'} var IPnote = ''; if (document.title.split(' - ')[0].split('.').length == 4) {IPnote = "If this is an IP address, and it is shared by multiple users, ignore this warning if you did not make any unconstructive edits. ";} var varticle = ''; if (location.href.indexOf('&vanarticle=') != -1) {varticle = ' to Category):/i,':$1:')) + '';} var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="==" + "Regarding edits made during  " + varticle + "==" + "\n" + " " + IPnote + "~" + "~" + "~" + "~"; f.wpSummary.value = "User notice: " + temp; }

function rrwarn { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="*The user has now been warned per 3RR not to let this happen again. " + "~" + "~" + "~" + "~"; t.value = t.value.replace(/\(Result:\)/,'(Result: user warned)'); f.wpSummary.value = "Response: user warned"; }

function rrblock { var number = prompt("User blocked for how many hours?") var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="*I have blocked the user for " + number + " hours per WP:3RR. " + "~" + "~" + "~" + "~"; t.value = t.value.replace(/\(Result:\)/,'(Result: ' + number + ' hours)'); f.wpSummary.value = "Response: user blocked"; }

function rrnoblock { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +="*The user has not yet violated WP:3RR because there are not yet four reverts within 24 hours nor is there any severely disruptive behavoir. However, I have warned the user for nearly breaching WP:3RR. " + "~" + "~" + "~" + "~"; t.value = t.value.replace(/\(Result:\)/,'(Result: no violation)'); f.wpSummary.value = "Response: no violation"; }

//more tabs addOnloadHook(add_testn_tabs) function add_testn_tabs {  var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div')[0].getElementsByTagName('ul')[0]; if (document.title.indexOf("Talk:") == -1 && document.title.indexOf("talk:") == -1 && document.title.indexOf("User:") == -1 && document.title.indexOf("MediaWiki:") == -1 && document.title.indexOf("Image:") == -1 && document.title.indexOf("Wikipedia:") == -1 && document.title.indexOf("Template:") == -1 && document.title.indexOf("Portal:") == -1 && document.title.indexOf("Help:") == -1 && document.title.indexOf("Main Page") == -1 && document.title.indexOf("Category:") == -1) {     if(document.getElementById('ca-edit')) {document.getElementById('ca-edit').firstChild.innerHTML = 'Modify';} } else {     if(document.getElementById('ca-edit')) {document.getElementById('ca-edit').firstChild.innerHTML = 'Edit';} if(document.getElementById('ca-talk')) {document.getElementById('ca-talk').firstChild.innerHTML = 'Talk';} } if (document.title.indexOf("Editing ") != -1) { if (document.title.indexOf("Editing User talk:") != -1) {       var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0]; addlimenu(tabs, '', 'warnfunc'); var warnfunc = document.getElementById('warnfunc').getElementsByTagName('ul')[0]; addlilink(warnfunc, 'javascript:welcometn(1)', 'welcome', ''); addlilink(warnfunc, 'javascript:welcometn(3)', 'welcome2', ''); addlilink(warnfunc, 'javascript:welcometn(2)', 'anon', ''); addlilink(warnfunc, 'javascript:testn(1)', 'test', ''); addlilink(warnfunc, 'javascript:povn', 'NPOV', ''); addlilink(warnfunc, 'javascript:testn(2)', 'vandal', ''); addlilink(warnfunc, 'javascript:testn(3)', 'vandal2', ''); addlilink(warnfunc, 'javascript:warningn', 'warn', ''); addlilink(warnfunc, 'javascript:testbl', 'blanking', ''); addlilink(warnfunc, 'javascript:spam(1)', 'spam', ''); addlilink(warnfunc, 'javascript:spam(2)', 'spam2', ''); addlilink(warnfunc, 'javascript:finalwn', 'final', ''); addlilink(warnfunc, 'javascript:blockn', 'vblock', ''); addlilink(warnfunc, 'javascript:revertsn', '3rr', ''); addlilink(warnfunc, 'javascript:rrblockn', 'rr block', ''); addlilink(warnfunc, 'javascript:usern', 'un block', ''); if(document.getElementById('ca-delete')) {       document.getElementById('ca-delete').firstChild.innerHTML = ' [d] '; }       if(document.getElementById('ca-move')) {     document.getElementById('ca-move').firstChild.innerHTML = '[m]'; }       if(document.getElementById('ca-watch')) {     document.getElementById('ca-watch').firstChild.innerHTML = '[w]'; }       if(document.getElementById('ca-unwatch')) {     document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]'; }     if(document.getElementById('ca-edit')) {       document.getElementById('ca-edit').firstChild.innerHTML = 'Edit'; }   }  else if (document.title.indexOf("Editing User:") != -1) {     var nothing = 'yes'; } else if (document.title.indexOf("Editing Wikipedia:Requests for page protection (section)") != -1) {     if(document.getElementById('ca-delete')) {       document.getElementById('ca-delete').firstChild.innerHTML = ' [d] '; }       if(document.getElementById('ca-move')) {     document.getElementById('ca-move').firstChild.innerHTML = '[m]'; }      if(document.getElementById('ca-watch')) {     document.getElementById('ca-watch').firstChild.innerHTML = '[w]'; }       if(document.getElementById('ca-unwatch')) {     document.getElementById('ca-unwatch').firstChild.innerHTML = '[uw]'; }   }  else if (document.title.indexOf("Editing Wikipedia:Administrators' noticeboard/3RR (section)") != -1) {   addTab('javascript:rrwarn',"a|wn","ca-wn","Warned",""); addTab('javascript:rrblock',"a|bl","ca-bl","Blocked",""); addTab('javascript:rrnoblock',"r|cl","ca-cl","Close to 3RR",""); } else if(document.title.indexOf("Wikipedia:") != -1 || document.title.indexOf("Help:Contents/Editing Wikipedia") != -1 || document.title.indexOf("Editing Talk") != -1 || document.title.indexOf("Editing Wikipedia talk") != -1) { {nothing=1;} } } else if (document.title.indexOf("User:") != -1) { if(document.getElementById('ca-talk')) {    document.getElementById('ca-talk').firstChild.innerHTML = 'Talk'; } } else if (document.title.indexOf("User talk:") != -1) { if(document.getElementById('ca-talk')) {    document.getElementById('ca-talk').firstChild.innerHTML = 'Talk'; } } } //