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