Add keyboard shortcuts and "anti-cache-postfix" for the main.js #26
This commit is contained in:
parent
4bb8dfb2e9
commit
5bfb5c1c2f
3 changed files with 34 additions and 18 deletions
|
@ -3,4 +3,19 @@ $(function () {
|
||||||
var page = $(e.target).val();
|
var page = $(e.target).val();
|
||||||
window.location = '/page/' + page;
|
window.location = '/page/' + page;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).on('keydown', function(e) {
|
||||||
|
switch (e.keyCode) {
|
||||||
|
case 76: // l
|
||||||
|
case 39: // -->
|
||||||
|
var prevUrl = $('#prev-image').attr('href');
|
||||||
|
if (prevUrl !== undefined) window.location = prevUrl;
|
||||||
|
break;
|
||||||
|
case 72: // h
|
||||||
|
case 37: // <--
|
||||||
|
var nextUrl = $('#next-image').attr('href');
|
||||||
|
if (nextUrl !== undefined) window.location = nextUrl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
|
|
||||||
<div class="btn-group pull-right clearfix" role="group">
|
<div class="btn-group pull-right clearfix" role="group">
|
||||||
{% if next-image %}
|
{% if next-image %}
|
||||||
<a class="btn btn-secondary" href="/show/{{ next-image.id }}">
|
<a class="btn btn-secondary" href="/show/{{ next-image.id }}" id="next-image">
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-secondary disabled" href="#">
|
<a class="btn btn-secondary disabled" href="#">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="fa fa-arrow-left"></span>
|
|
||||||
Neuer
|
<span class="fa fa-arrow-left"></span> Neuer
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a class="btn btn-secondary" href="/">
|
<a class="btn btn-secondary" href="/">
|
||||||
|
@ -18,12 +19,12 @@
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
{% if prev-image %}
|
{% if prev-image %}
|
||||||
<a class="btn btn-secondary" href="/show/{{ prev-image.id }}">
|
<a class="btn btn-secondary" href="/show/{{ prev-image.id }}" id="prev-image">
|
||||||
{% else %}
|
{% else %}
|
||||||
<a class="btn btn-secondary disabled" href="#">
|
<a class="btn btn-secondary disabled" href="#">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
Älter
|
|
||||||
<span class="fa fa-arrow-right"></span>
|
Älter <span class="fa fa-arrow-right"></span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -91,7 +91,7 @@
|
||||||
{% script "/assets/jquery/jquery.min.js" %}
|
{% script "/assets/jquery/jquery.min.js" %}
|
||||||
{% script "/assets/tether/dist/js/tether.min.js" %}
|
{% script "/assets/tether/dist/js/tether.min.js" %}
|
||||||
{% script "/assets/bootstrap/js/bootstrap.min.js" %}
|
{% script "/assets/bootstrap/js/bootstrap.min.js" %}
|
||||||
{% script "/js/main.js" %}
|
{% script "/js/main.js?v2" %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue