]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - app/Resources/static/themes/_global/js/tools.js
Added shortcuts
[github/wallabag/wallabag.git] / app / Resources / static / themes / _global / js / tools.js
index ab30deb11393ac676605a0cef4032302ca773fba..9a98f0a6ff20fd9bb3870bb2a20591f1c0dc3fdc 100644 (file)
@@ -1,4 +1,8 @@
 const $ = require('jquery');
+require('mousetrap');
+
+/* Allows inline call qr-code call */
+import jrQrcode from 'jr-qrcode'; // eslint-disable-line
 
 function supportsLocalStorage() {
   try {
@@ -48,3 +52,14 @@ function initExport() {
 }
 
 export { savePercent, retrievePercent, initFilters, initExport };
+
+/** Shortcuts **/
+
+/* Go to */
+Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') });
+Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') });
+
+/* Actions */
+Mousetrap.bind('g a', function() {
+    $("#nav-btn-add").trigger("click");
+});