March 17, 2010, 10:22:24 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: cpg1.4.26 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.4.25 or older update to this latest version as soon as possible.
[more]
   Home   Help Search Board rules Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Plugin: Keyboard Navigation  (Read 9150 times)
0 Members and 1 Guest are viewing this topic.
Αndré Topic starter
Dev Team member
****
Gender: Male
Germany Germany

Posts: 2574


aka eenemeenemuu


« on: January 06, 2009, 04: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.

* cpg1.4.x_plugin_keyboard_navigation_v1.1.zip (1.79 KB - downloaded 496 times.)
« Last Edit: January 10, 2009, 10:02:45 am by eenemeenemuu » Logged

Timos-Welt
Dev Team member
****
Gender: Male
Germany Germany

Posts: 709



WWW
« Reply #1 on: January 07, 2009, 12:18:37 am »

Great!  Smiley
Logged
Scias
Coppermine regular visitor
**
Posts: 84


« Reply #2 on: January 08, 2009, 12:09:18 am »

Sounds great, going to give it a whirl now. Thanks for the nice Plugin Wink
Logged
Scias
Coppermine regular visitor
**
Posts: 84


« Reply #3 on: January 10, 2009, 09:41:25 am »

Is it intended to only work for logged in Users? If not, that is what i am seeing currently. Sad
Logged
Αndré Topic starter
Dev Team member
****
Gender: Male
Germany Germany

Posts: 2574


aka eenemeenemuu


« Reply #4 on: January 10, 2009, 10:03:39 am »

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

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

Scias
Coppermine regular visitor
**
Posts: 84


« Reply #5 on: January 17, 2009, 11:32:27 pm »

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 Smiley
Logged
Αndré Topic starter
Dev Team member
****
Gender: Male
Germany Germany

Posts: 2574


aka eenemeenemuu


« Reply #6 on: January 17, 2009, 11:40:48 pm »

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:
if(Tastencode == 40)
{
blocking('picinfo','yes', 'block');
return false;
}
The rest should be done by the browser (tested with Firefox).
Logged

Scias
Coppermine regular visitor
**
Posts: 84


« Reply #7 on: January 28, 2009, 05:14:51 am »

Awesome. Thank you very much Wink
Logged
Heroe
Coppermine frequent poster
***
Gender: Male
France France

Posts: 114


WWW
« Reply #8 on: April 01, 2009, 05:48:57 pm »

The plugin don't seems to work for me Sad
abroadbg.com
user:test
pass:123654
Logged
Timos-Welt
Dev Team member
****
Gender: Male
Germany Germany

Posts: 709



WWW
« Reply #9 on: April 01, 2009, 08: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?!?
Logged
Αndré Topic starter
Dev Team member
****
Gender: Male
Germany Germany

Posts: 2574


aka eenemeenemuu


« Reply #10 on: April 02, 2009, 06: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.
Logged

Heroe
Coppermine frequent poster
***
Gender: Male
France France

Posts: 114


WWW
« Reply #11 on: April 02, 2009, 11:39:20 am »

I uninstall the plugin Smiley Timos-Welt is right i dont need at because i us enlarge it.
Thanks guys
Logged
TranzNDance
Dev Team member
****
Gender: Female
United States United States

Posts: 6146



WWW
« Reply #12 on: June 09, 2009, 05: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:
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;
}
Logged

Αndré Topic starter
Dev Team member
****
Gender: Male
Germany Germany

Posts: 2574


aka eenemeenemuu


« Reply #13 on: June 09, 2009, 07:05:50 am »

I never thought about using other keys than the arrow keys Wink

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?
Logged

kryspin
Coppermine novice
*
Posts: 21


« Reply #14 on: September 02, 2009, 02: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.
Logged
Αndré Topic starter
Dev Team member
****
Gender: Male
Germany Germany

Posts: 2574


aka eenemeenemuu


« Reply #15 on: September 02, 2009, 03:04:03 pm »

Open codebase.php, find
Code:
$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:
$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!
Logged

kryspin
Coppermine novice
*
Posts: 21


« Reply #16 on: September 02, 2009, 03: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.
Logged
papukaija
Contributor
***
Posts: 62


« Reply #17 on: September 06, 2009, 12:26:11 pm »

I never thought about using other keys than the arrow keys Wink

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.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.073 seconds with 18 queries.