From 63634ff1bb693429f6b35f7936786aa96a61215e Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sun, 12 Oct 2014 18:12:58 +0000 Subject: [PATCH] TinyMCE: fix the 'wpgallery' plugin to use a placeholder for galleries when either the 'wpview' plugin or wp.mce is not loaded. Fixes #28756 git-svn-id: https://develop.svn.wordpress.org/trunk@29883 602fd350-edb4-49c9-b593-d223f7449a82 --- .../js/tinymce/plugins/wpgallery/plugin.js | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js b/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js index 7f82e3575f..41dcfe5789 100644 --- a/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js @@ -61,25 +61,7 @@ tinymce.PluginManager.add('wpgallery', function( editor ) { editor.addCommand( 'WP_Gallery', function() { editMedia( editor.selection.getNode() ); }); -/* - editor.on( 'init', function( e ) { - // _createButtons() - // iOS6 doesn't show the buttons properly on click, show them on 'touchstart' - if ( 'ontouchstart' in window ) { - editor.dom.events.bind( editor.getBody(), 'touchstart', function( e ) { - var target = e.target; - - if ( target.nodeName == 'IMG' && editor.dom.hasClass( target, 'wp-gallery' ) ) { - editor.selection.select( target ); - editor.dom.events.cancel( e ); - editor.plugins.wordpress._hideButtons(); - editor.plugins.wordpress._showButtons( target, 'wp_gallerybtns' ); - } - }); - } - }); -*/ editor.on( 'mouseup', function( event ) { var dom = editor.dom, node = event.target; @@ -117,7 +99,7 @@ tinymce.PluginManager.add('wpgallery', function( editor ) { editor.on( 'BeforeSetContent', function( event ) { // 'wpview' handles the gallery shortcode when present - if ( ! editor.plugins.wpview ) { + if ( ! editor.plugins.wpview || typeof wp === 'undefined' || ! wp.mce ) { event.content = replaceGalleryShortcodes( event.content ); } });