我正在使用果园的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