如何在 TinyMCE 中默认 select "Justify text" 切换按钮?
How to select the "Justify text" toggle button in TinyMCE by default?
我的应用程序是使用 Ext.js 编写的,并使用了 TinyMCE。 TinyMCE 编辑器中的工具栏提供文本对齐选项:左对齐、居中、右对齐和对齐。我希望在加载包含编辑器的屏幕时默认选择 "justify" 选项。我查看了 TinyMCE 和 Ext.js 的文档,但无济于事。
这是我的 TinyMCE 配置代码:
Ext.define('Xxx.config.TinyMceConfig',{
singleton : true,
alternateClassName : ['TinyMceConfig'],
config:{
plugins: [
"lists link charmap searchreplace code fullscreen table paste ice"
],
language : "fr_FR",
docs_language : "fr_FR",
visual : true,
cleanup_on_startup : false,
cleanup : true,
gecko_spellcheck : true,
remove_linebreaks : false,
encoding : "xml",
entity_encoding : "raw",
toolbar1 : "fullscreen | undo redo selectall | bold italic underline alignleft aligncenter alignright alignjustify | pastetext pasteword pasteEditor",
toolbar2 : "searchreplace | subscript superscript charmap | unlink removeformat | visualaid table | cleanup code ice_smartquotes",
toolbar3 : "bullist numlist row_props cell_props | row_before row_after delete_row | col_before col_after delete_col | ice_togglechanges ice_toggleshowchanges iceacceptall icerejectall iceaccept icereject",
inline_styles : false,
paste_as_text :true,
paste_auto_cleanup_on_paste: true,
paste_text_use_dialog: true,
paste_retain_style_properties: "margin, border, border-width, border-style, bgcolor, background, border-color, ul, li, ol, page-break-before, " +
" page-break-after, border-collapse, padding, width, height, font-size, font-weight, font-family, text-align, text-decoration, float, " +
"display, line-height, align",
paste_convert_headers_to_strong : true,
paste_convert_word_fake_lists: false,
ice: {
isForceTracking: false,
isTracking: false,
user: { name: 'Utilisateur inconnu', id: 1}
},
menubar:false,
statusbar: false,
elementpath: false,
toolbar_items_size: 'small'
},
constructor: function(config) {
this.initConfig(config);
}
});
请参阅此示例 TinyMCE Fiddle 以了解如何让编辑器以选择对齐方式启动:
我的应用程序是使用 Ext.js 编写的,并使用了 TinyMCE。 TinyMCE 编辑器中的工具栏提供文本对齐选项:左对齐、居中、右对齐和对齐。我希望在加载包含编辑器的屏幕时默认选择 "justify" 选项。我查看了 TinyMCE 和 Ext.js 的文档,但无济于事。
这是我的 TinyMCE 配置代码:
Ext.define('Xxx.config.TinyMceConfig',{
singleton : true,
alternateClassName : ['TinyMceConfig'],
config:{
plugins: [
"lists link charmap searchreplace code fullscreen table paste ice"
],
language : "fr_FR",
docs_language : "fr_FR",
visual : true,
cleanup_on_startup : false,
cleanup : true,
gecko_spellcheck : true,
remove_linebreaks : false,
encoding : "xml",
entity_encoding : "raw",
toolbar1 : "fullscreen | undo redo selectall | bold italic underline alignleft aligncenter alignright alignjustify | pastetext pasteword pasteEditor",
toolbar2 : "searchreplace | subscript superscript charmap | unlink removeformat | visualaid table | cleanup code ice_smartquotes",
toolbar3 : "bullist numlist row_props cell_props | row_before row_after delete_row | col_before col_after delete_col | ice_togglechanges ice_toggleshowchanges iceacceptall icerejectall iceaccept icereject",
inline_styles : false,
paste_as_text :true,
paste_auto_cleanup_on_paste: true,
paste_text_use_dialog: true,
paste_retain_style_properties: "margin, border, border-width, border-style, bgcolor, background, border-color, ul, li, ol, page-break-before, " +
" page-break-after, border-collapse, padding, width, height, font-size, font-weight, font-family, text-align, text-decoration, float, " +
"display, line-height, align",
paste_convert_headers_to_strong : true,
paste_convert_word_fake_lists: false,
ice: {
isForceTracking: false,
isTracking: false,
user: { name: 'Utilisateur inconnu', id: 1}
},
menubar:false,
statusbar: false,
elementpath: false,
toolbar_items_size: 'small'
},
constructor: function(config) {
this.initConfig(config);
}
});
请参阅此示例 TinyMCE Fiddle 以了解如何让编辑器以选择对齐方式启动: