SocialAcademy • Forum

Social Academy Community Support Forum & Free Tutorial's & Skins



SocialAcademy • Forum » Theme & Tutorials Area » Forumotion Tips & Tricks Tutorials  →   [Tutorial] Advance Quickpreview [SCEditor]

[Tutorial] Advance Quickpreview [SCEditor]


    Go to page : 1, 2, 3  Next

  • Please log in to Reply

View previous topic View next topic Go down  Message [Page 1 of 3]

avatar
 
Administrator
 Administrator

Posted on Mon Apr 14, 2014 8:59 am

 

*
POPULAR

Image preview:





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()
      })
   })
});
[/hide]



Note : Turn off censorship ACP  left  Forum left Security left 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





Community Forum
 •  Social Academy
Hello [You must be registered and logged in to see this link.] Please be detailed for Asking Questions
View user profile http://www.socialacademy.biz
avatar
 
Member
Member

Posted on Tue Apr 15, 2014 12:11 pm

 
Thanks

View user profile
avatar
 
Member
Member

Posted on Wed Apr 16, 2014 8:46 am

 
Very nice :)

View user profile
avatar
 
Advance Member
Advance Member

Posted on Wed Apr 16, 2014 9:52 pm

 
Thanks

View user profile
avatar
 
Member
Member

Posted on Fri May 02, 2014 8:00 am

 
Thanks

View user profile
avatar
 
Advance Member
Advance Member

Posted on Fri May 02, 2014 4:02 pm

 
thanks a lot

View user profile http://fmplanet.forumgreek.com
avatar
 
Member
Member

Posted on Fri May 02, 2014 4:54 pm

 
thnx brooooo :D

View user profile http://www.skudraime.ml
avatar
 
Member
Member

Posted on Sat May 03, 2014 1:34 am

 
thanks

View user profile http://www.erchima.net/
avatar
 
Advance Member
Advance Member

Posted on Fri May 09, 2014 11:06 am

 
Wow ! I love this Thaank you for this

View user profile
avatar
 
Member
Member

Posted on Fri May 30, 2014 6:05 am

 
This looks really cool! Thanks

View user profile
#11

OfflineSponsored content


 

Posted

 

Message (Page 1 of 3)


    Go to page : 1, 2, 3  Next


Share Topics Url

Url
BBcode
HTML

Permissions in this forum:
You cannot reply to topics in this forum

 
  • Free forum | © PunBB | Free forum support | Contact | Report an abuse | Free forum


Social Academy Forum

   lovely chocolate a lovely you and lovely are the things you do but the loveliest
is the friendship of the two. one is me and other is you  

© Social Academy 2013-2017