aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-02-13 01:25:07 +0000
committerrvelices <rv-github@modusoptimus.com>2008-02-13 01:25:07 +0000
commite31b4e49d61a23cee65d40240a249c062f37c596 (patch)
tree99c66f2a285b3278d81a89e3b1070b6292a30c41
parente3a7b726d2fda5a8b32eeb0c9b24cfd908d0dee7 (diff)
merge revisions 2205 and 2206 from trunk to branch-1_7
feature 803: Implement keyboard navigation (left/right arrows) on the picture page fix: non-image elements without representative and without mime type icon default to thumbnail if possible git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2207 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/functions_picture.inc.php5
-rw-r--r--template/yoga/picture.tpl24
2 files changed, 29 insertions, 0 deletions
diff --git a/include/functions_picture.inc.php b/include/functions_picture.inc.php
index 09b7c90ce..1a479881c 100644
--- a/include/functions_picture.inc.php
+++ b/include/functions_picture.inc.php
@@ -149,6 +149,11 @@ function get_image_location($element_info)
$ext = get_extension($element_info['path']);
$path = get_themeconf('mime_icon_dir');
$path.= strtolower($ext).'.png';
+ if ( !file_exists(PHPWG_ROOT_PATH.$path)
+ and !empty($element_info['tn_ext']) )
+ {
+ $path = get_thumbnail_location($element_info);
+ }
}
// plugins want another location ?
diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl
index 9c1217af2..128f0ff65 100644
--- a/template/yoga/picture.tpl
+++ b/template/yoga/picture.tpl
@@ -212,3 +212,27 @@
</div>
<!-- END comments -->
+
+<script type="text/javascript">
+<!-- BEGIN next -->
+var nextUrl = "{next.U_IMG}".replace( "&amp;", "&" );
+<!-- END next -->
+<!-- BEGIN previous -->
+var prevUrl = "{previous.U_IMG}".replace( "&amp;", "&" );
+<!-- 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;
+}
+document.onkeydown = keypress;
+</script> \ No newline at end of file