User:Tinker/monobook.js/personalSidebar.js
Jump to navigation
Jump to search
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
// 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
addOnloadHook(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>');