wallabag/app/Resources/static/themes/baggy/js/shortcuts/entry.js
2016-11-22 21:31:21 +01:00

27 lines
635 B
JavaScript

import Mousetrap from 'mousetrap';
import $ from 'jquery';
$(document).ready(() => {
if ($('#article').length > 0) {
/* Article view */
Mousetrap.bind('o', () => {
$('div#article_toolbar ul.links a.original')[0].click();
});
/* mark as favorite */
Mousetrap.bind('f', () => {
$('div#article_toolbar ul.links a.favorite')[0].click();
});
/* mark as read */
Mousetrap.bind('a', () => {
$('div#article_toolbar ul.links a.markasread')[0].click();
});
/* delete */
Mousetrap.bind('del', () => {
$('div#article_toolbar ul.links a.delete')[0].click();
});
}
});