Fix bugs when anonymous uses member-only shortcuts

This commit is contained in:
Toks
2016-01-13 11:48:25 -05:00
parent e9d79b7ae0
commit af2167ea32
5 changed files with 22 additions and 2 deletions

View File

@@ -17,6 +17,10 @@
if ($("#image").length) { // post page or bookmarklet upload page
$(document).bind("keydown", "shift+e", function(e) {
if (Danbooru.meta("current-user-id") == "") { // anonymous
return;
}
if (!$("#edit-dialog").length) {
$("#edit").show();
$("#comments").hide();
@@ -33,7 +37,9 @@
if ($("#c-posts").length && $("#a-show").length) {
$(document).bind("keydown", "shift+o", function(e) {
Danbooru.Post.approve(Danbooru.meta("post-id"));
if (Danbooru.meta("current-user-can-approve-posts") === "true") {
Danbooru.Post.approve(Danbooru.meta("post-id"));
}
});
$(document).bind("keydown", "r", function(e) {