aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/_global/js
diff options
context:
space:
mode:
Diffstat (limited to 'app/Resources/static/themes/_global/js')
-rw-r--r--app/Resources/static/themes/_global/js/bookmarklet.js1
-rw-r--r--app/Resources/static/themes/_global/js/shortcuts/entry.js0
-rw-r--r--app/Resources/static/themes/_global/js/shortcuts/main.js15
-rw-r--r--app/Resources/static/themes/_global/js/tools.js11
4 files changed, 23 insertions, 4 deletions
diff --git a/app/Resources/static/themes/_global/js/bookmarklet.js b/app/Resources/static/themes/_global/js/bookmarklet.js
index 5174ff47..a497628b 100644
--- a/app/Resources/static/themes/_global/js/bookmarklet.js
+++ b/app/Resources/static/themes/_global/js/bookmarklet.js
@@ -1,4 +1,3 @@
1
2top['bookmarklet-url@wallabag.org'] = 1top['bookmarklet-url@wallabag.org'] =
3 '<!DOCTYPE html><html><head><title>bag it!</title>' + 2 '<!DOCTYPE html><html><head><title>bag it!</title>' +
4 '<link rel="icon" href="tpl/img/favicon.ico" />' + 3 '<link rel="icon" href="tpl/img/favicon.ico" />' +
diff --git a/app/Resources/static/themes/_global/js/shortcuts/entry.js b/app/Resources/static/themes/_global/js/shortcuts/entry.js
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/app/Resources/static/themes/_global/js/shortcuts/entry.js
diff --git a/app/Resources/static/themes/_global/js/shortcuts/main.js b/app/Resources/static/themes/_global/js/shortcuts/main.js
new file mode 100644
index 00000000..c81bf869
--- /dev/null
+++ b/app/Resources/static/themes/_global/js/shortcuts/main.js
@@ -0,0 +1,15 @@
1import Mousetrap from 'mousetrap';
2
3/** Shortcuts **/
4
5/* Go to */
6Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); });
7Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); });
8Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); });
9Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); });
10Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); });
11Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); });
12Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); });
13Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); });
14Mousetrap.bind('?', () => { window.location.href = Routing.generate('howto'); });
15Mousetrap.bind('g l', () => { window.location.href = Routing.generate('fos_user_security_logout'); });
diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js
index ab30deb1..cee84fa8 100644
--- a/app/Resources/static/themes/_global/js/tools.js
+++ b/app/Resources/static/themes/_global/js/tools.js
@@ -1,4 +1,9 @@
1const $ = require('jquery'); 1import $ from 'jquery';
2import './shortcuts/main';
3import './shortcuts/entry';
4
5/* Allows inline call qr-code call */
6import jrQrcode from 'jr-qrcode'; // eslint-disable-line
2 7
3function supportsLocalStorage() { 8function supportsLocalStorage() {
4 try { 9 try {
@@ -30,7 +35,7 @@ function initFilters() {
30 // no display if filters not available 35 // no display if filters not available
31 if ($('div').is('#filters')) { 36 if ($('div').is('#filters')) {
32 $('#button_filters').show(); 37 $('#button_filters').show();
33 $('.button-collapse-right').sideNav({ edge: 'right' }); 38 $('.js-filters-action').sideNav({ edge: 'right' });
34 $('#clear_form_filters').on('click', () => { 39 $('#clear_form_filters').on('click', () => {
35 $('#filters input').val(''); 40 $('#filters input').val('');
36 $('#filters :checked').removeAttr('checked'); 41 $('#filters :checked').removeAttr('checked');
@@ -43,7 +48,7 @@ function initExport() {
43 // no display if export not available 48 // no display if export not available
44 if ($('div').is('#export')) { 49 if ($('div').is('#export')) {
45 $('#button_export').show(); 50 $('#button_export').show();
46 $('.button-collapse-right').sideNav({ edge: 'right' }); 51 $('.js-export-action').sideNav({ edge: 'right' });
47 } 52 }
48} 53}
49 54