Plugin: Keyboard Navigation Plugin: Keyboard Navigation
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Plugin: Keyboard Navigation

Started by Αndré, January 06, 2009, 05:56:53 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

Αndré

With this plugin you can navigate to the previous/next picture, go back to the thumbnail page and switch the file info details via the keyboard arrows.

Timos-Welt


Scias

Sounds great, going to give it a whirl now. Thanks for the nice Plugin ;)

Scias

Is it intended to only work for logged in Users? If not, that is what i am seeing currently. :(

Αndré

Thanks for your report. I haven't tested it only while I was logged in ;)

Please see my first post. With version 1.1 it should work for all users.

Scias

Oh, i apologize for bugging you once again, but one of the Visitors mentioned a good idea, is that will there be a way to change the functions of the Keys? For example, instead of the DOWN ARROW KEY, opening the Information, it could instead scroll down a small amount with each hit, or be held down to continue scrolling?

This would be a excellent addition, though i was unsure if this was thought of yet, so i just thought i'd pass the idea by, this Plugin has a good future to it :)

Αndré

Quote from: Scias on January 18, 2009, 12:32:27 AM
instead of the DOWN ARROW KEY, opening the Information, it could instead scroll down a small amount with each hit, or be held down to continue scrolling?

Open codebase.php and delete lines 52-56:
if(Tastencode == 40)
{
blocking('picinfo','yes', 'block');
return false;
}

The rest should be done by the browser (tested with Firefox).

Scias


Heroe

The plugin don't seems to work for me :(
abroadbg.com
user:test
pass:123654

Timos-Welt

You're using EnlargeIt! which comes with its own keyboard navigation (and uses the same JS key listener). It doesn't make much sense to me to combine it with eenemeenemuu's plugin?!?

Αndré

Quote from: Timos-Welt on April 01, 2009, 09:40:54 PM
You're using EnlargeIt! which comes with its own keyboard navigation (and uses the same JS key listener). It doesn't make much sense to me to combine it with eenemeenemuu's plugin?!?
I've nothing to add.

I visited your website and keyboard navigation (with EnlargeIt!) works fine for me.

Heroe

I uninstall the plugin :) Timos-Welt is right i dont need at because i us enlarge it.
Thanks guys

Tranz

Thanks for this useful plugin, eenemeenemuu! I edited the code to add the ability to use the same shortcuts that gmail uses, in case anyone is interested in implementing it, too:

in codebase.php

if(Tastencode == 37 || Tastencode == 75 || Tastencode == 80) //left arrow or k or p
window.location = document.getElementById('prev').href;
if(Tastencode == 39 || Tastencode == 74|| Tastencode == 78) //right arrow or j or n
window.location = document.getElementById('next').href;
if(Tastencode == 38 || Tastencode == 85) //up arrow or u
window.location = document.getElementById('thumb').href;
if(Tastencode == 40 || Tastencode == 79) //down arrow or o
{
blocking('picinfo','yes', 'block');
return false;
}

Αndré

I never thought about using other keys than the arrow keys ;)

If desired, it should not be very hard to add a config page where the admin (or maybe each user itself) can choose his/her preferred keys.

Thoughts?

kryspin

Hi,
I just installed the plugin and arrows up and down work just fine, but arrows left and right don't seem to work at all (nothing happens, when pressed). Am I doing something wrong? The site is foto.stulc.cz. I would be grateful for help.

Αndré

Open codebase.php, find
$html = str_replace('><img src="'.$location.'images/prev.gif"', ' accesskey="b" id="prev"><img src="'.$location.'images/prev.gif"', $html);
$html = str_replace('><img src="'.$location.'images/next.gif"', ' accesskey="n" id="next"><img src="'.$location.'images/next.gif"', $html);

and replace with
$html = str_replace('><img src="'.$location.'images/nav_left.gif"', ' accesskey="b" id="prev"><img src="'.$location.'images/nav_left.gif"', $html);
$html = str_replace('><img src="'.$location.'images/nav_right.gif"', ' accesskey="n" id="next"><img src="'.$location.'images/nav_right.gif"', $html);



BTW: You are running an old version of Coppermine with a lot of security vulnerabilities. Upgrade to the latest version immediately!

kryspin

Thank you so much. Now it works like miracle.

I know I should upgrade, but I made a lot of mods (all from this forum) to the code and I don't really want to loose them. But I know I'll have to do it soon anyway.

papukaija

Quote from: Αndré on June 09, 2009, 08:05:50 AM
I never thought about using other keys than the arrow keys ;)

If desired, it should not be very hard to add a config page where the admin (or maybe each user itself) can choose his/her preferred keys.

Thoughts?
A config page for admins might be useful. User based config page should be admin configurable.