Convert keyboard shortcuts to use data-shortcut.

This commit is contained in:
evazion
2018-08-11 16:39:45 -05:00
parent d369d38419
commit bbaadda1e3
25 changed files with 44 additions and 259 deletions

View File

@@ -4,11 +4,11 @@ module PaginationHelper
if records.any?
if params[:page] =~ /[ab]/ && !records.is_first_page?
html << '<li>' + link_to("< Previous", nav_params_for("a#{records[0].id}"), :rel => "prev") + '</li>'
html << '<li>' + link_to("< Previous", nav_params_for("a#{records[0].id}"), rel: "prev", "data-shortcut": "a left") + '</li>'
end
unless records.is_last_page?
html << '<li>' + link_to("Next >", nav_params_for("b#{records[-1].id}"), :rel => "next") + '</li>'
html << '<li>' + link_to("Next >", nav_params_for("b#{records[-1].id}"), rel: "next", "data-shortcut": "d right") + '</li>'
end
end
@@ -29,7 +29,7 @@ module PaginationHelper
window = 4
if records.current_page >= 2
html << "<li class='arrow'>" + link_to(content_tag(:i, nil, class: "fas fa-chevron-left"), nav_params_for(records.current_page - 1), :rel => "prev") + "</li>"
html << "<li class='arrow'>" + link_to(content_tag(:i, nil, class: "fas fa-chevron-left"), nav_params_for(records.current_page - 1), rel: "prev", "data-shortcut": "a left") + "</li>"
else
html << "<li class='arrow'><span>" + content_tag(:i, nil, class: "fas fa-chevron-left") + "</span></li>"
end
@@ -69,7 +69,7 @@ module PaginationHelper
end
if records.current_page < records.total_pages && records.size > 0
html << "<li class='arrow'>" + link_to(content_tag(:i, nil, class: "fas fa-chevron-right"), nav_params_for(records.current_page + 1), :rel => "next") + "</li>"
html << "<li class='arrow'>" + link_to(content_tag(:i, nil, class: "fas fa-chevron-right"), nav_params_for(records.current_page + 1), rel: "next", "data-shortcut": "d right") + "</li>"
else
html << "<li class='arrow'><span>" + content_tag(:i, nil, class: "fas fa-chevron-right") + "</span></li>"
end

View File

@@ -1,11 +1,8 @@
import Utility from "./utility";
let Artist = {};
Artist.initialize_all = function() {
if ($("#c-artists").length) {
Artist.initialize_check_name();
Artist.initialize_shortcuts();
}
}
@@ -29,18 +26,6 @@ Artist.initialize_check_name = function() {
});
}
Artist.initialize_shortcuts = function() {
if ($("#c-artists #a-show").length) {
Utility.keydown("e", "edit", function(e) {
$("#artist-edit a")[0].click();
});
Utility.keydown("shift+d", "delete", function(e) {
$("#artist-delete a")[0].click();
});
}
};
$(document).ready(function() {
Artist.initialize_all();
});

View File

@@ -1,11 +1,8 @@
import Utility from './utility'
let FavoriteGroup = {};
FavoriteGroup.initialize_all = function() {
if ($("#c-posts").length && $("#a-show").length) {
this.initialize_add_to_favgroup_dialog();
Utility.keydown("1 2 3 4 5 6 7 8 9 0", "add_to_favgroup", FavoriteGroup.add_to_favgroup);
}
}
@@ -21,10 +18,6 @@ FavoriteGroup.initialize_add_to_favgroup_dialog = function() {
});
var open_favgroup_dialog = function(e) {
if (Utility.meta("current-user-id") === "") { // anonymous
return;
}
if ($(".add-to-favgroup").length === 1) {
// If the user only has one favorite group we don't need to ask which group to add the post to.
$(".add-to-favgroup").click();
@@ -34,18 +27,9 @@ FavoriteGroup.initialize_add_to_favgroup_dialog = function() {
e.preventDefault();
}
Utility.keydown("g", "open_favgroup_dialog", open_favgroup_dialog);
$("#open-favgroup-dialog-link").click(open_favgroup_dialog);
}
FavoriteGroup.add_to_favgroup = function(e) {
var favgroup_index = (e.key === "0") ? "10" : e.key;
var link = $("#add-to-favgroup-" + favgroup_index + ":visible");
if (link.length) {
link.click();
}
}
$(function() {
FavoriteGroup.initialize_all();
});

View File

@@ -1,24 +1,8 @@
import Utility from './utility'
let ForumPost = {};
ForumPost.initialize_all = function() {
if ($("#c-forum-topics #a-show,#c-forum-posts #a-show").length) {
this.initialize_edit_links();
Utility.keydown("e", "edit", function(e) {
$(".edit_forum_topic_link")[0].click();
});
Utility.keydown("shift+d", "delete", function(e) {
$("#forum-topic-delete a")[0].click();
});
}
if ($("#c-forum-topics").length) {
Utility.keydown("shift+r", "mark_all_as_read", function(e) {
$("#forum-topic-mark-all-as-read a")[0].click();
});
}
}

View File

@@ -806,11 +806,7 @@ let Note = {
},
initialize_shortcuts: function() {
if ($("#note-locked-notice").length === 0) {
$("#translate").click(Note.TranslationMode.toggle);
Utility.keydown("n", "translation_mode", Note.TranslationMode.toggle);
}
$("#translate").click(Note.TranslationMode.toggle);
$("#image").click(Note.Box.toggle_all);
},

View File

@@ -1,26 +0,0 @@
import Utility from './utility'
let Paginator = {};
Paginator.next_page = function() {
var href = $(".paginator a[rel=next]").attr("href");
if (href) {
window.location = href;
}
}
Paginator.prev_page = function() {
var href = $(".paginator a[rel=prev]").attr("href");
if (href) {
window.location = href;
}
}
$(function() {
if ($(".paginator").length) {
Utility.keydown("d right", "next_page", Paginator.next_page);
Utility.keydown("a left", "prev_page", Paginator.prev_page);
}
});
export default Paginator

View File

@@ -1,12 +1,6 @@
import Utility from './utility'
let Pool = {};
Pool.initialize_all = function() {
if ($("#c-pools").length) {
this.initialize_shortcuts();
}
if ($("#c-posts").length && $("#a-show").length) {
this.initialize_add_to_pool_link();
}
@@ -30,18 +24,6 @@ Pool.initialize_add_to_pool_link = function() {
});
}
Pool.initialize_shortcuts = function() {
if ($("#c-pools #a-show").length) {
Utility.keydown("e", "edit", function(e) {
$("#pool-edit a")[0].click();
});
Utility.keydown("shift+d", "delete", function(e) {
$("#pool-delete a")[0].click();
});
}
};
Pool.initialize_simple_edit = function() {
$("#sortable").sortable({
placeholder: "ui-state-placeholder"

View File

@@ -1,38 +0,0 @@
import Utility from './utility'
let PostPopular = {};
PostPopular.nav_prev = function(e) {
if ($("#popular-nav-links").length) {
var href = $("#popular-nav-links a[rel=prev]").attr("href");
if (href) {
location.href = href;
}
}
e.preventDefault();
}
PostPopular.nav_next = function(e) {
if ($("#popular-nav-links").length) {
var href = $("#popular-nav-links a[rel=next]").attr("href");
if (href) {
location.href = href;
}
}
e.preventDefault();
}
PostPopular.initialize_all = function() {
if ($("#c-explore-posts").length) {
Utility.keydown("a left", "prev_page", PostPopular.nav_prev);
Utility.keydown("d right", "next_page", PostPopular.nav_next);
}
}
$(document).ready(function() {
PostPopular.initialize_all();
});
export default PostPopular

View File

@@ -95,6 +95,17 @@ Post.initialize_edit_dialog = function() {
}
Post.open_edit_dialog = function() {
if ($("#edit-dialog").length === 1) {
return;
}
$("#edit").show();
$("#comments").hide();
$("#share").hide();
$("#post-sections li").removeClass("active");
$("#post-edit-link").parent("li").addClass("active");
$("#related-tags-container").show();
var $tag_string = $("#post_tag_string,#upload_tag_string");
$("div.input").has($tag_string).prevAll().hide();
$("#open-edit-dialog").hide();
@@ -230,22 +241,8 @@ Post.swipe_next = function(e) {
Post.initialize_shortcuts = function() {
if ($("#a-show").length) {
Utility.keydown("e", "edit", function(e) {
$("#post-edit-link").trigger("click");
$("#post_tag_string").focus();
e.preventDefault();
});
if (Utility.meta("current-user-can-approve-posts") === "true") {
Utility.keydown("shift+o", "approve", function(e) {
$(".approve-link").click();
});
}
Utility.keydown("a", "prev_page", Post.nav_prev);
Utility.keydown("d", "next_page", Post.nav_next);
Utility.keydown("f", "favorite", Post.favorite);
Utility.keydown("shift+f", "unfavorite", Post.unfavorite);
}
}
@@ -586,22 +583,6 @@ Post.approve = function(post_id) {
});
}
Post.favorite = function (e) {
if ($("#add-to-favorites").is(":visible")) {
$("#add-to-favorites")[0].click();
} else if (Utility.meta("current-user-id") === "") {
$(window).trigger("danbooru:notice", "You must be logged in to favorite posts");
} else {
$(window).trigger("danbooru:notice", "You have already favorited this post");
}
};
Post.unfavorite = function (e) {
$.ajax("/favorites/" + Utility.meta("post-id") + ".js", {
type: "DELETE"
});
};
Post.initialize_saved_searches = function() {
$("#new_saved_search #saved_search_label_string").autocomplete({
search: function() {

View File

@@ -1,5 +1,4 @@
import Utility from './utility'
import Post from './posts.js.erb'
let Shortcuts = {};
@@ -7,37 +6,6 @@ Shortcuts.initialize = function() {
Utility.keydown("s", "scroll_down", Shortcuts.nav_scroll_down);
Utility.keydown("w", "scroll_up", Shortcuts.nav_scroll_up);
Shortcuts.initialize_data_shortcuts();
Utility.keydown("q", "focus_search", function(e) {
$("#tags, #search_name, #search_name_matches, #query").trigger("focus").selectEnd();
e.preventDefault();
});
if ($("#image").length) { // post page or bookmarklet upload page
Utility.keydown("shift+e", "edit_dialog", function(e) {
if (Utility.meta("current-user-id") === "") { // anonymous
return;
}
if (!$("#edit-dialog").length) {
$("#edit").show();
$("#comments").hide();
$("#share").hide();
$("#post-sections li").removeClass("active");
$("#post-edit-link").parent("li").addClass("active");
$("#related-tags-container").show();
Post.open_edit_dialog();
}
e.preventDefault();
});
}
if ($("#c-posts #a-index, #c-favorites #a-index").length) {
Utility.keydown("r", "random", function(e) {
$("#random-post")[0].click();
});
}
}
// Bind keyboard shortcuts to links that have a `data-shortcut="..."` attribute. If multiple links have the

View File

@@ -1,4 +1,3 @@
import Utility from './utility'
import Post from './posts.js.erb'
import RelatedTag from './related_tag.js.erb'
@@ -18,7 +17,6 @@ Upload.initialize_all = function() {
}
this.initialize_info_bookmarklet();
this.initialize_similar();
this.initialize_shortcuts();
this.initialize_submit();
$("#related-tags-button").trigger("click");
@@ -55,13 +53,6 @@ Upload.initialize_submit = function() {
});
}
Upload.initialize_shortcuts = function() {
Utility.keydown("e", "edit", function(e) {
$("#upload_tag_string").focus();
e.preventDefault();
});
};
Upload.initialize_iqdb_source = function() {
if (/^https?:\/\//.test($("#normalized_url").val())) {
$.get("/iqdb_queries", {"url": $("#normalized_url").val()}).done(function(html) {$("#iqdb-similar").html(html)});

View File

@@ -1,25 +0,0 @@
import Utility from './utility'
let WikiPage = {};
WikiPage.initialize_all = function() {
if ($("#c-wiki-pages,#c-wiki-page-versions").length) {
this.initialize_shortcuts();
}
}
WikiPage.initialize_shortcuts = function() {
if ($("#a-show").length) {
Utility.keydown("e", "edit", function(e) {
$("#wiki-page-edit a")[0].click();
});
Utility.keydown("shift+d", "delete", function(e) {
$("#wiki-page-delete a")[0].click();
});
}
}
$(document).ready(function() {
WikiPage.initialize_all();
});

View File

@@ -76,7 +76,8 @@ module PostSetPresenters
:date => prev_date_for_scale(scale),
:scale => scale.downcase
),
:rel => (link_rel_for_scale?(template, scale.downcase) ? "prev" : nil)
:rel => (link_rel_for_scale?(template, scale.downcase) ? "prev" : nil),
:"data-shortcut" => (link_rel_for_scale?(template, scale.downcase) ? "a left" : nil)
)
html << template.link_to(
scale,
@@ -92,7 +93,8 @@ module PostSetPresenters
:date => next_date_for_scale(scale),
:scale => scale.downcase
),
:rel => (link_rel_for_scale?(template, scale.downcase) ? "next" : nil)
:rel => (link_rel_for_scale?(template, scale.downcase) ? "next" : nil),
:"data-shortcut" => (link_rel_for_scale?(template, scale.downcase) ? "d right" : nil)
)
html << '</span>'
html.join("\n").html_safe

View File

@@ -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 %>

View File

@@ -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 %>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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? %>

View File

@@ -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 %>

View File

@@ -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>

View File

@@ -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" %>

View File

@@ -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 %>

View File

@@ -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>

View File

@@ -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" %>

View File

@@ -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>