]> 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 55de090cc2ef234c0fa0b8bec8dc7ae6132ac6a1..9a98f0a6ff20fd9bb3870bb2a20591f1c0dc3fdc 100644 (file)
@@ -1,4 +1,5 @@
 const $ = require('jquery');
+require('mousetrap');
 
 /* Allows inline call qr-code call */
 import jrQrcode from 'jr-qrcode'; // eslint-disable-line
@@ -51,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");
+});