unified js for dtext previews
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
Danbooru.ForumPost = {};
|
||||
|
||||
Danbooru.ForumPost.initialize_all = function() {
|
||||
$("#c-forum-topics #preview").hide();
|
||||
|
||||
this.initialize_preview_link();
|
||||
this.initialize_last_forum_read_at();
|
||||
}
|
||||
|
||||
@@ -19,30 +16,6 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Danbooru.ForumPost.initialize_preview_link = function() {
|
||||
$("#c-forum-topics #preview a[name=toggle-preview]").click(function(e) {
|
||||
$("#preview").toggle();
|
||||
$("#dtext-help").toggle();
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#c-forum-topics input[value=Preview]").click(function(e) {
|
||||
e.preventDefault();
|
||||
$.ajax({
|
||||
type: "post",
|
||||
url: "/dtext_preview",
|
||||
data: {
|
||||
body: $("#forum_post_body").val()
|
||||
},
|
||||
success: function(data) {
|
||||
$("#dtext-help").hide();
|
||||
$("#preview").show();
|
||||
$("#preview .content").html(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
Reference in New Issue
Block a user