Overview
Textbox.io editor
instances are configured through a configuration object, passed as a second argument when creating an editor via replace
, replaceAll
, inline
, or inlineAll
. Defining properties of a configuration
object will override the configuration defaults supplied for any generated instances of editor
.
Configuration Object Properties
Note that all properties are optional. Defining a property overrides the editor default behavior.
autosubmit | Boolean | Specifies whether textboxio should handle form submission |
String | Specifies the path to the textboxio resources folder | |
css | Object | Editor rendering CSS and styling application |
codeview | Object | Code view feature |
images | Object | Editor image handling & upload |
links | Object | Editor link validation |
paste | Object | Editor paste behavior |
spelling | Object | Editor spell checking service |
ui | Object | Editor UI including toolbars, menus, etc. |
Example Configuration Structure
The configuration object follows the following structure.
var configStructure = { autosubmit: true, basePath : '', css : {}, codeview : {}, images : {}, links : {}, paste : {}, spelling : {}, ui : {} };
Configuration Defaults
This following object will replicate the default configuration for all Textbox.io instances.
var defaultConfig = { autosubmit: true, css : { stylesheets : [''], styles : [ { rule: 'p', text: 'block.p' }, { rule: 'h1', text: 'block.h1' }, { rule: 'h2', text: 'block.h2' }, { rule: 'h3', text: 'block.h3' }, { rule: 'h4', text: 'block.h4' }, { rule: 'div', text: 'block.div' }, { rule: 'pre', text: 'block.pre' } ] }, codeview : { enabled: true, showButton: true }, images : { allowLocal : true }, languages : ['en', 'es', 'fr', 'de', 'pt', 'zh'] ui : { toolbar : { items : [ 'undo', 'insert', 'style', 'emphasis', 'align', 'listindent', 'format', 'tools' ] } } };
Internationalization
Note that text
properties are pre-configured with values like block.p
. These string keys refer to the internationalized string label for that item. Using a pre-configured value means that the text value will be internationalized by locale
.