Участник:Obersachse/monobook.js
Материал из Википедии — свободной энциклопедии
Замечание: Чтобы после сохранения увидеть сделанные изменения, очистите кеш своего браузера: Mozilla / Firefox: Ctrl+Shift+R, IE: Ctrl+F5, Safari: Cmd+Shift+R, Konqueror: F5, Opera: через меню Tools→Preferences.
//Obersachse monobook.js // Script from [[Участник:Edward Chernenko/lupin-antivandal-script.js]] document.write('<script type="text/javascript" src="' + 'http://ru.wikipedia.org/w/index.php?title=Участник:Edward Chernenko/lupin-antivandal-script.js' + '&action=raw&ctype=text/javascript&dontcountme=s"></script>'); //*********************************************************************** // Marks admins with something // by [[:de:User:Spongo]] // 28. Dez. 2005 var markadmin = true; var UrlParameters = new Array (); readparams(); function MarkAdmins(){ if (markadmin){ // last update 2006-11-13 var admins=new Array('A.I.' , 'ACrush' , '.:Ajvol:.', 'Alma Pater', 'Amoses', 'Boleslav1', 'Butko', 'CodeMonk', 'Ctac', 'DaeX', 'Dmitry Gerasimov', 'Dr Bug' , 'Dstary', 'Hedgehog', 'Kneiphof', 'LoKi', 'Maxim Razin', 'Maximaximax', 'MaxSem', 'Mitrius', 'Morpheios Melas', 'Obersachse', 'Panther', 'Pauk', 'Paul Pogonyshev', 'Ramir', 'Redline', 'Solon', 'Tassadar', 'Torin', 'Tosha', 'Volkov', 'Wind', 'Wulfson', 'Yurik', 'Владимир Волохонский', 'Не А', 'Neon', 'С. Л.'); var langUser = "Участник:"; var aMark = document.createElement("b"); var aMarkText = document.createTextNode(" (Admin)"); // этот текст дополняется после имени админа (Standard: "(A)") aMark.appendChild(aMarkText); var ishistory = (UrlParameters['action']=='history'); var isdiskussion = (((document.URL.indexOf('Служебная:Recentchanges') > 0)) || (document.URL.indexOf('Обсуждение') > 0) || (document.URL.indexOf('Википедия') > 0)); var searchExp = /.wiki.Участник.(.+)/; if (ishistory || isdiskussion || ((UrlParameters['diff']>'') && (UrlParameters['oldid']>''))) { for (var i=0; aNode = document.getElementsByTagName("a")[i]; i++) { // if it's a link to an user if ( (href = aNode.getAttribute("href")) && (href.search("/wiki/" + langUser) != -1) ) { currUser = searchExp.exec(href)[1]; // is this user an admin? for (var k=0; k < admins.length; ++k){ if (currUser == admins[k]){ aNode.appendChild(aMark.cloneNode(true)); break; } } } } } } } //** 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 readparams //** addOnloadHook(MarkAdmins); //*********************************************************************** //*********************************************************************** // Unwatch // source: en:Wikipedia:WikiProject User scripts/Scripts // // This script adds an "unwatch" link to each entry in your watchlist. This version // works regardless of whether you have the "Enhanced recent changes" option // selected in your user preferences. By default the links take you back to your // watchlist. If you'd prefer them to take you to a "Removed from watchlist" page // like the unwatch links at the top of the watched pages, uncomment the second line // in the function. //*********************************************************************** function unwatch() { var query_prefix = "title=Служебная:Watchlist&action=submit&remove=1&id[]="; //var query_prefix = "action=unwatch&title="; if (window.location.href.indexOf("Служебная:Watchlist") == -1) return; // edit by de:Benutzer:CyRoXX: "Spezial" instead of "Special" to make it work with the german Wikipedia var links = document.getElementById('content').getElementsByTagName('a'); for (var i = 0; i < links.length; i++) { if (links[i].href.substring(links[i].href.length-15) != '&action=history') continue; var unwatch = document.createElement('a'); unwatch.href = "/w/index.php?" + query_prefix + encodeURIComponent(links[i].title); unwatch.title = "Unwatch "+links[i].title; unwatch.appendChild(document.createTextNode("unwatch")); links[i].parentNode.insertBefore(unwatch, links[i].nextSibling); // kluge to handle case where "diff" is unlinked: var delim = links[i].previousSibling; delim = (delim.nodeType == 3 ? delim.nodeValue : ""); links[i].parentNode.insertBefore(document.createTextNode(delim.replace(/^.*diff/, "")), unwatch); } }; addOnloadHook(unwatch);