aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default/template/picture_nav_buttons.tpl
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2010-11-25 21:26:29 +0000
committerrvelices <rv-github@modusoptimus.com>2010-11-25 21:26:29 +0000
commitbad80308ea2a987f34b44dca1912010f78f3341a (patch)
tree55b5c558b680e27a36bfe0f37aefcec5caba70ae /themes/default/template/picture_nav_buttons.tpl
parentc3df7f2705140e3830438db7a0dc24eaa1b5cf28 (diff)
-fix css rules
- comment_list.tpl style was broken - picture_nav_buttons.tpl shorter javascript git-svn-id: http://piwigo.org/svn/trunk@7877 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/template/picture_nav_buttons.tpl')
-rw-r--r--themes/default/template/picture_nav_buttons.tpl28
1 files changed, 14 insertions, 14 deletions
diff --git a/themes/default/template/picture_nav_buttons.tpl b/themes/default/template/picture_nav_buttons.tpl
index c2a34eb5f..0bb50bd8f 100644
--- a/themes/default/template/picture_nav_buttons.tpl
+++ b/themes/default/template/picture_nav_buttons.tpl
@@ -63,42 +63,42 @@
</div>
-<script type="text/javascript">// <![CDATA[
-{literal}
-function keyboardNavigation(e)
+<script type="text/javascript">// <![CDATA[ {literal}
+document.onkeydown = function(e)
{
- if(!e) e=window.event;
+ e=e||window.event;
if (e.altKey) return true;
- var target = e.target || e.srcElement;
+ var target = e.target||e.srcElement;
if (target && target.type) return true; //an input editable element
- var keyCode=e.keyCode || e.which;
+ var keyCode = e.keyCode||e.which;
var docElem = document.documentElement;
+ var url;
switch(keyCode) {
{/literal}
{if isset($next)}
- case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth ){ldelim}window.location="{$next.U_IMG}".replace( "&amp;", "&" ); return false; } break;
+ case 63235: case 39: if (e.ctrlKey || docElem.scrollLeft==docElem.scrollWidth-docElem.clientWidth)url="{$next.U_IMG|@escape:jasvascript}"; break;
{/if}
{if isset($previous)}
- case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0){ldelim}window.location="{$previous.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
+ case 63234: case 37: if (e.ctrlKey || docElem.scrollLeft==0)url="{$previous.U_IMG|@escape:jasvascript}"; break;
{/if}
{if isset($first)}
- /*Home*/case 36: if (e.ctrlKey){ldelim}window.location="{$first.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
+ /*Home*/case 36: if (e.ctrlKey)url="{$first.U_IMG|@escape:jasvascript}"; break;
{/if}
{if isset($last)}
- /*End*/case 35: if (e.ctrlKey){ldelim}window.location="{$last.U_IMG|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
+ /*End*/case 35: if (e.ctrlKey)url="{$last.U_IMG|@escape:jasvascript}"; break;
{/if}
{if isset($U_UP) and !isset($slideshow)}
- /*Up*/case 38: if (e.ctrlKey){ldelim}window.location="{$U_UP|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
+ /*Up*/case 38: if (e.ctrlKey)url="{$U_UP|@escape:jasvascript}"; break;
{/if}
{if isset($slideshow.U_START_PLAY)}
- /*Pause*/case 32: {ldelim}window.location="{$slideshow.U_START_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
+ /*Pause*/case 32: url="{$slideshow.U_START_PLAY|@escape:jasvascript}"; break;
{/if}
{if isset($slideshow.U_STOP_PLAY)}
- /*Play*/case 32: {ldelim}window.location="{$slideshow.U_STOP_PLAY|@escape:jasvascript}".replace("&amp;","&"); return false; } break;
+ /*Play*/case 32: url="{$slideshow.U_STOP_PLAY|@escape:jasvascript}"; break;
{/if}
}
+ if (url) {ldelim}window.location=url.replace("&amp;","&"); return false;}
return true;
}
-document.onkeydown=keyboardNavigation;
// ]]></script>