[SCEditor] Tùy biến toolbar và thêm các BBcode ẩn

  Bài viết hay nhất1
SCEditor đang sử dụng đã được forumotion tùy biến, bổ sung một số BBcode riêng như dailymotion, scroll, rand...
Bên cạnh đó, forumotion cũng lược bỏ một số tính năng và BBcode như emal, print, maximize
Bài viết này sẽ hướng dẫn bạn cách xắp xếp lại toolbar theo ý thích, và bổ sung các tính năng, BBcode ẩn.

[You must be registered and logged in to see this image.]
Toolbar đã tùy biến

Hướng dẫn

ACP >> Display >> Templates >> Post & Private Messages >> posting_body
Tìm:
Code:
{SCEDITOR}
Thêm vào bên dưới:
Code:
<script type="text/javascript">
//<![CDATA[
$(function () {
   $("#text_editor_textarea").sceditor("instance").destroy();
   try {
      FA.SCEditor = {
         sourceMode: bSourceMode
      };
      $("#text_editor_textarea").sceditor({
         locale: locale,
         width: ($.sceditor.ie <= 9) ? '' : '100%',
         height: height,
         plugins: plugin,
         toolbar: 'TOOLBAR',
         style: cssFile,
         rtl: isRtl,
         emoticonsEnabled: emoticonsEnabled,
         emoticonsCompat: true,
         emoticonsRoot: "",
         emoticons: {
            dropdown: smileys
         },
         emoticonsURL: iframeSrc
      });
      var editor = $("#text_editor_textarea").sceditor("instance");
      editor.toggleSourceMode();
      editor.sourceMode(FA.SCEditor.sourceMode);
      if (FA.SCEditor.sourceMode) $("a.sceditor-button-source").addClass("hover");
      if (plugin === 'bbcode') {
         FA_SCEditor.functions.showHideToolbarElements();
         if (!bSourceMode && editor.getSourceEditorValue().length) editor.setWysiwygEditorValue(editor.getSourceEditorValue() + '<br />')
      }
   } catch (e) {
      if (typeof (console) != 'undefined') {
         console.error(e)
      }
   }
   try {
      if (typeof (addSmileyPane) != 'undefined') {
         addSmileyPane()
      }
   } catch (e) {
      if (typeof (console) != 'undefined') {
         console.error(e)
      }
   }
});
//]]>
</script>
Tìm vị trí đánh dấu TOOLBAR(dòng 14) trong code trên, thay bằng mã toolbar của bạn, ví dụ:
Code:
bold,italic,underline,strike|left,center,right,justify|bulletlist,orderedlist,horizontalrule|quote,code,faspoiler,fahide,table|servimg,image,email,link,unlink|youtube,dailymotion,flash|size,color,font,removeformat|date,time,pastetext,cut,copy,paste|more|subscript,superscript,fascroll,faupdown,fawow,farand|print,maximize,source

Lưu ý:
Trong toolbar được phân thành từng cụm chức năng, trong mỗi cụm chức năng sẽ phân ra từng chức năng riêng biệt
Mỗi cụm sẽ cách nhau bằng dấu gạch đứng |
Mỗi BBcode (hoặc chức năng) được ngăn cách nhau bởi dấu phẩy ,

Các BBcode và chức năng có thể sử dụng trong forumotion:


Zzbaivong
You cannot reply to topics in this forum