aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/baggy
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/baggy
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/baggy')
-rwxr-xr-xapp/Resources/static/themes/baggy/js/autoCompleteTags.js2
-rwxr-xr-xapp/Resources/static/themes/baggy/js/init.js27
-rw-r--r--app/Resources/static/themes/baggy/js/shortcuts/entry.js22
-rw-r--r--app/Resources/static/themes/baggy/js/shortcuts/main.js0
-rw-r--r--app/Resources/static/themes/baggy/js/uiTools.js4
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
8export { split, extractLast }; 8export 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 @@
1import { savePercent, retrievePercent } from '../../_global/js/tools'; 1/* jQuery */
2import { toggleSaveLinkForm } from './uiTools'; 2import $ from 'jquery';
3
4/* eslint-disable no-unused-vars */
5/* jquery has default scope */
6import cookie from 'jquery.cookie';
7import ui from 'jquery-ui-browserify';
8/* eslint-enable no-unused-vars */
9
10/* Annotations */
11import annotator from 'annotator';
3 12
4const $ = global.jquery = require('jquery'); 13/* Shortcuts */
5require('jquery.cookie'); 14import './shortcuts/main';
6require('jquery-ui-browserify'); 15import './shortcuts/entry';
7const annotator = require('annotator'); 16import '../../_global/js/shortcuts/main';
17import '../../_global/js/shortcuts/entry';
18
19/* Tools */
20import { savePercent, retrievePercent } from '../../_global/js/tools';
21import toggleSaveLinkForm from './uiTools';
8 22
23global.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 @@
1import Mousetrap from 'mousetrap';
2import $ from 'jquery';
3
4/* Article view */
5Mousetrap.bind('o', () => {
6 $('div#article_toolbar ul.links a.original')[0].click();
7});
8
9/* mark as favorite */
10Mousetrap.bind('s', () => {
11 $('div#article_toolbar ul.links a.favorite')[0].click();
12});
13
14/* mark as read */
15Mousetrap.bind('a', () => {
16 $('div#article_toolbar ul.links a.markasread')[0].click();
17});
18
19/* delete */
20Mousetrap.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 @@
1const $ = require('jquery'); 1import $ from 'jquery';
2 2
3function toggleSaveLinkForm(url, event) { 3function 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
35export { toggleSaveLinkForm }; 35export default toggleSaveLinkForm;