我正在使用果園的TinyMCE Deluxe模塊來支持網站的其他編輯選項。我的客戶需要的一件事就是能夠進行文本對齊,與Word的工作方式相同。我看到TinyMCE有一個實用程序支持這些選項作爲「核心」控件集(see here)的一部分,但是當我嘗試編輯orchard-tinymce.js來支持核心時,我剛開始收到JS錯誤,並且工具欄沒有' t出現。果園TinyMCE配置
關於如何添加對齊選項的任何建議?
EDIT
這是我的果園tinymce.js文件(位於/模塊/ TinyMceDeluxe /腳本):
$(document).ready(function() {
tinyMceDeluxe = new TinyMceDeluxe.Orchard();
// 1st arg is an array of plugin names. See plugin link above for full list of available plugins
// 2nd arg is an options object; also see TinyMce documentation for details on all available options.
tinyMceDeluxe.init(['pagebreak', 'paste', 'table', 'template', 'syntaxhl'], {
theme: "advanced",
mode: "specific_textareas",
editor_selector: "tinymce",
plugins: "fullscreen,autoresize,searchreplace,mediapicker,inlinepopups,-table,-pagebreak,-template,-paste,-syntaxhl",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_statusbar_location: "bottom",
theme_advanced_resizing: "true",
//theme_advanced_buttons1: "search,replace,|,cut,copy,paste,|,undo,redo,|,link,unlink,charmap,emoticon,codeblock,|,bold,italic,|,numlist,bullist,formatselect,fontselect,fontsizeselect,|,styleselect,|,forecolor,backcolor",
theme_advanced_buttons1: 'core',
theme_advanced_buttons2: "mediapicker,|,tablecontrols,|,hr,removeformat,visualaid,|,visualchars,template,blockquote,pagebreak,|,alignleft,aligncenter,alignright,alignjustify,|,syntaxhl,code,fullscreen",
theme_advanced_buttons3: "",
convert_urls: false,
template_external_list_url: "/modules/tinymcedeluxe/scripts/samples/tinymce_template_list.js",
// content_css sets the path to your site's main .css file. The styles from this file are imported into a droplist in the TinyMce editor.
// TinyMceDeluxe sets this path automatically to the /Styles/custom.css file in your site's theme, but you can override the path by declaring it here:
//content_css: '/path/to/your/stylesheet.css',
valid_elements: "*[*]",
// shouldn't be needed due to the valid_elements setting, but TinyMCE would strip script.src without it.
extended_valid_elements: "script[type|defer|src|language]"
});
});
我註釋掉了theme_advanced_buttons1,它具有許多特定的內容,並將其更改爲「核心」。當我這樣做時,我在第一行的tiny_mce.js中得到一個錯誤:「Uncaught TypeError:無法讀取未定義的propery'Button'。」
向我們展示了一些你在配置中設置的代碼以及你得到的錯誤! – Thariama