aboutsummaryrefslogtreecommitdiffstats
path: root/template/yoga
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-02-15 22:10:26 +0000
committerrvelices <rv-github@modusoptimus.com>2008-02-15 22:10:26 +0000
commitea3769d28365be0e6f1a08c40508bb8c5543c6b9 (patch)
tree41cb924c8a5468d4a82a82ac8b7e0da283de76ac /template/yoga
parente31b4e49d61a23cee65d40240a249c062f37c596 (diff)
enhance keyboard navigation on picture page (first,last,thumbs)
git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2210 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'template/yoga')
-rw-r--r--template/yoga/picture.tpl37
1 files changed, 21 insertions, 16 deletions
diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl
index 128f0ff65..db7c95e8a 100644
--- a/template/yoga/picture.tpl
+++ b/template/yoga/picture.tpl
@@ -214,25 +214,30 @@
<!-- END comments -->
<script type="text/javascript">
+function keyboardNavigation(e)
+{
+ if(!e) var e=window.event;
+ if (e.altKey) return true;
+ var target = e.target || e.srcElement;
+ if (target && target.type) return true; //an input editable element
+ var keyCode=e.keyCode || e.which;
+ var docElem = document.documentElement;
+ switch(keyCode) {
<!-- BEGIN next -->
-var nextUrl = "{next.U_IMG}".replace( "&amp;", "&" );
+ case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){window.location="{next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
<!-- END next -->
<!-- BEGIN previous -->
-var prevUrl = "{previous.U_IMG}".replace( "&amp;", "&" );
+ case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ window.location="{previous.U_IMG}".replace("&amp;","&"); return false; } break;
<!-- END previous -->
-function keypress(e)
-{
- if(!e) var e=window.event;
- if (e.altKey) return true;
- var target = e.target || e.srcElement;
- if (target && target.type) return true; //an input editable element
- var keyCode=e.keyCode || e.which;
- var docElem = document.documentElement;
- switch(keyCode) {
- case 63235: case 39: if (nextUrl && (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth) ){window.location=nextUrl; return false; } break;
- case 63234: case 37: if (prevUrl && (e.ctrlKey || docElem.scrollLeft==0) ){ window.location=prevUrl; return false; } break;
- }
- return true;
+<!-- BEGIN first -->
+ /*Home*/case 36: if (e.ctrlKey){window.location="{first.U_IMG}".replace("&amp;","&"); return false; } break;
+<!-- END first -->
+<!-- BEGIN last -->
+ /*End*/case 35: if (e.ctrlKey){window.location="{last.U_IMG}".replace("&amp;","&"); return false; } break;
+<!-- END last -->
+ /*Up*/case 38: if (e.ctrlKey){window.location="{U_UP}".replace("&amp;","&"); return false; } break;
+ }
+ return true;
}
-document.onkeydown = keypress;
+document.onkeydown=keyboardNavigation;
</script> \ No newline at end of file