silverstripe-reports/javascript/tinymce_ssmacron/editor_plugin_src.js
Ingo Schommer a8fdcbd967 ENHANCEMENT Loading of tinymce_ssbuttons plugin via relative paths in HtmlEditorConfig rather than using the plugin name as a path spec (see r94060)
API CHANGE Changed cms/javascript/tinymce_ssbuttons plugin name to "ssbuttons" (see r94060)
API CHANGE Changed cms/javascript/tinymce_ssmacron plugin name to "ssmacron" (see r94060)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@94062 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 17:52:06 +13:00

44 lines
1.2 KiB
JavaScript

(function() {
var each = tinymce.each;
/**
* Load via: HtmlEditorConfig::get('cms')->enablePlugins(array('ssmacron', '../../../../cms/javascript/tinymce_ssmacron'))
*/
tinymce.create('tinymce.plugins.InsertMacron', {
getInfo : function() {
return {
longname : 'Button to insert macrons',
author : 'Hamish Friedlander. Heavily based on charmap that comes with TinyMCE',
authorurl : 'http://www.siverstripe.com/',
infourl : 'http://www.silverstripe.com/',
version : "1.0"
};
},
init : function(ed, url) {
// Register commands
ed.addCommand('mceInsertMacron', function() {
ed.windowManager.open({
file : url + '/macron.htm',
width : 350 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
height : 150 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
inline : true
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('ssmacron', {
title : 'Insert a Macron',
cmd : 'mceInsertMacron',
image : url + '/img/macron.png'
});
}
});
// Adds the plugin class to the list of available TinyMCE plugins
tinymce.PluginManager.add("ssmacron", tinymce.plugins.InsertMacron);
})();