WordPress.org

Make WordPress Core

Changeset 29883


Ignore:
Timestamp:
10/12/2014 06:12:58 PM (5 years ago)
Author:
azaozz
Message:

TinyMCE: fix the 'wpgallery' plugin to use a placeholder for galleries when either the 'wpview' plugin or wp.mce is not loaded. Fixes #28756

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpgallery/plugin.js

    r27640 r29883  
    6262        editMedia( editor.selection.getNode() );
    6363    });
    64 /*
    65     editor.on( 'init', function( e ) {
    66     //  _createButtons()
    6764
    68         // iOS6 doesn't show the buttons properly on click, show them on 'touchstart'
    69         if ( 'ontouchstart' in window ) {
    70             editor.dom.events.bind( editor.getBody(), 'touchstart', function( e ) {
    71                 var target = e.target;
    72 
    73                 if ( target.nodeName == 'IMG' && editor.dom.hasClass( target, 'wp-gallery' ) ) {
    74                     editor.selection.select( target );
    75                     editor.dom.events.cancel( e );
    76                     editor.plugins.wordpress._hideButtons();
    77                     editor.plugins.wordpress._showButtons( target, 'wp_gallerybtns' );
    78                 }
    79             });
    80         }
    81     });
    82 */
    8365    editor.on( 'mouseup', function( event ) {
    8466        var dom = editor.dom,
     
    118100    editor.on( 'BeforeSetContent', function( event ) {
    119101        // 'wpview' handles the gallery shortcode when present
    120         if ( ! editor.plugins.wpview ) {
     102        if ( ! editor.plugins.wpview || typeof wp === 'undefined' || ! wp.mce ) {
    121103            event.content = replaceGalleryShortcodes( event.content );
    122104        }
Note: See TracChangeset for help on using the changeset viewer.