posts: add "view original" sidebar option.
* Add a "View original" sidebar option. * Rename the "View large" sidebar option to "View smaller". * Remove the "Loading..." message when switching image sizes. * Fix the V hotkey not working after using it once. * Change #image-resize-link to .image-view-original link (note that there are two of these links now, one in the notice bar and one in the sidebar). * Add a `data-post-current-image-size` attribute on the <body> element and use it to control visibility of links and notices.
This commit is contained in:
@@ -68,8 +68,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? %>
|
||||
<div class="notice notice-small post-notice post-notice-resized" id="image-resize-notice" style="<%= CurrentUser.default_image_size == "original" ? "display: none;" : "" %>">
|
||||
<span>Resized to <%= number_to_percentage post.resize_percentage.floor, :precision => 0 %> of original (<%= link_to "view original", post.tagged_file_url, :id => "image-resize-link" %>)</span>
|
||||
<span style="display: none;">Loading...</span>
|
||||
<div class="notice notice-small post-notice post-notice-resized" id="image-resize-notice">
|
||||
Resized to <%= number_to_percentage post.resize_percentage.floor, precision: 0 %> of original (<%= link_to "view original", post.tagged_file_url, class: "image-view-original-link" %>)
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
<%= link_to "Resize to window", "#", class: "image-resize-to-window-link", "data-shortcut": "z" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<% if post.visible? && post.has_large? && !post.is_ugoira? %>
|
||||
<li id="post-option-view-large" style="<%= CurrentUser.default_image_size == "original" ? "" : "display: none;" %>">
|
||||
<%= link_to "View large", post.tagged_large_file_url, id: "image-view-large-link" %>
|
||||
<% if policy(post).visible? && post.has_large? && !post.is_ugoira? %>
|
||||
<li id="post-option-view-large">
|
||||
<%= link_to "View smaller", post.tagged_large_file_url, class: "image-view-large-link" %>
|
||||
</li>
|
||||
<li id="post-option-view-original">
|
||||
<%= link_to "View original", post.tagged_file_url, class: "image-view-original-link" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li id="post-option-find-similar">
|
||||
|
||||
Reference in New Issue
Block a user