Add wiki page edit shortcut

This commit is contained in:
Toks
2014-06-17 15:44:14 -04:00
parent dfb47199a0
commit beb3f1d542
2 changed files with 14 additions and 1 deletions

View File

@@ -6,6 +6,10 @@
if (Danbooru.meta("enable-auto-complete") === "true") {
this.initialize_autocomplete();
}
if (Danbooru.meta("enable-js-navigation") === "true") {
this.initialize_shortcuts();
}
}
}
@@ -44,6 +48,15 @@
$(field).data("uiAutocomplete")._renderItem = render_wiki_page;
});
}
Danbooru.WikiPage.initialize_shortcuts = function() {
if ($("#a-show").length) {
$(document).bind("keypress", "e", function(e) {
$("#wiki-page-edit-link")[0].click();
e.preventDefault();
});
}
}
})();
$(document).ready(function() {