Help:Quickbar

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
m (Preparation: reword)
(more, with {{utilities}})
 
(includes 7 intermediate revisions)
Line 4: Line 4:
1. First, decide what kind of link you would like to add:
1. First, decide what kind of link you would like to add:
-
*A page that you frequent, that isn't easily accessible.
+
*A page that you frequently visit, that isn't easily accessible.
*One of your user space pages.
*One of your user space pages.
*A friend's user page or talk page.
*A friend's user page or talk page.
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 visiting the following address:
+
==The Code for Monobook (the default skin)==
 +
Go to your monobook.js page by clicking [[Special:Mypage/monobook.js|here]].
-
<pre>http://www.hrwiki.org/index.php/User:Username/monobook.js</pre>
+
Edit the page, and insert the following lines of code:
 +
 
 +
<pre>
 +
{{subst:utilities}}
 +
 
 +
function addLinks()
 +
{
 +
  with (utilities)
 +
  {
 +
    addMonobookQuickbarLink("http://www.hrwiki.org/etc", "link title", "watchlist"); ******
 +
  }
 +
}
 +
if (window.addEventListener) window.addEventListener('load', addLinks, false);
 +
else if (window.attachEvent) window.attachEvent('onload', addLinks);
 +
</pre>
 +
 
 +
===Fine Tuning===
 +
Now, look at the line marked with ******:
 +
 
 +
*Remove the ******, it's only there so you can find the line.
 +
*There are three things you need to replace, in "quotes", separated by commas.
 +
**The first is the complete URL to the page you want to link to.
 +
**The second is what you want the link to say.
 +
**The third says where you want the link to be in the quickbar:
 +
***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.
 +
***Make it blank (ie just two quote marks <code>""</code>) if you want the link to appear after your '''log out''' link.
 +
*If you want to add several links, make multiple copies of this one line (don't copy the whole script).
 +
 
 +
Now, save your edit, and reload the page.
 +
 
 +
==The Code for Cologne Blue==
 +
Go to your cologneblue.js page by clicking [[Special:Mypage/cologneblue.js|here]].
-
==The Code==
 
Edit the page, and insert the following lines of code:
Edit the page, and insert the following lines of code:
<pre>
<pre>
-
gs*****InsertBefore = 'pt-@@@@@';
+
{{subst:utilities}}
-
function *****Link()
+
 
-
{
+
function addLinks()
-
  var user = document.getElementById( 'pt-userpage').firstChild.firstChild.data;
+
{
-
  var li = document.createElement( 'li' );
+
  with (utilities)
-
  li.id = 'pt-*****';
+
  {
-
  var a = document.createElement( 'a' );
+
    addCologneBlueTopbarLink("http://www.hrwiki.org/etc", "link title", true); ******
-
  a.appendChild( document.createTextNode( '******' ) );
+
  }
-
  a.href = '#####'
+
}
-
  li.appendChild( a );
+
if (window.addEventListener) window.addEventListener('load', addLinks, false);
-
  if ( ! gs*****InsertBefore )
+
else if (window.attachEvent) window.attachEvent('onload', addLinks);
-
  {
+
</pre>
-
      document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
+
 
-
  }
+
===Fine Tuning===
-
  else
+
Now, look at the line marked with ******:
-
  {
+
 
-
      var before = document.getElementById( gs******InsertBefore );
+
*Remove the ******, it's only there so you can find the line.
-
      before.appendChild( li, before );
+
*There are three things you need to replace, separated by commas.
-
  }
+
**The first is the complete URL to the page you want to link to.
-
}
+
**The second is what you want the link to say.
-
if ( window.addEventListener ) window.addEventListener( 'load', *****Link, false );
+
**The third says where you want the link to be in the quickbar. This can be <code>true</code> to put it at the start, or <code>false</code> to put it at the end.
-
else if ( window.attachEvent ) window.attachEvent( 'onload', *****Link );
+
**You can also replace <code>addCologneBlueTopbarLink</code> with <code>addCologneBlueSubtopbarLink</code> to add it to the second top bar (the one just below the categories)
 +
*If you want to add several links, make multiple copies of this one line (don't copy the whole script).
 +
 
 +
Now, save your edit, and reload the page.
 +
 
 +
==The Code for TaviStyle==
 +
Go to your tavistyle.js page by clicking [[Special:Mypage/tavistyle.js|here]].
 +
 
 +
Edit the page, and insert the following lines of code:
 +
 
 +
<pre>
 +
{{subst:utilities}}
 +
 
 +
function addLinks()
 +
{
 +
  with (utilities)
 +
  {
 +
    addTavistyleTopbarLink("http://www.hrwiki.org/etc", "link title", 1, true); ******
 +
  }
 +
}
 +
if (window.addEventListener) window.addEventListener('load', addLinks, false);
 +
else if (window.attachEvent) window.attachEvent('onload', addLinks);
</pre>
</pre>
-
==Fine Tuning==
+
===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:
+
Now, look at the line marked with ******:
-
*Where ever you see '''*****''' in the code, replace it with your (very short) new link name. You will do this eight times.
+
*Remove the ******, it's only there so you can find the line.
-
*Where you see '''@@@@@''' in the code, replace it with one of the following names:
+
*There are four things you need to replace, separated by commas.
-
**Replace it with '''userpage''' if you want the link to appear before your '''userpage''' link.
+
**The first is the complete URL to the page you want to link to.
-
**Replace it with '''mytalk''' if you want the link to appear before your '''my talk''' link.
+
**The second is what you want the link to say.
-
**Replace it with '''preferences''' if you want the link to appear before your '''preferences''' link.
+
**the third is which row of the top bar you want to add it to &ndash; <code>1</code> for the first, <code>2</code> for the second, or <code>3</code> to add a new row to the bottom.
-
**Replace it with '''watchlist''' if you want the link to appear before your '''my watchlist''' link.
+
**The fourth says where you want the link to be in the quickbar. This can be <code>true</code> to put it at the start, or <code>false</code> to put it at the end.
-
**Replace it with '''mycontris''' if you want the link to appear before your '''my contributions''' link.
+
*If you want to add several links, make multiple copies of this one line (don't copy the whole script).
-
**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. You should have a brand new link in your quickbar!
+
Now, save your edit, and reload the page.
-
[[Category:Help|Q]]
+
[[Category:Help|Quickbar]]

Current revision as of 14:32, 27 May 2006

Here's how to add a link to your quickbar:

Contents

[edit] Preparation

1. First, decide what kind of link you would like to add:

  • A page that you frequently visit, 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.

[edit] The Code for Monobook (the default skin)

Go to your monobook.js page by clicking here.

Edit the page, and insert the following lines of code:

{{subst:utilities}}

function addLinks()
{
  with (utilities)
  {
    addMonobookQuickbarLink("http://www.hrwiki.org/etc", "link title", "watchlist"); ******
  }
}
if (window.addEventListener) window.addEventListener('load', addLinks, false);
else if (window.attachEvent) window.attachEvent('onload', addLinks);

[edit] Fine Tuning

Now, look at the line marked with ******:

  • Remove the ******, it's only there so you can find the line.
  • There are three things you need to replace, in "quotes", separated by commas.
    • The first is the complete URL to the page you want to link to.
    • The second is what you want the link to say.
    • The third says where you want the link to be in the quickbar:
      • 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.
      • Make it blank (ie just two quote marks "") if you want the link to appear after your log out link.
  • If you want to add several links, make multiple copies of this one line (don't copy the whole script).

Now, save your edit, and reload the page.

[edit] The Code for Cologne Blue

Go to your cologneblue.js page by clicking here.

Edit the page, and insert the following lines of code:

{{subst:utilities}}

function addLinks()
{
  with (utilities)
  {
    addCologneBlueTopbarLink("http://www.hrwiki.org/etc", "link title", true); ******
  }
}
if (window.addEventListener) window.addEventListener('load', addLinks, false);
else if (window.attachEvent) window.attachEvent('onload', addLinks);

[edit] Fine Tuning

Now, look at the line marked with ******:

  • Remove the ******, it's only there so you can find the line.
  • There are three things you need to replace, separated by commas.
    • The first is the complete URL to the page you want to link to.
    • The second is what you want the link to say.
    • The third says where you want the link to be in the quickbar. This can be true to put it at the start, or false to put it at the end.
    • You can also replace addCologneBlueTopbarLink with addCologneBlueSubtopbarLink to add it to the second top bar (the one just below the categories)
  • If you want to add several links, make multiple copies of this one line (don't copy the whole script).

Now, save your edit, and reload the page.

[edit] The Code for TaviStyle

Go to your tavistyle.js page by clicking here.

Edit the page, and insert the following lines of code:

{{subst:utilities}}

function addLinks()
{
  with (utilities)
  {
    addTavistyleTopbarLink("http://www.hrwiki.org/etc", "link title", 1, true); ******
  }
}
if (window.addEventListener) window.addEventListener('load', addLinks, false);
else if (window.attachEvent) window.attachEvent('onload', addLinks);

[edit] Fine Tuning

Now, look at the line marked with ******:

  • Remove the ******, it's only there so you can find the line.
  • There are four things you need to replace, separated by commas.
    • The first is the complete URL to the page you want to link to.
    • The second is what you want the link to say.
    • the third is which row of the top bar you want to add it to – 1 for the first, 2 for the second, or 3 to add a new row to the bottom.
    • The fourth says where you want the link to be in the quickbar. This can be true to put it at the start, or false to put it at the end.
  • If you want to add several links, make multiple copies of this one line (don't copy the whole script).

Now, save your edit, and reload the page.

Personal tools