aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/_global/js
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2016-11-16 09:35:59 +0100
committerGitHub <noreply@github.com>2016-11-16 09:35:59 +0100
commite042a5d78fc7676eb399f61d199e8ec0045fbd1f (patch)
tree2bc79fda2ca07baf246a36543fd4419a7af7a7a8 /app/Resources/static/themes/_global/js
parent644b340178136ef9465fdc3cf40f1de0f5f8c3d3 (diff)
parent94f2057ffefdb164ae388a6971b4ed052082a434 (diff)
downloadwallabag-e042a5d78fc7676eb399f61d199e8ec0045fbd1f.tar.gz
wallabag-e042a5d78fc7676eb399f61d199e8ec0045fbd1f.tar.zst
wallabag-e042a5d78fc7676eb399f61d199e8ec0045fbd1f.zip
Merge pull request #2495 from wallabag/add-shortcuts
Added shortcuts
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.js4
4 files changed, 18 insertions, 2 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..ef6a1b84
--- /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('logout'); });
diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js
index 55de090c..568b2dce 100644
--- a/app/Resources/static/themes/_global/js/tools.js
+++ b/app/Resources/static/themes/_global/js/tools.js
@@ -1,4 +1,6 @@
1const $ = require('jquery'); 1import $ from 'jquery';
2import './shortcuts/main';
3import './shortcuts/entry';
2 4
3/* Allows inline call qr-code call */ 5/* Allows inline call qr-code call */
4import jrQrcode from 'jr-qrcode'; // eslint-disable-line 6import jrQrcode from 'jr-qrcode'; // eslint-disable-line