Make WordPress Core

Ticket #28532: 28532.3.diff

File 28532.3.diff, 1.3 KB (added by wonderboymusic, 9 years ago)
  • src/wp-includes/js/mce-view.js

     
    124124                 */
    125125                register: function( type, constructor ) {
    126126                        var defaultConstructor = {
    127                                         shortcode: type,
     127                                        type: type,
    128128                                        View: {},
    129129                                        toView: function( content ) {
    130                                                 var match = wp.shortcode.next( this.shortcode, content );
     130                                                var match = wp.shortcode.next( this.type, content );
    131131
    132132                                                if ( ! match ) {
    133133                                                        return;
     
    488488                 * @param {HTMLElement} node
    489489                 */
    490490                edit: function( node ) {
    491                         var media = wp.media[ this.shortcode ],
     491                        var media = wp.media[ this.type ],
    492492                                self = this,
    493493                                frame, data, callback;
    494494
     
    501501                        } );
    502502
    503503                        callback = function( selection ) {
    504                                 var shortcode = wp.media[ self.shortcode ].shortcode( selection ).string();
     504                                var shortcode = wp.media[ self.type ].shortcode( selection ).string();
    505505                                $( node ).attr( 'data-wpview-text', window.encodeURIComponent( shortcode ) );
    506506                                wp.mce.views.refreshView( self, shortcode );
    507507                                frame.detach();
     
    819819                                self = this,
    820820                                frame,
    821821                                data,
    822                                 isURL = 'embedURL' === this.shortcode;
     822                                isURL = 'embedURL' === this.type;
    823823
    824824                        $( document ).trigger( 'media:edit' );
    825825