Posted Mon Apr 14, 2014 8:59 am
POPULAR
Image preview:
After that , go to your
Title: AdvanceQuickPreview
Placement : In all the topics
Note : Turn off censorship ACP Forum Security Unauthorize unofficial forms to post messages and private messages on the forum: No
(you must reply to see the hidden codes)
After that , go to your
Administration Panel → Modules → HTML & Javascript → Javascript codes management |
Title: AdvanceQuickPreview
Placement : In all the topics
- Code:
$(function () {
$(function () {
$("#quick_reply input[name='preview']").click(function (b) {
b.preventDefault();
b = $("#text_editor_textarea").sceditor("instance");
3 >= b.val().length ? alert("Posts are too short!") : ($("#Zzpreview_overlay").length || ($("body").append('<div id="Zzpreview_overlay"><p class="h2"><span class="Zzpreview_title left">Preview</span><span class="Zzpreview_get left"><label><input type="checkbox" id="getPreview" /> Preview</label></span><a href="#quickreply" class="Zzpreview_close">Close</a></p><div class="post-entry"><div class="entry-content"><div id="Zzpreview_post"><img src="http://i.imgur.com/m3NXDa6.gif" alt="loading..." /> loading...</div></div></div><div class="center"><input type="button" class="Zzpreview_full Zzpreview_button" value="Preview"> <input type="button" class="Zzpreview_submit Zzpreview_button" value="Submit"></div></div>'),
$("#Zzpreview_post").width($(".entry-content:first").width()), "true" == my_getcookie("Zzpreview_check") && $("#getPreview").prop("checked", !0)), $("#Zzpreview_post").html('<img src="http://i.imgur.com/m3NXDa6.gif" alt="loading..." /> loading...'), $.sceditor.isWysiwygSupported && !$("#getPreview").prop("checked") ? (b.toggleSourceMode(), b.inSourceMode() && b.toggleSourceMode(), $("#Zzpreview_post").html(b.getBody().clone().html()), $("#Zzpreview_post > div:not([align])").replaceWith(function () {
return $(this).html().replace(/<br>$/g,
"") + "<br />"
}), $("#Zzpreview_post").html(function () {
var a = $(this).html(),
a = a.replace(/(\[spoiler=\"(.*)\"\])/g, '<dl class="codebox spoiler"><dt style="cursor: pointer;">$2:</dt><dd><div class="spoiler_content">'),
a = a.replace(/(\[spoiler\])/g, '<dl class="codebox spoiler"><dt style="cursor: pointer;">Spoiler:</dt><dd><div class="spoiler_content">'),
a = a.replace(/(\[\/spoiler\])/g, "</div></dd></dl>"),
a = a.replace(/\[hide\]/g, '<dl class="codebox hidecode"><dd>');
return a = a.replace(/\[\/hide\]/g, "</dd></dl>")
}),
$("#Zzpreview_post code").wrap('<dl class="codebox"><dd class="cont_code"></dd></dl>').parent("dd").before("<dt>Code:</dt>")) : $.post("/post", {
mode: "reply",
notify: 1,
preview: 1,
t: $("#quick_reply input[name='t']").val(),
message: $("#text_editor_textarea").sceditor("instance").val()
}, function (a) {
$("#Zzpreview_post").html($(a).find(".entry-content:first").html())
}), $("#Zzpreview_overlay").fadeIn())
});
$(document).on("change", "#getPreview", function () {
my_setcookie("Zzpreview_check", $("#getPreview").prop("checked"), !0)
});
$(document).on("click", ".Zzpreview_full", function () {
$("#quick_reply").attr("action", "/post?preview=1").submit()
});
$(document).on("click", ".Zzpreview_submit", function () {
$("#quick_reply input[name='post']").click()
});
$(document).on("click", ".Zzpreview_close", function () {
$("#Zzpreview_overlay").fadeOut()
})
})
});
Note : Turn off censorship ACP Forum Security Unauthorize unofficial forms to post messages and private messages on the forum: No
(you must reply to see the hidden codes)
Last edited by Red™ on Mon Jun 09, 2014 5:10 am; edited 3 times in total