(Untitled)

Dec 24, 2005 11:23

Well here is a quick script I wrote. There are two versions. One for GreaseMonkey (Firefox) and one for Trixie (Same idea but IE). So when you come to a "forbidden" or "error" page on the system the script will dynamically draw a forward and backwards button for you on the page ( Read more... )

Leave a comment

wetnun December 27 2005, 05:54:17 UTC
It wouldn't be hard to expand the menu system. Granted there is an issue of you having to edit the js file if you want to specify your particular home page.

But here is another version of the script that might work better for you. And I've commented things more so it might be easier for you to hack.

http://wetnun.net/lj/lj_forbidden_nav_buttons_with_menus.user.js

Basically it's an expanding navbar so you can edit your script to add/remove whatever buttons you want. So in this version you would just edit this part:

document.go_friends_handler = function (event) {
var url = 'http://www.livejournal.com/users/wetnun/friends/';
document.location.href = url;
event.preventDefault();
}

To read like this:

document.go_friends_handler = function (event) {
var url = 'http://www.livejournal.com/users/kunzite1/friends/';
document.location.href = url;
event.preventDefault();
}

And poof! Instant link to your friends page. And you can add remove any links you want. It should be pretty straight forward.

And I always take suggestions on code. What I make is generally quick hacks for myself (unless I'm getting paid to do something right for someone else). So they often leave room for improvement. :)

Reply

kunzite1 December 27 2005, 08:42:53 UTC
that's pretty sexy.

to make the username changing a little easier, you could set it to a global variable?

Reply

wetnun December 27 2005, 09:41:53 UTC
Changed in the with_menus version. I also added more handlers and the button code, but left the include commented out so you can just uncomment/comment buttons as you want. It also makes the code pretty easy to figure out. The file is up to 9KB now though. Never thought it would get that big initially. :)

Reply

kunzite1 December 27 2005, 09:44:30 UTC
hee. awesome.

JS is cool with the idea that you can assign function definitions to a variable.

Reply


Leave a comment

Up