Update item.tpl.html

This commit is contained in:
Flummi 2016-10-19 14:45:24 +00:00
parent ac48d23e49
commit bc8a64241d

View File

@ -7,7 +7,7 @@
</head>
<body>
<div class="id">[ID: {{ id }} | by: {{ username }}]</div>
<div class="return"><a href="/" title="return to main">f0ck.me</a></div><br />
<div class="return"><a href="/" title="return to main">f0ck.me</a></div>
<div class="controls">{% if next != null %}<a id="next" href="/{{ next }}"><<-</a> | {% endif %} <a id="random" href="/random" title="Random">random</a> {% if prev != null %} | <a id="prev" href="/{{ prev }}">->></a>{% endif %}</div><br />
{% if thumb != null %}
<div class="thumbnail">
@ -33,5 +33,31 @@
<span class="channel">channel: {{ userchannel }}</span>&nbsp;
<span class="network">network: {{ usernetwork }}</span>
</div>
<script>
function arrowKeys(e) {
switch(e.keyCode) {
case 39:
var prev = document.getElementById('prev');
if(prev) prev.click();
break;
case 37:
var next = document.getElementById('next');
if(next) next.click();
break;
}
}
if(document.readyState == 'complete' || document.readyState == 'loaded')
document.addEventListener('keydown', arrowKeys);
else {
if(/Chrome/i.test(navigator.userAgent))
window.addEventListener('load', function () {
document.addEventListener('keydown', arrowKeys);
});
else
document.addEventListener('DOMContentLoaded', function () {
document.addEventListener('keydown', arrowKeys);
});
}
</script>
</body>
</html>