additional keyboard shortcuts

This commit is contained in:
albert
2011-12-23 16:19:36 -05:00
parent 5ffd6d552a
commit 47d8f908df
5 changed files with 26 additions and 3 deletions

View File

@@ -6,6 +6,10 @@
Danbooru.Post.initialize_all = function() {
this.initialize_titles();
if ($("#c-posts").length) {
this.initialize_shortcuts();
}
if ($("#c-posts").length && $("#a-index").length) {
this.initialize_wiki_page_excerpt();
}
@@ -19,6 +23,21 @@
}
}
Danbooru.Post.initialize_shortcuts = function() {
key('/', function(e) {
$("#tags").trigger("focus");
e.preventDefault();
});
if ($("#a-show").length) {
key('e', function(e) {
$("#post-edit-link").trigger("click");
$("#post_tag_string").trigger("focus");
e.preventDefault();
});
}
}
Danbooru.Post.initialize_links = function() {
$("#side-edit-link").click(function(e) {
$("#post-edit-link").trigger("click");