Make WordPress Core

Ticket #41143: 41143.diff

File 41143.diff, 3.3 KB (added by xkon, 8 years ago)

Modified the buttons jQuery code to show / hide an error message.

  • 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"><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() ) { jQuery('#documentationerror').css('display', 'block'); } else { jQuery('#documentationerror').css('display', 'none'); 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'); }" /><span style="color:red;display: none;" id="documentationerror"><br/><?php _e('Please select a Function Name from the drop down menu.'); ?></span></div>
    276276                <?php endif; ?>
    277277<?php if ( is_writeable($real_file) ) : ?>
    278278        <?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 type="button" class="button" value="<?php esc_attr_e( 'Look Up' ); ?>" onclick="if ( '' == jQuery('#docs-list').val() ) { jQuery('#documentationerror').css('display', 'block'); } else { jQuery('#documentationerror').css('display', 'none'); 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        <span style="color:red;display: none;" id="documentationerror"><br/><?php _e('Please select a Function Name from the drop down menu.'); ?></span>
     268        </div>
    268269        <?php endif; ?>
    269270
    270271                <div>