silverstripe-framework/javascript/HtmlEditorField.js
Ingo Schommer 4ca6a29aad ENHANCEMENT Added support for loading external plugins (with relative paths) in HtmlEditorConfig. This means relative paths can be separate from the plugin name, and fixes a bug where paths containing dashes were ignored by TinyMCE.init().
ENHANCEMENT Changed sapphire/thirdparty/tinymce-advcode to use the original plugin name, and specify its relative path through HtmlEditorConfig instead.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@94060 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:17:55 +13:00

30 lines
1.1 KiB
JavaScript

/**
* Simple TinyMCE initialisation
*/
if((typeof tinyMCE != 'undefined')) {
tinymce.PluginManager.load('advcode', '/some/dir/someplugin/editor_plugin.js');
tinyMCE.init({
mode : "specific_textareas",
editor_selector : "htmleditor",
width: "100%",
auto_resize : false,
theme : "advanced",
theme_advanced_layout_manager: "SimpleLayout",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_toolbar_parent : "right",
plugins : "contextmenu,table,emotions,paste,-advcode,spellchecker",
blockquote_clear_tag : "p",
table_inline_editing : true,
theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,formatselect,separator,bullist,numlist,outdent,indent,blockquote,hr,charmap",
theme_advanced_buttons2 : "undo,redo,separator,cut,copy,paste,pastetext,pasteword,spellchecker,separator,advcode,search,replace,selectall,visualaid,separator,tablecontrols",
theme_advanced_buttons3 : "",
safari_warning : false,
relative_urls : true,
verify_html : true
});
}