moved stylesheets and javascripts to assets

This commit is contained in:
albert
2011-05-24 18:24:45 -04:00
parent 1c964b5189
commit ca68b2def1
45 changed files with 921 additions and 568 deletions

View File

@@ -0,0 +1,38 @@
(function() {
Danbooru.Comment = {};
Danbooru.Comment.initialize_all = function() {
$("div.dtext-preview").hide();
this.initialize_response_link();
this.initialize_preview_button();
}
Danbooru.Comment.initialize_response_link = function() {
$("a.expand-comment-response").click(function(e) {
e.preventDefault();
$(e.target).closest("div.new-comment").find("form").show();
$(e.target).hide();
});
$("div.new-comment form").hide();
}
Danbooru.Comment.initialize_preview_button = function() {
$("div.new-comment input[type=submit][value=Preview]").click(function(e) {
e.preventDefault();
$.ajax("/dtext/preview", {
type: "post",
data: {
body: $(e.target).closest("form").find("textarea").val()
},
success: function(data) {
$(e.target).closest("div.new-comment").find("div.comment-preview").show().html(data);
}
});
});
}
})();
$(document).ready(function() {
Danbooru.Comment.initialize_all();
});