Make WordPress Core

Changeset 15016


Ignore:
Timestamp:
05/28/2010 12:01:59 AM (14 years ago)
Author:
nacin
Message:

Custom background UI tweaks. Make 'Select Color' a link instead of a button, move color below the background image options, standardize screen reader text.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/custom-background.php

    r14775 r15016  
    233233<table class="form-table">
    234234<tbody>
    235 <tr valign="top">
    236 <th scope="row"><?php _e( 'Color' ); ?></th>
    237 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
    238 <input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
    239 <input type="button" class="button" value="<?php esc_attr_e('Select a Color'); ?>" id="pickcolor" />
    240 <div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
    241 </fieldset></td>
    242 </tr>
    243235<?php if ( get_background_image() ) : ?>
    244236<tr valign="top">
     
    262254<tr valign="top">
    263255<th scope="row"><?php _e( 'Repeat' ); ?></th>
    264 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Repeat' ); ?></span></legend>
     256<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Repeat' ); ?></span></legend>
    265257<label><input type="radio" name="background-repeat" value="no-repeat"<?php checked('no-repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('No Repeat'); ?></option></label>
    266258    <label><input type="radio" name="background-repeat" value="repeat"<?php checked('repeat', get_theme_mod('background_repeat', 'repeat')); ?>> <?php _e('Tile'); ?></option></label>
     
    272264<tr valign="top">
    273265<th scope="row"><?php _e( 'Attachment' ); ?></th>
    274 <td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Attachment' ); ?></span></legend>
     266<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Attachment' ); ?></span></legend>
    275267<label>
    276268<input name="background-attachment" type="radio" value="scroll" <?php checked('scroll', get_theme_mod('background_attachment', 'fixed')); ?> />
     
    284276</tr>
    285277<?php endif; // get_background_image() ?>
     278<tr valign="top">
     279<th scope="row"><?php _e( 'Color' ); ?></th>
     280<td><fieldset><legend class="screen-reader-text"><span><?php _e( 'Background Color' ); ?></span></legend>
     281<input type="text" name="background-color" id="background-color" value="#<?php echo esc_attr(get_background_color()) ?>" />
     282<a class="hide-if-no-js" href="#" id="pickcolor"><?php _e('Select a Color'); ?></a>
     283<div id="colorPickerDiv" style="z-index: 100; background:#eee; border:1px solid #ccc; position:absolute; display:none;"></div>
     284</fieldset></td>
     285</tr>
    286286</tbody>
    287287</table>
  • trunk/wp-admin/js/custom-background.dev.js

    r14684 r15016  
    1010    jQuery('#pickcolor').click(function() {
    1111        jQuery('#colorPickerDiv').show();
     12        return false;
    1213    });
    1314
  • trunk/wp-admin/js/custom-background.js

    r14684 r15016  
    1 var farbtastic;function pickColor(a){farbtastic.setColor(a);jQuery("#background-color").val(a);jQuery("#custom-background-image").css("background-color",a)}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show()});jQuery("#background-color").keyup(function(){var b=jQuery("#background-color").val(),a=b;if(a[0]!="#"){a="#"+a}a=a.replace(/[^#a-fA-F0-9]+/,"");if(a!=b){jQuery("#background-color").val(a)}if(a.length==4||a.length==7){pickColor(a)}});jQuery('input[name="background-position-x"]').change(function(){jQuery("#custom-background-image").css("background-position",jQuery(this).val()+" top")});jQuery('select[name="background-repeat"]').change(function(){jQuery("#custom-background-image").css("background-repeat",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(a){pickColor(a)});pickColor(jQuery("#background-color").val());jQuery(document).mousedown(function(){jQuery("#colorPickerDiv").each(function(){var a=jQuery(this).css("display");if(a=="block"){jQuery(this).fadeOut(2)}})})});
     1var farbtastic;function pickColor(a){farbtastic.setColor(a);jQuery("#background-color").val(a);jQuery("#custom-background-image").css("background-color",a)}jQuery(document).ready(function(){jQuery("#pickcolor").click(function(){jQuery("#colorPickerDiv").show();return false});jQuery("#background-color").keyup(function(){var b=jQuery("#background-color").val(),a=b;if(a[0]!="#"){a="#"+a}a=a.replace(/[^#a-fA-F0-9]+/,"");if(a!=b){jQuery("#background-color").val(a)}if(a.length==4||a.length==7){pickColor(a)}});jQuery('input[name="background-position-x"]').change(function(){jQuery("#custom-background-image").css("background-position",jQuery(this).val()+" top")});jQuery('select[name="background-repeat"]').change(function(){jQuery("#custom-background-image").css("background-repeat",jQuery(this).val())});farbtastic=jQuery.farbtastic("#colorPickerDiv",function(a){pickColor(a)});pickColor(jQuery("#background-color").val());jQuery(document).mousedown(function(){jQuery("#colorPickerDiv").each(function(){var a=jQuery(this).css("display");if(a=="block"){jQuery(this).fadeOut(2)}})})});
  • trunk/wp-includes/script-loader.php

    r15010 r15016  
    396396        ) );
    397397
    398         $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20100516' );
     398        $scripts->add( 'custom-background', "/wp-admin/js/custom-background$suffix.js", array('farbtastic'), '20100527' );
    399399        $scripts->add_data( 'custom-background', 'group', 1 );
    400400    }
Note: See TracChangeset for help on using the changeset viewer.