diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-02 16:44:20 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2016-11-15 21:54:50 +0100 |
commit | 16ef7607f43ebc3e0134360b7657af191e14fe12 (patch) | |
tree | 81cdc13b1b626e313a51119847c5b7c603ca5fba /app/Resources/static/themes/material | |
parent | af61cb80eb600618df95a01a15a08e87fc878c2a (diff) | |
download | wallabag-16ef7607f43ebc3e0134360b7657af191e14fe12.tar.gz wallabag-16ef7607f43ebc3e0134360b7657af191e14fe12.tar.zst wallabag-16ef7607f43ebc3e0134360b7657af191e14fe12.zip |
Reorganized JS folders for shortcuts
Diffstat (limited to 'app/Resources/static/themes/material')
-rwxr-xr-x | app/Resources/static/themes/material/js/init.js | 2 | ||||
-rw-r--r-- | app/Resources/static/themes/material/js/shortcuts/entry.js | 19 | ||||
-rw-r--r-- | app/Resources/static/themes/material/js/shortcuts/main.js | 13 |
3 files changed, 34 insertions, 0 deletions
diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index d8edeed1..3ff8de0a 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js | |||
@@ -1,6 +1,8 @@ | |||
1 | import $ from 'jquery'; | 1 | import $ from 'jquery'; |
2 | import annotator from 'annotator'; | 2 | import annotator from 'annotator'; |
3 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; | 3 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; |
4 | import './shortcuts/main.js'; | ||
5 | import './shortcuts/entry.js'; | ||
4 | 6 | ||
5 | require('materialize'); // eslint-disable-line | 7 | require('materialize'); // eslint-disable-line |
6 | 8 | ||
diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js new file mode 100644 index 00000000..900a8214 --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js | |||
@@ -0,0 +1,19 @@ | |||
1 | /* open original article */ | ||
2 | Mousetrap.bind('o', () => { | ||
3 | $('ul.side-nav li:nth-child(2) a i')[0].click(); | ||
4 | }); | ||
5 | |||
6 | /* mark as favorite */ | ||
7 | Mousetrap.bind('s', () => { | ||
8 | $('ul.side-nav li:nth-child(5) a i')[0].click(); | ||
9 | }); | ||
10 | |||
11 | /* mark as read */ | ||
12 | Mousetrap.bind('a', () => { | ||
13 | $('ul.side-nav li:nth-child(4) a i')[0].click(); | ||
14 | }); | ||
15 | |||
16 | /* delete */ | ||
17 | Mousetrap.bind('del', () => { | ||
18 | $('ul.side-nav li:nth-child(6) a i')[0].click(); | ||
19 | }); | ||
diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js new file mode 100644 index 00000000..ccd3c92d --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/main.js | |||
@@ -0,0 +1,13 @@ | |||
1 | /* Actions */ | ||
2 | Mousetrap.bind('g n', () => { | ||
3 | $('#nav-btn-add').trigger('click'); | ||
4 | }); | ||
5 | |||
6 | Mousetrap.bind('esc', () => { | ||
7 | $('.close').trigger('click'); | ||
8 | }); | ||
9 | |||
10 | // Display the first element of the current view | ||
11 | Mousetrap.bind('right', () => { | ||
12 | $('ul.data li:first-child span.dot-ellipsis a')[0].click(); | ||
13 | }); | ||