fixes #21: Unable to preview forum posts and wiki pages

This commit is contained in:
albert
2011-09-13 19:13:05 -04:00
parent c818f2c114
commit b166cac19f
2 changed files with 6 additions and 4 deletions

View File

@@ -21,16 +21,17 @@
} }
Danbooru.ForumPost.initialize_preview_link = function() { Danbooru.ForumPost.initialize_preview_link = function() {
$("#c-forum-topics #preview a[name=toggle-preview]").click(function() { $("#c-forum-topics #preview a[name=toggle-preview]").click(function(e) {
$("#preview").toggle(); $("#preview").toggle();
$("#dtext-help").toggle(); $("#dtext-help").toggle();
e.preventDefault();
}); });
$("#c-forum-topics input[value=Preview]").click(function(e) { $("#c-forum-topics input[value=Preview]").click(function(e) {
e.preventDefault(); e.preventDefault();
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/dtext/preview", url: "/dtext_preview",
data: { data: {
body: $("#forum_post_body").val() body: $("#forum_post_body").val()
}, },

View File

@@ -8,16 +8,17 @@
} }
Danbooru.WikiPage.initialize_preview_link = function() { Danbooru.WikiPage.initialize_preview_link = function() {
$("#c-wiki-pages #preview a[name=toggle-preview]").click(function() { $("#c-wiki-pages #preview a[name=toggle-preview]").click(function(e) {
$("#preview").toggle(); $("#preview").toggle();
$("#dtext-help").toggle(); $("#dtext-help").toggle();
e.preventDefault();
}); });
$("#c-wiki-pages input[value=Preview]").click(function(e) { $("#c-wiki-pages input[value=Preview]").click(function(e) {
e.preventDefault(); e.preventDefault();
$.ajax({ $.ajax({
type: "post", type: "post",
url: "/dtext/preview", url: "/dtext_preview",
data: { data: {
body: $("#wiki_page_body").val() body: $("#wiki_page_body").val()
}, },