Skip to content

Commit

Permalink
Make text fields has same "size"
Browse files Browse the repository at this point in the history
Update screenshot
Fix "multiple" typo mistake for "select" field
  • Loading branch information
rilwis committed Oct 6, 2012
1 parent 4062cd3 commit 1a14701
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 18 deletions.
5 changes: 2 additions & 3 deletions demo/demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,9 @@
// jQuery date picker options. See here http://jqueryui.com/demos/datepicker
'js_options' => array(
'appendText' => '(yyyy-mm-dd)',
'autoSize' => true,
'buttonText' => 'Select Date',
'dateFormat' => 'yy-mm-dd',
'numberOfMonths' => 2,
'changeMonth' => true,
'changeYear' => true,
'showButtonPanel' => true,
),
),
Expand Down
21 changes: 19 additions & 2 deletions inc/fields/color.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ static function admin_enqueue_scripts()
static function html( $html, $meta, $field )
{
return sprintf(
'<input class="rwmb-color" type="text" name="%s" id="%s" value="%s" size="8" />
'<input class="rwmb-color" type="text" name="%s" id="%s" value="%s" size="%s" />
<div class="rwmb-color-picker"></div>',
$field['field_name'],
empty( $field['clone'] ) ? $field['id'] : '',
$meta
$meta,
$field['size']
);
}

Expand All @@ -51,5 +52,21 @@ static function value( $new, $old, $post_id, $field )
{
return '#' === $new ? '' : $new;
}

/**
* Normalize parameters for field
*
* @param array $field
*
* @return array
*/
static function normalize_field( $field )
{
$field = wp_parse_args( $field, array(
'size' => 7,
) );

return $field;
}
}
}
2 changes: 1 addition & 1 deletion inc/fields/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static function html( $html, $meta, $field )
static function normalize_field( $field )
{
$field = wp_parse_args( $field, array(
'size' => 10,
'size' => 30,
'js_options' => array(),
) );

Expand Down
2 changes: 1 addition & 1 deletion inc/fields/datetime.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static function html( $html, $meta, $field )
static function normalize_field( $field )
{
$field = wp_parse_args( $field, array(
'size' => 20,
'size' => 30,
'js_options' => array(),
) );

Expand Down
7 changes: 0 additions & 7 deletions inc/fields/image.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,6 @@ static function html( $html, $meta, $field )
}

// Show form upload
$html .= "
<h4>{$i18n_title}</h4>
<div class='new-files'>
<div class='file-input'><input type='file' name='{$field['id']}[]' /></div>
<a class='rwmb-add-file' href='#'><strong>{$i18n_more}</strong></a>
</div>";

$html .= sprintf(
'<h4>%s</h4>
<div class="new-files">
Expand Down
2 changes: 1 addition & 1 deletion inc/fields/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static function html( $html, $meta, $field )
static function normalize_field( $field )
{
$field = wp_parse_args( $field, array(
'size' => 10,
'size' => 30,
) );

return $field;
Expand Down
4 changes: 2 additions & 2 deletions inc/fields/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ static function html( $html, $meta, $field )
$meta = (array) $meta;

$html = sprintf(
'<select class="rwmb-select" name="%s" id="%s" multiple="%s"',
'<select class="rwmb-select" name="%s" id="%s"%s>',
$field['field_name'],
$field['id'],
$field['multiple'] ? 'multiple' : ''
$field['multiple'] ? ' multiple="multiple"' : ''
);
$option = '<option value="%s" %s>%s</option>';

Expand Down
2 changes: 1 addition & 1 deletion inc/fields/time.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static function html( $html, $meta, $field )
static function normalize_field( $field )
{
$field = wp_parse_args( $field, array(
'size' => 10,
'size' => 30,
'js_options' => array(),
) );

Expand Down
Binary file modified screenshot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1a14701

Please sign in to comment.