diff --git a/themes/_global/js/keyboard.js b/themes/_global/js/keyboard.js
new file mode 100644
index 000000000..26978cb29
--- /dev/null
+++ b/themes/_global/js/keyboard.js
@@ -0,0 +1,27 @@
+function navigateKeyboard(leftURL, rightURL) {
+ window.addEventListener("keypress", function (event) {
+ var key = event.which || event.keyCode; // event.keyCode is used for IE8 and earlier versions
+ console.log("key pressed : " + key);
+ switch (key) {
+ case 37:
+ // left arrow
+ if (leftURL != "?view=view&id=") {
+ window.location = window.location.origin + window.location.pathname + leftURL;
+ }
+ break;
+ /*
+ case 38:
+ // top arrow
+ window.location = window.location.origin + window.location.pathname + window.location.search + "#top";
+ break;
+ */
+ case 39:
+ //right arrow
+ if (rightURL != "?view=view&id=") {
+ window.location = window.location.origin + window.location.pathname + rightURL;
+ }
+ break;
+ }
+
+ }, false);
+}
\ No newline at end of file
diff --git a/themes/baggy/_head.twig b/themes/baggy/_head.twig
index d252130ca..3799f8fb2 100755
--- a/themes/baggy/_head.twig
+++ b/themes/baggy/_head.twig
@@ -36,4 +36,5 @@
+
diff --git a/themes/baggy/css/main.css b/themes/baggy/css/main.css
index 1b221021b..5319fd681 100755
--- a/themes/baggy/css/main.css
+++ b/themes/baggy/css/main.css
@@ -873,6 +873,20 @@ blockquote {
font-size: 1.5em;
}
+.leftPosF {
+ position: fixed;
+ right: 24%;
+ bottom: 2em;
+ font-size: 1.5em;
+}
+
+.rightPosF {
+ position: fixed;
+ right: 16%;
+ bottom: 2em;
+ font-size: 1.5em;
+}
+
#article_toolbar {
margin-bottom: 1em;
}
@@ -970,6 +984,12 @@ pre code {
.topPosF {
right: 2.5em;
}
+ .leftPosF {
+ right: 4.5em;
+ }
+ .rightPosF {
+ right: 0.5em;
+ }
}
@media screen and (max-width: 700px) {
@@ -1063,6 +1083,14 @@ pre code {
display: none;
}
+ #article_toolbar .leftPosF {
+ display: none;
+ }
+
+ #article_toolbar .rightPosF {
+ display: none;
+ }
+
#article {
width: 100%;
}
diff --git a/themes/baggy/view.twig b/themes/baggy/view.twig
index ae02ce484..68af03f5b 100755
--- a/themes/baggy/view.twig
+++ b/themes/baggy/view.twig
@@ -8,7 +8,7 @@
@@ -103,5 +103,6 @@
retrievePercent({{ entry.id|e }});
});
});
+ navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}');
{% endblock %}
diff --git a/themes/default/_head.twig b/themes/default/_head.twig
index 91a555cb0..f3c9d8867 100755
--- a/themes/default/_head.twig
+++ b/themes/default/_head.twig
@@ -33,4 +33,5 @@
+
diff --git a/themes/default/view.twig b/themes/default/view.twig
index 0d4ec1744..9c9d15615 100755
--- a/themes/default/view.twig
+++ b/themes/default/view.twig
@@ -5,7 +5,7 @@
{% include '_pocheit-form.twig' %}
@@ -125,5 +125,6 @@
$('#article_toolbar .tool.top').parent().hide();
}
});
+ navigateKeyboard('?view=view&id={{ navigate.nextid|e }}','?view=view&id={{ navigate.previousid|e }}');
{% endblock %}