fix similar button for post/show
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
this.initialize_post_sections();
|
this.initialize_post_sections();
|
||||||
this.initialize_post_image_resize_links();
|
this.initialize_post_image_resize_links();
|
||||||
this.initialize_post_image_resize_to_window_link();
|
this.initialize_post_image_resize_to_window_link();
|
||||||
|
this.initialize_similar();
|
||||||
this.place_jlist_ads();
|
this.place_jlist_ads();
|
||||||
|
|
||||||
if (Danbooru.meta("always-resize-images") === "true") {
|
if (Danbooru.meta("always-resize-images") === "true") {
|
||||||
@@ -27,6 +28,26 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Danbooru.Post.initialize_similar = function() {
|
||||||
|
$("#similar-button").click(function(e) {
|
||||||
|
var old_source_name = $("#post_source").attr("name");
|
||||||
|
var old_target = $("#form").attr("target");
|
||||||
|
var old_action = $("#form").attr("action");
|
||||||
|
|
||||||
|
$("#post_source").attr("name", "url");
|
||||||
|
$("#form").attr("target", "_blank");
|
||||||
|
$("#form").attr("action", "http://danbooru.iqdb.org/");
|
||||||
|
|
||||||
|
$("#form").trigger("submit");
|
||||||
|
|
||||||
|
$("#post_source").attr("name", old_source_name);
|
||||||
|
$("#form").attr("target", old_target);
|
||||||
|
$("#form").attr("action", old_action);
|
||||||
|
|
||||||
|
e.preventDefault();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Danbooru.Post.initialize_shortcuts = function() {
|
Danbooru.Post.initialize_shortcuts = function() {
|
||||||
$(document).bind("keydown./", function(e) {
|
$(document).bind("keydown./", function(e) {
|
||||||
$("#tags").trigger("focus");
|
$("#tags").trigger("focus");
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
$("#form").attr("target", "_blank");
|
$("#form").attr("target", "_blank");
|
||||||
$("#form").attr("action", "http://danbooru.iqdb.org/");
|
$("#form").attr("action", "http://danbooru.iqdb.org/");
|
||||||
|
|
||||||
$("form").trigger("submit");
|
$("#form").trigger("submit");
|
||||||
|
|
||||||
$("#upload_source").attr("name", old_source_name);
|
$("#upload_source").attr("name", old_source_name);
|
||||||
$("#upload_file").attr("name", old_file_name);
|
$("#upload_file").attr("name", old_file_name);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= form_for(post, :html => {:class => "simple_form"}) do |f| %>
|
<%= form_for(post, :html => {:class => "simple_form", :id => "form"}) do |f| %>
|
||||||
<%= f.hidden_field :old_tag_string, :value => post.tag_string %>
|
<%= f.hidden_field :old_tag_string, :value => post.tag_string %>
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
|
|||||||
Reference in New Issue
Block a user