Merge pull request #3812 from evazion/feat-declarative-shortcuts
Add declarative keyboard shortcuts
This commit is contained in:
@@ -10,12 +10,12 @@
|
||||
<li><%= link_to "Posts (#{Post.fast_count(@artist.name)})", posts_path(:tags => @artist.name) %></li>
|
||||
<li><%= link_to "Show", artist_path(@artist) %></li>
|
||||
<% if CurrentUser.is_member? %>
|
||||
<li id="artist-edit"><%= link_to "Edit", edit_artist_path(@artist) %></li>
|
||||
<li id="artist-edit"><%= link_to "Edit", edit_artist_path(@artist), :"data-shortcut" => "e" %></li>
|
||||
<% end %>
|
||||
<li><%= link_to "History", artist_versions_path(:search => {:artist_id => @artist.id}) %></li>
|
||||
<% if @artist.deletable_by?(CurrentUser.user) %>
|
||||
<% if @artist.is_active? %>
|
||||
<li id="artist-delete"><%= link_to "Delete", artist_path(@artist), method: :delete, data: {confirm: "Are you sure you want to delete this artist?"} %></li>
|
||||
<li id="artist-delete"><%= link_to "Delete", artist_path(@artist), method: :delete, "data-shortcut": "shift+d", "data-confirm": "Are you sure you want to delete this artist?" %></li>
|
||||
<% else %>
|
||||
<li><%= link_to "Undelete", artist_path(@artist, format: "js"), method: :put, data: {confirm: "Are you sure you want to undelete this artist?", params: "artist[is_active]=true"}, remote: true %></li>
|
||||
<% end %>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
<%= link_to favgroup.name,
|
||||
add_post_favorite_group_path(favgroup, :post_id => post.id, :format => :js),
|
||||
:id => "add-to-favgroup-#{i + 1}", :class => "add-to-favgroup",
|
||||
:method => :put, :remote => true %>
|
||||
:method => :put, :remote => true,
|
||||
:"data-shortcut" => (i + 1) % 10, :"data-shortcut-when" => ":visible" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<ul id="related-list">
|
||||
<li><%= link_to "Deleted posts", posts_path(:tags => "#{@favorite_set.tag_string} status:deleted"), :rel => "nofollow" %></li>
|
||||
|
||||
<li><%= link_to "Random post", random_posts_path(:tags => @favorite_set.tag_string), :id => "random-post", :rel => "nofollow" %></li>
|
||||
<li><%= link_to "Random post", random_posts_path(:tags => @favorite_set.tag_string), :id => "random-post", :rel => "nofollow", :"data-shortcut" => "r" %></li>
|
||||
</ul>
|
||||
</section>
|
||||
</aside>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<li><%= link_to "New", new_forum_topic_path %></li>
|
||||
<li><%= link_to "Request alias", new_tag_alias_request_path %></li>
|
||||
<li><%= link_to "Request implication", new_tag_implication_request_path %></li>
|
||||
<li id="forum-topic-mark-all-as-read"><%= link_to "Mark all as read", mark_all_as_read_forum_topics_path, :method => :post %></li>
|
||||
<li id="forum-topic-mark-all-as-read"><%= link_to "Mark all as read", mark_all_as_read_forum_topics_path, :method => :post, :"data-shortcut" => "shift+r" %></li>
|
||||
<% end %>
|
||||
|
||||
<li><%= link_to "Search", search_forum_posts_path %></li>
|
||||
@@ -21,12 +21,12 @@
|
||||
<li><%= link_to "Subscribe", subscribe_forum_topic_path(@forum_topic), :method => :post, :data => {:confirm => "Are you sure you want to receive email notifications for this forum topic?"} %></li>
|
||||
<% end %>
|
||||
<% if !@forum_topic.new_record? && @forum_topic.editable_by?(CurrentUser.user) %>
|
||||
<li><%= link_to "Edit", edit_forum_topic_path(@forum_topic) %></li>
|
||||
<li><%= link_to "Edit", edit_forum_topic_path(@forum_topic), "data-shortcut": "e" %></li>
|
||||
<% if CurrentUser.is_moderator? %>
|
||||
<% if @forum_topic.is_deleted? %>
|
||||
<li><%= link_to "Undelete", undelete_forum_topic_path(@forum_topic), :method => :post %></li>
|
||||
<% else %>
|
||||
<li id="forum-topic-delete"><%= link_to "Delete", forum_topic_path(@forum_topic), :method => :delete, :data => {:confirm => "Are you sure you want to delete this forum topic?"} %></li>
|
||||
<li id="forum-topic-delete"><%= link_to "Delete", forum_topic_path(@forum_topic), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this forum topic?" %></li>
|
||||
<% end %>
|
||||
<% if @forum_topic.is_locked? %>
|
||||
<li><%= link_to "Unlock", forum_topic_path(@forum_topic, :forum_topic => {:is_locked => false}), :method => :put %></li>
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
<li><%= link_to "Show", pool_path(@pool) %></li>
|
||||
<li><%= link_to "Posts", posts_path(:tags => "pool:#{@pool.id}") %></li>
|
||||
<% if CurrentUser.is_member? %>
|
||||
<li id="pool-edit"><%= link_to "Edit", edit_pool_path(@pool) %></li>
|
||||
<li id="pool-edit"><%= link_to "Edit", edit_pool_path(@pool), "data-shortcut": "e" %></li>
|
||||
<% end %>
|
||||
<% if @pool.deletable_by?(CurrentUser.user) %>
|
||||
<% if @pool.is_deleted? %>
|
||||
<li id="pool-delete"><%= link_to "Undelete", undelete_pool_path(@pool), :method => :post, :remote => true %></li>
|
||||
<% else %>
|
||||
<li id="pool-delete"><%= link_to "Delete", pool_path(@pool), :method => :delete, :data => {:confirm => "Are you sure you want to delete this pool?"}, :remote => true %></li>
|
||||
<li id="pool-delete"><%= link_to "Delete", pool_path(@pool), :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this pool?", :remote => true %></li>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% if PoolArchive.enabled? %>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<% if params[:random] %>
|
||||
<%= hidden_field_tag :random, params[:random] %>
|
||||
<% end %>
|
||||
<%= text_field_tag("tags", tags, :id => tags_dom_id, :data => { :autocomplete => "tag-query" }) %><%= content_tag "button", content_tag("i", nil, class: "fas fa-search"), type: "submit" %>
|
||||
<%= text_field_tag("tags", tags, :id => tags_dom_id, :"data-shortcut" => "q", :"data-autocomplete" => "tag-query") %><%= content_tag "button", content_tag("i", nil, class: "fas fa-search"), type: "submit" %>
|
||||
<%= hidden_field_tag "ms", "1" %>
|
||||
<% end %>
|
||||
</section>
|
||||
@@ -31,4 +31,4 @@
|
||||
});
|
||||
});*/
|
||||
</script>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<li><%= link_to "Deleted", posts_path(:tags => "#{params[:tags]} status:deleted"), :rel => "nofollow" %></li>
|
||||
|
||||
<li><%= link_to "Random", random_posts_path(:tags => params[:tags]), :id => "random-post", :rel => "nofollow" %></li>
|
||||
<li><%= link_to "Random", random_posts_path(:tags => params[:tags]), :id => "random-post", :rel => "nofollow", :"data-shortcut" => "r" %></li>
|
||||
|
||||
<li><%= link_to "Count", posts_counts_path(:tags => params[:tags]) %></li>
|
||||
</ul>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
<div>
|
||||
<%= f.label :tag_string, "Tags" %>
|
||||
<%= f.text_area :tag_string, :size => "50x5", :value => post.presenter.categorized_tag_string + " ", :data => { :autocomplete => "tag-edit" } %>
|
||||
<span id="open-edit-dialog" class="ui-icon ui-icon-arrow-1-ne" title="detach" style="display: none;"/>
|
||||
<span id="open-edit-dialog" class="ui-icon ui-icon-arrow-1-ne" title="detach" style="display: none;" data-shortcut="shift+e"/>
|
||||
</div>
|
||||
|
||||
<%= button_tag "Related tags", :id => "related-tags-button", :type => "button", :class => "ui-button ui-widget ui-corner-all sub gradient" %>
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
<li><%= link_to "Resize to window", "#", :id => "image-resize-to-window-link" %></li>
|
||||
|
||||
<% if CurrentUser.is_member? %>
|
||||
<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 "Favorite", favorites_path(:post_id => post.id), :remote => true, :method => :post, :id => "add-to-favorites", :"data-shortcut" => "f" %></li>
|
||||
<li><%= link_to "Unfavorite", favorite_path(post), :remote => true, :method => :delete, :id => "remove-from-favorites", :"data-shortcut" => "shift+f" %></li>
|
||||
<li><%= link_to_if post.visible?, "Download", post.tagged_file_url + "?download=1", download: post.presenter.filename_for_download %></li>
|
||||
<li id="add-to-pool-list"><%= link_to "Add to pool", "#", :id => "pool" %></li>
|
||||
<% if post.is_note_locked? %>
|
||||
<li id="add-notes-list"><span id="note-locked-notice">Note locked</span></li>
|
||||
<% else %>
|
||||
<li id="add-notes-list"><%= link_to "Add note", "#", :id => "translate", :title => "Shortcut is N" %></li>
|
||||
<li id="add-notes-list"><%= link_to "Add note", "#", :id => "translate", :"data-shortcut" => "n" %></li>
|
||||
<% end %>
|
||||
<% if CurrentUser.is_builder? && post.has_notes? %>
|
||||
<li id="copy-all-notes-list"><%= link_to "Copy notes", "#", :id => "copy-notes" %></li>
|
||||
<% end %>
|
||||
<li id="add-artist-commentary-list"><%= link_to "Add commentary", "#", :id => "add-commentary" %></li>
|
||||
<li><%= link_to "Add to favorite group", "#", :id => "open-favgroup-dialog-link" %></li>
|
||||
<li><%= link_to "Add to favorite group", "#", :id => "open-favgroup-dialog-link", :"data-shortcut" => "g" %></li>
|
||||
<li><%= link_to "Find similar", iqdb_queries_path(:post_id => post.id) %></li>
|
||||
|
||||
<% if post.is_status_locked? %>
|
||||
@@ -40,7 +40,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if post.is_flagged? || post.is_pending? %>
|
||||
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve", :data => { :confirm => "Are you sure you want to approve this post?" } %></li>
|
||||
<li><%= link_to "Approve", moderator_post_approval_path(:post_id => post.id), :remote => true, :method => :post, :id => "approve", :"data-shortcut" => "shift+o", :"data-confirm" => "Are you sure you want to approve this post?" %></li>
|
||||
<% else %>
|
||||
<li><%= link_to "Hide from queue", moderator_post_disapproval_path(post_disapproval: { post_id: post.id, reason: "disinterest" }), remote: true, method: :post, id: "disapprove" %></li>
|
||||
<% end %>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if CurrentUser.is_member? && @post.visible? %>
|
||||
<li><a href="#edit" id="post-edit-link">Edit</a></li>
|
||||
<li><a href="#edit" id="post-edit-link" data-shortcut="e">Edit</a></li>
|
||||
<% end %>
|
||||
|
||||
<li><a href="#share">Share</a></li>
|
||||
|
||||
@@ -111,8 +111,8 @@
|
||||
<div class="input">
|
||||
<div>
|
||||
<%= f.label :tag_string, "Tags" %>
|
||||
<%= f.text_area :tag_string, :size => "60x5", :spellcheck => false, :data => { :autocomplete => "tag-edit" } %>
|
||||
<span id="open-edit-dialog" class="ui-icon ui-icon-arrow-1-ne" title="detach" style="display: none;"/>
|
||||
<%= f.text_area :tag_string, :size => "60x5", :spellcheck => false, :"data-autocomplete" => "tag-edit", :"data-shortcut" => "e" %>
|
||||
<span id="open-edit-dialog" class="ui-icon ui-icon-arrow-1-ne" title="detach" style="display: none;" data-shortcut="shift+e"/>
|
||||
</div>
|
||||
|
||||
<%= button_tag "Related tags", :id => "related-tags-button", :type => "button", :class => "ui-button ui-widget ui-corner-all sub gradient" %>
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
<li><%= link_to "Posts (#{@wiki_page.tag.try(:post_count) || 0})", posts_path(:tags => @wiki_page.title) %></li>
|
||||
<li><%= link_to "History", wiki_page_versions_path(:search => {:wiki_page_id => @wiki_page.id}) %></li>
|
||||
<% if CurrentUser.is_member? %>
|
||||
<li id="wiki-page-edit"><%= link_to "Edit", edit_wiki_page_path(@wiki_page) %></li>
|
||||
<li id="wiki-page-edit"><%= link_to "Edit", edit_wiki_page_path(@wiki_page), "data-shortcut": "e" %></li>
|
||||
<% end %>
|
||||
<% if CurrentUser.is_builder? && !@wiki_page.is_deleted? %>
|
||||
<li id="wiki-page-delete"><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :data => {:confirm => "Are you sure you want to delete this wiki page?"} %></li>
|
||||
<li id="wiki-page-delete"><%= link_to "Delete", wiki_page_path(@wiki_page), :remote => true, :method => :delete, :"data-shortcut" => "shift+d", :"data-confirm" => "Are you sure you want to delete this wiki page?" %></li>
|
||||
<% end %>
|
||||
<% elsif @wiki_page_version %>
|
||||
<li>|</li>
|
||||
|
||||
Reference in New Issue
Block a user