diff --git a/TinyMCEPlugin/pub/System/TinyMCEPlugin/plugins/foswiki/plugin.uncompressed.js b/TinyMCEPlugin/pub/System/TinyMCEPlugin/plugins/foswiki/plugin.uncompressed.js index f218b4e618..694fa570f5 100644 --- a/TinyMCEPlugin/pub/System/TinyMCEPlugin/plugins/foswiki/plugin.uncompressed.js +++ b/TinyMCEPlugin/pub/System/TinyMCEPlugin/plugins/foswiki/plugin.uncompressed.js @@ -19,8 +19,8 @@ /** * TinyMCE plugin that implements most Foswiki features */ -(function () { - 'use strict'; +"use strict"; +(function ($) { // Convert a simple attachment name into a URL function makeAttachmentURL(url) { @@ -173,7 +173,8 @@ // setup handler, and also from the raw->WYSIWYG switch function switchToWYSIWYG(self, editor) { // Get the textarea content - var text = editor.getElement().value; + var el = editor.getElement(), + text = el.value; // When switching back from a raw edit, a show side-effects // and will re-load the content from the textarea, which contains @@ -202,6 +203,7 @@ // (see above for details of why) editor.initialized = true; editor.isNotDirty = true; + $(el).trigger("fwSwitchToWYSIWYG", editor); }, function(type, req, o) { // Kill the progress state @@ -517,4 +519,4 @@ // Register plugin tinymce.PluginManager.add('foswiki', tinymce.plugins.Foswiki); -})(); +})(jQuery);