我正在尝试为 umbraco 富文本数据类型添加一个自定义按钮,所以我为 TinyMCE 制作了一个简单的插件......但我似乎无法让它工作,它显示在数据类型中,但当我打开一些编辑器时没有页...
//File: umbraco_client/tinymce3/plugins/addarrowheader/editor_plugin_src.js
//Same content in editor_plugin.js (just minified)
(function () {
tinymce.create('tinymce.plugins.mceAddArrowHeader', {
init: function (ed, url) {
ed.addCommand('addHeader', function () {
alert('hello!');
});
ed.addButton('addArrow', { title: 'DoAdd', image: '/images/editor/umbracoTextGen.gif', cmd: 'addHeader' });
},
getInfo: function () {
return {
longname: 'mceAddArrowHeader',
author: 'Bekker',
authorurl: 'Eksponent.com',
infourl: 'none',
version: tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('mceAddArrowHeader', tinymce.plugins.mceAddArrowHeader);
})();
在 tinyMceConfig.config(/config/ 文件夹)中添加了以下内容
//in <commands>
<command>
<umbracoAlias>mceAddArrowHeader</umbracoAlias>
<icon>images/editor/spellchecker.gif</icon>
<tinyMceCommand value="" userInterface="true" frontendCommand="mceAddArrowHeader">addarrowheader</tinyMceCommand>
<priority>76</priority>
</command>
//In <plugins>
//just using spellchecker.gif for test purpose, no custom icon yet...
<plugin loadOnFrontend="false">addarrowheader</plugin>