Make WordPress Core

Ticket #41143: 41143_v3.diff

File 41143_v3.diff, 3.4 KB (added by xkon, 7 years ago)

Disabled Button. Check code transfered to common.js

  • wp-admin/js/common.js

     
    10261026        }
    10271027})();
    10281028
     1029// Make the Look Up button in Theme / Plugin Editors disabled if nothing is selected.
     1030$('#documentation #docs-list').change(function(){
     1031        if ( $( this ).val() != '' ) {
     1032                $('#documentation #documentationLookup').prop('disabled', false);
     1033        }
     1034        else
     1035        {
     1036                $('#documentation #documentationLookup').prop('disabled', true);
     1037        }
     1038});
     1039
    10291040}( jQuery, window ));
  • wp-admin/plugin-editor.php

     
    272272                <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
    273273                </div>
    274274                <?php if ( !empty( $docs_select ) ) : ?>
    275                 <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() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ) ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ) ?>&amp;redirect=true'); }" /></div>
     275                <div id="documentation" class="hide-if-no-js">
     276            <label for="docs-list"><?php _e('Documentation:') ?></label>
     277            <?php echo $docs_select ?>
     278            <input disabled id="documentationLookup" 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() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ) ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ) ?>&amp;redirect=true'); }" />
     279        </div>
    276280                <?php endif; ?>
    277281<?php if ( is_writeable($real_file) ) : ?>
    278282        <?php if ( in_array( $plugin, (array) get_option( 'active_plugins', array() ) ) ) { ?>
  • wp-admin/theme-editor.php

     
    263263                <div id="documentation" class="hide-if-no-js">
    264264                <label for="docs-list"><?php _e('Documentation:') ?></label>
    265265                <?php echo $docs_select; ?>
    266                 <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() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ) ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ) ?>&amp;redirect=true'); }" />
    267                 </div>
     266                <input disabled id="documentationLookup"  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() ) + '&amp;locale=<?php echo urlencode( get_user_locale() ) ?>&amp;version=<?php echo urlencode( get_bloginfo( 'version' ) ) ?>&amp;redirect=true'); }" />
     267        </div>
    268268        <?php endif; ?>
    269269
    270270                <div>