Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Configuration Options

tstone edited this page Sep 13, 2010 · 3 revisions

Default Values + Options Dictionary

options = {
    'preload' : function() {},
    'postload' : function() {},
    'preview' : 'toolbar',
    'toolbar': {
        'backgroundMode': 'light',
        'layout': 'bold italic | link quote code image | numberlist bulletlist heading line',
        'buttons' : [],
    }
}

preload

A callback function to be fired right before MarkEdit is loaded.

postload

A callback function to be fired right after MarkEdit has been loaded.

preview

The preview mode. Possible values:

  • toolbar — Causes Compose/Preview toggle buttons to be rendered on the toolbar
  • above — Causes an auto-updated preview to appear above the editor
  • below — Causes an auto-updated preview to appear below the editor (WMD Editor style)
  • bottom — Same as ‘below’
  • top — Same as ‘above’
  • false — No preview will appear

toolbar

Contains all settings related to the toolbar

toolbar.backgroundMode

Sets whether the icons should display assuming a light or dark background. Possible values:

  • light — Assumes a light background. Foreground text will be black.
  • dark — Assumes a dark background. Foreground text will be white.
    Note this must be set independent of what jQuery theme you’re using.

toolbar.layout

Sets the order and grouping of the toolbar buttons. Available built-in buttons are listed in the defaults above. The syntax for layout is as follows:

  • The id of the button is listed
  • Spaces represents the break between buttons
  • Pipe character “|” represents a button group break
  • Buttons may be grouped as togglable by surrounding them in parenthesis

toolbar.buttons

An array of custom button definitions.

Button Definition Format

{
    'id' : String,              -- Used to identify the button
    'css' : String,             -- CSS class(es) to add to the button
    'tip' : String,             -- Mouse-over tool tip to be shown (html Title)
    'click' : function,         -- Function to be executed on Click event
    'mouseover' : function,     -- Function to be executed on Click event
    'mouseout' : function       -- Function to be executed on Click event
}

Clone this wiki locally