Make WordPress Core

Changeset 29182


Ignore:
Timestamp:
07/15/2014 11:38:33 PM (12 years ago)
Author:
azaozz
Message:

TinyMCE wpView: remove unused code, props avryl, see #28595

File:
1 edited

Legend:

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

    r29127 r29182  
    267267                });
    268268
    269                 // When the selection's content changes, scan any new content for matching views.
    270                 // Runs on paste and on inserting nodes/html.
    271                 editor.on( 'SetContent', function( e ) {
    272                         if ( ! e.context ) {
    273                                 return;
    274                         }
    275 
    276                         var node = selection.getNode();
    277 
    278                         if ( ! node.innerHTML ) {
    279                                 return;
    280                         }
    281 
    282                         node.innerHTML = wp.mce.views.toViews( node.innerHTML );
    283                 });
    284 
    285269                editor.dom.bind( editor.getBody().parentNode, 'mousedown mouseup click', function( event ) {
    286270                        var view = getView( event.target ),
     
    328312
    329313        editor.on( 'PreProcess', function( event ) {
    330                 // Replace the wpview node with the wpview string/shortcode?
     314                // Empty the wpview wrap nodes
    331315                tinymce.each( editor.dom.select( 'div[data-wpview-text]', event.node ), function( node ) {
    332                         // Empty the wrap node
    333                         if ( 'textContent' in node ) {
    334                                 node.textContent = '\u00a0';
    335                         } else {
    336                                 node.innerText = '\u00a0';
    337                         }
     316                        node.textContent = node.innerText = '\u00a0';
    338317                });
    339318    });
Note: See TracChangeset for help on using the changeset viewer.