Confluence 3.0 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
This documentation refers to a feature in the Confluence 3.1 release cycle. It will not work in Confluence 3.0 or before. Please check out our Milestone release notes to learn more about our milestone process for Confluence 3.1
TinyMCE is the wysiwyg editor we use in Confluence. You can now customise and enable TinyMCE plugins in Confluence by converting it as an Atlassian plugin. You simply need to define a plugin descriptor and provide a small snippet of javascript to configure your plugin.
Please note that this does not mean that all TinyMCE plugins are guaranteed to work in Confluence. Confluence is using a customised version of TinyMCE, so the plugins may not work 'out of the box' and could require some changes.
Defining the TinyMCE Plugin Resources
You will need to define the TinyMCE plugin resources (e.g. editor_plugin.js) in a web resource module with an added context of 'wysiwyg-editor'. Below is an example plugin descriptor for the TinyMCE Search & Replace plugin.
<atlassian-plugin name='TinyMCE Search Replace Plugin' key='tinymce.searchreplace.plugin'>
...
<resource name="searchreplace/" type="download" location="searchreplace/"/>
<web-resource name='TinyMCE Search Replace Web Resources' key='tinymce-searchreplace-resources'>
<resource name="searchreplace.js" type="download" location="searchreplace/editor_plugin.js"/>
<resource name="searchreplace-adapter.js" type="download" location="searchreplace/confluence-adapter.js"/>
<context>wysiwyg-editor</context>
</web-resource>
</atlassian-plugin>
Configuring TinyMCE Plugin Settings
To enable the TinyMCE plugin, you will need to configure the settings object that is typically passed to TinyMCE's init() method. To do this, simply add some javascript to register your configuration logic with
AJS.Editor.Adapter.addTinyMcePluginInit. The following code enables the search/replace plugin and adds the search and replace buttons to the second row of the toolbar.
AJS.Editor.Adapter.addTinyMcePluginInit(function(settings) {
settings.plugins += ",searchreplace";
settings.theme_advanced_buttons2 += ",search,replace";
});
Please note that if you are enabling several buttons on the toolbar, the buttons may not appear on pages using the Clickr theme. The theme has a fixed screen width, hence it is better to display the buttons on the second row of the toolbar.

1 Comment
arichter
Jan 04, 2010Enabling TinyMCE Plugins works generally. But it's not possible to combine it with a xwork plugin. If both plugin types are configured in one atlassian-plugin, the new xwork plugin overrides the existing mappings of the other buttons. Only the new button is working. If you disable the xwork component of the new plugin, all other buttons with xwork are working again.