The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Add more text size and fill more colors on post editor

3 posters

Go down

Solved Add more text size and fill more colors on post editor

Post by AlexisMcDevin January 15th 2015, 12:18 pm

Dear All,

As per the title, how can we add more text sizes and fill more colors on post editor?

My forum infomation you can find on my profile.

Add more text size and fill more colors on post editor 1979273_699726400141305_5059346010912132437_o

Thank you!
Alex.


Last edited by AlexisMcDevin on January 16th 2015, 8:10 am; edited 1 time in total
AlexisMcDevin
AlexisMcDevin
Forumember

Male Posts : 134
Reputation : 5
Language : English

http://ccxiqi.forumvi.com/

Back to top Go down

Solved Re: Add more text size and fill more colors on post editor

Post by Ikerepc January 15th 2015, 12:46 pm

For colors go to admin panel -> configuration -> Messages and e-mails -> Type of the editor colors palette : Extened
Ikerepc
Ikerepc
Active Poster

Male Posts : 1187
Reputation : 167
Language : Who cares...
Location : Where web help & support is needed

http://admins.forumotion.com

Back to top Go down

Solved Re: Add more text size and fill more colors on post editor

Post by Ange Tuteur January 15th 2015, 1:07 pm

Hey @AlexisMcDevin,

For font sizes go to Administration Panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In all the pages
Paste the code below :
Code:
$(function(){$(function() {
  $('.sceditor-button-size').click(function() {
    addSize(8, 'before');
    addSize(6, 'before');
   
    addSize(26, 'after');
    addSize(28, 'after');
    addSize(30, 'after');
 
    $('.sceditor-fontsize-option.new-size').click(function(e){$('#text_editor_textarea').sceditor('instance').insertText('[size='+$(this).attr('data-size')+']','[/size]');$('.sceditor-fontsize-picker').remove();e.preventDefault()})
  });
  function addSize(size, position){
    var data = '<a unselectable="on" class="sceditor-fontsize-option new-size" href="#" data-size="'+size+'"><span unselectable="on" style="font-size:'+size+'px;">'+size+'</span></a>';
    if (position == 'after' || position == null) $('.sceditor-fontsize-picker div').append(data);
    if (position == 'before') $('.sceditor-fontsize-picker div').prepend(data);
  }
})});

To add sizes write : addSize(number, position)

number : the size of the font e.g. 1, 2, 3..
position : where the option will be placed e.g. before, after..
- before places the option before all current fonts
- after places the option after all current fonts
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Add more text size and fill more colors on post editor

Post by AlexisMcDevin January 15th 2015, 2:20 pm

Hi @Ange Tuteur,

Text size (30) does not work. However, All other numbers is perfect. It is okay with me.

How about the color board? Can we add more colors or we should remove JS of this color board and using the original color board in PAC setting per "help.forummotion" forum?

(Type of the editor colors palette: Extended)

Here is the code of color board that I am using:
Code:
$(function(){$(function(){
  if ($("#text_editor_textarea").length < 1) return;
  $.sceditor.command.get('color')._menu  = function (editor, caller, callback) {
    var mColorBasic = [],
    html = $('<div />');
               
    // begin list of colors
             
    mColorBasic["Black"] = "#000000";
    mColorBasic["Dark Blue"] = "#00008B";
    mColorBasic["Teal"] = "#008080";
    mColorBasic["Dark Green"] = "#006400";
    mColorBasic["Indigo"] = "#4B0082";
    mColorBasic["Crimson"] = "#DC143C";
    mColorBasic["Orange"] = "#FF4500";
    mColorBasic["Brown"] = "#663300";
       
    mColorBasic["Dark Gray"] = "#666666";
    mColorBasic["Royal Blue"] = "#4169E1";
    mColorBasic["Dark Turquoise"] = "#00CED1";
    mColorBasic["Green"] = "#008000";
    mColorBasic["Purple"] = "#9400D3";
    mColorBasic["Red"] = "#FF0000";
    mColorBasic["Light Orange"] = "#FF9933";
    mColorBasic["Sienna"] = "#A0522D";
       
    mColorBasic["Light Gray"] = "#D3D3D3";
    mColorBasic["Sky Blue"] = "#87CEEB";
    mColorBasic["Cyan"] = "#00FFFF";
    mColorBasic["Green Apple"] = "#32CD32";
    mColorBasic["Mauve"] = "#DA70D6";
    mColorBasic["Salmon"] = "#FA8072";
    mColorBasic["Gold"] = "#FFD700";
    mColorBasic["Light Brown"] = "#CD853F";
       
    mColorBasic["White"] = "#FFFFFF";
    mColorBasic["Pale Turquoise"] = "#AFEEEE";
    mColorBasic["Blue Green"] = "#7FFFD4";
    mColorBasic["Pale Green"] = "#98FB98";
    mColorBasic["Pink"] = "#FFC0CB";
    mColorBasic["Peach"] = "#FFDAB9";
    mColorBasic["Yellow"] = "#FFFF00";
    mColorBasic["Wood"] = "#DEB887";
             
    // end list of colors
             
    for(key in mColorBasic) html.append('<div class="color-option" title="' + key + '"><span color="' + mColorBasic[key] + '" style="background-color: ' + mColorBasic[key] + ' !important;"></span></div>');
             
    html.find('span').click(function(e) {
      callback($(this).attr('color'));
      editor.closeDropDown(true);
      e.preventDefault();
    });
             
    editor.createDropDown(caller, "color-picker", html);
  }
})});

Below is the image after insert text szie for our reference only.
Add more text size and fill more colors on post editor 10520830_699759796804632_7686984372165435415_o
AlexisMcDevin
AlexisMcDevin
Forumember

Male Posts : 134
Reputation : 5
Language : English

http://ccxiqi.forumvi.com/

Back to top Go down

Solved Re: Add more text size and fill more colors on post editor

Post by AlexisMcDevin January 16th 2015, 8:09 am

Opps, the color bloard can be changed in my proviced code ablove.

Everything.... DONE!

Topic solved.

Thank you!
Alex.
AlexisMcDevin
AlexisMcDevin
Forumember

Male Posts : 134
Reputation : 5
Language : English

http://ccxiqi.forumvi.com/

Back to top Go down

Solved Re: Add more text size and fill more colors on post editor

Post by Ange Tuteur January 16th 2015, 8:16 am

Ohh you're welcome Mr. Green

I don't think font-size 30 is in our bbcode, and for the color palette, it is explain here : https://help.forumotion.com/t134603-personalize-the-color-palette-of-the-editor#906632 ^^

Topic archived

Have a nice day bye
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

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