This commit is contained in:
Toks
2013-04-05 19:06:17 -04:00
parent 803fbeada8
commit 8a50e0ccff
3 changed files with 8 additions and 2 deletions

View File

@@ -110,6 +110,11 @@
Danbooru.Post.nav_next();
e.preventDefault();
});
$(document).bind("keydown.f", function(e) {
$("#add-to-favorites").filter(":visible").trigger("click");
e.preventDefault();
});
}
$(document).bind("keydown.s", function(e) {

View File

@@ -1,12 +1,12 @@
<ul>
<li><%= link_to "Resize to window", "#", :id => "image-resize-to-window-link" %></li>
<li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites" %></li>
<li><%= link_to "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites", :title => "Shortcut is F" %></li>
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites" %></li>
<li><%= link_to "Add to pool", "#", :id => "pool" %></li>
<% if post.is_note_locked? %>
<li><span id="note-locked-notice">Note locked</span></li>
<% else %>
<li><%= link_to "Add note", "#", :id => "translate", :title => "Shortcut is CTRL+N" %></li>
<li><%= link_to "Add note", "#", :id => "translate", :title => "Shortcut is N" %></li>
<% end %>
<li><%= link_to "Find similar", "http://danbooru.iqdb.org/db-search.php?url=http://#{Danbooru.config.hostname}#{post.preview_file_url}" %></li>

View File

@@ -21,6 +21,7 @@
<li><span class="key">s</span> Scroll down</li>
<li><span class="key">a</span> Previous post</li>
<li><span class="key">d</span> Next post</li>
<li><span class="key">f</span> Favorite post</li>
</ul>
</section>
</div>