From f9cded7dd2acab3af8ff8481941e0c199daf8270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 24 Oct 2016 20:37:49 +0200 Subject: Added new shortcuts --- app/Resources/static/themes/_global/js/tools.js | 37 ++++++++++++++++++++++++- app/config/config.yml | 1 - 2 files changed, 36 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index 9a98f0a6..d6a2d803 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js @@ -58,8 +58,43 @@ export { savePercent, retrievePercent, initFilters, initExport }; /* Go to */ Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') }); Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') }); +Mousetrap.bind('g r', function() { window.location.href = Routing.generate('archive') }); +Mousetrap.bind('g a', function() { window.location.href = Routing.generate('all') }); +Mousetrap.bind('g t', function() { window.location.href = Routing.generate('tag') }); +Mousetrap.bind('g c', function() { window.location.href = Routing.generate('config') }); +Mousetrap.bind('g i', function() { window.location.href = Routing.generate('import') }); +Mousetrap.bind('g d', function() { window.location.href = Routing.generate('developer') }); +Mousetrap.bind('g h', function() { window.location.href = Routing.generate('howto') }); +Mousetrap.bind('g l', function() { window.location.href = Routing.generate('logout') }); + /* Actions */ -Mousetrap.bind('g a', function() { +Mousetrap.bind('g n', function() { $("#nav-btn-add").trigger("click"); }); + +Mousetrap.bind('esc', function() { + $(".close").trigger("click"); +}); + +// Display the first element of the current view +Mousetrap.bind('right', function() { + $("ul.data li:first-child span.dot-ellipsis a")[0].click(); +}); + +/* Article view */ +Mousetrap.bind('o', function() { + $("ul.side-nav li:nth-child(2) a i")[0].click(); +}); + +Mousetrap.bind('s', function() { + $("ul.side-nav li:nth-child(5) a i")[0].click(); +}); + +Mousetrap.bind('a', function() { + $("ul.side-nav li:nth-child(4) a i")[0].click(); +}); + +Mousetrap.bind('del', function() { + $("ul.side-nav li:nth-child(6) a i")[0].click(); +}); diff --git a/app/config/config.yml b/app/config/config.yml index 3cde2377..e0e1ad97 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -363,5 +363,4 @@ fos_js_routing: - import - developer - howto - - about - logout -- cgit v1.2.3