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.

more fonts in the editor?

2 posters

Go down

Solved more fonts in the editor?

Post by QeemBA July 9th 2014, 6:10 am

Hi everyone

Is it possible to have more fonts inside the editor??
QeemBA
QeemBA
Forumember

Posts : 38
Reputation : 1
Language : English

http://teamtazkirah.forummotion.com/

Back to top Go down

Solved Re: more fonts in the editor?

Post by Ange Tuteur July 9th 2014, 8:59 am

Hello Qeemba,

I wrote up a quick draft for you to test. This will allow you to add new fonts to the list of fonts :
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-font').click(function() {
    addFont('Calibri');
    addFont('Papyrus');
    addFont('Copperplate');
    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>')}
})});

To add new fonts to the list simply write addFont(); between the parenthesis you'll write the font you want in quotes. For example :
Code:
addFont('Baskerville');
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: more fonts in the editor?

Post by QeemBA July 9th 2014, 9:34 am

Hi Ange

Yes it did works! Big Thanks Smile
QeemBA
QeemBA
Forumember

Posts : 38
Reputation : 1
Language : English

http://teamtazkirah.forummotion.com/

Back to top Go down

Solved Re: more fonts in the editor?

Post by Ange Tuteur July 9th 2014, 10:56 am

You're welcome

Topic archived

Have a good day. Smile
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