diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-16 09:35:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-16 09:35:59 +0100 |
commit | e042a5d78fc7676eb399f61d199e8ec0045fbd1f (patch) | |
tree | 2bc79fda2ca07baf246a36543fd4419a7af7a7a8 /app/Resources/static/themes/baggy | |
parent | 644b340178136ef9465fdc3cf40f1de0f5f8c3d3 (diff) | |
parent | 94f2057ffefdb164ae388a6971b4ed052082a434 (diff) | |
download | wallabag-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/baggy')
5 files changed, 46 insertions, 9 deletions
diff --git a/app/Resources/static/themes/baggy/js/autoCompleteTags.js b/app/Resources/static/themes/baggy/js/autoCompleteTags.js index f287ebfa..64fdaa92 100755 --- a/app/Resources/static/themes/baggy/js/autoCompleteTags.js +++ b/app/Resources/static/themes/baggy/js/autoCompleteTags.js | |||
@@ -5,4 +5,4 @@ function extractLast(term) { | |||
5 | return split(term).pop(); | 5 | return split(term).pop(); |
6 | } | 6 | } |
7 | 7 | ||
8 | export { split, extractLast }; | 8 | export default { split, extractLast }; |
diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index dc11043a..05360a28 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js | |||
@@ -1,11 +1,26 @@ | |||
1 | import { savePercent, retrievePercent } from '../../_global/js/tools'; | 1 | /* jQuery */ |
2 | import { toggleSaveLinkForm } from './uiTools'; | 2 | import $ from 'jquery'; |
3 | |||
4 | /* eslint-disable no-unused-vars */ | ||
5 | /* jquery has default scope */ | ||
6 | import cookie from 'jquery.cookie'; | ||
7 | import ui from 'jquery-ui-browserify'; | ||
8 | /* eslint-enable no-unused-vars */ | ||
9 | |||
10 | /* Annotations */ | ||
11 | import annotator from 'annotator'; | ||
3 | 12 | ||
4 | const $ = global.jquery = require('jquery'); | 13 | /* Shortcuts */ |
5 | require('jquery.cookie'); | 14 | import './shortcuts/main'; |
6 | require('jquery-ui-browserify'); | 15 | import './shortcuts/entry'; |
7 | const annotator = require('annotator'); | 16 | import '../../_global/js/shortcuts/main'; |
17 | import '../../_global/js/shortcuts/entry'; | ||
18 | |||
19 | /* Tools */ | ||
20 | import { savePercent, retrievePercent } from '../../_global/js/tools'; | ||
21 | import toggleSaveLinkForm from './uiTools'; | ||
8 | 22 | ||
23 | global.jquery = $; | ||
9 | 24 | ||
10 | $.fn.ready(() => { | 25 | $.fn.ready(() => { |
11 | const $listmode = $('#listmode'); | 26 | const $listmode = $('#listmode'); |
diff --git a/app/Resources/static/themes/baggy/js/shortcuts/entry.js b/app/Resources/static/themes/baggy/js/shortcuts/entry.js new file mode 100644 index 00000000..728df8bd --- /dev/null +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js | |||
@@ -0,0 +1,22 @@ | |||
1 | import Mousetrap from 'mousetrap'; | ||
2 | import $ from 'jquery'; | ||
3 | |||
4 | /* Article view */ | ||
5 | Mousetrap.bind('o', () => { | ||
6 | $('div#article_toolbar ul.links a.original')[0].click(); | ||
7 | }); | ||
8 | |||
9 | /* mark as favorite */ | ||
10 | Mousetrap.bind('s', () => { | ||
11 | $('div#article_toolbar ul.links a.favorite')[0].click(); | ||
12 | }); | ||
13 | |||
14 | /* mark as read */ | ||
15 | Mousetrap.bind('a', () => { | ||
16 | $('div#article_toolbar ul.links a.markasread')[0].click(); | ||
17 | }); | ||
18 | |||
19 | /* delete */ | ||
20 | Mousetrap.bind('del', () => { | ||
21 | $('div#article_toolbar ul.links a.delete')[0].click(); | ||
22 | }); | ||
diff --git a/app/Resources/static/themes/baggy/js/shortcuts/main.js b/app/Resources/static/themes/baggy/js/shortcuts/main.js new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/app/Resources/static/themes/baggy/js/shortcuts/main.js | |||
diff --git a/app/Resources/static/themes/baggy/js/uiTools.js b/app/Resources/static/themes/baggy/js/uiTools.js index 900b2707..713c53f7 100644 --- a/app/Resources/static/themes/baggy/js/uiTools.js +++ b/app/Resources/static/themes/baggy/js/uiTools.js | |||
@@ -1,4 +1,4 @@ | |||
1 | const $ = require('jquery'); | 1 | import $ from 'jquery'; |
2 | 2 | ||
3 | function toggleSaveLinkForm(url, event) { | 3 | function toggleSaveLinkForm(url, event) { |
4 | $('#add-link-result').empty(); | 4 | $('#add-link-result').empty(); |
@@ -32,4 +32,4 @@ function toggleSaveLinkForm(url, event) { | |||
32 | plainUrl.focus(); | 32 | plainUrl.focus(); |
33 | } | 33 | } |
34 | 34 | ||
35 | export { toggleSaveLinkForm }; | 35 | export default toggleSaveLinkForm; |