2009-11-21 03:36:34 +01:00
|
|
|
(function() {
|
|
|
|
var each = tinymce.each;
|
|
|
|
|
2009-12-16 06:54:10 +01:00
|
|
|
/**
|
2010-11-24 07:24:02 +01:00
|
|
|
* Load via:
|
|
|
|
* HtmlEditorConfig::get('cms')->enablePlugins(array('ssmacron', '../../../../cms/javascript/tinymce_ssmacron'))
|
|
|
|
* HtmlEditorConfig::get('cms')->insertButtonsAfter ('advcode', 'ssmacron');
|
2009-12-16 06:54:10 +01:00
|
|
|
*/
|
2009-11-21 03:36:34 +01:00
|
|
|
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'
|
|
|
|
});
|
2010-11-24 07:24:02 +01:00
|
|
|
|
2009-11-21 03:36:34 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Adds the plugin class to the list of available TinyMCE plugins
|
2009-12-16 06:54:10 +01:00
|
|
|
tinymce.PluginManager.add("ssmacron", tinymce.plugins.InsertMacron);
|
2009-11-21 03:36:34 +01:00
|
|
|
})();
|