User:Omegatron/monobook.js/personalSidebar.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. |
Documentation for this user script can be added at User:Omegatron/monobook.js/personalSidebar. |
// Move the personal links to the sidebar
// Originally from http://meta.wikimedia.org/wiki/Help:User_styles#Make_the_user_toolbar_a_sidebox
// Make sure the page structure is compatible with the CSS
$(function () {
content = document.getElementById("column-one"); // Find the main content column
// Move the personal links into the side column (in case they have been moved elsewhere)
personal = document.getElementById("p-personal"); // Find the personal links list
personal.parentNode.removeChild(personal); // Remove the personal links list from the content column
content.insertBefore(personal,document.getElementById('p-logo').nextSibling); // Place personal links list after the logo
});
// Include style sheet inline so that script is self-contained:
document.write('<style type="text/css">' +
' /* Transform the user toolbar into a sidebox */ '+
' '+
' #p-personal { '+
' position:relative; '+
' z-index:3; '+
' width: 11.6em; '+
' } '+
' '+
' #p-personal .pBody { '+
' width: 10.7em; '+
' border: none; '+
' margin: 0 0 0.1em 0em; '+
' float: none; '+
' overflow: hidden; '+
' font-size: 95%; '+
' background: White; '+
' border-collapse: collapse; '+
' border: 1px solid #aaaaaa; '+
' padding: 0 0.8em 0.3em .5em; '+
' } '+
' '+
' #p-personal ul { '+
' /* line-height: 1em !important; */ '+
' line-height: inherit; '+
' list-style-type: square; '+
' list-style-image: url("/style/monobook/bullet.gif"); '+
' font-size:95%; '+
' padding:0; '+
' text-align:left; '+
' text-transform: none; '+
' margin: 0 0 0 1em; '+
' } '+
' '+
' #p-personal li { '+
' display: list-item; '+
' line-height: 1em; '+
' padding:0; '+
' margin: 0 0 0 0; '+
' font-size:95% '+
' } '+
' '+
' #p-personal h5 { '+
' display: inline; '+
' padding: 0em 1em 0em 0.5em; '+
' } '+
' '+
' #p-personal a { '+
' display: block; '+
' } '+
' '+
' li#pt-userpage { /* Suppress the person icon by your username */ '+
' background: none; '+
' } '+
' '+
'<'+'/style>');