Author Topic: Making a keyboard forum keyboard friendly  (Read 2460 times)

0 Members and 1 Guest are viewing this topic.

Offline FourOhFour

  • Thread Starter
  • Posts: 85
Making a keyboard forum keyboard friendly
« on: Sun, 18 October 2009, 10:15:56 »
I was particularly bored... so I fired up GlimmerBlocker and wrote a javascript for this forum, and others with a similar layout...

This adds a selection box around the first thread in a forum... j and k move the selection up and down. Enter opens the thread to the first unread post (or the beginning if it's not unread). Also, when at the bottom of a page, space will go to the next page.

Stuff I might add if I get around to it:
When scrolling, move the selection to keep it on screen.
When moving the selection, scroll to keep it on screen.

This should work with GreaseMonkey on firefox, or Opera's built in user javascript support. I know it works with Safari with GlimmerBlocker.

Only use greasemonkey scripts from sources you trust (and since I'm fairly new around here, that shouldn't be me :-P ). Greasemonkey scripts have access to the cookies for the site they are running on, and could copy your login credentials and the like. (this one doesn't, but of course I'd say that ;-) )

http://fourohfour.info/greasescripts/forumkeyboard.user.js

Offline FourOhFour

  • Thread Starter
  • Posts: 85
Making a keyboard forum keyboard friendly
« Reply #1 on: Sun, 18 October 2009, 14:23:34 »
Well, using it for a while, I've discovered a few issues...

First off, the lack of scrolling to follow the selection and moving the selection to follow the highlight is damned annoying.

Secondly, I'd like it to select the first thread with unread posts to begin with. Then I could browse the forum by just hitting the new posts link at the top, return to get to the first thread, space to scroll, backspace to get back, and return to get the next thread.

Thirdly, I need it to detect the links for the wiki sections of the site (keyboard mods and reviews).

Also, maybe space should move on to the next page sooner than the bottom of the page? There's a lot of cruft after the last post on many forums.

Which brings me to this... am I coding this for myself, or is anyone else interested? If I'm coding this for myself, I'm not going to bother with any configurability.

Also... any suggestions? I'm considering adding the selection thing to posts too... j/k to select posts, r to reply with quote, t to open a linked page in a new tab, maybe ! to report, I to add the user to the ignore list... I dunno.

Offline o2dazone

  • Posts: 953
Making a keyboard forum keyboard friendly
« Reply #2 on: Sun, 18 October 2009, 15:01:59 »
A few people on this forum use Mouseless Browsing Firefox Extension. Perhaps you can deconstruct the extension and see how they are doing it, considering it's all written in JS and xul

Offline JBert

  • Posts: 764
Making a keyboard forum keyboard friendly
« Reply #3 on: Sun, 18 October 2009, 16:24:20 »
I actually use Vimperator which incorporates the same functionality of being able to press a hotkey and select a link.

Still, this could be interesting. Maybe I'd use it for some custom script.
IBM Model F XT + Soarer's USB Converter || Cherry G80-3000/Clears

The storage list:
IBM Model F AT || Cherry G80-3000/Blues || Compaq MX11800 (Cherry brown, bizarre layout) || IBM KB-8923 (model M-style RD) || G81-3010 Hxx || BTC 5100C || G81-3000 Sxx || Atari keyboard (?)


Currently ignored by: nobody?

Disclaimer: we don\'t help you save money on [strike]keyboards[/strike] hardware, rather we make you feel less bad about your expense.
[/SIZE]

Offline FourOhFour

  • Thread Starter
  • Posts: 85
Making a keyboard forum keyboard friendly
« Reply #4 on: Sun, 18 October 2009, 18:09:16 »
Quote from: o2dazone;126699
A few people on this forum use Mouseless Browsing Firefox Extension. Perhaps you can deconstruct the extension and see how they are doing it, considering it's all written in JS and xul


That's almost enough to make me want to switch to firefox.

Actually, it wouldn't be hard to do that with javascript and glimmerblocker. Hmm. I just might abandon this script and do that. It would certainly be more general purpose.

Offline o2dazone

  • Posts: 953
Making a keyboard forum keyboard friendly
« Reply #5 on: Mon, 19 October 2009, 19:38:44 »
I think it's great what you're doing. The upside to your approach is the code is pure JS, you could easily port it over as a userscript for Chrome. I didn't want to make it sound like "This is worthless theres already something out there that does that!", because FF extensions don't work for Chrome or any other browser that supports or decides to support userscripts and/or greasemonkey

Offline FourOhFour

  • Thread Starter
  • Posts: 85
Making a keyboard forum keyboard friendly
« Reply #6 on: Mon, 19 October 2009, 20:26:31 »
Quote from: o2dazone;127073
I think it's great what you're doing. The upside to your approach is the code is pure JS, you could easily port it over as a userscript for Chrome. I didn't want to make it sound like "This is worthless theres already something out there that does that!", because FF extensions don't work for Chrome or any other browser that supports or decides to support userscripts and/or greasemonkey


Heh. With browsers, there's always some browser out there that does what you want... just none that do all you want. I love Opera's ability to force the page into the width of the window. I love Safari's speed and integration with the OS -- keychain, cmd-ctrl-d dictionary lookups, trackpad gestures. And finally, I do like Firefox's extensions. So some browser doing something is never a reason not to do it for another browser.

Plus this being a javascript, if some forum wanted to integrate it for all users, all they'd have to do is add a script tag. Well, at least, that's all they'd have to do if I'd stop using Safari-isms. Oh, well.

I did write a javascript version of the keyboard browsing addon you mentioned. Not nearly as powerful and with no configurability... and I think I like the selection and up/down/enter method better. It is forum specific, which is both good and bad... good in that it only picks out the interesting links instead of highlighting every silly little thing (which is what you get with Opera's built in keyboard browsing... (shift+arrows)), but bad in that it doesn't work on sites that it wasn't designed for. Numbering each (or almost each) link tends to make pages ugly and I find it easier to scroll a selection around and press enter than to key in a 2-3 digit number and pressing enter.

Anyway... I've fixed it to automatically scroll the page if you move the selection offscreen, and move the selection if you scroll such that it is offscreen. Because I'm lazy, I used a couple of Safari-isms instead of doing it in a cross browser pure javascript way... (element.scrollIntoViewIfNeeded and element.getClientRects, specifically) so it probably no longer works in Firefox or other browsers.

Still at the same URL: http://fourohfour.info/greasescripts/forumkeyboard.user.js