aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/_global/js/tools.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/Resources/static/themes/_global/js/tools.js')
-rw-r--r--app/Resources/static/themes/_global/js/tools.js48
1 files changed, 2 insertions, 46 deletions
diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js
index 96d9fcf6..77879dcd 100644
--- a/app/Resources/static/themes/_global/js/tools.js
+++ b/app/Resources/static/themes/_global/js/tools.js
@@ -1,5 +1,7 @@
1import $ from 'jquery'; 1import $ from 'jquery';
2import Mousetrap from 'mousetrap'; 2import Mousetrap from 'mousetrap';
3import './shortcuts/main.js';
4import './shortcuts/entry.js';
3 5
4/* Allows inline call qr-code call */ 6/* Allows inline call qr-code call */
5import jrQrcode from 'jr-qrcode'; // eslint-disable-line 7import jrQrcode from 'jr-qrcode'; // eslint-disable-line
@@ -52,49 +54,3 @@ function initExport() {
52} 54}
53 55
54export { savePercent, retrievePercent, initFilters, initExport }; 56export { savePercent, retrievePercent, initFilters, initExport };
55
56/** Shortcuts **/
57
58/* Go to */
59Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); });
60Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); });
61Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); });
62Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); });
63Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); });
64Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); });
65Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); });
66Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); });
67Mousetrap.bind('g h', () => { window.location.href = Routing.generate('howto'); });
68Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); });
69
70
71/* Actions */
72Mousetrap.bind('g n', () => {
73 $('#nav-btn-add').trigger('click');
74});
75
76Mousetrap.bind('esc', () => {
77 $('.close').trigger('click');
78});
79
80// Display the first element of the current view
81Mousetrap.bind('right', () => {
82 $('ul.data li:first-child span.dot-ellipsis a')[0].click();
83});
84
85/* Article view */
86Mousetrap.bind('o', () => {
87 $('ul.side-nav li:nth-child(2) a i')[0].click();
88});
89
90Mousetrap.bind('s', () => {
91 $('ul.side-nav li:nth-child(5) a i')[0].click();
92});
93
94Mousetrap.bind('a', () => {
95 $('ul.side-nav li:nth-child(4) a i')[0].click();
96});
97
98Mousetrap.bind('del', () => {
99 $('ul.side-nav li:nth-child(6) a i')[0].click();
100});