change post nav setting to post nav js setting

This commit is contained in:
albert
2013-03-07 19:40:23 -05:00
parent 9765331b9c
commit 147efb74d3
5 changed files with 7 additions and 8 deletions

View File

@@ -17,7 +17,7 @@
})();
$(function() {
if ($(".paginator").length) {
if ($(".paginator").length && (Danbooru.meta("enable-js-navigation") === "true")) {
$(document).bind("keydown.right", Danbooru.Paginator.next_page);
$(document).bind("keydown.left", Danbooru.Paginator.prev_page);
}

View File

@@ -7,8 +7,9 @@
this.initialize_titles();
if ($("#c-posts").length) {
this.initialize_shortcuts();
this.initialize_nav_help_link();
if (Danbooru.meta("enable-js-navigation") === "true") {
this.initialize_shortcuts();
}
}
if ($("#c-posts").length && $("#a-index").length) {
@@ -125,9 +126,6 @@
e.preventDefault();
});
}
Danbooru.Post.initialize_nav_help_link = function() {
}
Danbooru.Post.initialize_titles = function() {
$(".post-preview").each(function(i, v) {

View File

@@ -14,6 +14,7 @@
<% if flash[:notice] =~ /error/ %>
<meta name="errors" content="true">
<% end %>
<meta name="enable-js-navigation" content="<%= CurrentUser.user.enable_post_navigation %>">
<meta name="default-image-size" content="<%= CurrentUser.user.default_image_size %>">
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
<%= stylesheet_link_tag "application", :media => "screen" %>

View File

@@ -1,6 +1,6 @@
<% if (position == "bottom" && CurrentUser.user.new_post_navigation_layout) || (position == "top" && !CurrentUser.user.new_post_navigation_layout) %>
<div id="nav-links" class="ui-corner-all nav-notice">
<% if params[:tags].present? && CurrentUser.user.enable_post_navigation && params[:tags] !~ /order:/ %>
<% if params[:tags].present? && params[:tags] !~ /order:/ %>
<%= render "posts/partials/show/search_seq", :post => post %>
<% end %>

View File

@@ -10,7 +10,7 @@
<%= f.input :comment_threshold, :hint => "Comments below this score will be hidden by default" %>
<%= f.input :always_resize_images, :as => :select, :include_blank => false %>
<%= f.input :default_image_size, :hint => "Large is #{Danbooru.config.large_image_width} pixels wide, and original is whatever the original image is", :collection => %w(large original), :include_blank => false %>
<%= f.input :enable_post_navigation, :as => :select, :include_blank => false, :hint => "When searching, do you want to navigate from post to post?" %>
<%= f.input :enable_post_navigation, :as => :select, :include_blank => false, :label => "Enable keyboard shortcuts" %>
<%= f.input :new_post_navigation_layout, :as => :select, :label => "Pool links", :include_blank => false, :collection => [["Bottom", "true"], ["Top", "false"]], :hint => "When browsing pools, where do you want the navigation links to be placed?" %>
<%= f.input :favorite_tags, :hint => "A list of whitespace delimited tags that show up in your profile", :input_html => {:size => "40x5"} %>
<%= f.input :blacklisted_tags, :hint => "A list of newline delimited tags that you never want to see", :input_html => {:size => "40x5"} %>