This is an old revision of this page, as edited by Splash (talk | contribs) at 02:52, 3 June 2006 (update prot script, courtesy of VoA). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Revision as of 02:52, 3 June 2006 by Splash (talk | contribs) (update prot script, courtesy of VoA)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin is at User:Splash/vector.css. |
//<nowiki> function addlilink(tabs, url, name){ var na = document.createElement('a'); na.href = url; na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.appendChild(na); tabs.appendChild(li); return li; } ////////////////////////////////////////// // Tabs by Korath // returns <li><a href="url">name</a></li> ///////////////////////////////////////// function addlilink(url, name) { var na = document.createElement('a'); na.setAttribute('href', url); var txt = document.createTextNode(name); na.appendChild(txt); var li = document.createElement('li'); li.appendChild(na); return li; } // appends msg to the currently-editted page, sets the summary to summ, // and marks or unmarks the Watch this page checkbox according to watch. function edit_summary_watch(msg, summ, watch, line) { var f = document.editform, t = f.wpTextbox1; if ((t.value.length > 0) && (line == 1)) t.value += '\n'; t.value += msg; f.wpSummary.value += summ; f.wpWatchthis.checked = watch; } function delete_reason(process){ if(process==1) { document.forms.deleteconfirm.wpReason.value = '+)&action=delete.*$/, '$1').replace(/_/g, ' ')).replace(/^(Talk|Misplaced Pages( talk)?):/, '') + ']]'; } else if(process==2) { document.forms.deleteconfirm.wpReason.value = ']: \"\"'; } } // adds various tabs to call the above function add_tabs() { var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul'); // Only add for pages with "Editing User talk:" somewhere in the title if (document.title.indexOf("Editing User talk:") != -1) { tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:welcome}} ~" + "~" + "~" + "~", "{{" + "welcome}}", false, 1)',"Welc")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test1}} ~" + "~" + "~" + "~\n", "{{" + "test1}}", true, 1)',"T1")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2}} ~" + "~" + "~" + "~\n", "{{" + "test2}}", true, 1)',"T2")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2a}} ~" + "~" + "~" + "~\n", "{{" + "test2a}}", true, 1)',"T2a")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test2b}} ~" + "~" + "~" + "~\n", "{{" + "test2b}}", true, 1)',"T2b")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test3}} ~" + "~" + "~" + "~\n", "{{" + "test3}}", true, 1)',"T3")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test4}} ~" + "~" + "~" + "~\n", "{{" + "test4}}", true, 1)',"T4")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:test5}} ~" + "~" + "~" + "~\n", "{{" + "test5}}", true, 1)',"T5")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:spam1}} ~" + "~" + "~" + "~\n", "{{" + "spam1}}", true, 1)',"S1")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:spam2}} ~" + "~" + "~" + "~\n", "{{" + "spam2}}", true, 1)',"S2")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:rvfd}} ~" + "~" + "~" + "~\n", "{{" + "rvfd}}", true, 1)',"RVFD")); tabs.appendChild(addlilink('javascript:edit_summary_watch("{{" + "subst:blanking}} ~" + "~" + "~" + "~\n", "{{" + "blanking}}", true, 1)',"Blank")); } if(document.title.indexOf("Confirm delete") != -1) { tabs.appendChild(addlilink('javascript:delete_reason(1)', 'AfD', '')); tabs.appendChild(addlilink('javascript:delete_reason(2)', 'PROD', '')); } } if (window.addEventListener) window.addEventListener("load", add_tabs, false); else if (window.attachEvent) window.attachEvent("onload", add_tabs); function hidevfd(){ var divs = document.getElementsByTagName("div"); for(var x = 0; x < divs.length; ++x) if(divs.className.indexOf("vfd") != -1) divs.style.display = "none"; document.getElementById('footer').style.display = 'none'; } function showvfd(){ var divs = document.getElementsByTagName("div"); for(var x = 0; x < divs.length; ++x) if(divs.className.indexOf("vfd") != -1) divs.style.display = ""; document.getElementById('footer').style.display = ''; } function vfdlinks(){ var tabs = document.getElementById('p-cactions').getElementsByTagName('ul'); if(document.title.indexOf("Misplaced Pages:Articles for deletion") == 0){ add_link2('javascript:hidevfd()', 'hide'); add_link2('javascript:showvfd()', 'show'); } } if (window.addEventListener) window.addEventListener("load",vfdlinks,false); else if (window.attachEvent) window.attachEvent("onload",vfdlinks); /////////////////////////////////////////////////////////////////// // AutoVFD by Korath // This needs to change depending on skin used. ////////////////////////////////////////////////////////////////// function add_link2(url, name) { var na = document.createElement('a'); na.setAttribute('href', url); na.appendChild(document.createTextNode(name)); var li = document.createElement('li'); li.appendChild(na); var tabs = document.getElementById('p-cactions').getElementsByTagName('ul'); tabs.appendChild(li); } function strip_namespace(target) { var colon = target.indexOf(':'); if (colon != -1) { var spaces = new Array('User', 'Misplaced Pages', 'Image', 'MediaWiki', 'Template', 'Help', 'Category'); var ns = target.substring(0, colon); if (ns == '' || ns == 'Talk') return target.substring(colon + 1); else for (var i = 0; i < spaces.length; ++i) { if (ns == spaces || ns == spaces + '_talk') return target.substring(colon + 1); } } return target; } function copyvio() { document.editform.wpTextbox1.value = '{' + '{' + 'copyvio|url=}}'; document.editform.wpSummary.value = 'copyvio'; var target = document.editform.action; target = target.substring(target.indexOf('title=') + 6, target.lastIndexOf('&action=submit')); var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); var date = new Date(); date = months + '_' + date.getUTCDate(); var pagename = strip_namespace(target); window.open('/search/?title=Misplaced Pages:Copyright_problems&action=edit&fakeaction=copyviolist&faketarget=' + pagename, 'status,toolbar,location,menubar,directories,resizeable,scrollbars'); } function autocopyvio() { if (document.title.indexOf('Editing ') == 0) { var action = ''; var target = ''; if (location.search) { var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) { var eq = l.indexOf('='); var name = l.substring(0, eq); if (name == 'fakeaction') action = l.substring(eq + 1); else if (name == 'faketarget') target = unescape(l.substring(eq + 1)).replace(/_/g, ' '); } } if (action == 'copyviolist') { var index = document.editform.wpTextbox1.value.lastIndexOf("\n==Footer=="); if (index == -1) { window.alert("Couldn't find footer\n\n"); } else { var firsthalf = document.editform.wpTextbox1.value.substr(0,index); var secondhalf = document.editform.wpTextbox1.value.substr(index); document.editform.wpTextbox1.value = firsthalf + '*' + ']' + ' from ~' + '~~' + '~\n' + secondhalf; // document.editform.wpTextbox1.SelectionStart = document.editform.wpTextbox1.Text.Length; // document.editform.wpTextbox1.SelectionLength = 0; // document.editform.wpTextbox1.ScrollToCaret(); document.editform.wpSummary.value = 'Copyvio ' + ']'; } } //else // add_link2('javascript:copyvio()', 'copyvio'); } } if (window.addEventListener) window.addEventListener('load', autocopyvio, false); else if (window.attachEvent) window.attachEvent('onload', autocopyvio); function addpersondata() { edit_summary_watch("\n{"+"{Persondata\n|NAME=\n|ALTERNATIVE NAMES=\n|SHORT DESCRIPTION=\n|DATE OF BIRTH=\n|PLACE OF BIRTH=\n|DATE OF DEATH=\n|PLACE OF DEATH=\n}"+"}", "+\\]", false, 0); } function vfd() { document.editform.wpTextbox1.value = '{' + '{' + 'subst:afd}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value = 'AfD'; document.editform.wpWatchthis.checked = true; var target = document.editform.action; target = target.substring(target.indexOf('title=') + 6, target.lastIndexOf('&action=submit')); var months = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); var date = new Date(); date = date.getUTCFullYear() + '_' + months + '_' + date.getUTCDate(); var pagename = strip_namespace(target); window.open('/search/?title=Misplaced Pages:Articles_for_deletion/' + pagename + '&action=edit&fakeaction=vfdsub&faketarget=' + target, 'Vfd ' + unescape(target), 'status,toolbar,location,menubar,directories,resizable,scrollbars'); window.open('/search/?title=Misplaced Pages:Articles_for_deletion/Log/' + date + '&action=edit&fakeaction=vfdlist&faketarget=' + pagename, 'VfdLog ' + unescape(target), 'status,toolbar,location,menubar,directories,resizable,scrollbars'); } function closevfd(result,project) { if (project==1) {subst_text = "afd";} else if (project==2) {subst_text = "tfd";} else if (project==3) {subst_text = "cfd";} else if (project==4) {subst_text = "mfd";} if(result == 1) { document.editform.wpTextbox1.value = "{{" + "subst:" + subst_text + " top}} \'\'\'KEEP\'\'\'. -~" + "~" + "~" + "~\n" + document.editform.wpTextbox1.value; edit_summary_watch("{{" + "subst:" + subst_text + " bottom}}", "close - keep", false, 0); } else if(result == 2) { document.editform.wpTextbox1.value = "{{" + "subst:" + subst_text + " top}} \'\'\'MERGE\'\'\' to \'\' \'\'. -~" + "~" + "~" + "~\n" + document.editform.wpTextbox1.value; edit_summary_watch("{{" + "subst:" + subst_text + " bottom}}", "close - merge+redir", false, 0); } else if(result == 3) { document.editform.wpTextbox1.value = "{{" + "subst:" + subst_text + " top}} \'\'\'REDIRECT\'\'\' to \'\' \'\'. -~" + "~" + "~" + "~\n" + document.editform.wpTextbox1.value; edit_summary_watch("{{" + "subst:" + subst_text + " bottom}}", "close - redir", false, 0); } else if (result ==4) { document.editform.wpTextbox1.value = "{{" + "subst:" + subst_text + " top}} \'\'\'DELETE\'\'\'. -~" + "~" + "~" + "~\n" + document.editform.wpTextbox1.value; edit_summary_watch("{{" + "subst:" + subst_text + " bottom}}", "close - delete", false, 0); } else if (result ==5) { document.editform.wpTextbox1.value = "{{" + "subst:" + subst_text + " top}} \'\'\'NO CONSENSUS\'\'\'. -~" + "~" + "~" + "~\n" + document.editform.wpTextbox1.value; edit_summary_watch("{{" + "subst:" + subst_text + " bottom}}", "close - no consensus", false, 0); } } function vfdvote(vote) { if (vote == 1) edit_summary_watch("*\'\'\'Delete\'\'\' -~"+"~"+"~"+"~", document.editform.wpSummary.value + "delete", true, 0); else if (vote == 2) edit_summary_watch("*\'\'\'Keep\'\'\' -~"+"~"+"~"+"~", document.editform.wpSummary.value + "keep", true, 0); else if (vote == 3) edit_summary_watch("*\'\'\'Merge\'\'\' -~"+"~"+"~"+"~", document.editform.wpSummary.value + "merge", true, 0); else if (vote == 4) edit_summary_watch("*\'\'\'Redirect\'\'\' -~"+"~"+"~"+"~", document.editform.wpSummary.value + "redirect", true, 0); } function vfdtalk(result) { boiler1 = "=" + "=Articles for Deletion debate=" + "=\nThis article "; boiler2 = " an " + "] debate. The discussion can be found " + "]. -~" + "~" + "~" + "~"; if(result == 1) edit_summary_watch(boiler1 + "survived" + boiler2, document.editform.wpSummary.value + "link to AfD", false, 0); else if (result == 2) edit_summary_watch(boiler1 + "was merged with and redirected to \'\' \'\' as a result of" + boiler2, document.editform.wpSummary.value + "link to AfD", false, 0); else if (result == 3) edit_summary_watch(boiler1 + "was redirected to \'\' \'\' as a result of" + boiler2, document.editform.wpSummary.value + "link to AfD", false, 0); } function deletiontags() { if (document.title.indexOf("Editing Misplaced Pages:Votes for deletion") != -1 || document.title.indexOf("Editing Misplaced Pages:Pages for deletion") != -1 || document.title.indexOf("Editing Misplaced Pages:Articles for deletion") != -1 || document.title.indexOf("Misplaced Pages:Templates for deletion/Log") != -1 || document.title.indexOf("Misplaced Pages:Categories for deletion/Log") != -1 || document.title.indexOf("Misplaced Pages:Miscellany for deletion") != -1) { if (document.title.indexOf("Articles") != -1) {project = 1;} else if (document.title.indexOf("Templates") != -1) {project = 2;} else if (document.title.indexOf("Categories") != -1) {project = 3;} else if (document.title.indexOf("Miscellany") != -1) {project = 4;} add_link2('javascript:vfdvote(1)', 'v - d'); add_link2('javascript:vfdvote(2)', 'v - k'); add_link2('javascript:vfdvote(3)', 'v - m'); add_link2('javascript:vfdvote(4)', 'v - r'); add_link2('javascript:closevfd(1,project)', 'c - k'); add_link2('javascript:closevfd(2,project)', 'c - m'); add_link2('javascript:closevfd(3,project)', 'c - r'); add_link2('javascript:closevfd(4,project)', 'c - d'); add_link2('javascript:closevfd(5,project)', 'c - nc'); } else if (document.title.indexOf("Editing Misplaced Pages:Votes for deletion") == -1 && document.title.indexOf("Editing Misplaced Pages:Pages for deletion") == -1 && document.title.indexOf("Editing Misplaced Pages:Articles for deletion") == -1 && document.title.indexOf("Editing Talk:") == -1 && document.title.indexOf("Editing User talk:") == -1) { add_link2('javascript:vfd()', 'vfd'); add_link2('javascript:copyvio()', 'copyvio'); add_link2('javascript:addpersondata()', 'person'); } else if (document.title.indexOf("Editing Misplaced Pages:Votes for deletion") == -1 && document.title.indexOf("Editing Misplaced Pages:Pages for deletion") == -1 && document.title.indexOf("Editing Misplaced Pages:Articles for deletion") == -1 && document.title.indexOf("Editing Talk:") != -1 && document.title.indexOf("Editing User talk:") == -1) { add_link2('javascript:vfdtalk(1)','afd - k'); add_link2('javascript:vfdtalk(2)','afd - m'); add_link2('javascript:vfdtalk(3)','afd - r'); } } function autovfd() { if (document.title.indexOf('Editing ') == 0) { var action = ''; var target = ''; if (location.search) { var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) { var eq = l.indexOf('='); var name = l.substring(0, eq); if (name == 'fakeaction') action = l.substring(eq + 1); else if (name == 'faketarget') target = unescape(l.substring(eq + 1)).replace(/_/g, ' '); } } if (action == 'vfdlist') { document.editform.wpTextbox1.value += '{{' + 'subst:afd3|pg=' + target + '}}\n'; document.editform.wpSummary.value = ']'; document.editform.wpWatchthis.checked = false; } else if (action == 'vfdsub') { if (document.editform.wpTextbox1.value.length > 0) { target = document.editform.action; target = unescape(target.substring(target.indexOf('title=') + 6, target.lastIndexOf('&action=submit'))).replace(/_/g, ' '); window.alert("There's an old vfd at the default location already.\n\n" + 'Please either move it out of the way (and update existing links to it), or file the Vfd by hand in another location (such as ]).'); } else { document.editform.wpTextbox1.value += "{{" + "subst:afd2|pg=" + target + "|text=\'\'\'Delete\'\'\'}} -~" + "~" + "~" + "~"; document.editform.wpSummary.value = 'Nominate'; document.editform.wpWatchthis.checked = true; } } else deletiontags(); } } if (window.addEventListener) window.addEventListener('load', autovfd, false); else if (window.attachEvent) window.attachEvent('onload', autovfd); // Returns <li><a href="url">name</a></li> function addlilink(url, name) { var na = document.createElement('a'); na.setAttribute('href', url); var txt = document.createTextNode(name); na.appendChild(txt); var li = document.createElement('li'); li.appendChild(na); return li; } //function do_onload() //{ // if (document.title.indexOf('User:') == 0 // || document.title.indexOf('User talk:') == 0) // add_block_tab(); //} // Adds a "blocklog" tab and fills in the username field on Special:Blockip, if a "&faketarget=username" is present. function do_blockip_stuff() { // focus on Reason field document.getElementsByName('wpBlockReason').focus(); // Look for a &faketarget= for the username/ip var l = location.search.substring(1).split('&'); var target = ''; for (var i = 0; i < l.length; ++i) { var n = l.indexOf('='); if (l.substring(0, n) == 'faketarget') { target = l.substring(n + 1); break; } } if (target == '') return; // put account name in "IP Address/username" field var addr = document.getElementsByName('wpBlockAddress'); addr.value = unescape(target); // add "blocklog" tab var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul'); tabs.appendChild(addlilink('/search/?title=Special%3ALog&type=block&user=&page=User%3A' + target, 'blocklog')); } // Opens the block log in the current window, and Special:Blockip in a popup. // Width, height, top, and left are chosen for a 1600x1200 display. function blockpage_and_log(target) { window.open('/search/?title=Special%3ABlockip&faketarget=' + target, 'Block', 'width=1400,height=525,top=525,left=0'); document.location.href = 'http://en.wikipedia.org/search/?title=Special%3ALog&type=block&user=&page=User%3A' + target; } // Adds "block" and "blocklog" tabs to User: and User talk: pages. function add_block_tab() { var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul'); // use the "edit this page" tab to get already-tidied url var editlk = document.getElementById('ca-edit').getElementsByTagName('a').href; // cut everything up to "title=" from the start and everything past "&action=edit" from the end editlk = editlk.substring(editlk.indexOf('title=') + 6, editlk.lastIndexOf('&action=edit')); editlk = editlk.substring(editlk.indexOf(':') + 1); var slloc = editlk.indexOf('/'); if (slloc > 0) editlk = editlk.substring(0, slloc); // add "block" tab //tabs.appendChild(addlilink('/search/?title=Special%3ABlockip&faketarget=' + editlk, 'block')); // To open the block page and block log simultaneously, replace the above line with: tabs.appendChild(addlilink('javascript:blockpage_and_log("' + editlk + '")', 'Block')); // and uncomment the blockpage_and_log() function above. // add "blocklog" tab tabs.appendChild(addlilink('/search/?title=Special%3ALog&type=block&user=&page=User%3A' + editlk, 'blocklog')); //add "contributions" tab tabs.appendChild(addlilink('/w/wiki.phtml?title=Special:Contributions&target=User%3A' + editlk, 'contributions')); } function do_onload() { if (document.title.indexOf('User:') == 0 || document.title.indexOf('User talk:') == 0) add_block_tab(); else if (document.title.indexOf('Block user') == 0) // could stand to be more robust do_blockip_stuff(); } if (window.addEventListener) window.addEventListener("load", do_onload, false); else if (window.attachEvent) window.attachEvent("onload", do_onload); if ( document.createElement && window.addEventListener ) { function SoFixItInit() // pre-load, (don't want to slow down loading of article's content, though) { } function SoFixItLoad() // post-load { UserMenu = new PortletMenu( 'p-personal' ); PageMenu = new PortletMenu( 'p-cactions' ); NavMenu = new PortletMenu( 'p-navigation' ); //ToolMenu = new PortletMenu( 'p-tb' ); // This is inefficient and not particularly robust. // This comes first, I want this link to come up as // fast as possible. // function GetByClass( sElem, sClass ) { var i, a2 = , a = document.getElementsByTagName( sElem ); for ( i = 0; i < a.length; i++ ) if ( a.className == sClass ) a2.push( a ); return a2; } var a, td = GetByClass( 'td', 'diff-otitle' ); if ( ( td = td ) && ( a = td.getElementsByTagName( 'a' ) ) ) a.href = a.href + '&action=edit'; // need to change text, later var userName = UserMenu.getText( 'pt-userpage' ); // personal (top-most) menu // // Splash Talk Prefs Watch List Contribs Kate Logs #IRC Out // UserMenu.setText( 'pt-mytalk' , 'talk' ); UserMenu.setText( 'pt-preferences', 'prefs' ); UserMenu.setText( 'pt-watchlist' , 'watch' ); UserMenu.setText( 'pt-mycontris' , 'contribs' ); UserMenu.setText( 'pt-logout' , 'out' ); // UserMenu.setHref( 'pt-mycontris', 'http://en.wikipedia.org/search/?title=Special:Contributions&target=' + userName + '&offset=0&limit=500' ); // // // it seems there is a stylesheet that makes them lowercase // // ok, the lowercased menu items are starting to really bug me: // document.getElementById( 'p-personal' ).getElementsByTagName( 'ul' ).style.textTransform = 'none'; // UserMenu.insertBefore( 'pt-mycontris', 'pt-list', 'list', '/Special:Watchlist/edit' ); UserMenu.insertBefore( 'pt-logout' , 'pt-logs', 'logs', '/search/?title=Special%3ALog&user=' + userName ); UserMenu.insertBefore( 'pt-logout' , 'pt-irc' , '#irc', 'irc://irc.freenode.net/wikipedia' ); UserMenu.insertBefore( 'pt-logs' , 'pt-kate', 'count', 'javascript:void InlineKate( "' + userName + '" )' ); // so I always know what time it is in UTC land: // UserMenu.append( 'pt-utc', UTCTime(), 'javascript:void UserMenu.setText("pt-utc",UTCTime())' ); // article-actions menu, (the "tabs") // if ( PageMenu ) // theory: if it has a history tab, then it's purgable { PageMenu.insertBefore( 'ca-history', 'ca-lastdiff', 'Last Diff', PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'diff=0' ) ); PageMenu.append( 'ca-purge', 'Purge', PageMenu.getHref( 'ca-history' ).replace( /action=history/, 'action=purge' ) ); } var x = 1; //NavMenu.append( 'n-' + x++, 'monobook.js', '/User:' + userName + '/monobook.js' ); NavMenu.append( 'n-' + x++, 'Cat:Misplaced Pages', '/Category:Misplaced Pages' ); NavMenu.append( 'n-' + x++, 'Cat:Policies', '/Category:Wikipedia_policies_and_guidelines' ); NavMenu.append( 'n-' + x++, 'Cat:Official', '/Category:Wikipedia_official_policy' ); NavMenu.append( 'n-' + x++, 'Templates', '/Wikipedia:Template' ); NavMenu.append( 'n-' + x++, 'Cleanup tags', '/Wikipedia:Template_messages/Cleanup' ); NavMenu.append( 'n-' + x++, 'Stub sorts', '/Stub_types' ); } function PortletMenu( id ) // constructor { this.menu = document.getElementById( id ); this.list = this.menu.getElementsByTagName( 'ul' ); // bypass "<h5>Views</h5>", etc. // sigh...as far as I can figure, there is empty whitespace being treated // as TextNodes.... // var LIs = this.list.getElementsByTagName( 'li' ); for ( var i = 0; i < LIs.length; i++ ) { this.id ] = LIs; } this.newItem = function( id, txt, url ) { var li = document.createElement( 'li' ); li.id = id; var a = document.createElement( 'a' ); a.href = url; a.appendChild( document.createTextNode( txt ) ); li.appendChild( a ); this = li; // watch this!!! return li; } this.append = function( id, txt, url ) { this.list.appendChild( this.newItem( id, txt, url ) ); } this.insertBefore = function( old, id, txt, url ) { this.list.insertBefore( this.newItem( id, txt, url ), this ); } // the ByTagName here is a bit annoying, but in Safari, I was picking // up TextNodes by using this.firstChild.firstChild // this.getText = function( id ) { return this.getElementsByTagName( 'a' ).firstChild.data } this.setText = function( id, txt ) { this.getElementsByTagName( 'a' ).firstChild.data = txt } this.getHref = function( id ) { return this.getElementsByTagName( 'a' ).href } this.setHref = function( id, url ) { this.getElementsByTagName( 'a' ).href = url } // I add em as I need em.... } function InlineKate( user ) { var kate = 'http://tools.wikimedia.de/~interiot/cgi-bin/count_edits?user=Splash&dbname=enwiki_p'; var div = document.createElement( 'div' ); div.id = 'inlineKateDiv'; div.style.position = 'absolute'; div.style.zIndex = 1000; div.style.left = '20px'; div.style.top = '20px'; div.style.backgroundColor = '#FFFFFF'; div.style.borderStyle = 'solid'; div.style.borderWidth = ' medium'; div.style.borderColor = '#000000'; var top = document.createElement( 'div' ); top.id = 'inlineKateTop'; top.style.textAlign = 'right'; top.style.margin = '8px'; top.style.backgroundColor = '#DDDDDD'; var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( "Go to Interiot's" ) ); a.href = kate; a.target = '_parent'; a.style.margin = '8px'; top.appendChild( a ); a = document.createElement( 'a' ); a.appendChild( document.createTextNode( 'Close' ) ); a.href = "javascript:void RemoveNode('inlineKateDiv')"; a.style.margin = '8px'; top.appendChild( a ); div.appendChild( top ); var iframe = document.createElement( 'iframe' ); iframe.id = 'inlineKateBot'; iframe.style.width = '500px'; iframe.style.height = '600px'; iframe.style.margin = '8px'; iframe.style.borderStyle = 'solid'; iframe.style.borderWidth = 'thin'; iframe.style.borderColor = '#000000'; iframe.src = kate; div.appendChild( iframe ); document.body.appendChild( div ); } function RemoveNode( id ) { var node = document.getElementById( id ) node.parentNode.removeChild( node ); } function UTCTime() { // Get a date stamp for the time in UTC-land. // // for the future: a format arg // var s = '', d = new Date(), a = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); return d.getUTCDate() + ' ' + a + ' ' + d.getUTCFullYear() + ' ' + ( '0' + d.getUTCHours() ).substr( -2 ) + ':' + ( '0' + d.getUTCMinutes() ).substr( -2 ) + ' ' + 'UTC'; } SoFixItInit(); window.addEventListener( 'load', SoFixItLoad, false ); } // Released into the public domain by ] function NUPatrol() { if ( window.location.href.indexOf( 'Special:Log/newusers' ) < 0 && window.location.href.indexOf( '&type=newusers' ) < 0 ) return; var items, item, i, links, user, name, talk, contribs, insertLoc, link; items = document.getElementById( 'bodyContent' ).getElementsByTagName( 'ul' ).getElementsByTagName( 'li' ); function NewLink( txt, url, plainlinks, linkColor ) { var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( txt ) ); a.href = url; if ( plainlinks ) a.className = 'plainlinks'; if ( linkColor ) { if ( typeof linkColor == "string" ) a.style.color = linkColor; else a.style.color = '#FF0000'; // old default behavior } return a; } for ( i = 0; i < items.length; i++ ) { item = items; links = item.getElementsByTagName( 'a' ); user = links; name = user.firstChild.nodeValue; talk = links; talk.firstChild.nodeValue = 'talk'; // lowercase 'Talk' for consistency contribs = links; insertLoc = user.nextSibling; // ' newusers ' item.insertBefore( document.createTextNode( ' ( ' ), insertLoc ); item.insertBefore( talk, insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( contribs, insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'actions', '/search/?title=Special%3ALog&user=' + name, true, '#000088' ), insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'blocks', '/search/?title=Special%3ALog&type=block&page=User%3A' + name, true, '#008800' ), insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'is blocked?', '/Special:Ipblocklist?action=search&ip=' + name, true, '#888800' ), insertLoc ); item.insertBefore( document.createTextNode( ', ' ), insertLoc ); item.insertBefore( NewLink( 'do block!', '/search/?title=Special:Blockip&ip=' + name, true, '#880000' ), insertLoc ); item.insertBefore( document.createTextNode( ' )' ), insertLoc ); item.removeChild( insertLoc.nextSibling ); // should remove the span item.removeChild( insertLoc ); // should remove ' newusers ' text } } if ( window.addEventListener ) window.addEventListener( 'load', NUPatrol, false ); else if ( window.attachEvent ) window.attachEvent( 'onload', NUPatrol ); // This will add an link at the top of all pages except preview pages // by User:Pile0nades // Add an link to pages function editTopLink() { // if this is preview page or generated page, stop if(document.getElementById("wikiPreview") || window.location.href.indexOf("/Special:") != -1) return; // get the page title var pageTitle = document.title.split(" - ").replace(" ", "_"); // create div and set innerHTML to link var divContainer = document.createElement("div"); divContainer.innerHTML = '<div class="editsection" style="float:right;margin-left:5px;margin-top:3px;">+'">edit top</a>]</div>'; // insert divContainer into the DOM before the h1 if(window.location.href.indexOf("&action=edit") == -1) document.getElementById("content").insertBefore(divContainer, document.getElementsByTagName("h1")); if(window.location.href.indexOf("&action=edit§ion=0") != -1) document.getElementById("wpSummary").value = "/* Intro */ "; } addOnloadHook(editTopLink); // Like document.getElementsByTagName, but finds only direct children of a given node function node_getElementsByTagName(node, tag) { var arr = new Array; tag = tag.toUpperCase(); for (node = node.firstChild; node; node = node.nextSibling) if (node.tagName == tag) arr = node; return arr; } addOnloadHook(function () { var node = document.getElementById('contentSub'); // monobook-like skins if (!node) // classic-like skins { var h1s = document.getElementsByTagName('h1'); for (var i = 0; i < h1s.length; ++i) if (h1s.className && h1s.className.indexOf('pagetitle') >= 0) { node = h1s.nextSibling; break; } } if (node && node.firstChild && node.firstChild.nodeType == Node.TEXT_NODE && node.firstChild.data.indexOf("Revision as of") >= 0) { var as = node_getElementsByTagName(node, 'a'); if (as.firstChild.data == "view current revision") { var a = document.createElement('a'); a.href = as.href.replace(/&direction=prev&oldid=/, '&diff=prev&oldid='); a.appendChild(document.createTextNode('(diff) ')); node.insertBefore(a, as); a = document.createElement('a'); a.href = as.href.replace(/&direction=next&oldid=/, '&diff=next&oldid='); a.appendChild(document.createTextNode(' (diff)')); node.appendChild(a); } } }); //<pre><nowiki> //Helper tools if (!addTab) { document.write('<script type="text/javascript" src="' + 'http://en.wikipedia.org/search/?title=User:Voice_of_All/Addtabs/monobook.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); } //END function strip_namespace(target) { var colon = target.indexOf(':'); if (colon != -1) { var spaces = new Array('User', 'Misplaced Pages', 'Image', 'MediaWiki', 'Template', 'Help', 'Category'); var ns = target.substring(0, colon); if (ns == '' || ns == 'Talk') return target.substring(colon + 1); else for (var i = 0; i < spaces.length; ++i) { if (ns == spaces || ns == spaces + '_talk') return target.substring(colon + 1); } } return target; } //END function jssubmitclose() { var form = document.getElementById('editform'); form.submit(); setTimeout('window.close()',12000); } //END //Auto-replace function oldautoreplacetxt(what,withw) { var undefined; i = 1; var original = document.editform.wpTextbox1.value; if (what == ''){alert("Invalid command."); return;} else if (what == 'null'){alert("Action cancelled."); return;} else { if (withw == ''){alert("All such appearances of text will be removed.");} else if (withw.split(what) != undefined) {alert("Action cancelled to avoid infinite loop."); return;} else { if (document.editform.wpTextbox1.value.split(what) != undefined) { while (i == 1) { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(what, withw); if (document.editform.wpTextbox1.value.indexOf(what) != -1) {i = 1;} else {i = -1;} } } //document.editform.wpSummary.value += 'JS: Replacing text "' + what + '" with "' + withw + '" '; } } } //END //Auto-replace function autoreplacetxt(s,r) { var original = document.editform.wpTextbox1.value; if(s) { if(!r && r != '') {alert('Action cancelled.'); return;} var txt = document.editform.wpTextbox1; txt.value = txt.value.replace(new RegExp(s, "g"), r); } } //END // ============= test-n.js ============== function tnaddlilink(url, name) { var na = document.createElement('a'); na.setAttribute('href', url); var txt = document.createTextNode(name); na.appendChild(txt); var li = document.createElement('li'); li.appendChild(na); return li; } //--------------------------------------------------------------- function URLEncoding(input) { var encodedInputString=escape(input); encodedInputString=encodedInputString.replace("+", "%2B"); encodedInputString=encodedInputString.replace("/", "%2F"); var outputurl=encodedInputString; return outputurl; } //END addOnloadHook(protection_tabs); function protection_tabs() { var c1 = document.getElementById('column-one'); var tabs = c1.getElementsByTagName('div').getElementsByTagName('ul'); if (document.title.indexOf("") != -1) { if (document.title.indexOf("Editing ") != -1) { document.getElementById('ca-edit').firstChild.innerHTML = 'Edit'; document.getElementById('ca-talk').firstChild.innerHTML = 'Talk'; if (document.title.indexOf("Editing User talk:") != -1) { addTab("javascript:usprotect()", "(s)", "ca-sp", "Semi-protect", ""); if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; addTab("javascript:uunprotect()", "(u)", "ca-up", "Un-protect", ""); } } else if (document.title.indexOf("Editing User:") != -1) { addTab("javascript:usprotect()", "(s)", "ca-sp", "Semi-protect", ""); addTab("javascript:ufprotect()", "(p)", "ca-fp", "Full-protect", ""); if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'Protection (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'Protection (on)'; addTab("javascript:uunprotect()", "(u)", "ca-up", "Un-protect", ""); } } else if (document.title.indexOf("Editing Misplaced Pages:Requests for page protection (section)") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; } tabs.appendChild(tnaddlilink('javascript:rfpps()',"a|s")); tabs.appendChild(tnaddlilink('javascript:rfppp()',"a|p")); tabs.appendChild(tnaddlilink('javascript:rfppm()',"a|m")); tabs.appendChild(tnaddlilink('javascript:rfpprv()',"r|s")); tabs.appendChild(tnaddlilink('javascript:rfppr()',"r|p")); tabs.appendChild(tnaddlilink('javascript:rfppun()',"a|u")); tabs.appendChild(tnaddlilink('javascript:rfppru()',"r|u")); tabs.appendChild(tnaddlilink('javascript:rfppu()',"au")); } else if (document.title.indexOf("Editing Misplaced Pages:Administrators' noticeboard/3RR (section)") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; } } //This line removes a minor glitch ] else if(document.title.indexOf("Editing Help:Contents/Editing Misplaced Pages") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; } } else if(document.title.indexOf("Help:Contents/Editing Misplaced Pages") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'Protection (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'Protection (on)'; } } else if(document.title.indexOf("Editing Talk:") != -1 || document.title.indexOf("Editing Misplaced Pages talk:") != -1 || document.title.indexOf("Editing Template talk:") != -1 || document.title.indexOf("Editing MediaWiki talk:") != -1 || document.title.indexOf("Editing Help talk:") != -1 || document.title.indexOf("Editing Portal talk:") != -1 || document.title.indexOf("Editing Image talk:") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; addTab("javascript:oprotect()", "(p)", "ca-ofp", "Full-protect", ""); addTab("javascript:osprotect()", "(s)", "ca-osp", "Semi-protect", ""); } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; addTab("javascript:oprotect()", "(p)", "ca-ofp", "Full-protect", ""); addTab("javascript:osprotect()", "(s)", "ca-osp", "Semi-protect", ""); addTab("javascript:ounprotect()", "(u)", "ca-oup", "Un-protect", ""); } if(document.getElementById('ca-edit')) { document.getElementById('ca-edit').firstChild.innerHTML = 'Edit'; } } else if(document.title.indexOf("Editing Misplaced Pages:") != -1 || document.title.indexOf("Editing Template:") != -1 || document.title.indexOf("Editing Category:") != -1 || document.title.indexOf("Editing MediaWiki:") != -1 || document.title.indexOf("Editing Portal:") != -1 || document.title.indexOf("Editing Help:") != -1 || document.title.indexOf("Editing Image:") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; addTab("javascript:oprotect()", "(p)", "ca-ofp", "Full-protect", ""); addTab("javascript:osprotect()", "(s)", "ca-osp", "Semi-protect", ""); } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; addTab("javascript:oprotect()", "(p)", "ca-ofp", "Full-protect", ""); addTab("javascript:osprotect()", "(s)", "ca-osp", "Semi-protect", ""); addTab("javascript:ounprotect()", "(u)", "ca-oup", "Un-protect", ""); } } else { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'P (off)'; addTab("javascript:protect()", "(p)", "ca-fp", "Full-protect", ""); addTab("javascript:sprotect()", "(s)", "ca-sp", "Semi-protect", ""); } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'P (on)'; addTab("javascript:protect()", "(p)", "ca-fp", "Full-protect", ""); addTab("javascript:sprotect()", "(s)", "ca-sp", "Semi-protect", ""); addTab("javascript:unprotect()", "(u)", "ca-up", "Un-protect", ""); } if(document.getElementById('ca-edit')) { document.getElementById('ca-edit').firstChild.innerHTML = 'Edit'; } } } else if (document.title.indexOf("User:") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'Protection (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'Protection (on)'; } } else if (document.title.indexOf("User talk:") != -1) { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'Protection (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'Protection (on)'; } } else { if(document.getElementById('ca-protect')) { document.getElementById('ca-protect').firstChild.innerHTML = 'Protection (off)'; } if(document.getElementById('ca-unprotect')) { document.getElementById('ca-unprotect').firstChild.innerHTML = 'Protection (on)'; } } } } //***************************************************** //PROTECTION JS //***************************************************** //***************************************************** //This is for if people skrew with the WP:PP page layout var movesec = 7; var artfull = 10; var artsemi = 11; var otherpro = 13; var userfull = 16; var usersemi = 17; var regtalk = 18; var anontalk = 19; //End of WP:PP constants //***************************************************** //***************************************************** function protect() { var message = "Are you sure you want to full-protect this page?"; var return_value = confirm(message); if (return_value == true) { var z = ''; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{tl|protected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{tl|vprotected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { var z = 'notag'; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpTextbox1.value = '{{protected' + '}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+{{protected' + '}}'; window1 = window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + artfull + '&fakeaction=plist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window2 = window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsfprotect', 'targetname2', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); jssubmitclose(); return; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } } } function sprotect() { var message = "Are you sure you want to semi-protect this page?"; var return_value = confirm(message); if (return_value == true) { var z = ''; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{usertalk-sprotected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Usertalk-sprotected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { var z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { var z = 'notag'; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+{{sprotected' + '}}'; window1 = window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + artsemi + '&fakeaction=plist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window2 = window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jssprotect', 'targetname2', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); jssubmitclose(); return; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } } } function usprotect() { var z = ''; if (document.title.indexOf("Editing User talk") != -1) { value = 't'; } if (document.title.indexOf("Editing User:") != -1) { value = 'u'; } var reg = ''; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Sprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Usertalk-sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{usertalk-sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vutprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Vutprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Vprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Vprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Sutprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sutprotected}}') != undefined) { z = 'notag'; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } else { if (value == 'u') { var act = 'u'; type = 17; } else if (value == 't') { var act = 'ut'; var reg = prompt('Is this an anon or a registered user (enter *a* or *r*)?'); if (reg == 'a') { type = 19; } else if (reg == 'r') { type = 18; } else { alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; } } else { alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; } form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+{{sprotected' + '}}'; window1 = window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + type + '&fakeaction=' + act + 'plist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window2 = window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jssprotect', 'targetname2', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); return; } } function ufprotect() { var z = ''; if (document.title.indexOf("Editing User:") != -1) { value = 'u'; } var reg = ''; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Sprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Usertalk-sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{usertalk-sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vutprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Vutprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Vprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Vprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{Sutprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sutprotected}}') != undefined) { z = 'notag'; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } else { if (value == 'u') { var act = 'u'; type = 16; } form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpTextbox1.value = '{{Vprotected' + '}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+{{Vprotected' + '}}'; window1 = window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + type + '&fakeaction=' + act + 'plist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window2 = window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsfprotect', 'targetname2', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); return; } } function oprotect() { var z = ''; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { z = 'notag'; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); return; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpTextbox1.value = '{{protected' + '}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+{{protected' + '}}'; window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + otherpro + '&fakeaction=oplist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsfprotect', 'targetname2', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); } } function osprotect() { var z =''; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{vprotected}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { z = 'notag'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { z = 'notag'; } if (z == 'notag') { alert("Error: A protection tag is already on this page. If this tag is supposed to be part of the text, then add the desired protection tag manually."); } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpTextbox1.value = '{{sprotected' + '}}\n' + document.editform.wpTextbox1.value; document.editform.wpSummary.value += '+{{sprotected' + '}}'; window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + otherpro + '&fakeaction=oplist&faketarget=' + target, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jssprotect', 'targetnameo', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); } } function unprotect() { var message = "Are you sure you want to unprotect this page?"; var return_value = confirm(message); if (return_value == true) { var undefined; var original = document.editform.wpTextbox1.value; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { whattag = 'sprotect'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { whattag = 'sprotected'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{semiprotect}}') != undefined) { whattag = 'semiprotect'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{semiprotected}}') != undefined) { whattag = 'semiprotected'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{semi-protected}}') != undefined) { whattag = 'semi-protected'; whattype = artsemi; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{vprotect}}') != undefined) { whattag = 'vprotect'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{vprotected}}') != undefined) { whattag = 'vprotected'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { whattag = 'protect'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { whattag = 'protected'; whattype = artfull; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { whattag = 'moveprotect'; whattype = movesec; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { whattag = 'moveprotected'; whattype = movesec; var go = 'yes'; } else { alert("Error: There is no recognized protection tag on this page."); return; } if (go == 'yes') { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpSummary.value += 'Unprotected page -- removing tag'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + whattag + '}}',''); window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + whattype + '&fakeaction=pdelist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsunprotect', 'targetnamepro', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); jssubmitclose(); return; } } } function ounprotect() { var undefined; var original = document.editform.wpTextbox1.value; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { whattag = 'sprotect'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { whattag = 'sprotected'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { whattag = 'protect'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { whattag = 'protected'; whattype = otherpro; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { whattag = 'moveprotect'; whattype = movesec; var go = 'yes'; } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { whattag = 'moveprotected'; whattype = movesec; var go = 'yes'; } else { alert("Error: There is no recognized protection tag on this page."); } if (go == 'no') { alert("Error: The protection tag is preceded by text (in which case you have to remove it manually)."); } if (go == 'yes') { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } document.editform.wpSummary.value += 'Unprotected page -- removing tag'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + whattag + '}}',''); window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + whattype + '&fakeaction=pdelist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsunprotect', 'targetnamep', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); } } //USERPAGE UNPROTECT function uunprotect() { var undefined; var gotagged = 'no'; var gonotagged = 'no'; if (document.title.indexOf("Editing User talk:") != -1) { value = 't'; } if (document.title.indexOf("Editing User:") != -1) { value = 'u'; } var original = document.editform.wpTextbox1.value; var target = document.title.split("Editing ").split(" - "); jstarget = URLEncoding(target); if (value == 'u') { type = 17; } else if (value == 't') { var reg = prompt('Is this an anon or a registered user (enter *a* or *r*)?'); if (reg == 'a') { type = 19; } else if (reg == 'r') { type = 18; } else { alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; } } else { alert("Error: Invalid input. Make sure you are not actually including the asterisk symbols."); return; } //Tag search if (document.editform.wpTextbox1.value.split('{{sprotect}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{sprotect}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'sprotect'; type = usersemi; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'sprotect'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'sprotect'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{vprotect}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{vprotect}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'vprotect'; type = userfull; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'vprotect'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'vprotect'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{vutprotected}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{vutprotected}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'vutprotected'; type = userfull; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'vutprotected'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'vutprotected'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{vprotected}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{vprotected}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'vprotected'; type = userfull; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'vprotected'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'vprotected'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{sprotected}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{sprotected}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'sprotected'; type = usersemi; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'sprotected'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'sprotected'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{Usertalk-sprotect}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{Usertalk-sprotect}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'Usertalk-sprotect'; type = usersemi; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'Usertalk-sprotect'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'Usertalk-sprotect'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{usertalk-sprotect}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{usertalk-sprotect}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'usertalk-sprotect'; type = usersemi; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'usertalk-sprotect'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'usertalk-sprotect'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{protect}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{protect}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'protect'; type = userfull; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'protect'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'protect'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{protected}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{protected}}') == '') { if (value == 'u') { gotagged = 'yes'; tagtype = 'protected'; type = userfull; } else if (value == 't') { if (reg == 'a') { gotagged = 'yes'; tagtype = 'protected'; type = anontalk; } else if (reg == 'r') { gotagged = 'yes'; tagtype = 'protected'; type = regtalk; } } } } else if (document.editform.wpTextbox1.value.split('{{moveprotect}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{moveprotect}}') == '') { document.editform.wpSummary.value += 'Unprotected'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split('{{moveprotect}}'); } } else if (document.editform.wpTextbox1.value.split('{{moveprotected}}') != undefined) { if (document.editform.wpTextbox1.value.split('{{moveprotected}}') == '') { document.editform.wpSummary.value += 'Unprotected'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split('{{moveprotected}}'); } } //No tag found...what now? else { var message = "Note: Either there is no recognized protection tag on this page or it is preceded by text. Press OK to continue."; var return_value = confirm(message); //If they click OK if (return_value == true) { if (value == 't') { if (reg == 'a') { window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + anontalk + '&fakeaction=pdelist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); gonotagged = 'yes'; } else if (reg == 'r') { window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + regtalk + '&fakeaction=pdelist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); gonotagged = 'yes'; } else { alert("An unknown error has occured."); } } if (value == 'u') { var level = prompt("Page no longer semi or fully protected (enter *s* or *f*)?"); if (level == 's') { window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + usersemi + '&fakeaction=pdelist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); gonotagged = 'yes'; } else if (level == 'f') { window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + userfull + '&fakeaction=pdelist&faketarget=' + target, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); gonotagged = 'yes'; } else { alert("Invalid input."); return; } } else if (value != 'u' && value != 't') { alert("An unknown page recognition error has occured."); } } else { document.editform.wpSummary.value += ""; return; } } form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } if (gotagged == 'yes') { document.editform.wpSummary.value += 'Unprotected'; document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace('{{' + tagtype + '}}',''); var windowpp = window.open('http://en.wikipedia.org/search/?title=Misplaced Pages:List_of_protected_pages&action=edit§ion=' + type + '&fakeaction=pdelist&faketarget=' + jstarget, 'targetname', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); var windowcp = window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsunprotect', 'targetnameu', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); } if (gonotagged == 'yes') { var windowcp = window.open('http://en.wikipedia.org/search/?title=' + target + '&action=protect&fakeaction=jsunprotect', 'targetnameu', 'location=no,toolbar=no,status=no,directories=no,scrollbars=yes'); } } //Listing function addOnloadHook(autoplist); function autoplist() { if (document.title.indexOf('Editing ') == 0) { var action = ''; var target = ''; if (location.search) { var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) { var eq = l.indexOf('='); var name = l.substring(0, eq); if (name == 'fakeaction') action = l.substring(eq + 1); else if (name == 'faketarget') target = unescape(l.substring(eq + 1)).replace(/_/g, ' '); } } if (action == 'plist') { autoreplacetxt('\n\n','\n'); var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:"); var usertalk = document.editform.wpTextbox1.value.split("User talk:"); var themovename = document.editform.wpTextbox1.value.split("Misplaced Pages:"); var themove = "*{{Non-article|Misplaced Pages|" + themovename + "}}"; var thepage = "*{{article|" + target + "}}"; var thepage2 = "* {{article|" + target + "}}"; var lapage = "*{{la|" + target + "}}"; var theuser = "*]"; var vandaltalk = "*{{vandal|" + usertalk + "}}"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(vandaltalk) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(themove) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage2) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(lapage) != undefined) { var errorl = 'yes'; } if (errorl == 'yes') { alert("Error: The page is already listed."); return; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } var reason = prompt("Enter an explanation for protection:") var f = document.editform, t = f.wpTextbox1; t.value +="*{{article|" + pagename + "}}. " + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "] protected; adding to list."; } } if (action == 'uplist') { autoreplacetxt('\n\n','\n'); var username = target.split("User:"); var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:"); var usertalk = document.editform.wpTextbox1.value.split("User talk:"); var themovename = document.editform.wpTextbox1.value.split("Misplaced Pages:"); var themove = "*{{Non-article|Misplaced Pages|" + themovename + "}}"; var thepage = "*{{article|" + target + "}}"; var thepage2 = "* {{article|" + target + "}}"; var lapage = "*{{la|" + target + "}}"; var theuser = "*]"; var vandaltalk = "*{{vandal|" + usertalk + "}}"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(vandaltalk) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(themove) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage2) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(lapage) != undefined) { var errorl = 'yes'; } if (errorl == 'yes') { alert("Error: The page is already listed."); return; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } var reason = prompt("Enter an explanation for protection:") var f = document.editform, t = f.wpTextbox1; t.value +="*] -- " + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "]" + " protected; adding to list."; } } if (action == 'utplist') { autoreplacetxt('\n\n','\n'); var username = target.split("User talk:"); var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:"); var usertalk = document.editform.wpTextbox1.value.split("User talk:"); var themovename = document.editform.wpTextbox1.value.split("Misplaced Pages:"); var themove = "*{{Non-article|Misplaced Pages|" + themovename + "}}"; var thepage = "*{{article|" + target + "}}"; var thepage2 = "* {{article|" + target + "}}"; var lapage = "*{{la|" + target + "}}"; var theuser = "*]"; var vandaltalk = "*{{vandal|" + usertalk + "}}"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(vandaltalk) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(themove) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage2) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(lapage) != undefined) { var errorl = 'yes'; } if (errorl == 'yes') { alert("Error: The page is already listed."); return; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } var reason = prompt("Enter an explanation for protection:") var f = document.editform, t = f.wpTextbox1; t.value +="*{{vandal|" + pagename + "}} --" + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "]" + " protected; adding to list."; } } if (action == 'oplist') { autoreplacetxt('\n\n','\n'); var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:"); var usertalk = document.editform.wpTextbox1.value.split("User talk:"); var themovename = document.editform.wpTextbox1.value.split("Misplaced Pages:"); var themove = "*{{Non-article|Misplaced Pages|" + themovename + "}}"; var thepage = "*{{article|" + target + "}}"; var thepage2 = "* {{article|" + target + "}}"; var lapage = "*{{la|" + target + "}}"; var theuser = "*]"; var vandaltalk = "*{{vandal|" + usertalk + "}}"; document.editform.wpTextbox1.value = original; if (document.editform.wpTextbox1.value.split(theuser) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(vandaltalk) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(themove) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(thepage2) != undefined) { var errorl = 'yes'; } else if (document.editform.wpTextbox1.value.split(lapage) != undefined) { var errorl = 'yes'; } if (errorl == 'yes') { alert("Error: The page is already listed."); return; } else { form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } var reason = prompt("Enter an explanation for protection") var f = document.editform, t = f.wpTextbox1; t.value +="*{{Non-article|Misplaced Pages|" + pagename + "}}. " + reason + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "]" + " protected; adding to list."; } } } } //This function sets the selected values on the Confirm protection page addOnloadHook(jsprotect); function jsprotect() { if (document.title.indexOf('Confirm protection') != -1) { var action = ''; var target = ''; if (location.search) { var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) { var eq = l.indexOf('='); var name = l.substring(0, eq); if (name == 'fakeaction') action = l.substring(eq + 1); else if (name == 'faketarget') target = unescape(l.substring(eq + 1)).replace(/_/g, ' '); } } if (action == 'jsunprotect') { document.getElementsByTagName('option').selected=true; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=true; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=false; document.getElementById('mwProtect-reason').value = 'Article locked for a while; hopefully, protection is no longer necessary.'; } if (action == 'jssprotect') { document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=true; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=true; document.getElementsByTagName('option').selected=false; document.getElementById('mwProtect-reason').value = 'Heavy vandalism from multiple sources.'; } if (action == 'jsfprotect') { document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=true; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=false; document.getElementsByTagName('option').selected=true; document.getElementById('mwProtect-reason').value = 'Users engaging in edit warring.'; } } } //END addOnloadHook(autopdelist); function autopdelist() { if (document.title.indexOf('Editing ') == 0) { var action = ''; var target = ''; if (location.search) { var l = location.search.substring(1).split('&'); for (var i = 0; i < l.length; ++i) { var eq = l.indexOf('='); var name = l.substring(0, eq); if (name == 'fakeaction') action = l.substring(eq + 1); else if (name == 'faketarget') target = unescape(l.substring(eq + 1)).replace(/_/g, ' '); } } if (action == 'pdelist') { oldautoreplacetxt('* {{','*{{'); autoreplacetxt('\n\n','\n'); var undefined; var pagename = strip_namespace(target); pagename = unescape(pagename); var original = document.editform.wpTextbox1.value; document.editform.wpTextbox1.value = pagename; var username = document.editform.wpTextbox1.value.split("User:"); var usertalk = document.editform.wpTextbox1.value.split("User talk:"); var themovename = document.editform.wpTextbox1.value.split("Misplaced Pages:"); var themove = "*{{Non-article|Misplaced Pages|" + themovename + "}}"; var thepage = "*{{article|" + target + "}}"; var thepage2 = "* {{article|" + target.substr(0,1).toLowerCase + target.substring(1) + "}}"; var lapage = "*{{la|" + target + "}}"; var theuser = "*]"; var vandaltalk = "*{{vandal|" + usertalk + "}}"; document.editform.wpTextbox1.value = original; form = document.getElementById('bodyContent'); l = form.getElementsByTagName('input'); for (i = 0 ; i < l.length; i++) { if (l.name == 'wpMinoredit') {l.value = '1'; l.checked=true;} } if (document.editform.wpTextbox1.value.split(thepage) != undefined) { if (document.editform.wpTextbox1.value.split(thepage) != undefined) { var firsthalf = document.editform.wpTextbox1.value.split(thepage); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(thepage); splitpoint = document.editform.wpTextbox1.value.split("*{{"); document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) { secondhalf = original.split(thepage); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert("The page has been located and de-listed. The de-listed page had no protection summary or explanation."); } else { secondhalf = document.editform.wpTextbox1.value.split(thepage + splitpoint); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpoint + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } } } else if (document.editform.wpTextbox1.value.split(thepage2) != undefined) { if (document.editform.wpTextbox1.value.split(thepage2) != undefined) { var firsthalf = document.editform.wpTextbox1.value.split(thepage2); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(thepage2); splitpoint = document.editform.wpTextbox1.value.split("*{{"); document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) { secondhalf = original.split(thepage2); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert("The page has been located and de-listed. The de-listed page had no protection summary or explanation."); return; } else { secondhalf = document.editform.wpTextbox1.value.split(thepage2 + splitpoint); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpoint + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } } } else if (document.editform.wpTextbox1.value.split(themove) != undefined) { if (document.editform.wpTextbox1.value.split(themove) != undefined) { var firsthalf = document.editform.wpTextbox1.value.split(themove); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(themove); splitpoint = document.editform.wpTextbox1.value.split("*{{"); document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) { secondhalf = original.split(themove); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert("The page has been located and de-listed. The de-listed page had no protection summary or explanation."); } else { if (splitpoint.split("*" + " != undefined) { splitpointb = splitpoint.split("*" + "; secondhalf = document.editform.wpTextbox1.value.split(themove + splitpointb); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpointb + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } else { secondhalf = document.editform.wpTextbox1.value.split(themove + splitpoint); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpoint + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } } } } else if (document.editform.wpTextbox1.value.split(lapage) != undefined) { if (document.editform.wpTextbox1.value.split(lapage) != undefined) { var firsthalf = document.editform.wpTextbox1.value.split(lapage); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(lapage); splitpoint = document.editform.wpTextbox1.value.split("*{{"); document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) { secondhalf = original.split(lapage); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert("The page has been located and de-listed. The de-listed page had no protection summary or explanation."); } else { if (splitpoint.split("*" + " != undefined) { splitpointb = splitpoint.split("*" + "; secondhalf = document.editform.wpTextbox1.value.split(lapage + splitpointb); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpointb + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } else { secondhalf = document.editform.wpTextbox1.value.split(lapage + splitpoint); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpoint + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } } } } else if (document.editform.wpTextbox1.value.split(vandaltalk) != undefined) { if (document.editform.wpTextbox1.value.split(vandaltalk) != undefined) { var firsthalf = document.editform.wpTextbox1.value.split(vandaltalk); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(vandaltalk); splitpoint = document.editform.wpTextbox1.value.split("*" + "{{"); document.editform.wpTextbox1.value = original.split(splitpoint); var secondhalf = original.split(vandaltalk + splitpoint); document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) { secondhalf = document.editform.wpTextbox1.value.split(vandaltalk); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert("The page has been located and de-listed. The de-listed page had no protection summary or explanation."); return; } else { document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpoint + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } } } else if (document.editform.wpTextbox1.value.split(theuser) != undefined) { if (document.editform.wpTextbox1.value.split(theuser) != undefined) { var firsthalf = document.editform.wpTextbox1.value.split(theuser); document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.split(theuser); splitpoint = document.editform.wpTextbox1.value.split("*" + "; document.editform.wpTextbox1.value = original.split(splitpoint); var secondhalf = original.split(theuser + splitpoint); document.editform.wpTextbox1.value = original; if (splitpoint.length <= 3) { secondhalf = document.editform.wpTextbox1.value.split(theuser + splitpoint); document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert("The user's page has been located and de-listed. The de-listed page had no protection summary or explanation."); return; } else { document.editform.wpTextbox1.value = firsthalf + secondhalf; document.editform.wpSummary.value += "] unprotected; delisting."; alert('The page has been located and de-listed. The protection explanation:' + '\n' + '------------' + '\n' + splitpoint + '\n' + '------------' + '\n' + '...was also removed. Please read this summary; avoid clicking "save page" if necessary.'); return; } } } else { alert("Note: The page you unprotected was not found on the list and may never have been listed. However, check to make sure that this is not a glitch, such as the listed article being a redirect to the actual page or beind the newest entry, or inconsistant asterik usage. Move-protected articles tend to be listed inconsistantly. Also, some entries for non-articles are listed with templates that this tool does not look for." + "\n" + "------------" + "\n" + "Debuging Information: " + "vandaltalk=" + vandaltalk + " |username=" + username + " |username2=" + usertalk + " |target=" + target + " |thepage=" + thepage + " |thepage2=" + thepage2 + " |themove=" + themove + " |theuser=" + theuser); document.editform.wpSummary.value += "] unprotected; delisting."; return; document.editform.wpTextbox1.value = original; } } } } //END //RFPP tabs function rfppp() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":'''Fully protected''' due to ]. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page fully protected"; } function rfpps() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":'''Semi-protected''' due to heavy ]. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page semi-protected"; } function rfppm() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":'''Move-protected''' due to excessive renaming. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page move-protected"; } function rfppun() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":'''Un-protected.''' Its been protected for long enough. Hopefully things have calmed down since then. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: page un-protected"; } function rfppu() { var pro = prompt("A user already protected or un-protected (enter *p* or *u*)?") if (pro == 'p') { value = 'protected'; } else if (pro == 'u') { value = 'un-protected'; } else { alert("Error: Invalid input. Make sure that you are not actually including the aterisk symbols."); return; } var user = prompt("What user?") if (!user){return;} usera = user.replace(' ','_').replace(' ','_').replace(' ','_'); var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":Page already " + value + " by ]" + ". " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: already " + value + " by another user"; } function rfppru() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":The issues that started the ] have not yet been resolved and the edits also appear to be in ]. It is also too soon to assume that the editors have just left for good, so the page is better left protected for now. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: un-protection request denied"; } function rfppr() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":There is not enough recent activity to ] ] at this time. For now, be sure to use descriptive ] and discuss edits on ]. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: protection request denied"; } function rfpprv() { var f = document.editform, t = f.wpTextbox1; if (t.value.length > 0) t.value += '\n'; t.value +=":There is not enough recent activity to ] ] at this time. Just ] and revert any vandalism. " + "~" + "~" + "~" + "~"; f.wpSummary.value += "Response: protection request denied"; } //</nowiki></pre>