Make Your Own Boss Button

Yesterday I added a little featurette to Wordie: a keyboard shortcut (ctl-b) that automatically launches a work-appropriate site. The idea was to help people enjoy Wordie at work, without it being quite so obvious that they weren’t actually working. Silly, but whatever. I think it’s funny.

A few people have asked how to do the same, so here it is: how to implement a Wordie-style boss button.

First, download this open-source javascript library:

Put it in the docroot of your webserver wherever you keep your javascript files (mine are in /javascripts), and add this function to the top of the file:

function bossButton() {
var rand = Math.floor(Math.random()*10);
switch(rand) {
case 0: url = ‘’; break;
case 1: url = ‘’; break;
case 2: url = ‘’; break;
case 3: url = ‘’; break;
case 4: url = ‘’; break;
case 5: url = ‘’; break;
case 6: url = ‘’; break;
case 7: url = ‘’; break;
case 8: url = ‘’; break;
case 9: url = ‘,1055,10121515,00.html’; break;
shortcut.add(“Ctrl+b”,function() {

Then add this line to your web pages, inside the <head> tags at the top of the page, ideally in a commonly called template so you only have to do it once for the whole site. Make sure to edit the path so it matches where you actually put shortcuts.js:

<script src=”/javascripts/shortcuts.js” type=”text/javascript”></script></div>

Then, at the bottom of every page (again, ideally in a template), add this:

<script type=”text/javascript”>bossButton();</script>

Now you can hit ‘ctl-b’, and the page will automatically change to one of the 10 urls in the bossButton function. You can change the urls, of course. To use a different keyboard shortcut, change the text in the “shortcut.add(…)” line towards the bottom of the bossButton() function.

Have fun, and don’t work too hard 🙂

One thought on “Make Your Own Boss Button

  1. Hi John! Thanks for your little script, which inspired me for a boss button on my little pointless web project 😉 Works like a charm! Peter

Comments are closed.