Options

How to use

All options should be passed via the constructor.

e.g.

// Create the editor
$("textarea").sceditor({
	// Options go here

	// Option 1
	plugins: "bbcode",

	// Option 2
	toolbar: "bold,italic,underline|source",

	// Option 3
	locale: "no-NB"
});

toolbar

toolbar String Defaults to a list of all the built in commands

A comma separated list of commands. To separate commands into groups, use the bar character (|) instead of a comma. e.g.: "bold,italic,underline|source"

Below is a list of default commands that can be included.

  • bold
  • italic
  • underline
  • strike
  • subscript
  • superscript
  • left
  • center
  • right
  • justify
  • font
  • size
  • color
  • removeformat
  • cut
  • This only works in IE because of security permissions. It’s disabled in other browsers.
  • copy
  • This only works in IE because of security permissions. It’s disabled in other browsers.
  • paste
  • This only works in IE because of security permissions. It’s disabled in other browsers.
  • pastetext
  • bulletlist
  • orderedlist
  • table
  • code
  • quote
  • horizontalrule
  • image
  • email
  • link
  • unlink
  • emoticon
  • youtube
  • date
  • time
  • ltr
  • rtl
  • print
  • maximize
  • source

toolbarExclude

toolbarExclude String Defaults to null

Comma separated list of commands to exclude from the toolbar. Leave as null to not exclude any.

style

style String Defaults to "jquery.sceditor.default.css"

URL of the stylesheet to used to style the WYSIWYG editors content.

fonts

fonts String Defaults to "Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana"

A comma separated list of fonts to use with the font selector.

colors

colors String Defaults to null

Should be comma separated list of hex colours with bar (|) characters to signal a new columns. If set to null the colors will be auto generated.

For example:

colors: '#ffff00,#ff00ff,#00ffff|#ff000,#00ff00,#0000ff',

Would produce:

locale

locale String Defaults to "en"

The locale to use, e.g.: en, en-US, fr, etc.

Important The language file must be included after the editors main JS file but before the editor is created. e.g.

<script src="../minified/jquery.sceditor.min.js"></script>
<script src="../languages/nl.js"></scrip>

<!-- create the editor here -->
$(function() {
	$('textarea').sceditor({
		plugins: 'bbcode'
	});
});

charset

charset String Defaults to "utf-8"

The charset to use for the WYSIWYG content.

emoticonsEnabled

emoticonsEnabled Bool Defaults to true

If emoticons should be enabled. Set to false to disable emoticons.

emoticonsCompat

emoticonsCompat Bool Defaults to false

Enables or disables emoticons compatibility mode.

When this is enabled, emoticons must be surrounded by whitespace or EOL characters. For example, if you have an emoticon with the code :/, in compatibility mode it will not replace the :/ in http://.

Compatibility mode currently has limited As You Type emoticon conversion support. EOL characters are not recognised as whitespace with AYT conversion so only emoticons surrounded by whitespace will be converted. This does not affect non-AYT conversion which will still work as normal.

emoticonsRoot

emoticonsRoot String Defaults to an empty string

Root URL of all emoticons. This string will be prepended to all emoticon URLs.

emoticons

emoticons Object

Object in the following format:

{
    // Emoticons to be included in the dropdown
    dropdown: {
        ":)": "emoticons/smile.png",
        ":angel:": "emoticons/angel.png"
    },
    // Emoticons to be included in the more section
    more: {
        ":alien:": "emoticons/alien.png",
        ":blink:": "emoticons/blink.png"
    },
    // Emoticons that are not shown in the dropdown but will still
    // be converted. Can be used for things like aliases
    hidden: {
        ":aliasforalien:": "emoticons/alien.png",
        ":aliasforblink:": "emoticons/blink.png"
    }
}

width

width String or int Defaults to null

Initial width of the editor. Can be either an int which will be treated as the px value or a string percentage. e.g. "100%".

If set to null the width will be set the with of the textarea it is replacing.

height

height String or int Defaults to null

Initial height of the editor. Can be either an int which will be treated as the px value or a string percentage. e.g. "100%".

If set to null the height will be set the height of the textarea it is replacing.

resizeEnabled

resizeEnabled Bool Defaults to true

If to allow the editor to be resized. If set to true, a small grip will be added to the bottom right-hand corner (bottom left-hand corner in LTR mode) of the editor which allows it to be resized.

resizeMinWidth

resizeEnabled int Defaults to null

Minimum width that the editor can be resized to. Set to null for half textarea width or -1 for unlimited.

resizeMinHeight

resizeMinHeight int Defaults to null

Minimum height that the editor can be resized. Set to null for half textarea height or -1 for unlimited

resizeMaxHeight

resizeMaxHeight int Defaults to null

Maximum height the editor can be resized to. Set to null for double textarea height or -1 for unlimited

resizeMaxWidth

resizeMaxWidth int Defaults to null

Maximum width the editor can be resized to. Set to null for double textarea width or -1 for unlimited

resizeHeight

resizeHeight bool Defaults to true

If to enable resizing the editors height.

resizeWidth

resizeWidth bool Defaults to true

If to enable resizing the editors width.

dateFormat

dateFormat String Defaults to "year-month-day"

Date format to used by the date command. This option will be overridden if the current locale specifies a date format.

The words year, month and day will be replaced with the users current year, month and day.

toolbarContainer

toolbarContainer HTMLElement Defaults to null

HTML node that to contain the toolbar into. Defaults to adding the toolbar above the iframe.

enablePasteFiltering

enablePasteFiltering bool Defaults to false

If to enable paste filtering. When text is pasted it will be filtered through any plugins.

With the BBCode plugin this will cause any HTML without a valid BBCode to be stripped.

readOnly

readOnly bool Defaults to false

If the editor is read only.

rtl

rtl bool Defaults to false

If to set the editor to right-to-left mode.

This can be changed at runtime with the rtl(bool) method.

autofocus

autofocus bool Defaults to false

If to auto focus the editor on page load.

autofocusEnd

autofocusEnd bool Defaults to true

If the cursor should be placed at the end when auto focusing or at the beginning.

autoExpand

autoExpand bool Defaults to false

If to auto expand the editor to fit the content

autoUpdate

autoUpdate bool Defaults to false

If true, the original textbox will be updated with the editors current value when the editor loses focus.

runWithoutWysiwygSupport

runWithoutWysiwygSupport bool Defaults to false

If to run the source editor when there is no browser WYSIWYG support. Only really applies to mobile OS’s as all modern desktop browsers support WYSIWYG editing.

id

id String Defaults to null

ID to assign the editor.

plugins

plugins String Defaults to an empty string

A commas separated list of plugins. e.g. "plugin1,plugin2"

See plugins documentation for list of default plugins.

spellcheck

spellcheck Boolean Defaults to true

If to enable the browsers built in spell checker. This option is mostly so the built in spell checker can be disabled.

disableBlockRemove

disableBlockRemove Boolean Defaults to false

By default the editor will remove block level elements when the cursor is placed at the start of them and backspace is pressed. This option allows that behaviour to be disabled.

parserOptions

parserOptions Object Defaults to an empty object

If to trim the whitespace from the start and end of BBCode. By default the whitespace will be left.

bbcodeTrim

bbcodeTrim Boolean Defaults to false

BBCode parser options, only applies if using the editor in BBCode mode.

See $.sceditor.BBCodeParser.defaults for list of valid options

dropDownCss

dropDownCss Object Defaults to an empty object

Extra CSS to add to the dropdown menu (e.g. z-index).

comments powered by Disqus