Make WordPress Core

Ticket #49317: Javascript_Coding_Standards.patch

File Javascript_Coding_Standards.patch, 1.7 KB (added by ankitmaru, 5 years ago)
  • src/js/_enqueues/wp/media/editor.js

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    164164                        var shortcode, html, extension;
    165165
    166166                        props = wp.media.string.props( props, attachment );
    167                         if ( props.link !== 'embed' )
    168                                 return wp.media.string.link( props );
     167                        if ( props.link !== 'embed' ) {
     168                                return wp.media.string.link(props);
     169                        }
    169170
    170171                        shortcode = {};
    171172
     
    446447
    447448                                if ( attrs._orderbyRandom ) {
    448449                                        attrs.orderby = 'rand';
    449                                 } else if ( attrs._orderByField && attrs._orderByField != 'rand' ) {
     450                                } else if ( attrs._orderByField && attrs._orderByField !== 'rand' ) {
    450451                                        attrs.orderby = attrs._orderByField;
    451452                                }
    452453
     
    625626                                thumbnail_id: settings.post.featuredImageId,
    626627                                _wpnonce:     settings.post.nonce
    627628                        }).done( function( html ) {
    628                                 if ( html == '0' ) {
     629                                if ( html === '0' ) {
    629630                                        window.alert( window.setPostThumbnailL10n.error );
    630631                                        return;
    631632                                }
     
    801802
    802803                                selection = selection || state.get('selection');
    803804
    804                                 if ( ! selection )
     805                                if ( ! selection ) {
    805806                                        return;
     807                                }
    806808
    807809                                $.when.apply( $, selection.map( function( attachment ) {
    808810                                        var display = state.display( attachment ).toJSON();
     
    965967                                                size:  'image-size',
    966968                                                alt:   'image_alt'
    967969                                        }, function( option, prop ) {
    968                                                 if ( props[ prop ] )
     970                                                if ( props[ prop ] ){
    969971                                                        options[ option ] = props[ prop ];
     972                                                }
    970973                                        });
    971974                                } else if ( 'video' === attachment.type ) {
    972975                                        html = wp.media.string.video( props, attachment );