additional keyboard shortcuts
This commit is contained in:
@@ -14,7 +14,8 @@
|
|||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(function() {
|
||||||
key('right', function(){ Danbooru.Paginator.next_page() });
|
key('right', function(){ Danbooru.Paginator.next_page() });
|
||||||
key('left', function(){ Danbooru.Paginator.prev_page() });
|
key('left', function(){ Danbooru.Paginator.prev_page() });
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,10 @@
|
|||||||
Danbooru.Post.initialize_all = function() {
|
Danbooru.Post.initialize_all = function() {
|
||||||
this.initialize_titles();
|
this.initialize_titles();
|
||||||
|
|
||||||
|
if ($("#c-posts").length) {
|
||||||
|
this.initialize_shortcuts();
|
||||||
|
}
|
||||||
|
|
||||||
if ($("#c-posts").length && $("#a-index").length) {
|
if ($("#c-posts").length && $("#a-index").length) {
|
||||||
this.initialize_wiki_page_excerpt();
|
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() {
|
Danbooru.Post.initialize_links = function() {
|
||||||
$("#side-edit-link").click(function(e) {
|
$("#side-edit-link").click(function(e) {
|
||||||
$("#post-edit-link").trigger("click");
|
$("#post-edit-link").trigger("click");
|
||||||
|
|||||||
@@ -5,8 +5,9 @@ div#c-static {
|
|||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
|
||||||
section {
|
section {
|
||||||
width: 33%;
|
width: 20%;
|
||||||
float: left;
|
float: left;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: $h3_size;
|
font-size: $h3_size;
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
<h1>Post</h1>
|
<h1>Post</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><span class="key">n</span> New note</li>
|
<li><span class="key">n</span> New note</li>
|
||||||
|
<li><span class="key">e</span> Edit tags</li>
|
||||||
<li><span class="key">/</span> Search</li>
|
<li><span class="key">/</span> Search</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<li><h1>Tools</h1></li>
|
<li><h1>Tools</h1></li>
|
||||||
|
<li><%= link_to("Keyboard Shortcuts", keyboard_shortcuts_path) %></li>
|
||||||
<li><%= link_to("Bookmarklet", bookmarklet_path) %></li>
|
<li><%= link_to("Bookmarklet", bookmarklet_path) %></li>
|
||||||
<li><%= link_to("API Documentation", wiki_pages_path(:title => "help:api")) %></li>
|
<li><%= link_to("API Documentation", wiki_pages_path(:title => "help:api")) %></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user