From 2f41519c46c03ab0b195ad55d47ddf1fafd13a61 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 10 Mar 2015 20:27:48 +0000 Subject: [PATCH] TinyMCE: Remove old placeholder functions and callbacks. Props iseulde. Fixes #31576. git-svn-id: https://develop.svn.wordpress.org/trunk@31703 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/tinymce/plugins/wordpress/plugin.js | 82 ++----------------- 1 file changed, 5 insertions(+), 77 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js index f3af6490ce..12601cce99 100644 --- a/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wordpress/plugin.js @@ -433,85 +433,13 @@ tinymce.PluginManager.add( 'wordpress', function( editor ) { } }); - // popup buttons for the gallery, etc. - editor.on( 'init', function() { - editor.dom.bind( editor.getWin(), 'scroll', function() { - _hideButtons(); - }); - - editor.dom.bind( editor.getBody(), 'dragstart', function() { - _hideButtons(); - }); - }); - - editor.on( 'BeforeExecCommand', function() { - _hideButtons(); - }); - - editor.on( 'SaveContent', function() { - _hideButtons(); - }); - - editor.on( 'MouseDown', function( e ) { - if ( e.target.nodeName !== 'IMG' ) { - _hideButtons(); - } - }); - - editor.on( 'keydown', function( e ) { - if ( e.which === tinymce.util.VK.DELETE || e.which === tinymce.util.VK.BACKSPACE ) { - _hideButtons(); - } - }); - - // Internal functions - function _setEmbed( c ) { - return c.replace( /\[embed\]([\s\S]+?)\[\/embed\][\s\u00a0]*/g, function( a, b ) { - return ''; - }); - } - - function _getEmbed( c ) { - return c.replace( /]+>/g, function( a ) { - if ( a.indexOf('class="wp-oembed') !== -1 ) { - var u = a.match( /alt="([^\"]+)"/ ); - - if ( u[1] ) { - a = '[embed]' + u[1] + '[/embed]'; - } - } - - return a; - }); - } - - function _showButtons( n, id ) { - var p1, p2, vp, X, Y; - - vp = editor.dom.getViewPort( editor.getWin() ); - p1 = DOM.getPos( editor.getContentAreaContainer() ); - p2 = editor.dom.getPos( n ); - - X = Math.max( p2.x - vp.x, 0 ) + p1.x; - Y = Math.max( p2.y - vp.y, 0 ) + p1.y; - - DOM.setStyles( id, { - 'top' : Y + 5 + 'px', - 'left' : X + 5 + 'px', - 'display': 'block' - }); - } - - function _hideButtons() { - DOM.hide( DOM.select( '#wp_editbtns, #wp_gallerybtns' ) ); - } + function noop() {} // Expose some functions (back-compat) return { - _showButtons: _showButtons, - _hideButtons: _hideButtons, - _setEmbed: _setEmbed, - _getEmbed: _getEmbed + _showButtons: noop, + _hideButtons: noop, + _setEmbed: noop, + _getEmbed: noop }; });