aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/static/js/hotkeys.js
diff options
context:
space:
mode:
authorJames Taylor <28744867+user234683@users.noreply.github.com>2020-10-13 20:06:52 -0700
committerGitHub <noreply@github.com>2020-10-13 20:06:52 -0700
commite3c311e10a54ae1b7d9114cc58de315157538e0f (patch)
tree36b3325a43db223ba9a999cf8716ea0b1c148322 /youtube/static/js/hotkeys.js
parent641af53e2ea0cb7ea398631d13c804d7ac1e0a8a (diff)
parentd2ee49ec453999904381ec592f38a9a34e02044c (diff)
downloadyt-local-e3c311e10a54ae1b7d9114cc58de315157538e0f.tar.lz
yt-local-e3c311e10a54ae1b7d9114cc58de315157538e0f.tar.xz
yt-local-e3c311e10a54ae1b7d9114cc58de315157538e0f.zip
Merge pull request #29 from zrose584/copy_ts
add 't' hotkey to copy video link at current time
Diffstat (limited to 'youtube/static/js/hotkeys.js')
-rw-r--r--youtube/static/js/hotkeys.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube/static/js/hotkeys.js b/youtube/static/js/hotkeys.js
index b295db9..5688ef3 100644
--- a/youtube/static/js/hotkeys.js
+++ b/youtube/static/js/hotkeys.js
@@ -36,6 +36,11 @@ function onKeyDown(e) {
if (tt.mode == "showing") tt.mode = "disabled";
else tt.mode = "showing";
}
+ else if (c == "t") {
+ let video_id = JSON.parse(Q(".video-info input[name=video_info_list]").value).id
+ let ts = Math.floor(Q("video").currentTime);
+ copyTextToClipboard(`https://youtu.be/${video_id}?t=${ts}`);
+ }
}
window.addEventListener('DOMContentLoaded', function() {