MyBB Hacks

Full Version: Font Family And Size Preview In Editor
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This modification is for previewing font family and size in the font and size dropdown list in the editor (hopefully Biggrin).
  • Manual Edit:
    jscripts/editor.js
    Find:

    Javascript Code
    this.fonts["Arial"] = "Arial";
    this.fonts["Courier"] = "Courier";
    this.fonts["Impact"] = "Impact";
    this.fonts["Tahoma"] = "Tahoma";
    this.fonts["Times New Roman"] = "Times New Roman";
    this.fonts["Trebuchet MS"] = "Trebuchet MS";
    this.fonts["Verdana"] = "Verdana";


    Replace with:

    Javascript Code
    this.fonts["Arial"] = '<span style="font-family: Arial; font-size: 14px;">Arial</span>';
    this.fonts["Courier"] = '<span style="font-family: Courier; font-size: 14px;">Courier</span>';
    this.fonts["Impact"] = '<span style="font-family: Impact; font-size: 14px;">Impact</span>';
    this.fonts["Tahoma"] = '<span style="font-family: Tahoma; font-size: 14px;">Tahoma</span>';
    this.fonts["Times New Roman"] = '<span style="font-family: Times New Roman; font-size: 14px;">Times New Roman</span>';
    this.fonts["Trebuchet MS"] = '<span style="font-family: Trebuchet MS; font-size: 14px;">Trebuchet MS</span>';
    this.fonts["Verdana"] = '<span style="font-family: Verdana; font-size: 14px;">Verdana</span>';


    [attachment=620]

    Find:

    Javascript Code
    this.sizes["xx-small"] = this.options.lang.size_xx_small;
    this.sizes["x-small"] = this.options.lang.size_x_small;
    this.sizes["small"] = this.options.lang.size_small;
    this.sizes["medium"] = this.options.lang.size_medium;
    this.sizes["large"] = this.options.lang.size_large;
    this.sizes["x-large"] = this.options.lang.size_x_large;
    this.sizes["xx-large"] = this.options.lang.size_xx_large;


    Replace with:

    Javascript Code
    this.sizes["xx-small"] = '<span style="font-size: xx-small;">'+this.options.lang.size_xx_small+'</span>';
    this.sizes["x-small"] = '<span style="font-size: x-small;">'+this.options.lang.size_x_small+'</span>';
    this.sizes["small"] = '<span style="font-size: small;">'+this.options.lang.size_small+'</span>';
    this.sizes["medium"] = '<span style="font-size: medium;">'+this.options.lang.size_medium+'</span>';
    this.sizes["large"] = '<span style="font-size: large;">'+this.options.lang.size_large+'</span>';
    this.sizes["x-large"] = '<span style="font-size: x-large;">'+this.options.lang.size_x_large+'</span>';
    this.sizes["xx-large"] = '<span style="font-size: xx-large;">'+this.options.lang.size_xx_large+'</span>';


    [attachment=621]



Thanks for the patches file, saved me some time Tongue
Reference URL's