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]

#1

OfflineGrafix

Grafix
 
Management Team
 Management Team

Posted Mon Apr 14, 2014 8:59 am

 

*
POPULAR

Image preview:
[Tutorial] Advance Quickpreview [SCEditor] Fddddd10




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

https://socialacademy.forumotion.com
#2

Offlinecool123

cool123
 
Member
Member

Posted Tue Apr 15, 2014 12:11 pm

 
Thanks

#3

OfflineJesus.

Jesus.
 
Member
Member

Posted Wed Apr 16, 2014 8:46 am

 
Very nice :)

#4

OfflineDark-Avenger

Dark-Avenger
 
Advance Member
Advance Member

Posted Wed Apr 16, 2014 9:52 pm

 
Thanks

#5

OfflineEgoOne

EgoOne
 
Member
Member

Posted Fri May 02, 2014 8:00 am

 
Thanks

#6

OfflineJ0k3R^

J0k3R^
 
Advance Member
Advance Member

Posted Fri May 02, 2014 4:02 pm

 
thanks a lot

http://fmplanet.forumgreek.com
#7

Offlineeby

eby
 
Member
Member

Posted Fri May 02, 2014 4:54 pm

 
thnx brooooo :D

http://www.skudraime.ml
#8

Offlineerchima

erchima
 
Member
Member

Posted Sat May 03, 2014 1:34 am

 
thanks

http://www.erchima.net/
#9

OfflineUdarsha45

Udarsha45
 
Advance Member
Advance Member

Posted Fri May 09, 2014 11:06 am

 
Wow ! I love this Thaank you for this

#10

Offlinepuppycheese123

puppycheese123
 
Member
Member

Posted Fri May 30, 2014 6:05 am

 
This looks really cool! Thanks

#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 | Computers and Internet | Internet | ©phpBB | Free forum support | Report an abuse | Forumotion.com


Social Academy Forum
© Social Academy 2013-2022