source: extensions/luciano/template/picture_nav_keys.tpl @ 27153

Last change on this file since 27153 was 12534, checked in by plg, 12 years ago

bug fixed: keyboard navigation available on Luciano (thanks to sichr.net for the tip)

bug fixed: compatibility with Google+1 plugin on picture.php

File size: 1.7 KB
Line 
1{* Allows going thru the photogallery using left/right keys *}
2
3<script type="text/javascript">// <![CDATA[
4{literal}
5function keyboardNavigation(e)
6{
7if(!e) e=window.event;
8if (e.altKey) return true;
9var target = e.target || e.srcElement;
10if (target && target.type) return true; //an input editable element
11var keyCode=e.keyCode || e.which;
12var docElem = document.documentElement;
13switch(keyCode) {
14{/literal}
15{if isset($next)}
16case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){ldelim}window.location="{$next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
17{/if}
18{if isset($previous)}
19case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ldelim}window.location="{$previous.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
20{/if}
21{if isset($first)}
22/*Home*/case 36: if (e.ctrlKey){ldelim}window.location="{$first.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
23{/if}
24{if isset($last)}
25/*End*/case 35: if (e.ctrlKey){ldelim}window.location="{$last.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
26{/if}
27{if isset($U_UP) and !isset($slideshow)}
28/*Up*/case 38: if (e.ctrlKey){ldelim}window.location="{$U_UP|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
29{/if}
30
31{if isset($slideshow.U_START_PLAY)}
32/*Pause*/case 32: {ldelim}window.location="{$slideshow.U_START_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
33{/if}
34{if isset($slideshow.U_STOP_PLAY)}
35/*Play*/case 32: {ldelim}window.location="{$slideshow.U_STOP_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
36{/if}
37}
38return true;
39}
40document.onkeydown=keyboardNavigation;
41// ]]></script>
Note: See TracBrowser for help on using the repository browser.