Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
James Hare (talk | contribs) (Fancy transition stuff) |
(Update) |
||
Line 1: | Line 1: | ||
− | /* |
+ | /* Interface modifications for anonymous users */ |
+ | function removeSidebarSection(section) { |
||
+ | try { |
||
+ | var target = "p-" + section; |
||
+ | var sidebar = document.getElementById("mw-panel"); |
||
+ | var element = document.getElementById(target); |
||
+ | sidebar.removeChild(element); |
||
+ | } catch (e) { |
||
+ | return; |
||
+ | } |
||
+ | } |
||
+ | |||
+ | function customizeSidebarForAnon() { |
||
+ | removeSidebarSection("tb"); |
||
+ | } |
||
+ | |||
+ | if (wgUserName == null) { |
||
+ | addOnloadHook(customizeSidebarForAnon); |
||
+ | } |
||
+ | |||
+ | /* Add a few links to the toolbox */ |
||
addOnloadHook(function() { |
addOnloadHook(function() { |
||
+ | mw.util.addPortletLink( 'p-tb', '/wiki/Special:RecentChanges', 'Recent changes', 't-recentchanges', 'Recent changes ', 'r', '#t-recentchangeslinked' ); |
||
− | + | $( '#megaheader img' ).css( 'opacity', 1 ); /* Thank you Jack Phoenix! */ |
|
}); |
}); |
Revision as of 01:25, 16 July 2016
/* Interface modifications for anonymous users */
function removeSidebarSection(section) {
try {
var target = "p-" + section;
var sidebar = document.getElementById("mw-panel");
var element = document.getElementById(target);
sidebar.removeChild(element);
} catch (e) {
return;
}
}
function customizeSidebarForAnon() {
removeSidebarSection("tb");
}
if (wgUserName == null) {
addOnloadHook(customizeSidebarForAnon);
}
/* Add a few links to the toolbox */
addOnloadHook(function() {
mw.util.addPortletLink( 'p-tb', '/wiki/Special:RecentChanges', 'Recent changes', 't-recentchanges', 'Recent changes ', 'r', '#t-recentchangeslinked' );
$( '#megaheader img' ).css( 'opacity', 1 ); /* Thank you Jack Phoenix! */
});