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.

Font Size (more options)

5 posters

Go down

Solved Font Size (more options)

Post by TheCrow Sat 1 Nov - 21:09

Hello,

Can i add numbers of font-size: 19.20.21.22.23 to the editor font-size button?
Is there a way to do that?

MrMind


Last edited by MrMind on Thu 6 Nov - 11:55; edited 1 time in total
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Sat 1 Nov - 21:14

Hello MrMind,

Go to Administration Panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In all the pages
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

There are already example sizes added.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Sat 1 Nov - 21:17

I want between numbers 18 and 24 to add the 19.20.21.22.23. How will i do that because i didn't understand the after and before thing.. scratch
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Sat 1 Nov - 21:59

Replace your script with this instead :
Code:
$(function(){$(function() {
  $('.sceditor-button-size').click(function() {
    addSize(23, 'after', 18);
    addSize(22, 'after', 18);
    addSize(21, 'after', 18);
    addSize(20, 'after', 18);
    addSize(19, 'after', 18);
 
    $('.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, dataSize){
    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 (typeof dataSize === 'undefined') {
      if (position == 'after') $('.sceditor-fontsize-picker div').append(data);
      if (position == 'before') $('.sceditor-fontsize-picker div').prepend(data);
    }
    if (typeof dataSize != 'undefined') {
      if (position == 'after') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').after(data);
      if (position == 'before') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').before(data);
    }
  }
})});

I added dataSize to the args, so you have to write : addSize(size, position, dataSize);

Example : addSize(19, 'after', 18);
Literally : The size option '19' is added in after the size option '18'

dataSize is optional, if for example you want to add an option to the end of the list you'll write : addSize(100, 'after');
Literally : Add the size option '100' after all size options


If you have a lot of font-sizes you can add a scroll bar to the drop down by adding this to your CSS :
Code:
.sceditor-fontsize-picker {
  overflow-y:auto;
  overflow-x:hidden;
  height:200px;
}
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Sun 2 Nov - 0:34

This makes the perfixes and the bbcodes not working. Why is that? As soon as i set it in the posts it is all ok but it is only working on the fast editor.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Sun 2 Nov - 0:50

What do you mean by prefixes ? Have you made sure to tick "In all the pages" for the script ?
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Sun 2 Nov - 2:26

If i tick all pages, the perfixes (https://i.imgur.com/UIONjBx.png) and the bbcodes don't work. If i click in the topics, then its all ok.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Sun 2 Nov - 2:37

Okay, replace the script by this :
Code:
$(function(){$(function() {
  if (!document.getElementById('text_editor_textarea')) return;
  $('.sceditor-button-size').click(function() {
    addSize(23, 'after', 18);
    addSize(22, 'after', 18);
    addSize(21, 'after', 18);
    addSize(20, 'after', 18);
    addSize(19, 'after', 18);
 
    $('.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, dataSize){
    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 (typeof dataSize === 'undefined') {
      if (position == 'after') $('.sceditor-fontsize-picker div').append(data);
      if (position == 'before') $('.sceditor-fontsize-picker div').prepend(data);
    }
    if (typeof dataSize != 'undefined') {
      if (position == 'after') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').after(data);
      if (position == 'before') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').before(data);
    }
  }
})});

It'll only run if the editor is on the page. I have no idea why it's stopping those scripts from working as it's only triggered on click of the size button.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Sun 2 Nov - 4:02

Sorry man,

Still stops those the javascripts. Now stops, bbcodes, perfixes and the navbar scroll. I cannot help anyways. Sorry.

p.s. i had to put it to All the pages right? Because after i see that it is not working i set it to the topics only so the others don't have any affect.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Mon 3 Nov - 8:17

Currently I am running it on my test forum without any problems. Could you provide the two scripts that are having problems, so I may see what the cause is ?
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Mon 3 Nov - 10:52

OFC

Perfixes (all the pages):

BBcodes (all the pages):

nav bar scroll (all the pages):
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Tue 4 Nov - 11:29

Βump!
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Michael_vx Tue 4 Nov - 11:57

i got a problem here after i did my thoughts its showed wrong list
10 - 12 -11 - 13 - 15 -14 -16 - 18 - 19 - 20 - 21 - 22 - 23 -24 - 35 - 34 - 33 - 32 - 31 - 30 - 29 - 28 - 27 - 26 - 25
here the script after changes i made

Code:
    $(function(){$(function() {
      $('.sceditor-button-size').click(function() {
        addSize(23, 'after', 18);
        addSize(22, 'after', 18);
        addSize(21, 'after', 18);
        addSize(20, 'after', 18);
        addSize(19, 'after', 18);
        addSize(11, 'after', 10);
        addSize(12, 'after', 10);
        addSize(14, 'after', 13);
        addSize(15, 'after', 13);
        addSize(25, 'after', 24);
        addSize(26, 'after', 24);
        addSize(27, 'after', 24);
        addSize(28, 'after', 24);
        addSize(29, 'after', 24);
        addSize(30, 'after', 24);
        addSize(31, 'after', 24);
        addSize(32, 'after', 24);
        addSize(33, 'after', 24);
        addSize(34, 'after', 24);
        addSize(35, 'after', 24);
   
        $('.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, dataSize){
        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 (typeof dataSize === 'undefined') {
          if (position == 'after') $('.sceditor-fontsize-picker div').append(data);
          if (position == 'before') $('.sceditor-fontsize-picker div').prepend(data);
        }
        if (typeof dataSize != 'undefined') {
          if (position == 'after') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').after(data);
          if (position == 'before') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').before(data);
        }
      }
    })});
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Tue 4 Nov - 23:30

@MrMind I installed all scripts, but have not encountered any errors. I'm not sure what the problem could be. Have you made any modifications to the size script ?

@Michael The option that you want to be first must be the last. For example instead of adding 50, 51, 52, we would add 52, 51, 50.

Try now :
Code:
    $(function(){$(function() {
      $('.sceditor-button-size').click(function() {
        addSize(23, 'after', 18);
        addSize(22, 'after', 18);
        addSize(21, 'after', 18);
        addSize(20, 'after', 18);
        addSize(19, 'after', 18);
        addSize(12, 'after', 10);
        addSize(11, 'after', 10);
        addSize(15, 'after', 13);
        addSize(14, 'after', 13);
        addSize(35, 'after', 24);
        addSize(34, 'after', 24);
        addSize(33, 'after', 24);
        addSize(32, 'after', 24);
        addSize(31, 'after', 24);
        addSize(30, 'after', 24);
        addSize(29, 'after', 24);
        addSize(28, 'after', 24);
        addSize(27, 'after', 24);
        addSize(26, 'after', 24);
        addSize(25, 'after', 24);
 
        $('.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, dataSize){
        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 (typeof dataSize === 'undefined') {
          if (position == 'after') $('.sceditor-fontsize-picker div').append(data);
          if (position == 'before') $('.sceditor-fontsize-picker div').prepend(data);
        }
        if (typeof dataSize != 'undefined') {
          if (position == 'after') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').after(data);
          if (position == 'before') $('.sceditor-fontsize-picker div a[data-size="'+dataSize+'"]').before(data);
        }
      }
    })});
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by SLGray Wed 5 Nov - 0:20

Oops! Posted in the wrong topic.


Font Size (more options) Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51482
Reputation : 3519
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Font Size (more options)

Post by Ape Wed 5 Nov - 0:36

I used the first code without a problem to any of my systems i had this some time a go thanks to Ange Tuteur Very good


Font Size (more options) Left1212Font Size (more options) Center11Font Size (more options) Right112
Font Size (more options) Ape_b110
Font Size (more options) Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19110
Reputation : 1991
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Font Size (more options)

Post by Michael_vx Wed 5 Nov - 7:57

Ange
thanks a lot i think im getting dumber these days Very Happy
may be its the cold
i also added the number 17 you have missed Very Happy
worked like a charm for me now
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Wed 5 Nov - 12:19

@Ange, i didn't make any modifications to anything! If you want i can send you via pm a test account information to check it out in the admin panel.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Michael_vx Wed 5 Nov - 14:52

Ange i think there something in my forum not right
while posting posts i find this
starting from font 30 to 35 not working
can that be fixed or ill just have to make it 29 max ?
sorry for too much asking
Sad
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Font Size (more options)

Post by Ape Wed 5 Nov - 19:44

Hi ya @Michael_vx

Just to confirm anything after 29 will not work as FM systems Do not have font sizes bigger then 29 on there servers  I had the same problem.

APE


Font Size (more options) Left1212Font Size (more options) Center11Font Size (more options) Right112
Font Size (more options) Ape_b110
Font Size (more options) Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19110
Reputation : 1991
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Wed 5 Nov - 20:19

MrMind wrote:@Ange, i didn't make any modifications to anything! If you want i can send you via pm a test account information to check it out in the admin panel.
I am sending you the information of a Test Account as an Admin so you can access the Admin Panel and check out the problem. If you set the font sizes to all the pages it deactivates the three javascripts and keeps that. Check it and please inform me with your suggestions if possible.

Thanks in advance.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Ange Tuteur Thu 6 Nov - 0:06

Thanks for the info. I inspected your forum and found a syntax error. This script was missing a semi-colon( ; ) at the end.
Code:
$(document).ready(function() {
    $.getScript('https://raw.github.com/lokesh/lightbox2/master/js/lightbox.js');
});
$(function () {
        $('input[name="description"]').change(function () {
            var ValidFileExtension = ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'gif', 'GIF', 'bmp','BMP'];
        if ($.inArray($(this).val().split('.').pop().toLowerCase(), ValidFileExtension) == -1) {
            alert("Το πεδίο υποστηρίζει μόνο αρχεία μορφής: '.jpeg','.jpg', '.png', '.gif', '.bmp'");
        }
    })
})

I corrected it, and everything should be okay. Smile
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Michael_vx Thu 6 Nov - 9:14

APE wrote:Hi ya @Michael_vx

Just to confirm anything after 29 will not work as FM systems Do not have font sizes bigger then 29 on there servers  I had the same problem.

APE
so that wont be changed Very Happy i mean there is no way to fix it am i right ?
Ange Tuteur wrote:Thanks for the info. I inspected your forum and found a syntax error. This script was missing a semi-colon( ; ) at the end.
Code:
$(document).ready(function() {
    $.getScript('https://raw.github.com/lokesh/lightbox2/master/js/lightbox.js');
});
$(function () {
        $('input[name="description"]').change(function () {
            var ValidFileExtension = ['jpg', 'JPG', 'jpeg', 'JPEG', 'png', 'PNG', 'gif', 'GIF', 'bmp','BMP'];
        if ($.inArray($(this).val().split('.').pop().toLowerCase(), ValidFileExtension) == -1) {
            alert("Το πεδίο υποστηρίζει μόνο αρχεία μορφής: '.jpeg','.jpg', '.png', '.gif', '.bmp'");
        }
    })
})

I corrected it, and everything should be okay. Smile
should i change the old with the new one ? or its no problem Smile
im just asking only Razz
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Font Size (more options)

Post by TheCrow Thu 6 Nov - 10:12

@Michael_vx, the new js is not for you. And it is not for this topic. It is just a mistake that a js had in my forum.

Edit: My question-problem is now solved. Moderators may close this and if wanted you can close it after the others questions are solved.
TheCrow
TheCrow
Manager
Manager

Male Posts : 6913
Reputation : 794
Language : Greek, English

https://forumote.forumotion.com

Back to top Go down

Solved Re: Font Size (more options)

Post by Michael_vx Thu 6 Nov - 13:19

Shocked 
if its not for me then i see no problem
ill just wait for Ange will say Smile
Michael_vx
Michael_vx
Forumember

Male Posts : 664
Reputation : 29
Language : Arabic and some English
Location : Egypt

Back to top Go down

Solved Re: Font Size (more options)

Post by Ape Thu 6 Nov - 15:29

There is no plan on upping the text size on the servers as far as i know so there is no other way to add them as it has to be done server side.

as this is now marked as solved i will lock it Wink
Topic solved and archived

APE


Font Size (more options) Left1212Font Size (more options) Center11Font Size (more options) Right112
Font Size (more options) Ape_b110
Font Size (more options) Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19110
Reputation : 1991
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Back to top

- Similar topics

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