ucan-ext-js-kitchen-sink
Version:
my-ext-gen-app description for Ext JS app MyExtGenApp
105 lines (97 loc) • 3.45 kB
JavaScript
Ext.define('UCAN.comment.src.commentEditorContainer', {
extend: 'Ext.Container',
xtype: 'commentEditorContainer',
cls: 'js-ucan-comment-editor-container ucan-comment-editor-container',
flex: 1,
config: {
comment: null,
value: null,
translator: null,
edit: false,
froalaConfig: null,
enableCancel: true
},
twoWayBindable: {
comment: true,
value: true,
translator: true,
edit: true,
froalaConfig: true,
enableCancel: true
},
publishes: ['comment', 'value', 'translator', 'edit', 'froalaConfig', 'enableCancel'],
layout: 'vbox',
items: [
{
cls: 'js-ucan-comment-editor-container-ucan-native-froala-value',
xtype: 'ucanNativeFroala',
hasDynamicConfig: false,
editorConfig: {
toolbarButtons: {
'moreText': {
'buttons': ['bold', 'italic', 'underline', 'subscript', 'superscript', 'clearFormatting'],
'buttonsVisible': 6
},
'moreParagraph': {
'buttons': ['formatOL', 'formatUL', 'outdent', 'indent', 'quote'],
'buttonsVisible': 5
},
'moreRich': {
'buttons': ['specialCharacters', 'insert'],
'buttonsVisible': 4
},
'moreMisc': {
'buttons': ['undo', 'redo', 'fullscreen', 'spellChecker', 'selectAll', 'wirisEditor', 'wirisChemistry', 'html', 'help'],
'align': 'right',
'buttonsVisible': 8
}
},
htmlAllowedEmptyTags: [
'textarea', 'a', 'object', 'video', 'style', '.fa', '.fr-emoticon', '.fr-inner', 'path',
'line', 'hr', 'mprescripts', 'none'
],
imageEditButtons: ['wirisEditor', 'wirisChemistry'],
htmlAllowedTags: ['.*'],
htmlAllowedAttrs: ['.*'],
attribution: false,
charCounterCount: false,
language: 'de',
placeholder: '',
pluginsEnabled: [
'align', 'codeBeautifier', 'codeView', 'colors', 'embedly', 'emoticons', 'entities', 'file', 'fontAwesome', 'fontFamily',
'fontSize', 'fullscreen', 'image', 'imageTUI', 'imageManager', 'inlineStyle', 'inlineClass', 'lineBreaker', 'lineHeight', 'link',
'lists', 'paragraphFormat', 'paragraphStyle', 'quote', 'save', 'table', 'url', 'video', 'wordPaste', 'wiris'
]
}
},
{
xtype: 'container',
layout: 'hbox',
items: [
{
xtype: 'button',
cls: 'js-ucan-comment-editor-container-button-submit',
handler: 'onSubmitComment'
},
{
xtype: 'button',
cls: 'js-ucan-comment-editor-container-button-cancel',
handler: 'onCancelComment'
}
]
}
],
updateTranslator: function(config) {
this.down('[cls~=js-ucan-comment-editor-container-button-submit]').setText(config.get('comment_editor_send'));
this.down('[cls~=js-ucan-comment-editor-container-button-cancel]').setText(config.get('comment_editor_cancel'));
},
updateEnableCancel: function(config) {
this.down('[cls~=js-ucan-comment-editor-container-button-cancel]').setHidden(config);
},
updateValue: function(config) {
this.down('[cls~=js-ucan-comment-editor-container-ucan-native-froala-value]').setValue(config);
},
updateFroalaConfig: function(config) {
this.down('[cls~=js-ucan-comment-editor-container-ucan-native-froala-value]').setEditor(config);
}
});