From 16ef7607f43ebc3e0134360b7657af191e14fe12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Wed, 2 Nov 2016 16:44:20 +0100 Subject: Reorganized JS folders for shortcuts --- app/Resources/static/themes/baggy/js/init.js | 3 +++ .../static/themes/baggy/js/shortcuts/entry.js | 19 +++++++++++++++++++ .../static/themes/baggy/js/shortcuts/main.js | 0 3 files changed, 22 insertions(+) create mode 100644 app/Resources/static/themes/baggy/js/shortcuts/entry.js create mode 100644 app/Resources/static/themes/baggy/js/shortcuts/main.js (limited to 'app/Resources/static/themes/baggy/js') diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index b7347f7c..5a8911ad 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js @@ -1,4 +1,7 @@ import $ from 'jquery'; +import { initFilters, initExport } from '../../_global/js/tools'; +import './shortcuts/main.js'; +import './shortcuts/entry.js'; /* eslint-disable no-unused-vars */ /* jquery has default scope */ 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..d618f28e --- /dev/null +++ b/app/Resources/static/themes/baggy/js/shortcuts/entry.js @@ -0,0 +1,19 @@ +/* Article view */ +Mousetrap.bind('o', () => { + $('div#article_toolbar ul.links li:nth-child(2) a')[0].click(); +}); + +/* mark as favorite */ +Mousetrap.bind('s', () => { + $('div#article_toolbar ul.links li:nth-child(5) a')[0].click(); +}); + +/* mark as read */ +Mousetrap.bind('a', () => { + $('div#article_toolbar ul.links li:nth-child(4) a')[0].click(); +}); + +/* delete */ +Mousetrap.bind('del', () => { + $('div#article_toolbar ul.links li:nth-child(7) a')[0].click(); +}); 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 -- cgit v1.2.3