PDA

View Full Version : Miscellaneous Hacks - Keyboard Navigator (CTRL+Arrows shortcuts)


Vitaly
03-05-2009, 10:00 PM
vb 4.x version here (https://vborg.vbsupport.ru/showthread.php?t=243397)


This hack adds some keyboard shortcuts for accelerated navigation. Very convenient, when you browse forum without mouse (notebook with touchpad and so on).

Current shortcuts:
Ctrl + Left - previous page (current page - 1)
Ctrl + Right - next page (current page + 1)
Ctrl + Up - 1 level up.
(!) Ctrl + Down - Go to next unread thread in current forum (only for registered forum members)Demo: http://forum.rcdesign.ru/f22/ (without CTRL+DOWN for guests)

(!) "Next Unread" is taken from end (the most old unread thread). Reason is simple - that makes less returns, since top threads are updated very often.

PS. As you can see from screenshot, only Ctrl + Left/Right have visual helpers. If someone have good idea how to show, that Ctrl+ Up/Down are working too - feel free to share.

This mod is developped here: http://github.com/rcdesign/vb-keyboard_navigator . Patches are welcome.

History

0.6
- Redirects for moved threads caused error for CTRL+Down

0.5
- added lock when cursor focus is in edit area
- removed CTRL+HOME shortcut (uncomment in template, if really need it)

0.4
- added Ctrl+Down

0.2, 0.3
- Small JS fixes
- Nice helpers in pagebar (see screenshot)

0.1
- First Public Release

jonah1892
03-06-2009, 08:32 PM
first post :D

interesting mod, ill be trying it on my localhost before i put it on my live site

DieselMinded
03-06-2009, 09:34 PM
anyone installed this yet?

GhoHan
03-06-2009, 09:37 PM
Good Idea sir
Thank you very2 much
i will try this ..

Vitaly
03-06-2009, 10:13 PM
Ups... it was broken in IE, sorry :) . Please, reupload with new JS file (first post updated).

PS. I'm not strong in javascript. So, your experienced advices are always welcome :)

Vitaly
03-07-2009, 02:53 PM
Undated to v0.2

1. Simplifyed JS
2. Nice texts in pagebar ( "<- Ctrl" and "Ctrl ->", see new screenshot ).

Thinking about "what to do with Ctrl + Down". Next unread thread in current forum? Is it convenient use-case?

jambo_1969
03-07-2009, 03:48 PM
Installed and Uninstalled.

Ctrl up the only one reporting an action.

Vitaly
03-07-2009, 04:06 PM
Jambo, refresh page wiith CTRL+F5. Probably, your browser cached old JS file.

You can check here: http://forum.rcdesign.ru - all buttons are ok.

jambo_1969
03-07-2009, 04:14 PM
Tar muchly - reinstalled :D

xuanhuy238
03-08-2009, 03:51 AM
i don't use shortcut of previous and next pages

dvbusuario
03-09-2009, 05:30 AM
i don't use shortcut of previous and next pages

Me too!

Vitaly
03-14-2009, 05:48 AM
Everybody welcome to test new version 0.4 !


What's chaged:
No uploads needed (desided to include javascript in template)
CTRL + DOWN hotkey (not for guests) !!! - Move to new unread thread in current forum. If no new thread - then go up to thread list.How CTRL + DOWN work.

The most old unread thread taken from current forum. Then user redirected to first unread post in that thread.

Why oldest thread, not newest?

Usability question. Still not desided, what is better. It seems, that top threads are updated more often. So, if you navigate from start, more "come back" happens. IMHO, that's a bit irritating.

How to install:

Make shure, that "readed posts" are tracked in database (forum setting).
Just import product.

Vitaly
03-17-2009, 04:17 PM
Fixed some bugs in 0.4 pre-release and released new 0.4 version (first post). Ctrl+Down added enougth functionality to browse forum with shortcuts.

Enjoy!

As you can see from screenshot, only Ctrl + Left/Right have visual helpers. If someone have good idea how to show, that Ctrl+ Up/Down are working too - feel free to shre.

Jasem
03-24-2009, 02:12 PM
Great job, thank you!

installed

Vitaly
08-04-2009, 06:15 AM
I've added all shortcuts lock, when user edit text in any input or textarea field.

That prevents conflicts, when user wish to move cursor on word left/right, but is redirected to another page instead.

Dr. Bantham
08-09-2009, 12:45 PM
Great mod!

The latest version introduces a conflict with cyb Chatbox. The "Message..." prompt will not disappear as it should when activating the input box.

Vitaly
08-09-2009, 04:56 PM
Try to comment out (or delete) this block:

var c = document.getElementsByTagName('input');
for (var i=0; i<c.length; i++) {
if (c[i].type == 'text') {
c[i].onfocus = onFocusHandler;
c[i].onblur = onBlurHandler;
}
}


in template kbd_nav_block.

Zi55
01-16-2010, 04:37 AM
I install it in my forum , but only the CTRL Up/down is working Left and right not working at all
.l try it also in test forum , the same thing happen
Thanks

TK1990
02-24-2010, 11:45 AM
I install it in my forum , but only the CTRL Up/down is working Left and right not working at all
.l try it also in test forum , the same thing happen
Thanks

Same here.

Vitaly
02-24-2010, 11:58 AM
1. vB version ?
2. Skin ?

Please check. that Ctrl -> and <- Ctrl were added as on screenshot from description.

netwind
10-11-2010, 03:27 AM
If anybody need work it with vb3.6, just update template 'pagenav'.
This hack need rel="next" and rel="prev" like in modern vb versions.