-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeystrokes.js
62 lines (30 loc) · 1 KB
/
keystrokes.js
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var $j = jQuery.noConflict();
const open_main_menu = async (e)=>{
// Quickly open up the menu without moving the mouse
$j("#youbookmark-div").click();
}
const open_bookmark_menu = async (e)=>{
// Quickly bookmark a video without moving the mouse
// too much
$j("#youbookmark-div").click();
$j("#bookmark-save-btn").ready(()=>{
$j("#bookmark-save-btn").click();
});
}
(()=>{
$j(document).keydown((e)=>{
if (e.ctrlKey && e.keyCode == 73) {
// Detecting Ctrl - I which is a shortcut for
// opening up the bookmark menu
// Press Ctrl - I again to close it
if($j(".ymark-menu-bookmark")[0]){
// Checking if the user has previously opened the
// menu or not
$j(".confirm-tasks-btn #cancel").click();
// If yes then close it
}else{
open_main_menu();
}
};
});
})();