forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Αndré on January 06, 2009, 05:56:53 pm

Title: Plugin: Keyboard Navigation
Post by: Αndré on January 06, 2009, 05:56:53 pm
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.
Title: Re: Plugin: Keyboard Navigation
Post by: Timos-Welt on January 07, 2009, 01:18:37 am
Great!  :)
Title: Re: Plugin: Keyboard Navigation
Post by: Scias on January 08, 2009, 01:09:18 am
Sounds great, going to give it a whirl now. Thanks for the nice Plugin ;)
Title: Re: Plugin: Keyboard Navigation
Post by: Scias on January 10, 2009, 10:41:25 am
Is it intended to only work for logged in Users? If not, that is what i am seeing currently. :(
Title: Re: Plugin: Keyboard Navigation
Post by: Αndré on January 10, 2009, 11:03:39 am
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.
Title: Re: Plugin: Keyboard Navigation
Post by: Scias on January 18, 2009, 12:32:27 am
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 :)
Title: Re: Plugin: Keyboard Navigation
Post by: Αndré on January 18, 2009, 12:40:48 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:
Code: [Select]
if(Tastencode == 40)
{
blocking('picinfo','yes', 'block');
return false;
}
The rest should be done by the browser (tested with Firefox).
Title: Re: Plugin: Keyboard Navigation
Post by: Scias on January 28, 2009, 06:14:51 am
Awesome. Thank you very much ;)
Title: Re: Plugin: Keyboard Navigation
Post by: Heroe on April 01, 2009, 06:48:57 pm
The plugin don't seems to work for me :(
abroadbg.com
user:test
pass:123654
Title: Re: Plugin: Keyboard Navigation
Post by: 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?!?
Title: Re: Plugin: Keyboard Navigation
Post by: Αndré on April 02, 2009, 07:51:43 am
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.
Title: Re: Plugin: Keyboard Navigation
Post by: Heroe on April 02, 2009, 12:39:20 pm
I uninstall the plugin :) Timos-Welt is right i dont need at because i us enlarge it.
Thanks guys
Title: Re: Plugin: Keyboard Navigation
Post by: Tranz on June 09, 2009, 06:24:41 am
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
Code: [Select]
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;
}
Title: Re: Plugin: Keyboard Navigation
Post by: Α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?
Title: Re: Plugin: Keyboard Navigation
Post by: kryspin on September 02, 2009, 03:58:42 pm
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.
Title: Re: Plugin: Keyboard Navigation
Post by: Αndré on September 02, 2009, 04:04:03 pm
Open codebase.php, find
Code: [Select]
$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
Code: [Select]
$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!
Title: Re: Plugin: Keyboard Navigation
Post by: kryspin on September 02, 2009, 04:12:46 pm
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.
Title: Re: Plugin: Keyboard Navigation
Post by: papukaija on September 06, 2009, 01:26:11 pm
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.