dopetalk

Technology => SMF Forum Code Modifications => Topic started by: Chip on July 07, 2019, 08:54:06 AM

Title: Adding an additional font size option (11pt) to the editor drop down menu
Post by: Chip on July 07, 2019, 08:54:06 AM
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  :))
SimplePortal 2.3.6 © 2008-2014, SimplePortal