From 21f4012df4dca262791bb39fcb37e80a9cb251e1 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Thu, 2 Jan 2014 07:03:11 +0000 Subject: [PATCH] TinyMCE: add stub for the missing editor.controlManager to the compat3x plugin. See #24067. Built from https://develop.svn.wordpress.org/trunk@26897 git-svn-id: http://core.svn.wordpress.org/trunk@26780 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../js/tinymce/plugins/compat3x/plugin.js | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/wp-includes/js/tinymce/plugins/compat3x/plugin.js b/wp-includes/js/tinymce/plugins/compat3x/plugin.js index 31b78ca468..3ae60f48bd 100644 --- a/wp-includes/js/tinymce/plugins/compat3x/plugin.js +++ b/wp-includes/js/tinymce/plugins/compat3x/plugin.js @@ -127,6 +127,25 @@ return; } + function cmNoop() { + var obj = {}, methods = 'add addMenu addSeparator collapse createMenu destroy displayColor expand focus ' + + 'getLength hasMenus hideMenu isActive isCollapsed isDisabled isRendered isSelected mark ' + + 'postRender remove removeAll renderHTML renderMenu renderNode renderTo select selectByIndex ' + + 'setActive setAriaProperty setColor setDisabled setSelected setState showMenu update'; + + log('editor.controlManager.*'); + + function _noop() { + return cmNoop(); + } + + tinymce.each( methods.split(' '), function( method ) { + obj[method] = _noop; + }); + + return obj; + } + editor.controlManager = { buttons: {}, @@ -144,7 +163,25 @@ if (this.buttons[name]) { this.buttons[name].active(state); } - } + }, + + onAdd: new Dispatcher(), + onPostRender: new Dispatcher(), + + add: function(obj) { return obj; }, + createButton: cmNoop, + createColorSplitButton: cmNoop, + createControl: cmNoop, + createDropMenu: cmNoop, + createListBox: cmNoop, + createMenuButton: cmNoop, + createSeparator: cmNoop, + createSplitButton: cmNoop, + createToolbar: cmNoop, + createToolbarGroup: cmNoop, + destroy: noop, + get: noop, + setControlType: cmNoop }; patchEditorEvents("PreInit BeforeRenderUI PostRender Load Init Remove Activate Deactivate", "editor");