TinyMCE: add stubs for the missing tinymce.util.Cookie, windowManager.onOpen and windowManager.onClose to the compat3x plugin. See #24067, fixes #26750.

Built from https://develop.svn.wordpress.org/trunk@26890


git-svn-id: http://core.svn.wordpress.org/trunk@26773 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Ozz 2014-01-02 01:07:11 +00:00
parent 2a68f85fa1
commit e8e30c03f5
2 changed files with 21 additions and 3 deletions

View File

@ -31,6 +31,11 @@
function Dispatcher(target, newEventName, argsMap, defaultScope) { function Dispatcher(target, newEventName, argsMap, defaultScope) {
target = target || this; target = target || this;
if ( ! newEventName ) {
this.add = this.addToTop = this.remove = this.dispatch = function(){};
return;
}
this.add = function(callback, scope) { this.add = function(callback, scope) {
log('<target>.on' + newEventName + ".add(..)"); log('<target>.on' + newEventName + ".add(..)");
@ -85,10 +90,17 @@
}; };
} }
tinymce.util.Dispatcher = Dispatcher;
tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload"); tinymce.onBeforeUnload = new Dispatcher(tinymce, "BeforeUnload");
tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor"); tinymce.onAddEditor = new Dispatcher(tinymce, "AddEditor", "editor");
tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor"); tinymce.onRemoveEditor = new Dispatcher(tinymce, "RemoveEditor", "editor");
function noop(){}
tinymce.util.Cookie = {
get: noop, getHash: noop, remove: noop, set: noop, setHash: noop
};
function patchEditor(editor) { function patchEditor(editor) {
function patchEditorEvents(oldEventNames, argsMap) { function patchEditorEvents(oldEventNames, argsMap) {
tinymce.each(oldEventNames.split(" "), function(oldName) { tinymce.each(oldEventNames.split(" "), function(oldName) {
@ -132,7 +144,7 @@
if (this.buttons[name]) { if (this.buttons[name]) {
this.buttons[name].active(state); this.buttons[name].active(state);
} }
}, }
}; };
patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor"); patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");
@ -193,8 +205,14 @@
selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection); selection.onGetContent = new Dispatcher(editor, "GetContent", filterSelectionEvents(true), selection);
selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection); selection.onBeforeSetContent = new Dispatcher(editor, "BeforeSetContent", filterSelectionEvents(true), selection);
selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection); selection.onSetContent = new Dispatcher(editor, "SetContent", filterSelectionEvents(true), selection);
});
editor.windowManager.createInstance = function(className, a, b, c, d, e) { editor.on('BeforeRenderUI', function() {
var windowManager = editor.windowManager;
windowManager.onOpen = new Dispatcher();
windowManager.onClose = new Dispatcher();
windowManager.createInstance = function(className, a, b, c, d, e) {
log("windowManager.createInstance(..)"); log("windowManager.createInstance(..)");
var constr = tinymce.resolve(className); var constr = tinymce.resolve(className);

View File

@ -18,7 +18,7 @@ $wp_db_version = 26691;
* *
* @global string $tinymce_version * @global string $tinymce_version
*/ */
$tinymce_version = '4012-20131228'; $tinymce_version = '4012-20140101';
/** /**
* Holds the required PHP version * Holds the required PHP version