User:Virgolette/vector.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Virgolette/vector.css. |
// I need this to avoid the collapse of tabs,
// since I've moved the right tabs to the left
// See User:Virgolette/vector.css
// Thanks to User:Amalthea
wgVectorEnabledModules.collapsibletabs = false;
// BEGIN modified User:PleaseStand/hide-vector-sidebar.js
/* Adds a button to toggle visibility of the Vector sidebar.
Written by PleaseStand. Public domain;
all copyright claims waived as described
in http://en.wikipedia.org/wiki/Template:PD-self */
/*global document, window, addPortletLink, hookEvent, skin*/
var sidebarSwitch;
function sidebarHide() {
document.getElementById("panel").style.display = "none";
document.getElementById("head-base").style.marginLeft = "0";
document.getElementById("content").style.marginLeft = "0";
document.getElementById("left-navigation").style.left = "0";
document.getElementById("footer").style.marginLeft = "0";
/* optional: this part is working with my css */
document.getElementById("left-navigation").style.marginLeft = "0em";
document.getElementById("right-navigation").style.marginLeft = "11em";
document.getElementById("simpleSearch").style.left = "0.2em";
/* optional */
if(typeof sidebarSwitch == "object") {
sidebarSwitch.parentNode.removeChild(sidebarSwitch);
}
sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarShow()", "Show sidebar", "ca-sidebar", "Show the navigation links", "a");
}
function sidebarShow() {
document.getElementById("panel").style.display = "";
document.getElementById("head-base").style.marginLeft = "";
document.getElementById("content").style.marginLeft = "";
document.getElementById("left-navigation").style.left = "";
document.getElementById("footer").style.marginLeft = "";
/* optional: this part is working with my css */
document.getElementById("left-navigation").style.marginLeft = "";
document.getElementById("right-navigation").style.marginLeft = "";
document.getElementById("simpleSearch").style.left = "";
/* optional */
if(typeof sidebarSwitch == "object") {
sidebarSwitch.parentNode.removeChild(sidebarSwitch);
}
sidebarSwitch = addPortletLink("p-cactions", "javascript:sidebarHide()", "Hide sidebar", "ca-sidebar", "Hide the navigation links", "a");
}
// Only activate on Vector skin
if(skin == "vector") {
hookEvent("load", function() {
// Change this if you want to hide the sidebar by default
sidebarShow();
});
}
// END modified User:PleaseStand/hide-vector-sidebar.js
// This function reduce the length of personal links
// at the top of the page. I need this because I've
// moved up the tabs reducing the waste of space
function shortlinks()
{
document.getElementById('pt-mytalk').firstChild.innerHTML = 'Talk';
document.getElementById('pt-preferences').firstChild.innerHTML = 'Preferences';
document.getElementById('pt-watchlist').firstChild.innerHTML = 'Watch';
document.getElementById('pt-mycontris').firstChild.innerHTML = 'Edits';
}
addOnloadHook(shortlinks);