complete preview for both new and announcement
This commit is contained in:
1 parent
8bd5481b3f
commit
6044857fea
24 files changed
+301
-67
No files matched your search
@@ -3,25 +3,53 @@
|
||||
// <%= 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
|
||||
});
|
||||
// $(".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");
|
||||
// // }
|
||||
// // });
|
||||
// url = "/panel/news/back_end/news_bulletins/preview?preview=true"
|
||||
// // alert(url)
|
||||
// form.attr("action",url);
|
||||
// form.submit();
|
||||
// //return false;
|
||||
// });
|
||||
var clicked_what = null;
|
||||
$("button.post_preview").click(function(){
|
||||
clicked_what = $(this);
|
||||
$("form.nccu_ajax_form").ajaxSubmit({
|
||||
beforeSubmit: function(a,f,o){
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
o.dataType = 'script';
|
||||
o.url = clicked_what.attr("url");
|
||||
}
|
||||
});
|
||||
})
|
||||
// $("form.nccu_ajax_form").ajaxForm({
|
||||
// beforeSubmit: function(a,f,o) {
|
||||
// // if(clicked_what.hasClass("post_preview")){
|
||||
// // $("#main-wrap").after("<span id='show_preview'></span>");
|
||||
// // o.dataType = 'script';
|
||||
// // o.url = clicked_what.attr("url");
|
||||
// // }
|
||||
// },
|
||||
// success: function(data) {
|
||||
// // if(!clicked_what.hasClass("post_preview")){
|
||||
// // window.location = data.redirect_url;
|
||||
// // }
|
||||
// }
|
||||
// })
|
||||
|
||||
$("a.preview_trigger").click(function(){
|
||||
$("#main-wrap").after("<span id='show_preview'></span>");
|
||||
|
||||
Reference in new issue
Block a user