Author Topic: Adding an additional font size option (11pt) to the editor drop down menu  (Read 58 times)

Offline Chip (OP)

  • Server Admin
  • Moderator
  • Hero Member
  • ***
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 5981
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:July 15, 2019, 07:29:49 AM
  • Deeply Confused Learner
see https://www.simplemachines.org/community/index.php?topic=568610

In ./Themes/default/GenericControls.template.php, find this:

Code: [Select]
                \'\': ', JavaScriptEscape($txt['font_size']), ',
                           \'1\': \'8pt\',
                           \'2\': \'10pt\',
                           \'3\': \'12pt\',
                           \'4\': \'14pt\',
                           \'5\': \'18pt\',
                           \'6\': \'24pt\',
                           \'7\': \'36pt\'

Replace with this:

Code: [Select]
                \'\': ', JavaScriptEscape($txt['font_size']), ',
                           \'1\': \'8pt\',
                           \'2\': \'10pt\',
                           \'3\': \'11pt\',
                           \'4\': \'12pt\',
                           \'5\': \'14pt\',
                           \'6\': \'18pt\',
                           \'7\': \'24pt\',
                           \'8\': \'36pt\'

In ./Themes/default/scripts/editor.js, find this:

Code: [Select]
// Font maps (HTML => CSS size)
   this.aFontSizes = [
      0,
      8,
      10,
      12,
      14,
      18,
      24,
      36

Then just add 11, after the 10 like this:

Code: [Select]
this.aFontSizes = [
      0,
      8,
      10,
      11,
      12,
      14,
      18,
      24,
      36


Post Merged: July 07, 2019, 09:26:46 AM

Note: you need to refresh the browser's code cache for javascript before it works properly !

Post Merged: July 07, 2019, 09:42:23 AM

to refresh the Javscript cache only, I went into Opera's Settings > Clear browsing data > (tick) Cached Images and Files (only).

Works perfectly like it rolled off the production line at Simple Machines !

(in 11 pt  :))
« Last Edit: July 07, 2019, 09:44:11 AM by Chip »
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair !

Tags:
 




TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE



Founded December 2014