unified js for dtext previews

This commit is contained in:
albert
2011-10-20 18:50:16 -04:00
parent f630365c3b
commit e8808987d5
21 changed files with 101 additions and 190 deletions

View File

@@ -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() {