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 : ,
openTalkPageOnAutoRevert : false,
openAOLAnonTalkPage : false,
summaryAd : " using ]",
deletionSummaryAd : " using ]",
protectionSummaryAd : " using ]",
watchSpeedyPages : ,
watchProdPages : true,
openUserTalkPageOnSpeedyDelete : ,
watchRevertedPages : ,
markRevertedPagesAsMinor : ,
deleteTalkPageOnDelete : false,
watchWarnings : true,
markAIVReportAsMinor : true,
markSpeedyPagesAsMinor : false,
markProdPagesAsMinor : true,
confirmUsernameToAIV : true,
toolboxButtons : ,
showRollbackLinks :
};
//end twinkle
//<pre><nowiki>
function countedit() {
countuser = mw.config.get('wgTitle').split( '/' );
if( mw.config.get('wgNamespaceNumber') == '-1' && mw.config.get('wgTitle') == 'Contributions' )
countuser = document.getElementById( 'contentSub' ).getElementsByTagName( 'a' ).getAttribute('title').split(':');
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: {{fullurl:Wikipedia:Articles for deletion/Log/{{CURRENTYEAR}}_{{CURRENTMONTHNAME}}_{{CURRENTDAY}}|action=edit}}
var now = new Date(); var url = '';
var mn = ;
url += mw.config.get('wgServer') + mw.config.get('wgScript') + '?title=Wikipedia:Articles_for_deletion/Log/';
url += now.getUTCFullYear() + '_' + mn + '_' + now.getUTCDate();
mw.util.addPortletLink('p-tb', url, 'AFD/today', 'ca-afd', 'AFD for today');
})
//</nowiki></pre>
//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<articles.length;i++) {
var article = articles;
if(article.length > 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;
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) {
document.getElementById("wpMassDeleteSubmit").value = "Done (" + deleted + ")";
}
}
}
function massdeleteform() {
var bodyContent = (skin == "cologneblue" ? "article" : "bodyContent");
document.getElementsByTagName("h1").textContent = "Animum's mass-deletion tool";
document.title = "Animum's mass-deletion tool - Wikipedia, the free encyclopedia";
document.getElementById(bodyContent).innerHTML = '<h3 id="siteSub">From Wikipedia, the free encyclopedia</h3><br /><br />'
+ '<form id="wpMassDelete" name="wpMassDelete">'
+ '<b>If you abuse this tool, it\'s <i>your</i> fault, not mine.</b>'
+ '<br /><br />'
+ 'Pages to delete (one on each line, please):<br />'
+ '<textarea tabindex="1" accesskey="," name="wpMassDeletePages" id="wpMassDeletePages" rows="10" cols="80"></textarea>'
+ '<br /><br /><table style="background-color:transparent">'
+ '<tr><td>Common reasons:</td>'
+ '<td><select id="wpMassDeleteReasons">'
+ '<optgroup label="Other reason">'
+ '<option value="other">Other reason</option>'
+ '</optgroup>'
+ '<optgroup label="Criteria for speedy deletion">'
+ '<optgroup label="General criteria">'
+ '<option value="]: ]">G1: Patent nonsense</option>'
+ '<option value="]: Test page">G2: Test page</option>'
+ '<option value="]: Pure ], including the redirects created from the cleanup of page-move vandalism">G3: Vandalism</option>'
+ '<option value="]: Recreation of material previously deleted per an XfD">G4: Repost</option>'
+ '<option value="]: Page created by a ]">G5: Banned</option>'
+ '<option value="]: Non-controversial maintenance, including deleting a page to merge histories, or to make way for an uncontroversial move">G6: Maintenance</option>'
+ '<option value="]: Only one editor has made significant edits to this page, and he or she has blanked it or requested its deletion">G7: Author</option>'
+ '<option value="]: Talk page whose corresponding article does not exist">G8: Talkpage</option>'
+ '<option value="]: ]">G10: Attack page</option>'
+ '<option value="]: ]">G11: Advertising</option>'
+ '<option value="]: Blatant ] infringement">G12: Copyvio</option>'
+ '</optgroup>'
+ '<optgroup label="Articles">'
+ '<option value="]: Very short article providing little or no context">A1: No context</option>'
+ '<option value="]: Article written in a foreign language that exists on another Wikimedia project">A2: Foreign</option>'
+ '<option value="]: 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>'
+ '<option value="]: Properly transwikied elsewhere">A5: Transwiki</option>'
+ '<option value="]: Biographical article that did not assert the ] of its subject">A7: Non-notable person</option>'
+ '<option value="]: Article about a web site or other online forum that did not assert the ] of its subject">A7: Non-notable website</option>'
+ '<option value="]: Article about a company that did not assert the ] of its subject">A7: Non-notable corporation</option>'
+ '<option value="]: Article about a club or group that did not assert the significance of its subject">A7: Non-notable club</option>'
+ '<option value="]: Article about a band that did not assert the ] of its subject">A7: Non-notable band</option>'
+ '</optgroup>'
+ '<optgroup label="Redirects">'
+ '<option value="]: Redirect to non-existent page">R1: Non-existent</option>'
+ '<option value="]: Redirect to the \'Talk:\', \'User talk:\', or \'User:\' namespaces from the mainspace">R2: Cross-namespace</option>'
+ '<option value="]: Redirect based on an implausible typo">R3: Implausible typo</option>'
+ '</optgroup>'
+ '<optgroup label="Images and other media">'
+ '<option value="]: Exact copy of a preexisting image">I1: Copy</option>'
+ '<option value="]: Corrupt or empty image">I2: Corrupt or empty</option>'
+ '<option value="]: 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>'
+ '<option value="]: Image that has lacked sources or licensing information for more than seven days">I4: Unknown source</option>'
+ '<option value="]: Unfree image that has not been used in an article for more than seven days">I5: Unfree and unused</option>'
+ '<option value="]: No ] given for fair use for more than seven days">I6: No rationale</option>'
+ '<option value="]: Bad ] given for fair use and the uploader was notified more than 48 hours ago">I7: Bad fair use rationale</option>'
+ '<option value="]: Identical copy of this image exists on Wikimedia Commons">I8: On Commons</option>'
+ '<option value="]: Uploader claims that this image is under a free license, but obviously is not">I9: Image copyvio</option>'
+ '<option value="]: Image was neither image, sound, nor video, and has no foreseeable encyclopedic use">I10: Useless image</option>'
+ '<option value="]: Permission has not been verified within seven days of the uploader\'s notification">I11: No permission</option>'
+ '</optgroup>'
+ '<optgroup label="Categories">'
+ '<option value="]: Category has been unpopulated for at least 4 days">C1: Empty</option>'
+ '<option value="]: Eligible for ]">C2: Speedy rename</option>'
+ '<option value="]: Category was populated solely by a template, and that template has been deleted per deletion policy">C3: Populating template was deleted</option>'
+ '</optgroup>'
+ '<optgroup label="User namespace">'
+ '<option value="]: User or user subpage of which the corresponding user requests deletion">U1: User requests deletion</option>'
+ '<option value="]: Userpage of a non-existent user">U2: Non-existent user</option>'
+ '<option value="]: Userpage that is primarily a gallery of fair-use images">U3: Fair use gallery</option>'
+ '</optgroup>'
+ '<optgroup label="Templates">'
+ '<option value="]: Divisive or inflammatory template">T1: Inflammatory</option>'
+ '<option value="]: Blatant misrepresentation of established policy">T2: Blatant misrepresentation</option>'
+ '<option value="]: 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</option>'
+ '</optgroup>'
+ '<optgroup label="Portals">'
+ '<option value="]: Portal that would be subject to deletion as an article">P2: Deletion as article</option>'
+ '<option value="]: Underpopulated portal">P2: Underpopulated</option>'
+ '</optgroup>'
+ '</optgroup>'
+ '</select></td></tr>'
+ '<tr><td>Other reason:</td>'
+ '<td><input type="text" id="wpMassDeleteReason" name="wpMassDeleteReason" maxlength="255" /></td></tr>'
+ '<tr><td><input type="button" id="wpMassDeleteSubmit" name="wpMassDeleteSubmit" value="Delete" onclick="doMassDelete()" /></td>'
+ '</form>';
}
$(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) {
var protection = info.protection;
protlevels = protection.level;
protlevels = 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("<fieldset>");
if(deletedrevs) {
deletedrevs2 = deletedrevs.split("<ul>").split("</ul>").split("<li>");
for(x=1;x<deletedrevs2.length;x++) {
if(deletedrevs2.split("</li>").split('name="ts')) {
link += deletedrevs2.split("</li>").split('<input name="ts').split('"') + "|";
}
}
}
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").href.split("?title=").split("&");
var oldid = document.getElementById("mw-diff-ntitle1").getElementsByTagName("a").href.split("oldid=").split("&");
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.timestamp.replace(//g, "");
var link = makeLink("#FF7133", "javascript:deleteRevision(\"" + article + "\", '" + timestamp + "')", "delete revision", true);
getElementsByClassName(document, "td", "diff-ntitle").insertBefore(link, document.getElementById("mw-diff-ntitle4"));
}
}
}
if(mw.config.get('wgPageName') == "Special:Undelete") {
if(UrlParameters) {
var inputs = document.getElementsByTagName("input");
for(i=0;i<inputs.length;i++) {
var input = inputs;
if(input.type == "checkbox") {
input.checked = true;
}
var norestore_timestamps = UrlParameters.split("|");
for(n=0;n<norestore_timestamps.length;n++) {
if(input.name.indexOf("ts" + norestore_timestamps) != -1 || input.checked == false) {
input.checked = false;
}
}
}
document.getElementById("wpComment").value = "Expunging revision from page history.";
document.getElementById("mw-undelete-submit").click();
}
if(UrlParameters == "submit" && document.cookie.search(/protectionparams/) != -1 && document.cookie.search(/protectiontitles/) != -1) {
var title_ = document.cookie.split("protectiontitles=").split(";");
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=").split(";") + "&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 += "<br /><b>Original protection levels have been restored.</b>";
}
}
}
}
});
//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 == "move" || location.href.substring(location.href.indexOf("title=") + 6).split("/") == "move" || location.href.substring(location.href.indexOf("https://wiki95.com/en/") + 6).split("?").split("/") == "move") && (UrlParameters || 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;
if (matches = link.href.match(re)) {
if (matches == 'mail') continue;
if (matches == '/') matches = 'https://wiki95.com/en/';
var n = 'https://secure.wikimedia.org/wikipedia/' + matches + matches;
link.href = n; link.title = n;
if (link.innerHTML.match(re)) link.innerHTML = n;
}
}
});
importScript('User:Ale_jrb/Scripts/csdhelper.js'); //]
importScript('User:Ale_jrb/Scripts/userhist.js'); //]
hookEvent ( 'load', function () { if ( typeof Ethnio !== 'undefined' ) { Ethnio.set_cookie (); } });