Help:Quickbar
From Homestar Runner Wiki
(Difference between revisions)
(→Fine Tuning: reword) |
(Easier method of linking that, and less likely to result in someone creating the example page (User:Username/monobook.js)) |
||
Line 10: | Line 10: | ||
2. Find the complete address of that page, and copy it down. | 2. Find the complete address of that page, and copy it down. | ||
- | 3. Go to your monobook.js page by | + | 3. Go to your monobook.js page by clicking [[Special:Mypage/monobook.js|here]]. |
- | + | ||
- | + | ||
==The Code== | ==The Code== |
Revision as of 07:01, 7 February 2006
Here's how to add a link to your quickbar:
Preparation
1. First, decide what kind of link you would like to add:
- A page that you frequent, that isn't easily accessible.
- One of your user space pages.
- A friend's user page or talk page.
2. Find the complete address of that page, and copy it down.
3. Go to your monobook.js page by clicking here.
The Code
Edit the page, and insert the following lines of code:
gs*****InsertBefore = 'pt-@@@@@'; function *****Link() { var user = document.getElementById( 'pt-userpage').firstChild.firstChild.data; var li = document.createElement( 'li' ); li.id = 'pt-*****'; var a = document.createElement( 'a' ); a.appendChild( document.createTextNode( '******' ) ); a.href = '#####' li.appendChild( a ); if ( ! gs*****InsertBefore ) { document.getElementById( 'pt-logout' ).parentNode.appendChild( li ); } else { var before = document.getElementById( gs******InsertBefore ); before.appendChild( li, before ); } } if ( window.addEventListener ) window.addEventListener( 'load', *****Link, false ); else if ( window.attachEvent ) window.attachEvent( 'onload', *****Link );
Fine Tuning
Now, look at all of the symbols in the code. You'll see stars, @ signs, and number signs. You need to replace them:
- Where ever you see ***** in the code, replace it with your (very short) new link name. You will do this eight times.
- Where you see @@@@@ in the code, replace it with one of the following names:
- Replace it with userpage if you want the link to appear before your userpage link.
- Replace it with mytalk if you want the link to appear before your my talk link.
- Replace it with preferences if you want the link to appear before your preferences link.
- Replace it with watchlist if you want the link to appear before your my watchlist link.
- Replace it with mycontris if you want the link to appear before your my contributions link.
- Replace it with logout if you want the link to appear before your log out link.
- Delete that entire line of text if you want the link to appear after your log out link.
- Where you see ##### in the code, replace it with the entire link path to the page you want to link to.
Now, save your edit, and reload the page.