User:Seresin/monobook.js

importScript('User:AzaToth/morebits.js'); importScript('User:AzaToth/twinklefluff.js'); importScript('User:AzaToth/twinklewarn.js'); importScript('User:AzaToth/twinkleprod.js'); importScript('User:AzaToth/twinklexfd.js'); importScript('User:AzaToth/twinkledeprod.js'); importScript('User:AzaToth/twinklediff.js'); importScript('User:AzaToth/twinkleunlink.js');

TwinkleConfig = { revertMaxRevisions             :       50, userTalkPageMode               :       'tab', showSharedIPNotice             :       true, openTalkPage                   :       [ 'agf', 'norm', 'vand' ], openTalkPageOnAutoRevert       :       false, openAOLAnonTalkPage            :       false, summaryAd                      :       " using TW", deletionSummaryAd              :       " using TW", protectionSummaryAd            :       " using TW", watchSpeedyPages               :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], watchProdPages                 :       true, openUserTalkPageOnSpeedyDelete :       [ 'g1', 'g2', 'g10', 'g11', 'g12', 'a1', 'a7', 'i3', 'i4', 'i5', 'i6', 'i7', 'u3', 't1' ], watchRevertedPages             :       [ 'agf', 'norm', 'vand', 'torev' ], markRevertedPagesAsMinor       :       [ 'agf', 'norm', 'vand', 'torev' ], deleteTalkPageOnDelete         :       false, watchWarnings                  :       true, markAIVReportAsMinor           :       true, markSpeedyPagesAsMinor         :       false, markProdPagesAsMinor           :       true, confirmUsernameToAIV           :       true, toolboxButtons                 :       [ ], showRollbackLinks : [ 'diff', 'contribs' ] };

//end twinkle

// function countedit { countuser = mw.config.get('wgTitle').split( '/' )[0]; if( mw.config.get('wgNamespaceNumber') == '-1' && mw.config.get('wgTitle') == 'Contributions' ) countuser = document.getElementById( 'contentSub' ).getElementsByTagName( 'a' )[0].getAttribute('title').split(':')[1]; alert("Please remember that Editcountitis can be fatal and that WikiProject \n User Scripts can not be held responsible :p"); location.href = 'http://tools.wikimedia.de/~interiot/cgi-bin/Tool1/wannabe_kate?username=' + countuser + '&site=en.wikipedia.org' } function addcountedit { if( mw.config.get('wgNamespaceNumber') == '2' || mw.config.get('wgNamespaceNumber') == '3' ) { mw.util.addPortletLink('p-cactions', 'javascript:countedit', "edit count"); } if( mw.config.get('wgNamespaceNumber') == '-1' && mw.config.get('wgTitle') == 'Contributions' ) { mw.util.addPortletLink('p-cactions', 'javascript:countedit', "edit count"); } } $(addcountedit); $(function { //add to tb:   var now = new Date; var url = '';  var mn = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];  url += mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Wikipedia:Articles_for_deletion/Log/';  url += now.getUTCFullYear + '_' + mn[now.getUTCMonth] + '_' + now.getUTCDate;  mw.util.addPortletLink('p-tb', url, 'AFD/today', 'ca-afd', 'AFD for today'); })

//

//use search start—————————

if(mw.config.get('wgNamespaceNumber')==2||wgNamespaceNumber==3) addOnloadHook(function { var n = mw.config.get('wgTitle');  if(n.indexOf('/')!=-1)  n = n.substring(0,mw.config.get('wgTitle').indexOf('/'))  mw.util.addPortletLink('p-tb', mw.config.get('wgScript') + '?title=Special:Listusers&username=' + n,'User Search','t-usersearch','Special:Listusers&username=' + n); })

//user search end—————————

importScript('User:Gracenotes/rollback.js');

importScript('User:Mr.Z-man/closeAFD.js');

//mass delete start———————————— //s function doMassDelete { document.getElementById("wpMassDeleteSubmit").disabled = true; var articles = document.getElementById("wpMassDeletePages").value.split("\n"); for(i=0;i 0) { var req = new XMLHttpRequest; req.open("GET", mw.config.get('wgScriptPath') + "/api.php?format=json&action=query&prop=info&intoken=delete&titles=" + article, false); req.send(null); var response = eval("(" + req.responseText + ")").query.pages; for(var index in response) { var info = response[index]; var deletetoken = info.deletetoken; var postdata = "wpReason=" + (document.getElementById("wpMassDeleteReasons").value == "other" ? document.getElementById("wpMassDeleteReason").value : document.getElementById("wpMassDeleteReasons").value) + "&wpEditToken=" + encodeURIComponent(deletetoken); var req = new XMLHttpRequest; req.open("POST", mw.config.get('wgScript') + "?title=" + article + "&action=delete", false); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.setRequestHeader("Content-length", postdata.length); req.send(postdata); var deleted = parseInt(parseInt(i)+1); document.getElementById("wpMassDeleteSubmit").value = "(" + deleted + ")"; }       }        if(!articles[i+1]) { document.getElementById("wpMassDeleteSubmit").value = "Done (" + deleted + ")"; }   } } function massdeleteform { var bodyContent = (skin == "cologneblue" ? "article" : "bodyContent"); document.getElementsByTagName("h1")[0].textContent = "Animum's mass-deletion tool"; document.title = "Animum's mass-deletion tool - Wikipedia, the free encyclopedia"; document.getElementById(bodyContent).innerHTML = 'From Wikipedia, the free encyclopedia

'       + '' + 'If you abuse this tool, it\'s your fault, not mine.' + '

'           + 'Pages to delete (one on each line, please): '               + ' ' + '

'               + '  Common reasons: ' + ' ' + '' + ' Other reason ' + ' '                       + '' + '' + 'G1: Patent nonsense ' + 'G2: Test page ' + 'G3: Vandalism ' + 'G4: Repost ' + 'G5: Banned ' + 'G6: Maintenance ' + 'G7: Author ' + 'G8: Talkpage ' + '<option value="Criterion G10: Attack page">G10: Attack page ' + '<option value="Criterion G11: Blatant advertising">G11: Advertising ' + '<option value="Criterion G12: Blatant copyright infringement">G12: Copyvio ' + ' '                           + '<optgroup label="Articles">' + '<option value="Criterion A1: Very short article providing little or no context">A1: No context ' + '<option value="Criterion A2: Article written in a foreign language that exists on another Wikimedia project">A2: Foreign ' + '<option value="Criterion A3: No content except possibly external links, a \'See also\' section, category tags, or attempts to correspond with the article\'s subject">A3: No content ' + '<option value="Criterion A5: Properly transwikied elsewhere">A5: Transwiki ' + '<option value="Criterion A7: Biographical article that did not assert the significance of its subject">A7: Non-notable person ' + '<option value="Criterion A7: Article about a web site or other online forum that did not assert the significance of its subject">A7: Non-notable website ' + '<option value="Criterion A7: Article about a company that did not assert the significance of its subject">A7: Non-notable corporation ' + '<option value="Criterion A7: Article about a club or group that did not assert the significance of its subject">A7: Non-notable club ' + '<option value="Criterion A7: Article about a band that did not assert the significance of its subject">A7: Non-notable band ' + ' '                           + '<optgroup label="Redirects">' + '<option value="Criterion R1: Redirect to non-existent page">R1: Non-existent ' + '<option value="Criterion R2: Redirect to the \'Talk:\', \'User talk:\', or \'User:\' namespaces from the mainspace">R2: Cross-namespace ' + '<option value="Criterion R3: Redirect based on an implausible typo">R3: Implausible typo ' + ' '                           + '<optgroup label="Images and other media">' + '<option value="Criterion I1: Exact copy of a preexisting image">I1: Copy ' + '<option value="Criterion I2: Corrupt or empty image">I2: Corrupt or empty ' + '<option value="Criterion I3: Licensed for non-commercial use only, non-derivative use or used with permission, uploaded on or after May 19, 2005, and does not meet the non-free content criteria">I3: Non-commercial ' + '<option value="Criterion I4: Image that has lacked sources or licensing information for more than seven days">I4: Unknown source ' + '<option value="Criterion I5: Unfree image that has not been used in an article for more than seven days">I5: Unfree and unused ' + '<option value="Criterion I6: No justification given for fair use for more than seven days">I6: No rationale ' + '<option value="Criterion I7: Bad justification given for fair use and the uploader was notified more than 48 hours ago">I7: Bad fair use rationale ' + '<option value="Criterion I8: Identical copy of this image exists on Wikimedia Commons">I8: On Commons ' + '<option value="Criterion I9: Uploader claims that this image is under a free license, but obviously is not">I9: Image copyvio ' + '<option value="Criterion I10: Image was neither image, sound, nor video, and has no foreseeable encyclopedic use">I10: Useless image ' + '<option value="Criterion I11: Permission has not been verified within seven days of the uploader\'s notification">I11: No permission ' + ' '                           + '<optgroup label="Categories">' + '<option value="Criterion C1: Category has been unpopulated for at least 4 days">C1: Empty ' + '<option value="Criterion C2: Eligible for speedy renaming">C2: Speedy rename ' + '<option value="Criterion C3: Category was populated solely by a template, and that template has been deleted per deletion policy">C3: Populating template was deleted ' + ' '                           + '<optgroup label="User namespace">' + '<option value="Criterion U1: User or user subpage of which the corresponding user requests deletion">U1: User requests deletion ' + '<option value="Criterion U2: Userpage of a non-existent user">U2: Non-existent user ' + '<option value="Criterion U3: Userpage that is primarily a gallery of fair-use images">U3: Fair use gallery ' + ' '                           + '<optgroup label="Templates">' + '<option value="Criterion T1: Divisive or inflammatory template">T1: Inflammatory ' + '<option value="Criterion T2: Blatant misrepresentation of established policy">T2: Blatant misrepresentation ' + '<option value="Criterion T3: Template was not employed in any useful fashion, either a substantial duplicate or a hardcoded instance of a preexisting template, and was tagged for seven days">T3: Duplicate ' + ' '                           + '<optgroup label="Portals">' + '<option value="Criterion P1: Portal that would be subject to deletion as an article">P2: Deletion as article ' + '<option value="Criterion P2: Underpopulated portal">P2: Underpopulated ' + ' '                       + ' '                    + '  '            + '  Other reason: ' + ' <input type="text" id="wpMassDeleteReason" name="wpMassDeleteReason" maxlength="255" /> ' + ' <input type="button" id="wpMassDeleteSubmit" name="wpMassDeleteSubmit" value="Delete" onclick="doMassDelete" /> ' + ' '; } $(function {   if(mw.config.get('wgNamespaceNumber') == -1 && (mw.config.get('wgPageName') == "Special:Massdelete" || mw.config.get('wgPageName') == "Special:MassDelete") && RegExp("sysop", "i").test(mw.config.get('wgUserGroups'))) {        massdeleteform;        document.getElementById("wpMassDeleteReasons").onchange = function {            document.getElementById("wpMassDeleteReason").disabled = (document.getElementById("wpMassDeleteReasons").value != "other"); //If the "Other reason" option isn't selected, disable the "Other reason" input box.        }    } }); //endmassdelete————————— //startdeleterevision importScript('User:Animum/urlparameters.js'); importScript('User:Animum/formatresponse.js'); function makeLink(color, link, text, br) { var span = document.createElement("span"); span.id = "delete-revision"; var b = document.createElement("b"); b.appendChild(document.createTextNode(" [")); span.appendChild(b); var na = document.createElement("a"); na.href = link; var span2 = document.createElement("span"); span2.style.color = color; span2.style.fontWeight = "bold"; span2.appendChild(document.createTextNode(text)); na.appendChild(span2); span.appendChild(na); var b2 = document.createElement("b"); b2.appendChild(document.createTextNode("]")); span.appendChild(b2); return span; } function deleteRevision(title_, timestamp) { var req = sajax_init_object; req.open("GET", mw.config.get('wgScriptPath') + "/api.php?format=json&action=query&prop=info&inprop=protection&titles=" + title_, false); req.send(null); var info = formatResponse(eval("(" + req.responseText + ")")); var protlevels = {}; if(info.protection) { for(a=0;a<2;a++) { if(info.protection[a]) { var protection = info.protection[a]; protlevels[protection.type] = protection.level; protlevels["expiry"] = protection.expiry; }       }    }    var addition = new Date; addition = new Date(addition.getTime + 1000*25); if(protlevels.edit || protlevels.move) { document.cookie = "protectionparams=" + (protlevels.edit ? "mwProtect-level-edit=" + protlevels.edit : "") + (protlevels.move ? (protlevels.edit ? "&" : "") + "mwProtect-level-move=" + protlevels.move : "") + "&mwProtect-reason=" + encodeURIComponent("Restoring original protection levels") + (protlevels.expiry == "infinity" ? "" : "&mwProtect-expiry=" + protlevels.expiry) + "; path=/; expires=" + addition.toGMTString + ";"; }   document.cookie = "protectiontitles=" + title_ + "; path=/; expiry=" + addition.toGMTString + ";"; var link = mw.config.get('wgScript') + "?title=Special:Undelete/" + title_ + "&page=" + title_ + "&norestore="; var req = sajax_init_object; req.open("GET", mw.config.get('wgScript') + "?title=Special:Undelete/" + title_, false); req.send(null); var deletedrevs = req.responseText.split(" ")[1]; if(deletedrevs) { deletedrevs2 = deletedrevs.split("<ul>")[1].split("</ul>")[0].split("<li>"); for(x=1;x<deletedrevs2.length;x++) { if(deletedrevs2[x].split("</li>")[0].split('name="ts')[1]) {               link += deletedrevs2[x].split("</li>")[0].split('<input name="ts')[1].split('"')[0] + "|";            }        }    }    var req = sajax_init_object;    req.open("GET", mw.config.get('wgScriptPath') + "/api.php?format=json&action=query&prop=info&intoken=delete&titles=" + title_, false);    req.send(null);    var deletetoken = formatResponse(eval("(" + req.responseText + ")")).deletetoken;    var reason = prompt("Optional reason (leave blank for default):");    var postdata = "wpReason=" + (reason.length > 0 ? encodeURIComponent(reason) : encodeURIComponent("Deleting to expunge a revision from this page's history."))                 + "&wpEditToken=" + encodeURIComponent(deletetoken);    var req = sajax_init_object;    req.open("POST", mw.config.get('wgScript') + "?title=" + title_ + "&action=delete", true); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.setRequestHeader("Content-length", postdata.length); req.send(postdata); req.onreadystatechange = function { if(req.status == 200 && req.readyState == 4) { location.href = link + timestamp; }   } } $(function {    if(/[?&]diff=/.test(location.href)) {        if(document.getElementById("mw-diff-ntitle1")) {            var article = document.getElementById("mw-diff-ntitle1").getElementsByTagName("a")[0].href.split("?title=")[1].split("&")[0];            var oldid = document.getElementById("mw-diff-ntitle1").getElementsByTagName("a")[0].href.split("oldid=")[1].split("&")[0];            var req = sajax_init_object;            req.open("GET", mw.config.get('wgScriptPath') + "/api.php?format=json&action=query&prop=revisions&rvlimit=2&rvstartid=" + oldid + "&titles=" + article, false);            req.send(null);            var info = formatResponse(eval("(" + req.responseText + ")"));            if(info.revisions) {                var timestamp = info.revisions[0].timestamp.replace(/[^0-9]/g, "");                var link = makeLink("#FF7133", "javascript:deleteRevision(\"" + article + "\", '" + timestamp + "')", "delete revision", true); getElementsByClassName(document, "td", "diff-ntitle")[0].insertBefore(link, document.getElementById("mw-diff-ntitle4")); }       }    }    if(mw.config.get('wgPageName') == "Special:Undelete") { if(UrlParameters["norestore"]) { var inputs = document.getElementsByTagName("input"); for(i=0;i<inputs.length;i++) { var input = inputs[i]; if(input.type == "checkbox") { input.checked = true; }               var norestore_timestamps = UrlParameters["norestore"].split("|"); for(n=0;n<norestore_timestamps.length;n++) { if(input.name.indexOf("ts" + norestore_timestamps[n]) != -1 || input.checked == false) { input.checked = false; }               }            }            document.getElementById("wpComment").value = "Expunging revision from page history."; document.getElementById("mw-undelete-submit").click; }       if(UrlParameters["action"] == "submit" && document.cookie.search(/protectionparams/) != -1 && document.cookie.search(/protectiontitles/) != -1) { var title_ = document.cookie.split("protectiontitles=")[1].split(";")[0]; var req = sajax_init_object; req.open("GET", mw.config.get('wgScriptPath') + "/api.php?format=json&action=query&prop=info&intoken=protect&titles=" + title_, false); req.send(null); var info = formatResponse(eval("(" + req.responseText + ")")); var postdata = document.cookie.split("protectionparams=")[1].split(";")[0] + "&wpEditToken=" + encodeURIComponent(info.protecttoken) + "&wpProtectReasonSelection=other"; var req = sajax_init_object; req.open("POST", mw.config.get('wgScript') + "?title=" + title_ + "&action=protect", true); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.setRequestHeader("Content-length", postdata.length); req.send(postdata); req.onreadystatechange = function { if(req.status == 200 && req.readyState == 4) { document.getElementById("contentSub").innerHTML += " Original protection levels have been restored."; }           }        }    } }); //enddeleterevision————————— //startrevertmove————————— importScript('User:Animum/urlparameters.js'); importScript('User:Animum/formatresponse.js'); importScript('User:Animum/moveRV-movefunc.js'); function zeroPad(str) {    return ("0" + str).slice(-2); } var isSysop = /sysop/.test(mw.config.get('wgUserGroups')); function doMoveRV {    var domove = confirm("All of the moves listed on this page will be reverted" + (isSysop ? ", and the resulting redirects will be deleted" : "") + ".\n\nClick \"OK\" to proceed or \"Cancel\" to abort.");    if(domove) {        revertmoves; //Function contained in moveRV-movefunc.js    } else {        return;    } } $(function { if(mw.config.get('wgNamespaceNumber') == -1 && mw.config.get('wgCanonicalSpecialPageName') == "Log" && (UrlParameters["type"] == "move" || location.href.substring(location.href.indexOf("title=") + 6).split("/")[1] == "move" || location.href.substring(location.href.indexOf("/wiki/") + 6).split("?")[0].split("/")[1] == "move") && (UrlParameters["user"] || location.href.substring(location.href.indexOf("user=") + 5))) { mw.util.addPortletLink("p-cactions", "javascript:doMoveRV", "pagemove", "ca-pagemove"); } }); //endrevert //startsecurelink $(function { if (mw.config.get('wgServer') != 'https://secure.wikimedia.org') return; var re = /^http\:\/\/(.*?)\.wikipedia\.org(\/.*?)$/; var links = document.getElementsByTagName('a'); for (var i = links.length; i--;) { var link = links[i]; if (matches = link.href.match(re)) { if (matches[1] == 'mail') continue; if (matches[2] == '/') matches[2] = '/wiki/'; var n = 'https://secure.wikimedia.org/wikipedia/' + matches[1] + matches[2]; link.href = n; link.title = n;			if (link.innerHTML.match(re)) link.innerHTML = n;		} } });

importScript('User:Ale_jrb/Scripts/csdhelper.js'); //User:Ale_jrb/Scripts

importScript('User:Ale_jrb/Scripts/userhist.js'); //User:Ale_jrb/Scripts

hookEvent ( 'load', function { if ( typeof Ethnio !== 'undefined' ) { Ethnio.set_cookie ; } });