PDA

View Full Version : Mousegestures suited for this forum


M7S
5th December 2004, 16:34
Always save whatever you write before you leave the computer. I had written a long post that now is lost...

Here's a short version anyways. On optimos homepage (http://optimoz.mozdev.org) there's a gesture for their Mouse Gesture extension for Firefox (and the Mozilla Suite too?) named "Go to Next". It "loads the first link found to have the word 'Next' in it". I was really happy when I found this gesture since it was the only thing i missed when I stopped using Opera (Opera's FastForward does more or less the same thing).

I had a little problem though... When using that gesture on Doom9's forum I got to the next thread while imho it would be much smarter to get to the next page in the thread instead. Today I realised how simple :o it was to change the script the gesture uses so it would work the way I wanted it to work. I really liked being able to use this gesture on this forum so I tought maybe someone else would like it too.

That's why I'm posting these links: Go to Next (mozgest://addmapping/browser/R/custom/Go%20To%20Next/var%20browser%20%3D%20getBrowser()%3B%0Afor(i%20%3D%200%3B%20i%20%3C%20window._content.document.links.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20var%20link%20%3D%20window._content.document.links%5Bi%5D.text.toLowerCase()%3B%0A%20if%20(link.indexOf(%22%C2%BB%22)%20%3E%20-1)%0A%7Bwindow._content.document.location%20%3D%20window._content.document.links%5Bi%5D.href%0Ai%20%3D%20window._content.document.links.length%7D%0A%20if%20(link.indexOf(%22next%22)%20%3E%20-1)%0A%7Bwindow._content.document.location%20%3D%20window._content.document.links%5Bi%5D.href%0Ai%20%3D%20window._content.document.links.length%7D%7D/) and Go to Previous (mozgest://addmapping/browser/L/custom/Go%20To%20Last/var%20browser%20%3D%20getBrowser()%3B%0Afor(i%20%3D%200%3B%20i%20%3C%20window._content.document.links.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20var%20link%20%3D%20window._content.document.links%5Bi%5D.text.toLowerCase()%3B%0A%20if%20(link.indexOf(%22%C2%AB%20first%22)%20%3E%20-1)%0A%7Bi%2B%2B%3Bvar%20link%20%3D%20window._content.document.links%5Bi%5D.text.toLowerCase()%3B%7D%0A%20if%20(link.indexOf(%22last%20%C2%BB%22)%20%3E%20-1)%0A%7Bi%2B%2B%3Bvar%20link%20%3D%20window._content.document.links%5Bi%5D.text.toLowerCase()%3B%7D%0A%20if%20(link.indexOf(%22%C2%AB%22)%20%3E%20-1)%0A%7Bwindow._content.document.location%20%3D%20window._content.document.links%5Bi%5D.href%0Ai%20%3D%20window._content.document.links.length%7D%0A%20if%20(link.indexOf(%22last%22)%20%3E%20-1)%0A%7Bwindow._content.document.location%20%3D%20window._content.document.links%5Bi%5D.href%0Ai%20%3D%20window._content.document.links.length%7D%7D/)

Click on them to install. Of course you must have optimoz's Mouse Gestures extension installed. These gestures will work on some other sites than this forum too, even if they are written for this forum. NB! These gestures will overwrite the gestures for back and forward (or whatever gesture you have on L and R), if you don't choose where you want them. I use RockerGestures for Back and Forward so I don't need to have Back and Forward on L and R too.

Hope someone finds this useful,
M7S

EDIT: forgot to give a link to the Mouse Gesture extension (https://update.mozilla.org/extensions/moreinfo.php?application=firefox&id=39&vid=810)

EDIT2: Fixed a possible bug in go to previous.

Neo Neko
6th December 2004, 01:22
You know if there really are that many of us Moz users here we aught to see about getting permission to create and distribute a customised Doom9 branded version of firefox with usefull extensions etc for the forums. :p