view for preview

This commit is contained in:
Matthew K. Fu JuYuan committed 2012-09-04 09:24:12 +08:00
1 parent fc4e2ceba5
commit ae1595a008
7 files changed
+80 -1

No files matched your search

@@ -3,6 +3,26 @@
// <%= link_to "NewPreview", realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger'%>
$(document).ready(function() {
$("a.post_preview").click(function(e){
$("#main-wrap").after("<span id='show_preview'></span>");
e.preventDefault();
var form = $(this).parents("form").first()
//var cont = form["content"].value;
$.ajax({
type: 'POST',
url: $(this).attr("href")+'?preview=true',
data: form.serialize(),
dataType: "script",
success: function (msg) {
$("#"+start_modal_with_id).modal('show'); },
error: function(){
alert("ERROR");
}
});
return false
});
$("a.preview_trigger").click(function(){
$("#main-wrap").after("<span id='show_preview'></span>");
$.ajax({