[Đóng góp] Add thêm font chữ vào SCEditor

  Bài viết hay nhất1
Demo: [Đóng góp] Add thêm font chữ vào SCEditor Captur15
Cách làm:
B1: Vào ACP --> Modules --> JavaScript codes management
Tạo 1 script mới
Tên : Là lá la 123 ( gì cũng được )
Placement : In all the pages
Paste đoạn code phía dưới:
Code:
    $(function(){$(function() {
      $('.sceditor-button-font').click(function() {
        addFont('Calibri');
        addFont('Papyrus');
        addFont('Avantgarde');
     
        $('.sceditor-font-option.new-font').click(function(e){$('#text_editor_textarea').sceditor('instance').insertText('[font='+$(this).attr('data-font')+']','[/font]');$('.sceditor-font-picker').remove();e.preventDefault()})
      });
      function addFont(font){$('.sceditor-font-picker div').append('<a unselectable="on" class="sceditor-font-option new-font" href="#" data-font="'+font+'"><font unselectable="on" face="'+font+'">'+font+'</font></a>')}
    })});

Lưu Ý: Để add thêm font vào thì dùng mẫu code này nhé
Code:
addFont('FONT-NAME');
Thay FONT-NAME = tên Font.
Chỉ add thêm được những font mà có sẵn trong máy tính thôi nhé =)) , ai không có thì không thấy đâu

+++Bonus+++
Nếu mà thanh chọn Font quá dài thì dùng đoạn css này nhé :)
Code:
    .sceditor-font-picker {
      height:250px;
      width:150px;
      overflow-y:auto;
    }
Css ở ACP --> Display --> Colors --> Css stylesheet
Nguồn: http://fmdesign.forumotion.com/t220-add-more-font-choices-to-the-editor

  Bài viết hay nhất2
Nếu vậy thì sao không kèm luôn cái hướng dẫn thêm font đi
The author of this message was banned from the forum - See the message
  Bài viết hay nhất4
You cannot reply to topics in this forum