aboutsummaryrefslogtreecommitdiffhomepage
path: root/app/Resources/static/themes/material/js/shortcuts/entry.js
blob: e19800bd3a175ef34c68e55510a3a3bff572eb42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import Mousetrap from 'mousetrap';
import $ from 'jquery';

$(document).ready(() => {
  if ($('#article').length > 0) {
    /* open original article */
    Mousetrap.bind('o', () => {
      $('ul.side-nav a.original i')[0].click();
    });

    /* mark as favorite */
    Mousetrap.bind('f', () => {
      $('ul.side-nav a.favorite i')[0].click();
    });

    /* mark as read */
    Mousetrap.bind('a', () => {
      $('ul.side-nav a.markasread i')[0].click();
    });

    /* delete */
    Mousetrap.bind('del', () => {
      $('ul.side-nav a.delete i')[0].click();
    });
  }
});