Plugin Editor: Disable the documentation look up button when no function is selected.
Props xkon. Fixes #41143. Built from https://develop.svn.wordpress.org/trunk@44617 git-svn-id: http://core.svn.wordpress.org/trunk@44448 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
32ace06a39
commit
63cbfcbded
|
@ -53,6 +53,8 @@ wp.themePluginEditor = (function( $ ) {
|
|||
component.textarea = component.form.find( '#newcontent' );
|
||||
component.textarea.on( 'change', component.onChange );
|
||||
component.warning = $( '.file-editor-warning' );
|
||||
component.docsLookUpButton = component.form.find( '#docs-lookup' );
|
||||
component.docsLookUpList = component.form.find( '#docs-list' );
|
||||
|
||||
if ( component.warning.length > 0 ) {
|
||||
component.showWarning();
|
||||
|
@ -77,6 +79,15 @@ wp.themePluginEditor = (function( $ ) {
|
|||
}
|
||||
return undefined;
|
||||
} );
|
||||
|
||||
component.docsLookUpList.on( 'change', function() {
|
||||
var option = $( this ).val();
|
||||
if ( '' === option ) {
|
||||
component.docsLookUpButton.prop( 'disabled', true );
|
||||
} else {
|
||||
component.docsLookUpButton.prop( 'disabled', false );
|
||||
}
|
||||
} );
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -265,7 +265,7 @@ foreach ( $plugins as $plugin_key => $a_plugin ) {
|
|||
<input type="hidden" name="plugin" value="<?php echo esc_attr( $plugin ); ?>" />
|
||||
</div>
|
||||
<?php if ( ! empty( $docs_select ) ) : ?>
|
||||
<div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ); ?>&version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&redirect=true'); }" /></div>
|
||||
<div id="documentation" class="hide-if-no-js"><label for="docs-list"><?php _e( 'Documentation:' ); ?></label> <?php echo $docs_select; ?> <input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?> " onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ); ?>&version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&redirect=true'); }" /></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( is_writeable( $real_file ) ) : ?>
|
||||
<div class="editor-notices">
|
||||
|
|
|
@ -285,7 +285,7 @@ else :
|
|||
<div id="documentation" class="hide-if-no-js">
|
||||
<label for="docs-list"><?php _e( 'Documentation:' ); ?></label>
|
||||
<?php echo $docs_select; ?>
|
||||
<input type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ); ?>&version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&redirect=true'); }" />
|
||||
<input disabled id="docs-lookup" type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' != jQuery('#docs-list').val() ) { window.open( 'https://api.wordpress.org/core/handbook/1.0/?function=' + escape( jQuery( '#docs-list' ).val() ) + '&locale=<?php echo urlencode( get_user_locale() ); ?>&version=<?php echo urlencode( get_bloginfo( 'version' ) ); ?>&redirect=true'); }" />
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.1-beta1-44616';
|
||||
$wp_version = '5.1-beta1-44617';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue