X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=app%2FResources%2Fstatic%2Fthemes%2F_global%2Fjs%2Ftools.js;h=9a98f0a6ff20fd9bb3870bb2a20591f1c0dc3fdc;hb=3cc78f06799b0c91957767e8d9255e67b30edd96;hp=55de090cc2ef234c0fa0b8bec8dc7ae6132ac6a1;hpb=644b340178136ef9465fdc3cf40f1de0f5f8c3d3;p=github%2Fwallabag%2Fwallabag.git diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 55de090c..9a98f0a6 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -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"); +});