diff options
Diffstat (limited to 'template/yoga/picture.tpl')
-rw-r--r-- | template/yoga/picture.tpl | 24 |
1 files changed, 24 insertions, 0 deletions
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( "&", "&" ); +<!-- END next --> +<!-- BEGIN previous --> +var prevUrl = "{previous.U_IMG}".replace( "&", "&" ); +<!-- 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 |