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. Built from https://develop.svn.wordpress.org/trunk@31642 git-svn-id: http://core.svn.wordpress.org/trunk@31623 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7ce4256d4d
commit
b6393c9d77
|
@ -4605,6 +4605,7 @@ EmbedLink = Settings.extend({
|
||||||
|
|
||||||
// clear out previous results
|
// clear out previous results
|
||||||
this.$('.embed-container').hide().find('.embed-preview').html('');
|
this.$('.embed-container').hide().find('.embed-preview').html('');
|
||||||
|
this.$( '.setting' ).hide();
|
||||||
|
|
||||||
// only proceed with embed if the field contains more than 6 characters
|
// only proceed with embed if the field contains more than 6 characters
|
||||||
if ( url && url.length < 6 ) {
|
if ( url && url.length < 6 ) {
|
||||||
|
@ -4641,7 +4642,7 @@ EmbedLink = Settings.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
renderFail: function () {
|
renderFail: function () {
|
||||||
this.$( '.setting' ).hide().filter( '.title' ).show();
|
this.$( '.setting' ).hide().filter( '.link-text' ).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderoEmbed: function( response ) {
|
renderoEmbed: function( response ) {
|
||||||
|
@ -4650,7 +4651,7 @@ EmbedLink = Settings.extend({
|
||||||
opts = { silent: true };
|
opts = { silent: true };
|
||||||
|
|
||||||
this.$( '.setting' ).hide()
|
this.$( '.setting' ).hide()
|
||||||
.filter( '.title' )[ html ? 'hide' : 'show' ]();
|
.filter( '.link-text' )[ html ? 'hide' : 'show' ]();
|
||||||
|
|
||||||
if ( response && response.attr ) {
|
if ( response && response.attr ) {
|
||||||
attr = response.attr;
|
attr = response.attr;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -28,6 +28,7 @@ EmbedLink = Settings.extend({
|
||||||
|
|
||||||
// clear out previous results
|
// clear out previous results
|
||||||
this.$('.embed-container').hide().find('.embed-preview').html('');
|
this.$('.embed-container').hide().find('.embed-preview').html('');
|
||||||
|
this.$( '.setting' ).hide();
|
||||||
|
|
||||||
// only proceed with embed if the field contains more than 6 characters
|
// only proceed with embed if the field contains more than 6 characters
|
||||||
if ( url && url.length < 6 ) {
|
if ( url && url.length < 6 ) {
|
||||||
|
@ -64,7 +65,7 @@ EmbedLink = Settings.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
renderFail: function () {
|
renderFail: function () {
|
||||||
this.$( '.setting' ).hide().filter( '.title' ).show();
|
this.$( '.setting' ).hide().filter( '.link-text' ).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderoEmbed: function( response ) {
|
renderoEmbed: function( response ) {
|
||||||
|
@ -73,7 +74,7 @@ EmbedLink = Settings.extend({
|
||||||
opts = { silent: true };
|
opts = { silent: true };
|
||||||
|
|
||||||
this.$( '.setting' ).hide()
|
this.$( '.setting' ).hide()
|
||||||
.filter( '.title' )[ html ? 'hide' : 'show' ]();
|
.filter( '.link-text' )[ html ? 'hide' : 'show' ]();
|
||||||
|
|
||||||
if ( response && response.attr ) {
|
if ( response && response.attr ) {
|
||||||
attr = response.attr;
|
attr = response.attr;
|
||||||
|
|
|
@ -815,10 +815,13 @@ function wp_print_media_templates() {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-embed-link-settings">
|
<script type="text/html" id="tmpl-embed-link-settings">
|
||||||
<label class="setting title">
|
<label class="setting link-text">
|
||||||
<span><?php _e( 'Title' ); ?></span>
|
<span><?php _e( 'Link Text' ); ?></span>
|
||||||
<input type="text" class="alignment" data-setting="title" />
|
<input type="text" class="alignment" data-setting="link-text" />
|
||||||
</label>
|
</label>
|
||||||
|
<div class="embed-container" style="display: none;">
|
||||||
|
<div class="embed-preview"></div>
|
||||||
|
</div>
|
||||||
<div class="embed-link-dimensions">
|
<div class="embed-link-dimensions">
|
||||||
<label class="setting width">
|
<label class="setting width">
|
||||||
<span><?php _e( 'Maximum Width' ); ?></span>
|
<span><?php _e( 'Maximum Width' ); ?></span>
|
||||||
|
@ -829,9 +832,6 @@ function wp_print_media_templates() {
|
||||||
<input type="text" class="alignment" data-setting="height" />
|
<input type="text" class="alignment" data-setting="height" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="embed-container" style="display: none;">
|
|
||||||
<div class="embed-preview"></div>
|
|
||||||
</div>
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-embed-image-settings">
|
<script type="text/html" id="tmpl-embed-image-settings">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31641';
|
$wp_version = '4.2-alpha-31642';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue