#1938: Add random post keyboard shortcut

This commit is contained in:
Toks
2014-06-08 14:34:36 -04:00
parent a56c1f3350
commit abfd48d58a
4 changed files with 21 additions and 7 deletions

View File

@@ -15,11 +15,7 @@
e.preventDefault();
});
if ($("#image").length) {
$(document).bind("keypress", "shift+o", function(e) {
Danbooru.Post.approve(Danbooru.meta("post-id"));
});
if ($("#image").length) { // post page or bookmarklet upload page
$(document).bind("keypress", "shift+e", function(e) {
if (!$("#edit-dialog").length) {
$("#edit").show();
@@ -34,6 +30,22 @@
e.preventDefault();
});
}
if ($("#c-posts").length && $("#a-show").length) {
$(document).bind("keypress", "shift+o", function(e) {
Danbooru.Post.approve(Danbooru.meta("post-id"));
});
$(document).bind("keypress", "r", function(e) {
$("#random-post")[0].click();
});
}
if ($("#c-posts").length && $("#a-index").length) {
$(document).bind("keypress", "r", function(e) {
$("#random-post")[0].click();
});
}
}
Danbooru.Shortcuts.nav_scroll_down = function() {