Make WordPress Core

Changeset 31642


Ignore:
Timestamp:
03/06/2015 03:02:08 PM (10 years ago)
Author:
helen
Message:

Media: UI tweaks for Insert from URL.

"Title" field is now labeled as "Link Text", to reflect how it's actually used. It's also hidden whenever the embed is updating, to make it clearer that something is happening. Embed dimension fields are shown below the preview, much like image property fields are shown below.

fixes #29476, see #31139.

Location:
trunk/src/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media/views.js

    r31632 r31642  
    46064606        // clear out previous results
    46074607        this.$('.embed-container').hide().find('.embed-preview').html('');
     4608        this.$( '.setting' ).hide();
    46084609
    46094610        // only proceed with embed if the field contains more than 6 characters
     
    46424643
    46434644    renderFail: function () {
    4644         this.$( '.setting' ).hide().filter( '.title' ).show();
     4645        this.$( '.setting' ).hide().filter( '.link-text' ).show();
    46454646    },
    46464647
     
    46514652
    46524653        this.$( '.setting' ).hide()
    4653             .filter( '.title' )[ html ? 'hide' : 'show' ]();
     4654            .filter( '.link-text' )[ html ? 'hide' : 'show' ]();
    46544655
    46554656        if ( response && response.attr ) {
  • trunk/src/wp-includes/js/media/views/embed/link.js

    r31632 r31642  
    2929        // clear out previous results
    3030        this.$('.embed-container').hide().find('.embed-preview').html('');
     31        this.$( '.setting' ).hide();
    3132
    3233        // only proceed with embed if the field contains more than 6 characters
     
    6566
    6667    renderFail: function () {
    67         this.$( '.setting' ).hide().filter( '.title' ).show();
     68        this.$( '.setting' ).hide().filter( '.link-text' ).show();
    6869    },
    6970
     
    7475
    7576        this.$( '.setting' ).hide()
    76             .filter( '.title' )[ html ? 'hide' : 'show' ]();
     77            .filter( '.link-text' )[ html ? 'hide' : 'show' ]();
    7778
    7879        if ( response && response.attr ) {
  • trunk/src/wp-includes/media-template.php

    r31620 r31642  
    816816
    817817    <script type="text/html" id="tmpl-embed-link-settings">
    818         <label class="setting title">
    819             <span><?php _e( 'Title' ); ?></span>
    820             <input type="text" class="alignment" data-setting="title" />
    821         </label>
     818        <label class="setting link-text">
     819            <span><?php _e( 'Link Text' ); ?></span>
     820            <input type="text" class="alignment" data-setting="link-text" />
     821        </label>
     822        <div class="embed-container" style="display: none;">
     823            <div class="embed-preview"></div>
     824        </div>
    822825        <div class="embed-link-dimensions">
    823826            <label class="setting width">
     
    829832                <input type="text" class="alignment" data-setting="height" />
    830833            </label>
    831         </div>
    832         <div class="embed-container" style="display: none;">
    833             <div class="embed-preview"></div>
    834834        </div>
    835835    </script>
Note: See TracChangeset for help on using the changeset viewer.