AI OnAI Off
The epi plugins are not loaded the same way as external plugins. Basically, the plugins are built into the package and so they are being loaded via AMD when the TinyMCE editor is loaded. Since your external plugin is not loaded via AMD but rather as a normal script you should not wrap it in a define call. Instead do a require call inside your plugin function if you need to get things from the edit UI at runtime. So something like:
tinymce.PluginManager.add("epi-image-editor", function (editor) {
editor.addCommand("mceEPiImageEditor", function () {
require(["epi-cms/legacy/LegacyDialogPopup"], function (LegacyDialogPopup) {
var dialog = new LegacyDialogPopup();
dialog.show();
editor.fire("OpenWindow", {
win: null
});
});
});
});
Disclaimer: I have not tested this code snippet :)
Trying to use the LegacyDialogPopup in tinyMCE but i dont get how Episerver is doing it.
Looking at epi-image-editor.js Epi is doing it like this:
But when i register my plugin
.AddExternalPlugin("MyPlug", "/pathtoplug.js")
and use the same pattern as upper code:
How do they register their addons to run in the dojo context?