MyBB Community Forums

Full Version: Make the editor.js fonts/size preview
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm willing to make the fonts in the editor.js appear like this as a preview in the dropdown menu:
		// Defines an array of fonts to be shown in the font drop down.
		this.fonts = new Object();
		this.fonts["Arial"] = "[font=Arial]Arial[/font]";
                ...

ANd for the sizes too:
		// An array of font sizes to be shown.
		this.sizes = new Object();
		this.sizes["xx-small"] = [size=xx-small]1[/size];
		this.sizes["x-small"] = [size=x-small]2[/size];
		this.sizes["small"] = [size=small]3[/size];
		this.sizes["medium"] = [size=medium]4[/size];
		this.sizes["large"] = [size=large]5[/size];
		this.sizes["x-large"] = [size=x-large]6[/size];
		this.sizes["xx-large"] = [size=xx-large]7[/size];

How can I do this?
Anyone know how to do it?
Anyone knows?
I guess you have to use HTML and not BBCode there.

// Defines an array of fonts to be shown in the font drop down.
        this.fonts = new Object();
        this.fonts["Arial"] = "<font face='Arial'>Arial</font>";
                ... 
Thank you it worked Smile