Make WordPress Core

Changeset 9564


Ignore:
Timestamp:
11/08/2008 02:15:53 AM (17 years ago)
Author:
azaozz
Message:

Styling for custom fields

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/colors-fresh.css

    r9560 r9564  
    4747#poststuff .inside .approved {
    4848    color: green;
     49}
     50
     51#postcustomstuff table {
     52    border-color: #dfdfdf;
     53    background-color: #F9F9F9;
     54}
     55
     56#postcustomstuff thead th {
     57    background-color: #F1F1F1;
     58}
     59
     60#postcustomstuff table input,
     61#postcustomstuff table textarea {
     62    border-color: #dfdfdf;
     63    background-color: #fff;
    4964}
    5065
     
    252267}
    253268
    254 .button {
     269.button,
     270.submit input {
    255271    border-color: #DCDCDC;
    256272    color: #464646;
     
    265281
    266282.button,
     283.submit input,
    267284.button-secondary {
    268285    background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
     
    275292}
    276293
    277 .button[disabled], .button:disabled {
     294.button[disabled],
     295.button:disabled {
    278296    background-color: #999;
    279297}
    280298
    281299.button:hover,
    282 #edit-slug-buttons a.save:hover {
     300.submit input:hover,
     301#edit-slug-buttons a.save:hover,
     302#postcustomstuff .submit input:hover {
    283303    border-color: #535353;
    284304}
  • trunk/wp-admin/edit-form-advanced.php

    r9557 r9564  
    356356?>
    357357<div id="postcustomstuff">
    358 <table cellpadding="3">
    359358<?php
    360359$metadata = has_meta($post->ID);
    361360list_meta($metadata);
    362 ?>
    363 
    364 </table>
    365 <?php
    366     meta_form();
     361meta_form();
    367362?>
    368363<div id="ajax-response"></div>
  • trunk/wp-admin/edit-page-form.php

    r9557 r9564  
    288288?>
    289289<div id="postcustomstuff">
    290 <table cellpadding="3">
    291290<?php
    292291$metadata = has_meta($post->ID);
    293292list_meta($metadata);
    294 ?>
    295 
    296 </table>
    297 <?php
    298     meta_form();
     293meta_form();
    299294?>
    300295<div id="ajax-response"></div>
  • trunk/wp-admin/includes/template.php

    r9557 r9564  
    21012101function list_meta( $meta ) {
    21022102    // Exit if no meta
    2103     if (!$meta ) {
    2104         echo '<tbody id="the-list" class="list:meta"><tr style="display: none;"><td>&nbsp;</td></tr></tbody>'; //TBODY needed for list-manipulation JS
     2103    if ( ! $meta ) {
     2104        echo '
     2105<table id="list-table" style="display: none;">
     2106    <thead>
     2107    <tr>
     2108        <th class="left">' . __( 'Name' ) . '</th>
     2109        <th>' . __( 'Value' ) . '</th>
     2110    </tr>
     2111    </thead>
     2112    <tbody id="the-list" class="list:meta">
     2113    <tr><td></td></tr>
     2114    </tbody>
     2115</table>'; //TBODY needed for list-manipulation JS
    21052116        return;
    21062117    }
    21072118    $count = 0;
    21082119?>
     2120<table id="list-table">
    21092121    <thead>
    21102122    <tr>
    2111         <th><?php _e( 'Key' ) ?></th>
     2123        <th class="left"><?php _e( 'Name' ) ?></th>
    21122124        <th><?php _e( 'Value' ) ?></th>
    2113         <th colspan='2'><?php _e( 'Action' ) ?></th>
    21142125    </tr>
    21152126    </thead>
     
    21182129    foreach ( $meta as $entry )
    21192130        echo _list_meta_row( $entry, $count );
    2120     echo "\n\t</tbody>";
     2131?>
     2132    </tbody>
     2133</table>
     2134<?php
    21212135}
    21222136
     
    21622176
    21632177    $r .= "\n\t<tr id='meta-{$entry['meta_id']}' class='$style'>";
    2164     $r .= "\n\t\t<td valign='top'><label class='hidden' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' /></td>";
    2165     $r .= "\n\t\t<td><label class='hidden' for='meta[{$entry['meta_id']}][value]'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>";
    2166     $r .= "\n\t\t<td style='text-align: center;'><input name='updatemeta' type='submit' tabindex='6' value='".attribute_escape(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /><br />";
    2167     $r .= "\n\t\t<input name='deletemeta[{$entry['meta_id']}]' type='submit' ";
     2178    $r .= "\n\t\t<td class='left'><label class='hidden' for='meta[{$entry['meta_id']}][key]'>" . __( 'Key' ) . "</label><input name='meta[{$entry['meta_id']}][key]' id='meta[{$entry['meta_id']}][key]' tabindex='6' type='text' size='20' value='{$entry['meta_key']}' />";
     2179
     2180    $r .= "\n\t\t<div class='submit'><input name='deletemeta[{$entry['meta_id']}]' type='submit' ";
    21682181    $r .= "class='delete:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$delete_nonce deletemeta' tabindex='6' value='".attribute_escape(__( 'Delete' ))."' />";
     2182    $r .= "\n\t\t<input name='updatemeta' type='submit' tabindex='6' value='".attribute_escape(__( 'Update' ))."' class='add:the-list:meta-{$entry['meta_id']}::_ajax_nonce=$update_nonce updatemeta' /></div>";
    21692183    $r .= wp_nonce_field( 'change-meta', '_ajax_nonce', false, false );
    2170     $r .= "</td>\n\t</tr>";
     2184    $r .= "</td>";
     2185   
     2186    $r .= "\n\t\t<td><label class='hidden' for='meta[{$entry['meta_id']}][value]'>" . __( 'Value' ) . "</label><textarea name='meta[{$entry['meta_id']}][value]' id='meta[{$entry['meta_id']}][value]' tabindex='6' rows='2' cols='30'>{$entry['meta_value']}</textarea></td>\n\t</tr>";
    21712187    return $r;
    21722188}
     
    21912207?>
    21922208<p><strong><?php _e( 'Add a new custom field:' ) ?></strong></p>
    2193 <table id="newmeta" cellspacing="3" cellpadding="3">
    2194     <tr>
    2195 <th colspan="2"><label <?php if ( $keys ) : ?> for="metakeyselect" <?php else : ?> for="metakeyinput" <?php endif; ?>><?php _e( 'Key' ) ?></label></th>
     2209<table id="newmeta">
     2210<thead>
     2211<tr>
     2212<th class="left"><label for="metakeyselect"><?php _e( 'Name' ) ?></label></th>
    21962213<th><label for="metavalue"><?php _e( 'Value' ) ?></label></th>
    21972214</tr>
    2198     <tr valign="top">
    2199         <td style="width: 18%;" class="textright">
     2215</thead>
     2216
     2217<tbody>
     2218<tr>
     2219<td id="newmetaleft" class="left">
    22002220<?php if ( $keys ) : ?>
    22012221<select id="metakeyselect" name="metakeyselect" tabindex="7">
     
    22052225    foreach ( $keys as $key ) {
    22062226        $key = attribute_escape( $key );
    2207         echo "\n\t<option value='$key'>$key</option>";
     2227        echo "\n<option value='$key'>$key</option>";
    22082228    }
    22092229?>
    2210 </select> <label for="metakeyinput"><?php _e( 'or' ); ?></label>
     2230</select>
    22112231<?php endif; ?>
     2232<input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" />
     2233<a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;">
     2234<span id="enternew"><?php _e('Enter new'); ?></span>
     2235<span id="cancelnew" class="hidden"><?php _e('Cancel'); ?></span>
     2236</a>
    22122237</td>
    2213 <td><input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" /></td>
    2214         <td><textarea id="metavalue" name="metavalue" rows="3" cols="25" tabindex="8"></textarea></td>
    2215     </tr>
    2216 <tr class="submit"><td colspan="3">
    2217     <?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?>
    2218     <input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
     2238<td><textarea id="metavalue" name="metavalue" rows="2" cols="25" tabindex="8"></textarea></td>
     2239</tr>
     2240
     2241<tr><td colspan="2" class="submit">
     2242<input type="submit" id="addmetasub" name="addmeta" class="add:the-list:newmeta" tabindex="9" value="<?php _e( 'Add Custom Field' ) ?>" />
     2243<?php wp_nonce_field( 'add-meta', '_ajax_nonce', false ); ?>   
    22192244</td></tr>
     2245</tbody>
    22202246</table>
    22212247<?php
  • trunk/wp-admin/js/page.js

    r9491 r9564  
    106106        return false;
    107107    });
    108    
     108
     109    // Custom Fields
     110    jQuery('#the-list').wpList( { addAfter: function( xml, s ) {
     111        $('table#list-table').show();
     112        if ( jQuery.isFunction( autosave_update_post_ID ) ) {
     113            autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
     114        }
     115    }, addBefore: function( s ) {
     116        s.data += '&post_id=' + jQuery('#post_ID').val();
     117        return s;
     118    }
     119    });
     120
    109121    // preview
    110122    $('#post-preview').click(function(e){
  • trunk/wp-admin/js/post.js

    r9542 r9564  
    290290    // Custom Fields
    291291    jQuery('#the-list').wpList( { addAfter: function( xml, s ) {
     292        $('table#list-table').show();
    292293        if ( jQuery.isFunction( autosave_update_post_ID ) ) {
    293294            autosave_update_post_ID(s.parsed.responses[0].supplemental.postid);
  • trunk/wp-admin/wp-admin.css

    r9556 r9564  
    314314.button-primary,
    315315.button-secondary,
    316 .button-highlighted {
     316.button-highlighted,
     317#postcustomstuff .submit input {
    317318    font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
    318319    text-decoration: none;
     
    516517}
    517518
    518 .plugins p {
    519 }
    520 
    521519#login .fullwidth {
    522520    width: 320px;
     
    544542}
    545543
    546 #postcustomstuff .updatemeta, #postcustomstuff .deletemeta {
     544/* post meta postbox */
     545#postcustomstuff table,
     546#postcustomstuff input,
     547#postcustomstuff textarea {
     548    border-width: 1px;
     549    border-style: solid;
     550    -moz-border-radius: 3px;
     551    -khtml-border-radius: 3px;
     552    -webkit-border-radius: 3px;
     553    border-radius: 3px;
     554}
     555
     556#postcustomstuff .updatemeta,
     557#postcustomstuff .deletemeta {
    547558    margin: auto;
     559}
     560
     561#postcustomstuff thead th {
     562    padding: 5px 8px 8px;
     563}
     564
     565#postcustom #postcustomstuff .submit,
     566#pagecustomdiv #postcustomstuff .submit {
     567    border: 0 none;
     568    float: none;
     569    padding: 5px 8px;
     570}
     571
     572#side-sortables #postcustom #postcustomstuff .submit,
     573#side-sortables #pagecustomdiv #postcustomstuff .submit {
     574    padding: 0 5px;
     575}
     576
     577#side-sortables #postcustom #postcustomstuff td.left input,
     578#side-sortables #pagecustomdiv #postcustomstuff td.left input {
     579    margin: 3px 3px 0;
     580}
     581
     582#side-sortables #postcustom #postcustomstuff #the-list textarea,
     583#side-sortables #pagecustomdiv #postcustomstuff #the-list textarea {
     584    height: 85px;
     585    margin: 3px;
    548586}
    549587
     
    553591    border-width: 1px;
    554592    border-style: solid;
    555 }
    556 
    557 #postcustomstuff table input, #postcustomstuff table textarea {
     593    border-spacing: 0;
     594}
     595
     596#postcustomstuff table input,
     597#postcustomstuff table select,
     598#postcustomstuff table textarea {
    558599    width: 95%;
     600    margin: 8px 0 8px 8px;
     601}
     602
     603#postcustomstuff th.left,
     604#postcustomstuff td.left {
     605    width: 38%;
     606}
     607
     608#postcustomstuff .submit input {
     609    width: auto;
     610}
     611
     612#postcustomstuff #newmeta .submit {
     613    padding: 0 8px;
    559614}
    560615
    561616#postcustomstuff table #addmetasub {
    562617    width: auto;
     618}
     619
     620#postcustomstuff #newmetaleft {
     621    vertical-align: top;
     622}
     623
     624#postcustomstuff #newmetaleft a {
     625    padding: 0 10px;
     626    text-decoration: none;
    563627}
    564628
  • trunk/wp-includes/script-loader.php

    r9561 r9564  
    177177            'cancel' => __('Cancel'),
    178178        ) );
    179         $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081105' );
     179        $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'wp-lists', 'postbox', 'slug', 'settings-box'), '20081107' );
    180180        $scripts->localize( 'post', 'postL10n', array(
    181181            'tagsUsed' =>  __('Tags used on this post:'),
     
    196196            'saveDraft' => __('Save Draft')
    197197        ) );
    198         $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'postbox', 'settings-box'), '20081103' );
     198        $scripts->add( 'page', '/wp-admin/js/page.js', array('jquery', 'slug', 'wp-lists', 'postbox', 'settings-box'), '20081107' );
    199199        $scripts->localize( 'page', 'postL10n', array(
    200200            'cancel' => __('Cancel'),
Note: See TracChangeset for help on using the changeset viewer.