Hinweis: Leere nach dem Veröffentlichen den Browser-Cache, um die Änderungen sehen zu können.
- Firefox/Safari: Umschalttaste drücken und gleichzeitig Aktualisieren anklicken oder entweder Strg+F5 oder Strg+R (⌘+R auf dem Mac) drücken
- Google Chrome: Umschalttaste+Strg+R (⌘+Umschalttaste+R auf dem Mac) drücken
- Edge: Strg+F5 drücken oder Strg drücken und gleichzeitig Aktualisieren anklicken
/*
tasks:
- at page: add link to discussion history
- at talk pages: add link to page history
- delete items from the rhs toolbar that i don't use.
- add other reasonable items
tested in firefox only
*/
$(function (){
function remove_item(id){
if(document.getElementById(id) !== null){
document.getElementById(id).remove();
}
}
// links to (discussion) history
const hist_link = document.getElementById("ca-history");
if(hist_link !== null){
const new_hist_link = document.createElement("li");
new_hist_link.className = 'vector-tab-noicon mw-list-item';
const title = hist_link.childNodes[0].href;
const re_match = /title=(.*)&(?:amp;|)action=history$/i.exec(title);
if(re_match !== null){
const page_name = document.getElementById("ca-talk").previousElementSibling.childNodes[0].pathname.substring(6);
if(re_match[1] === page_name){
const talk_name = document.getElementById("ca-talk").childNodes[0].pathname.substring(6);
if(talk_name !== 'ex.php'){
//hist_link.childNodes[0].childNodes[0].innerHTML = "page history";
new_hist_link.innerHTML = "<a href=\"/w/index.php?title=" + talk_name
+ "&action=history\">discussion history</a>";
hist_link.parentNode.insertBefore(new_hist_link, hist_link.nextSibling);
}
}else{
//hist_link.childNodes[0].childNodes[0].innerHTML = "discussion history";
new_hist_link.innerHTML = "<a href=\"/w/index.php?title=" + page_name
+ "&action=history\">page history</a>";
hist_link.parentNode.insertBefore(new_hist_link, hist_link);
}
}
}
// right hand side tools
remove_item("t-urlshortener");
remove_item("t-urlshortener-qrcode");
jQuery(document).ready(function(){
mw.loader.using("mediawiki.util",
function(){
// new link for spam log
let link = "/wiki/Special:Log?type=spamblacklist&page=" + encodeURIComponent(mw.config.get('wgPageName')) + "&wpFormIdentifier=logeventslist";
if(mw.config.get("wgRelevantUserName") !== null){
link = "/w/index.php?title=Special:Log/spamblacklist/"
+ mw.util.wikiUrlencode(mw.config.get("wgRelevantUserName"))
}
mw.util.addPortletLink(
"p-tb",
link,
"Spam log",
"n-spam",
"show spam log of user/page",
"#n-mainpage-description",
null);
// generate addition "user" menu from "general" content
if(mw.config.get("wgRelevantUserName") !== null && $('#p-tb').length > 0){
if($('#n-user').length === 0){
$('#p-cactions').append('<div id="n-user" class="vector-menu mw-portlet mw-portlet-tb" lang="en" dir="ltr"><div class="vector-menu-heading">User</div><div class="vector-menu-content"><ul class="vector-menu-content-list"></ul></div></div>');
}
$('#n-user ul').append($('#p-tb li#t-contributions'));
$('#n-user ul').append($('#p-tb li#t-blockip'));
$('#n-user ul').append($('#p-tb li#t-emailuser'));
$('#n-user ul').append($('#p-tb li#t-mute'));
$('#n-user ul').append($('#p-tb li#t-userrights'));
$('#n-user ul').append($('#p-tb li#n-spam'));
}
});
});
});