User:Animum/derhexer.js
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. In Internet Explorer and Firefox, hold down the Ctrl key and click the Refresh or Reload button. Opera users have to clear their caches through Tools→Preferences, see the instructions for Opera. Konqueror and Safari users can just click the Reload button.
// <pre><nowiki> Based on [[User:DerHexer/monobook.js]] // get URL parameters (used for page type variables) var UrlParameters = new Array (); readparams(); function readparams() { var asReadInUrlParameters; var asReadInUrlParameter; // Get URL parameters asReadInUrlParameters = location.search.substring(1, location.search.length).split("&"); for (i = 0; i < asReadInUrlParameters.length; i++) { asReadInUrlParameter = asReadInUrlParameters[i].split("="); UrlParameters[decodeURIComponent(asReadInUrlParameter[0])] = decodeURIComponent(asReadInUrlParameter[1]); } } function fillActionPage() { if (UrlParameters["action"] == "delete") { if ((document.getElementsByTagName("h1")[0].childNodes[0].nodeValue == 'Action complete') || (document.getElementsByTagName("h1")[0].childNodes[0].nodeValue == 'Internal error')) { window.close(); } } if (UrlParameters["deletereason"] > "") { if (UrlParameters["deletereason"] != 'undefined') { if (wgCanonicalNamespace != "Image") { document.getElementById("deleteconfirm").wpReason.value = UrlParameters["deletereason"]; } else { document.wpReason.value = UrlParameters["deletereason"]; } } window.setTimeout(function() { document.getElementById("deleteconfirm").wpConfirmB.click(); }, 100); } if (UrlParameters["blockreason"] > "" && UrlParameters["blockduration"] > "") { document.forms["blockip"].wpBlockReason.value = UrlParameters["blockreason"]; if (UrlParameters["blockduration"].search(/[^\d]/) == -1) { document.forms["blockip"].wpBlockOther.value = UrlParameters["blockduration"] + " hours"; var blocktime = UrlParameters["blockduration"] + " hours"; } else { document.forms["blockip"].wpBlockOther.value = UrlParameters["blockduration"]; var blocktime = UrlParameters["blockduration"]; } var isBlocked = UrlParameters["title"].replace(/Special:Blockip\//, ''); if (UrlParameters["blockduration"] == 'indefinite') { if (UrlParameters["blockreason"] != 'name') { if (UrlParameters["blockreason"] != '\{\{uw-ublock\}\}') { document.forms["blockip"].wpEmailBan.checked = true; document.forms["blockip"].wpCreateAccount.checked = true; document.forms["blockip"].wpEnableAutoblock.checked = true; } else { document.forms["blockip"].wpCreateAccount.checked = false; document.forms["blockip"].wpEnableAutoblock.checked = false; document.forms["blockip"].wpEmailBan.checked = false; } } } else { document.forms["blockip"].wpEmailBan.checked = true; document.forms["blockip"].wpCreateAccount.checked = true; document.forms["blockip"].wpEnableAutoblock.checked = true; } } if (UrlParameters["protectreason"] > "" && UrlParameters["protectduration"] > "" && UrlParameters["protecttype"] > "") { document.getElementById("expires").value = UrlParameters["protectduration"]; document.getElementById("mwProtect-reason").value = UrlParameters["protectreason"]; protectLevelsUpdate(this); if (UrlParameters["anotherprotecttype"] != '') { document.getElementById("mwProtect-level-move").selectedIndex = UrlParameters["anotherprotecttype"]; } else { document.getElementById("mwProtect-level-move").selectedIndex = UrlParameters["protecttype"]; } document.getElementById("mwProtect-level-edit").selectedIndex = UrlParameters["protecttype"]; window.setTimeout(function() { document.getElementById("mw-Protect-submit").click(); }, 100); } if ( ( (UrlParameters["title"] == 'Special:Log') && (UrlParameters["type"] == 'newusers') ) || (location.href.substring(location.href.indexOf("/wiki/")).search(/Special\:Log\/newusers/) != -1) ) { if ( (UrlParameters["limit"] < 51) || (document.body.getElementsByTagName("p")[1].childNodes[0].nodeValue.match(/\d+/) < 51) ) { var as = document.body.getElementsByTagName("ul")[0].getElementsByTagName("a"); for (i=0; i < as.length; i++) { if (as[i].childNodes[0].nodeValue == "block") { var newlink = document.createElement('a'); newlink.setAttribute('href', 'http://en.wikipedia.org/w/index.php?title=Special:Blockip/' + as[i].title.replace(/Special:Blockip\//, '') + '&blockreason=name&blockduration=infinite'); var EditTextNode = document.createTextNode("fastblock"); newlink.appendChild(EditTextNode); as[i].parentNode.insertBefore( newlink, as[i].nextSibling ); as[i].parentNode.insertBefore( document.createTextNode(' | '), as[i].nextSibling ); } } } } if (UrlParameters["title"] == 'Category:All_images_with_the_same_name_on_Wikimedia_Commons') { var as = document.getElementsByTagName("table")[1].getElementsByTagName("a"); for (i=0; i<as.length; i++) { as[i].href = "http://en.wikipedia.org/w/index.php?title=" + as[i].href.replace(/http\:\/\/en\.wikipedia\.org\/wiki\//, '') + "&opencommons=1"; } } if (UrlParameters["opencommons"] > "") { var uri = "http://commons.wikimedia.org/w/index.php?title=" + wgPageName; window.open(uri); } if (UrlParameters["diff"] > "") { function searchRollbackLink() { var tds = document.getElementsByTagName("td"); for (var i=0; i<tds.length; i++) { var td = tds[i]; if (td.className != "diff-ntitle") continue; var as = td.getElementsByTagName("a"); for (var j=0; j<as.length; j++) { var a = as[j]; if (!/.*action=rollback.*/(a.href)) continue; var newlink = document.createElement('a'); a.setAttribute('accesskey', "s"); newlink.setAttribute('href', a.href); var EditTextNode = document.createTextNode("normal rollback"); newlink.appendChild(EditTextNode); as[j].parentNode.insertBefore( newlink, as[j].nextSibling ); as[j].parentNode.insertBefore( document.createTextNode(' | '), as[j].nextSibling ); return a; } } return tds; } function RollAndSpam(rolluri) { location.href = rolluri; var backrolled = rolluri.split("from=")[1].split("&token=")[0]; var vandalizedpage = wgPageName; var uri = "http://en.wikipedia.org/w/index.php?title=User talk:" + backrolled + "&vandalizedpage=" + vandalizedpage + "&action=edit&spam=1"; window.setTimeout(function() { location.href = uri; }, 500); } if (wgUserName == "DerHexer" || wgUserName == "Animum") { var revlink = searchRollbackLink(); revlink.onclick = function() { RollAndSpam(revlink.href); return false; } } } if ( (UrlParameters["spam"] > "") && (UrlParameters["vandalizedpage"] > "") ) { document.editform.wpMinoredit.checked=true; var splitted = document.forms["editform"].wpTextbox1.value.split("<!--"); var lastsplitted = splitted[splitted.length-1]; var now = new Date(); var actual_time = now.getTime(); var last_time = lastsplitted.match(/([\:\d]+)\, (\d+) ([^\d]+) (\d+)/); var last_timestamp = Date.parse(RegExp.$2 + " " + RegExp.$3 + " " + RegExp.$4 + " " + RegExp.$1 + ":00 GMT"); var difftime = last_timestamp + 86400000 - actual_time; var matchedtemplate = lastsplitted.match(/uw\-([^\d]*)(\d)/); var matchedtemplatename = RegExp.$1; var matchednumber = RegExp.$2; var matchedtemplate2 = lastsplitted.match(/Template\:Test(\d)/); var matchednumber2 = RegExp.$1; if (lastsplitted.search(/Uw\-Blank(\d)/) != -1) { var matchednumber = RegExp.$1; var matchedtemplatename = 'vandalism'; } else if (lastsplitted.search(/Uw\-Blank[^\d]/) != -1) { var matchednumber = 1; var matchedtemplatename = 'vandalism'; } if ((lastsplitted.search(/Uw\-bv/) != -1) || (lastsplitted.search(/Blatantvandal/) != -1) || (lastsplitted.search(/uw\-\(whatsoever\)/))) { var matchednumber = 4; var matchedtemplatename = 'vandalism'; } if ((!matchedtemplatename) || (lastsplitted.search(/cluebotwarning(\d)/)) || (matchedtemplatename == 'cluebotwarning') || (matchedtemplatename == 'block') || (difftime < 0) || (matchedtemplatename.search(/\d/) != -1) || (document.forms["editform"].wpTextbox1.value.length == "0") || (window.location.href.indexOf("&vandalizedpage=User_talk:") != -1)) { var matchedtemplatename = 'vandalism'; var matchednumber = 2; } if ((document.forms["editform"].wpTextbox1.value.length == "0") || (!last_time)) { document.editform.wpSummary.value = "Caution: " + matchedtemplatename + " on \[\[" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\]\]"; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\{\{subst\:uw-" + matchedtemplatename + "2\|" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\|subst\=subst\:\}\} " + usersignature; } else { if (difftime < 0) { document.editform.wpSummary.value = "Caution: " + matchedtemplatename + " on \[\[" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\]\]"; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst\:uw-" + matchedtemplatename + "2\|" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\|subst\=subst\:\}\} " + usersignature; } else { if ((matchednumber == 4) || (matchednumber2 == 4)) { if (wgTitle.match(/\d+\.\d+\.\d+\.\d+/)) { function newRequest() { try { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else { return new ActiveXObject("MSXML2.XMLHTTP"); } } catch (e) { return false; } } var req; if (req = newRequest()) { var text = "/w/api.php?format=xml&action=query&list=logevents&letype=block&letitle=User:" + wgTitle; req.open("GET", text, false); req.send(""); var blocks = req.responseXML.getElementsByTagName("block"); if (blocks.length > 0) { if (blocks[0].getAttribute('duration').search(/\./) == -1) { var duration = blocks[0].getAttribute('duration'); } else { var duration = "12 hours"; } } else { var duration = "12 hours"; } } if (duration.search(/(\d+) (\w+)/) != -1) { var newblockdurationnumber = 2 * RegExp.$1; var lastblockdurationname = RegExp.$2; if (lastblockdurationname.search(/s\b/) != -1) { var newblockdurationname = lastblockdurationname; } else { var newblockdurationname = lastblockdurationname + "s"; } var blockurl = "http://en.wikipedia.org/w/index.php?title=Special:Blockip/" + wgTitle + "&blockduration=" + newblockdurationnumber + "%20" + newblockdurationname + "&blockreason=%5B%5BWikipedia:Vandalism%7CVandalism%5D%5D"; } else { var blockurl = "http://en.wikipedia.org/w/index.php?title=Special:Blockip/" + wgTitle; } } else { var blockurl = "http://en.wikipedia.org/w/index.php?title=Special:Blockip/" + wgTitle + "&blockduration=infinite&blockreason=%5B%5BWikipedia:Vandalism%7CVandalism%5D%5D-only%20account"; } window.setTimeout(function() { location.href = blockurl; }, 1000); } else { document.editform.wpSummary.value = "Final warning: " + matchedtemplatename + " on \[\[" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\]\]"; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst\:uw-" + matchedtemplatename + "4\|" + UrlParameters["vandalizedpage"].replace(/\_/g, ' ') + "\|subst\=subst\:\}\} " + usersignature; } } } } if (UrlParameters["addtemplate"] > '') { document.editform.wpMinoredit.checked=true; if (UrlParameters["addtemplate"] == 1) { document.editform.wpSummary.value = "You have been temporarily blocked."; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst\:uw-block1\|time=" + UrlParameters["blockduration"] + "\|reason\=\[\[Wikipedia:Vandalism\|vandalism\]\]\|subst\=subst\:\}\}"; } else if (UrlParameters["addtemplate"] == 2) { document.editform.wpSummary.value = "\{\{indefblockeduser\}\}"; document.forms["editform"].wpTextbox1.value = "\{\{indefblockeduser\}\}"; } else if (UrlParameters["addtemplate"] == 3) { document.editform.wpSummary.value = "You have been blocked for violation of the \[\[WP\:U\|Username policy\]\]."; document.forms["editform"].wpTextbox1.value = document.forms["editform"].wpTextbox1.value + "\n\n\{\{subst:uw-ublock\|subst\=subst\:\|sig\=y}\}"; } document.editform.wpSave.click(); window.setTimeout(function() { window.close(); }, 1000); } if (wgUserName == "DerHexer") { if (UrlParameters["title"] == "User:DerHexer/redirects" && UrlParameters["action"] == "edit") { if (UrlParameters["number"]) { var namespace = new Array (); namespace = ["", "Wikipedia ", "Bild ", "MediaWiki ", "Template ", "Help ", "Category ", "Portal "]; var namespace_number = new Array (); namespace_number = [0, 4, 6, 8, 10, 12, 14, 100]; var number = UrlParameters["number"]; function newRequest() { try { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else { return new ActiveXObject("MSXML2.XMLHTTP"); } } catch (e) { return false; } } var beginning = UrlParameters["beginning"]; var req; if (req = newRequest()) { var text = "/w/query.php?format=xml&what=allpages&aplimit=" + UrlParameters["pages"] + "&apnamespace=" + (namespace_number[number] + 1) + "&apfrom=" + beginning + "&apfilterredir=redirects"; req.open("GET", text, false); req.send(""); var redir = req.responseXML.getElementsByTagName("title"); } for (i = 0; i < redir.length; i++) { var redir2 = "/w/query.php?format=xml&what=allpages&aplimit=1&apnamespace=" + namespace_number[number] + "&apfrom=" + redir[i].childNodes[0].nodeValue.replace(new RegExp(namespace[number] + "Talk:"), "").replace(/ /g, "%20").replace(/&/g, "%26").replace(/\"/g, "%22").replace(/\+/g, "%2B").replace(/\'/g, "%27") + "&apfilterredir=redirects"; var req; if (req = newRequest()) { req.open("GET", redir2, false); req.send(""); var redir_compare = req.responseXML.getElementsByTagName("title"); var redir_compare_disk = namespace[number] + "Talk:" + redir_compare[0].childNodes[0].nodeValue.replace(new RegExp(namespace[number].replace(/ /, "") + ":"), ""); if (redir[i].childNodes[0].nodeValue == redir_compare_disk) { var redir3 = "/w/query.php?format=xml&what=backlinks&bllimit=1&titles=" + redir_compare_disk; var req; if (req = newRequest()) { req.open("GET", redir3, false); req.send(""); var linked = req.responseXML.getElementsByTagName("bl"); if (linked.length == 0) { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + "http://en.wikipedia.org/w/index.php?title=" + redir[i].childNodes[0].nodeValue.replace(/ /g, "%20").replace(/&/g, "%26").replace(/\"/g, "%22").replace(/\+/g, "%2B").replace(/\'/g, "%27") + "&redirect=no&action=delete&deletereason=unnecessary%20redirect<br />"; } } } if (i == redir.length-1) { document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + "http://en.wikipedia.org/w/index.php?title=User:DerHexer/redirects&action=edit&beginning=" + redir[i].childNodes[0].nodeValue.replace(new RegExp(namespace[number] + "Talk:"), "").replace(/ /g, "%20").replace(/&/g, "%26").replace(/\"/g, "%22").replace(/\+/g, "%2B").replace(/\'/g, "%27") + "&number=" + number + "&pages=" + UrlParameters["pages"]; document.editform.wpPreview.click(); } } } } } } } if ( (UrlParameters["action"] == "delete") || (UrlParameters["deletereason"] > "") || ( (UrlParameters["blockreason"] > "") && (UrlParameters["blockduration"] > "") ) || ( (UrlParameters["protectreason"] > "") && (UrlParameters["protectduration"] > "") && (UrlParameters["protecttype"] > "") ) || ( ( (UrlParameters["title"] == 'Special:Log') && (UrlParameters["type"] == 'newusers') ) || (location.href.substring(location.href.indexOf("/wiki/")).search(/Special\:Log\/newusers/) != -1) ) || (UrlParameters["title"] == 'Category:All_images_with_the_same_name_on_Wikimedia_Commons') || (UrlParameters["opencommons"] > "") || (UrlParameters["diff"] > "") || ( (UrlParameters["spam"] > "") && (UrlParameters["vandalizedpage"] > "") ) || (UrlParameters["addtemplate"] > '') || (UrlParameters["title"] == "User:DerHexer/redirects" && UrlParameters["action"] == "edit") ) { addOnloadHook(fillActionPage); } // <nowiki> // Funktionen im Quickbar (monobook.js) var usedropdown = false; // Wenn keine Dropdowns gewünscht sind, hier false eintragen! var qbnewpage = false; // sollen Seiten aus dem QuickBar im neuen Fenster aufgerufen werden? var timeout = 50000; // 50 Sekunden auf das Neuladen der Seite warten var zeigeversion = false; // monobook-Version anzeigen? var zeigehilfe = true; // kurze Hilfetexte beim überfahren mit der Maus anzeigen ? default true var debugme = false; // Debug-Modus? var usersignature = '\~\~\~\~'; //Standardsignatur // Modul: admin.js var delreason = true; // Löschgründe ergänzen? var deletereasons = 'G1|\[\[Wikipedia\:Patent nonsense%7CPatent nonsense\]\]||G1:Nonsense; G2|Test page||G2:Test; G3|Pure \[\[Wikipedia\:Vandalism%7Cvandalism\]\]||G3:Vandalism; G3|Redirect made as a result of the cleanup of page-move vandalism||G3:Pagemove; G4|Recreation of deleted material||G4:Repost; G5|Page made by a \[\[Wikipedia\:List of banned users%7Cbanned user\]\]||G5:Banned; G6|Temporary deletion in order to merge page histories||G6:Histmerge; G6|Making way for a non-controversial move||G6:Move; G6|Deleting page per result of AfD discussion||G6:AFD; G6|Non-controversial housekeeping deletion||G6:Housekeeping; G7|Only one editor has made substantial edits to this page and he or she has requested its deletion or blanked the page||G7:Author; G8|Talk page whose corresponding page does not exist||G8:Talk; G10|\[\[Wikipedia\:Attack page%7CAttack page\]\]||G10:Attack; G11|\[\[Wikipedia\:Spam%7CBlatant advertising\]\]||G11:Spam; G12|Blatant \[\[Wikipedia\:Copyrights%7Ccopyright\]\] infringement||G12:Copyvio; A1|Very short article providing little or no context||A1:Nocontext; A2|Foreign language article that exists on another Wikimedia project||A2:Foreign; A3|No content whatsoever except possibly links elsewhere, a rephrasing of the title, and/or attempts to correspond||A3:Nocontent; A5|Properly transwikied elsewhere||A5:Transwiki; A7|Biographical article that did not assert the \[\[Wikipedia\:Notability %28people%29%7Csignificance\]\] of its subject||A7:Bio; A7|Article about a web site or other online forum that did not assert the \[\[Wikipedia\:Notability %28web%29%7Csignificance\]\] of its subject||A7:Web; A7|Article about a company that did not assert the \[\[Wikipedia\:Notability %28organizations and companies%29%7Csignificance\]\] of its subject||A7:Corp; A7|Article about a club or group that did not assert significance||A7:Club; A7|Article about a band that did not assert the \[\[Wikipedia\:Notability %28music%29%7Csignificance\]\] of its subject||A7:Band; R1|Redirect to non-existent page||R1:Redirnone; R2|Redirect to User/User talk namespaces from mainspace||R2:Rediruser; R3|Redirect based on an implausible typo||R3:Redirtypo; I1|Redundant to another image||I1:Redundant; I2|Image is corrupted||I2:Noimage; I3|Licensed as for non-commercial use only, non-derivative use or used with permission\, uploaded on or after May 19\, 2005\, and no assertion of fair use was provided||I3:Noncom; I4|Image lacking sources or licensing information for more than seven days||I4:Nosource; I5|Unfree image that was not used for more than seven days||I5:Unfree; I6|No \[\[Wikipedia\:Non-free use rationale guideline%7Cjustification\]\] given for fair use for more than seven days||I6:Norat; I7|Bad \[\[Wikipedia\:Non-free use rationale guideline%7Cjustification\]\] given for fair use and the uploader was notified more than 48 hours ago||I7:Badrat; I8|Image exists on the Commons||I8:Commons; C1|Category is empty for 4 days or more||C1:Emptycat; C3|Category solely populated from a now\-deleted template||C3:Catfd; U1|User or user subpage of which the corresponding user requests deletion||U1:Userreq; U2|Userpage of non-existent user||U2:Nouser; U3|Userpage that is primarily a gallery of fair use images||U3:Fugallery; T1|Divisive and inflammatory template||T1:Divisive; P2|Underpopulated portal||P2:Emptyportal'; var blockreason = true; // Blockgründe ergänzen? var blockreasons = "\[\[Wikipedia:Vandalism%7CVandalism\]\]||7||B(v+7h); \[\[Wikipedia:Vandalism%7CVandalism\]\]||24||B(v+24h); \[\[Wikipedia:Vandalism%7CVandalism\]\]||31||B(v+31h); \[\[Wikipedia:Vandalism%7CVandalism\]\]||3 days||B(v+3d); \[\[Wikipedia:Vandalism%7CVandalism\]\]||1 week||B(v+1w); \[\[Wikipedia:Vandalism%7CVandalism\]\]||1 month||B(v+1m); \[\[Wikipedia:Vandalism%7CVandalism\]\]||3 months||B(v+3m); \[\[Wikipedia:Vandalism%7CVandalism\]\]||6 months||B(v+6m); \[\[Wikipedia:Vandalism%7CVandalism\]\]||1 year||B(v+1a); \[\[Wikipedia:Vandalism%7CVandalism\]\]-only account||indefinite||B(voa+i); \{\{uw-ublock\}\}||indefinite||B(name+i)"; var protectreason = true; // Schutzgründe ergänzen? var protectreasons = "IP vandalism||1 day||1||P(IP-V+1d); IP vandalism||1 week||1||P(IP-V+1w); IP vandalism||3 months||1||P(IP-V+3m); IP vandalism||infinite||1||P(IP-V+i); edit war||indefinite||2||P(EW+i); \{\{\[\[Template\:Indefblockeduser\|indefblockeduser\]\]\}\}||infinite||2||P(indefblock+i); \{\{\[\[Template:Unblock\|unblock\]\]\}\} abuse||indefinite||2||P(unblock+i); protection removed||infinite||0||P(!protection+i)"; var blockedtext = "Zwei Stunden."; // Standardtext für die VM // **************** SETUP Ende *********************************** var user = wgUserName ; // username wird automatisch übernommen // page type variables: namespaces var isArticle = (wgNamespaceNumber == 0); var isArticleTalk = (wgNamespaceNumber == 1); var isBild = (wgCanonicalNamespace == "Image"); var isCategory = (wgCanonicalNamespace == "Category"); var isTemplate = (wgCanonicalNamespace == "Template"); var isGeneric = false; if ((!isBild) && (!isCategory) && (!isTemplate)) isGeneric = true; var isProject = (wgCanonicalNamespace == "Project"); // page type variables: namespace == -1 var isSpecial = (wgCanonicalNamespace == "Special"); var isRestore = (isSpecial && (wgCanonicalSpecialPageName == "Undelete")); var isContrib = (isSpecial && (wgCanonicalSpecialPageName == "Contributions")); var isWatchlist = (isSpecial && (wgCanonicalSpecialPageName == "Watchlist")); // page type variables: namespace == -1 var isTalk = (!isSpecial && isOdd(wgNamespaceNumber)); // page type variables: other stuff var isPHP = (document.URL.indexOf('index.php') > 0); var isDiff = UrlParameters["diff"]; var isEdit = ((UrlParameters['action']=='edit') || (UrlParameters['action']=='submit')); var isHistory = (UrlParameters['action']=='history'); // Admin functions var adminflag = false; if (isAdmin()) adminflag = true; /* * ab hier wird der Quickbar (der Kasten oben links) zusammengebaut * * zuerst die allgemeinen Variablen (hier bitte nix ändern!) */ var Quickbar = '<div class="pBody noprint" id="p-quickbar" style="position:absolute; top:5px; z-index:10; width:14em;">'; var xxx = ''; var trenner='<hr />'; var br ='<br />'; var qbtarget = '_self'; if (qbnewpage) qbtarget = '_blank'; var dropdown = usedropdown; var scrpt = ''; var scrptn = 0; var indropdown; var ind; /* * Quickbar-Zusammenbau, Teil 1: * * zuerst die Reihenfolge der einzelnen Abschnitte: */ function buildQuickbar() { // der folgende Abschnitt wird nur bei Admins eingeblendet qbAdminTools(); } /* * Quickbar-Zusammenbau, Teil 2: * * die Belegung der einzelnen Abschnitte */ function qbAdminTools() { if (!adminflag) return; w (0,'<hr /><div id="adminbarlinks">','Adminbar',''); if (delreason) { w (0,'<center>Delete</center>','Löschen',''); decodeadminreasons(deletereasons); } if (blockreason) { w (0,'<center>Block</center>','Sperren',''); decodeadminreasons(blockreasons); } if (protectreason) { w (0,'<center>Protect</center>','Schützen',''); decodeadminreasons(protectreasons); } w (0,'</div></div>','',''); } /* * hier wird der Quickbar in die Seite geschrieben * (ab hier bitte nichts ändern) */ buildQuickbar(); document.write(Quickbar); if (typeof(version) == 'undefined') var version = "?"; if (!isEdit || zeigeversion || isPHP) { document.write( '<div align="right" id="adminbartop">', (zeigeversion) ? ('<a href="#" onclick="amIuptodate()" title="Versionscheck">' + (adminflag ? 'A/' : '') + version + '</a> ') : '', '<a href="/w/index.php?title=Special%3APrefixindex&from=',user, '&namespace=2" target="', qbtarget, '" title="Special:Prefixindex">', (user.split(' ')[0].length < 10) ? user.split(' ')[0] : 'MyPages', '</a>', '</div>'); } document.write(xxx,'</div>'); if (scrpt > '') { document.write('<script> function _doopt (was) { switch (was) {', scrpt, '}}<\/script>'); scrpt=''; } // // ab hier functions // function w (was,lurl,linktext,targt,title) { if (!title) title=linktext; if (!zeigehilfe) title=''; if (!dropdown) { switch (was) { case 0 : xxx=xxx+lurl;break; case 1 : xxx=xxx+'<a href="'+lurl+'" target="'+targt+'" title="'+title+'">'+linktext+'</a> ';break; case 2 : xxx=xxx+'<a href="#" onclick="newtext('+ lurl +')" title="'+title+'">'+linktext+'</a> ';break; case 3 : xxx=xxx+'<a href="#" onclick="insertTagsWrapper('+ lurl +')" title="'+title+'">'+linktext+'</a> ';break; case 4 : xxx=xxx+'<a href="#" onclick="'+ lurl +'" title="'+title+'">'+linktext+'</a> ';break; } } //if else //todo: Hilfe bei Dropdowns. Benutzt die überhaupt jemand???? { var ltext='__________'.substr(1,ind)+linktext; switch (was) { case 0 : if (lurl==br) {xxx=xxx+'<option>'+linktext+'</option>';ind=2;} else if (lurl==trenner) newdropdown(linktext); break; case 1 : xxx=xxx+'<option value="1|'+lurl+'">'+ltext+'</option>';break; case 2 : xxx=xxx+'<option value="2|'+scrptn+'">'+ltext+'</option>'; scrpt=scrpt+'case '+scrptn+':newtext('+lurl+');break;';scrptn++;break; case 3 : xxx=xxx+'<option value="3|'+scrptn+'">'+ltext+'</option>'; scrpt=scrpt+'case '+scrptn+':insertTagsWrapper('+lurl+');break;';scrptn++;break; case 4 : xxx=xxx+'<option value="4|'+scrptn+'">'+ltext+'</option>'; scrpt=scrpt+'case '+scrptn+':'+lurl+';break;';scrptn++;break; } //switch } //else } //w function isEven(myNumber) { return (myNumber % 2 == 0); } function isOdd(myNumber) { return (! isEven(myNumber)); } function isAdmin() { var specialrights = false; if (typeof wgUserGroups != 'object') return(specialrights); if (typeof wgUserGroups[0] != 'string') return(specialrights); for (i=0;i<wgUserGroups.length;i++) { if (wgUserGroups[i] == "sysop") specialrights = true; } return(specialrights); } function importJavascriptL(page, lang) { try { /* check the parameters and set defaults */ if(!page) throw("importJavascriptL: Missing parameter page."); if(!lang) lang = wgContentLanguage; /* create import url */ var import_url = 'http://' + lang + '.wikipedia.org' + wgScriptPath + '/index.php?title=User:' + page + '.js&action=raw&ctype=text/javascript&smaxage=2678400&dontcountme=s'; /* import page */ var Head = document.getElementsByTagName('head').item(0); var Script = document.createElement('script'); Script.setAttribute('type', 'text/javascript'); Script.setAttribute('src', import_url); Script.setAttribute('charset', 'utf-8'); Head.appendChild(Script); return true; } catch(e) { alert(e.message); return false; } } function decodeadminreasons(adminreasons) { // DerHexer var adminreason = adminreasons.split('; '); for (i=0; i < adminreason.length; i++) { var adminreasoncount = adminreason[i].split("||"); switch(adminreasoncount.length) { case 1 : w (4,"deleting('" + adminreasoncount[0] + "');","" + adminreasoncount[0] + ""); break; case 2 : w (4,"deleting('" + adminreasoncount[0] + "');","" + adminreasoncount[1] + ""); break; case 3 : w (4,"blocking('" + adminreasoncount[0] + "', '" + adminreasoncount[1] + "');","" + adminreasoncount[2] + ""); break; case 4 : w (4,"protecting('" + adminreasoncount[0] + "', '" + adminreasoncount[1] + "', '" + adminreasoncount[2] + "');","" + adminreasoncount[3] + ""); break; case 5 : w (4,"protecting('" + adminreasoncount[0] + "', '" + adminreasoncount[1] + "', '" + adminreasoncount[2] + "', '" + adminreasoncount[3] + "');","" + adminreasoncount[4] + ""); break; } } } // ***** FOOT-Block ***** if (adminflag && (delreason || blockreason || protectreason) && wgUserName == 'Animum') importJavascriptL('Animum/derhexeradmin','en'); // [[User:Animum/derhexeradmin.js]] // </nowiki></pre>