Skip to main content

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.

BehaviourClass
behaviourBehaviour
behaviour.textTextBehaviour
behaviour.anyAnyBehaviour
behaviour.emptyEmptyBehaviour
behaviour.unknownUnknownBehaviour
behaviour.processinginstructionProcessingInstructionBehaviour
behaviour.chapterChapterBehaviour
behaviour.headingHeadingBehaviour
behaviour.subheadingSubheadingBehaviour
behaviour.paragraphParagraphBehaviour
behaviour.linebreakLineBreakBehaviour
behaviour.horizontallineHorizontalLine
behaviour.metadataMetadataBehaviour
behaviour.metarootMetadataRootBehaviour
behaviour.metagroupMetadataGroupBehaviour
behaviour.metafieldMetadataFieldBehaviour
behaviour.footnoteFootnoteBehaviour
behaviour.codeCodeBehaviour
behaviour.inlinecodeInlineCodeBehaviour
behaviour.infoInfoBehaviour
behaviour.noteNoteBehaviour
behaviour.containerContainerBehaviour
behaviour.supercontainerSuperContainerBehaviour
behaviour.mastercontainerMasterContainerBehaviour
behaviour.inlinecontainerInlineContainerBehaviour
behaviour.boxBoxBehaviour
behaviour.contentContentBehaviour
behaviour.groupGroupBehaviour
behaviour.listListBehaviour
behaviour.listitemListItemBehaviour
behaviour.orderedlistOrderedListBehaviour
behaviour.unorderedlistUnorderedListBehaviour
behaviour.inlineInlineBehaviour
behaviour.inlineblockInlineBlockBehaviour
behaviour.inlineformatInlineFormatBehaviour
behaviour.boldBoldBehaviour
behaviour.italicItalicBehaviour
behaviour.underlineUnderlineBehaviour
behaviour.superscriptSuperscriptBehaviour
behaviour.subscriptSubscriptBehaviour
behaviour.overlineOverlineBehaviour
behaviour.linethroughLinethroughBehaviour
behaviour.fontFontBehaviour
behaviour.monospaceMonospaceBehaviour
behaviour.romanTimesNewRomanBehaviour
behaviour.texttransformTextTransformBehaviour
behaviour.lowercaseLowerCaseFormatBehaviour
behaviour.uppercaseUpperCaseFormatBehaviour
behaviour.preservecasePreserveCaseFormatBehaviour
behaviour.capitalizeCapitalizeCaseFormatBehaviour
behaviour.milestonestartMilestoneStartBehaviour
behaviour.milestoneendMilestoneEndBehaviour
behaviour.linkLinkBehaviour
behaviour.mediaAbstractMediaBehaviour
behaviour.imageImageBehaviour
behaviour.inlineimageInlineImageBehaviour
behaviour.videoVideoBehaviour
behaviour.inlinevideoInlineVideoBehaviour
behaviour.svgSvgBehaviour
behaviour.inlinesvgInlineSvgBehaviour
behaviour.mathAbstractMathBehaviour
behaviour.mathmlMathMlBehaviour
behaviour.texTexBehaviour
behaviour.tableTableBehaviour
behaviour.tablecellTableCellBehaviour
behaviour.tableheadcellTableHeadCellBehaviour
behaviour.tablerowTableRowBehaviour
behaviour.tablecaptionTableCaptionBehaviour
behaviour.tablerowgroupTableRowGroup
behaviour.tablebodyTableBodyBehaviour
behaviour.tablefootTableFootBehaviour
behaviour.tableheadTableHeadBehaviour
behaviour.tablecolTableColumnBehavkour
behaviour.tablecolgroupTableColumnGroupBehavkour
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'
});
}
};