forum previews working

This commit is contained in:
albert
2011-03-12 16:09:11 -05:00
parent 21cc1cbafa
commit bd520f61f7
29 changed files with 1516 additions and 81 deletions

View File

@@ -3,7 +3,7 @@ $(document).ready(function() {
// $("#upgrade-account").hide();
// Cookie.put('hide-upgrade-account', '1', 7);
// });
// Table striping
$("table.striped tbody tr:even").addClass("even");
$("table.striped tbody tr:odd").addClass("odd");

View File

@@ -2,7 +2,7 @@
Danbooru.Comment = {};
Danbooru.Comment.initialize_all = function() {
$("#c-comments div.dtext-preview").hide();
$("div.dtext-preview").hide();
this.initialize_response_link();
this.initialize_preview_button();
}

View File

@@ -0,0 +1,35 @@
(function() {
Danbooru.ForumPost = {};
Danbooru.ForumPost.initialize_all = function() {
$("#c-forum-topics #preview").hide();
this.initialize_preview_link();
}
Danbooru.ForumPost.initialize_preview_link = function() {
$("#c-forum-topics #preview a[name=toggle-preview]").click(function() {
$("#preview").toggle();
$("#dtext-help").toggle();
});
$("#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() {
Danbooru.ForumPost.initialize_all();
});