silverstripe-framework/thirdparty/tinymce-advcode/editor_plugin_src.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

41 lines
1.2 KiB
JavaScript

(function() {
tinymce.PluginManager.requireLangPack('advcode');
tinymce.create('tinymce.plugins.AdvancedCodePlugin', {
init : function(ed, url) {
// Register commands
ed.addCommand('mceAdvancedCode', function() {
ed.windowManager.open({
file : url + '/dialog.html',
width : 750 + parseInt(ed.getLang('advcode.delta_width', 0)),
height : 450 + parseInt(ed.getLang('advcode.delta_height', 0)),
inline : 1
}, {
plugin_url : url
});
});
// Register buttons
ed.addButton('advcode', {
title : ed.getLang('advcode.desc', 0),
cmd : 'mceAdvancedCode',
image : url + '/img/html.png'
});
ed.onNodeChange.add(function(ed, cm, n) {});
},
getInfo : function() {
return {
longname : 'Advanced Code Editor',
author : 'Daniel Insley',
authorurl : 'http://www.danielinsley.com',
infourl : 'http://github.com/dinsley/tinymce-codepress/tree/master',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
// Register plugin
tinymce.PluginManager.add('advcode', tinymce.plugins.AdvancedCodePlugin);
})();