Behaviour configuration
Now that we have Xeditor running we can get into the more detailed configuration. The most important configuration is to describe how elements should behave and look.
For this configuration the src/js/config/behaviours.js
file can be edited. Here, each element in the schema is now simply assigned to a role.
All element names can be found entirely in types.gen.json.
Behaviour | Class |
---|---|
behaviour | Behaviour |
behaviour.text | TextBehaviour |
behaviour.any | AnyBehaviour |
behaviour.empty | EmptyBehaviour |
behaviour.unknown | UnknownBehaviour |
behaviour.processinginstruction | ProcessingInstructionBehaviour |
behaviour.chapter | ChapterBehaviour |
behaviour.heading | HeadingBehaviour |
behaviour.subheading | SubheadingBehaviour |
behaviour.paragraph | ParagraphBehaviour |
behaviour.linebreak | LineBreakBehaviour |
behaviour.horizontalline | HorizontalLine |
behaviour.metadata | MetadataBehaviour |
behaviour.metaroot | MetadataRootBehaviour |
behaviour.metagroup | MetadataGroupBehaviour |
behaviour.metafield | MetadataFieldBehaviour |
behaviour.footnote | FootnoteBehaviour |
behaviour.code | CodeBehaviour |
behaviour.inlinecode | InlineCodeBehaviour |
behaviour.info | InfoBehaviour |
behaviour.note | NoteBehaviour |
behaviour.container | ContainerBehaviour |
behaviour.supercontainer | SuperContainerBehaviour |
behaviour.mastercontainer | MasterContainerBehaviour |
behaviour.inlinecontainer | InlineContainerBehaviour |
behaviour.box | BoxBehaviour |
behaviour.content | ContentBehaviour |
behaviour.group | GroupBehaviour |
behaviour.list | ListBehaviour |
behaviour.listitem | ListItemBehaviour |
behaviour.orderedlist | OrderedListBehaviour |
behaviour.unorderedlist | UnorderedListBehaviour |
behaviour.inline | InlineBehaviour |
behaviour.inlineblock | InlineBlockBehaviour |
behaviour.inlineformat | InlineFormatBehaviour |
behaviour.bold | BoldBehaviour |
behaviour.italic | ItalicBehaviour |
behaviour.underline | UnderlineBehaviour |
behaviour.superscript | SuperscriptBehaviour |
behaviour.subscript | SubscriptBehaviour |
behaviour.overline | OverlineBehaviour |
behaviour.linethrough | LinethroughBehaviour |
behaviour.font | FontBehaviour |
behaviour.monospace | MonospaceBehaviour |
behaviour.roman | TimesNewRomanBehaviour |
behaviour.texttransform | TextTransformBehaviour |
behaviour.lowercase | LowerCaseFormatBehaviour |
behaviour.uppercase | UpperCaseFormatBehaviour |
behaviour.preservecase | PreserveCaseFormatBehaviour |
behaviour.capitalize | CapitalizeCaseFormatBehaviour |
behaviour.milestonestart | MilestoneStartBehaviour |
behaviour.milestoneend | MilestoneEndBehaviour |
behaviour.link | LinkBehaviour |
behaviour.media | AbstractMediaBehaviour |
behaviour.image | ImageBehaviour |
behaviour.inlineimage | InlineImageBehaviour |
behaviour.video | VideoBehaviour |
behaviour.inlinevideo | InlineVideoBehaviour |
behaviour.svg | SvgBehaviour |
behaviour.inlinesvg | InlineSvgBehaviour |
behaviour.math | AbstractMathBehaviour |
behaviour.mathml | MathMlBehaviour |
behaviour.tex | TexBehaviour |
behaviour.table | TableBehaviour |
behaviour.tablecell | TableCellBehaviour |
behaviour.tableheadcell | TableHeadCellBehaviour |
behaviour.tablerow | TableRowBehaviour |
behaviour.tablecaption | TableCaptionBehaviour |
behaviour.tablerowgroup | TableRowGroup |
behaviour.tablebody | TableBodyBehaviour |
behaviour.tablefoot | TableFootBehaviour |
behaviour.tablehead | TableHeadBehaviour |
behaviour.tablecol | TableColumnBehavkour |
behaviour.tablecolgroup | TableColumnGroupBehavkour |
module.exports = {
setBehaviours: function (manager) {
manager.setBehaviours({
// core
'box': 'behaviour.box',
'p': 'behaviour.paragraph',
'linebreak': 'behaviour.lineBreak',
'heading': 'behaviour.heading',
'subheading': 'behaviour.subheading',
'footnote': 'behaviour.footnote',
'chapter': {
type: 'behaviour.chapter',
toc: {
textType: 'heading',
hasNumber: true
}
},
// media
'med_image': 'behaviour.image',
'med_video': 'behaviour.video',
'svg:svg': 'behaviour.svg',
'mml:math': 'behaviour.mathml',
'tex': 'behaviour.tex',
// list
'list_unordered': 'behaviour.unorderedList',
'list_ordered': {
type: 'behaviour.orderedList',
keepParentIndex: false
},
'list_item': 'behaviour.listItem',
// inline
'bold': 'behaviour.bold',
'italic': 'behaviour.italic',
'underline': 'behaviour.underline',
'superscript': 'behaviour.superscript',
'subscript': 'behaviour.subscript',
// table
'tab_table': 'behaviour.table',
'tab_caption': 'behaviour.tableCaption',
'tab_head': 'behaviour.tableHead',
'tab_body': 'behaviour.tableBody',
'tab_foot': 'behaviour.tableFoot',
'tab_row': 'behaviour.tableRow',
'tab_cell': {
type: 'behaviour.tableCell',
alignAttribute: 'align'
},
'tab_headcell': 'behaviour.tableHeadCell'
});
}
};