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 | Content CSS and styling application |
codeview | Object | Code view feature |
images | Object | Image handling & upload |
links | Object | Content link validation |
macros | Object | Built-in macro configuration |
paste | Object | Content paste behavior |
spelling | Object | Content spell checking service |
ui | Object | Editor UI including toolbars, menus, etc. |
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']
macros : {
allowed : [ 'headings', 'lists', 'semantics', 'entities', 'hr', 'link' ]
}
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.