Make WordPress Core

Ticket #3191: 3191c.diff

File 3191c.diff, 13.3 KB (added by mdawaffe, 18 years ago)

CSS and layout improvements

  • wp-admin/upload-js.php

     
    6262
    6363                        h += "<div id='upload-file'>"
    6464                        h += "<div id='file-title'>"
    65                         h += "<h2><a href='" + this.currentImage.src + "' title='Direct Link to this file'>" + this.currentImage.title + "</a></h2>";
    66                         h += "<span>[&nbsp";
    67                         h += "<a href='" + this.currentImage.page + "' title='Permalink to the blog page for this file'>page link</a>"
     65                        if ( !this.currentImage.thumb )
     66                                h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
     67                        else
     68                                h += "<h2>" + this.currentImage.title + "</h2>";
     69                        h += "<span>[&nbsp;";
     70                        h += "<a href='#' onclick='theFileList.editView(" + id + ")'>edit</a>"
    6871                        h += '&nbsp;|&nbsp;';
    69                         h += "<a href='#' onclick='theFileList.editView(" + id + ")'  title='Edit this file'>edit</a>"
    70                         h += '&nbsp;|&nbsp;';
    7172                        if ( this.ID ) {
    7273                                var params = $H(this.params);
    7374                                params.ID = '';
     
    7879                        }
    7980                        h += "&nbsp;]</span>";
    8081                        h += '</div>'
    81                         h += "<div id='upload-file-view' class='left'>";
     82                        h += "<div id='upload-file-view' class='alignleft'>";
    8283                        if ( this.currentImage.thumb )
    83                                 h += "<img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
     84                                h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>";
    8485                        else
    8586                                h += '&nbsp;';
    8687                        h += "</div>";
    8788
    88                         h += "<form name='uploadoptions' id='uploadoptions' class='left'>";
     89                        h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
     90                        h += "<table>";
    8991                        if ( this.currentImage.thumb ) {
    90                                 h += "<input type='radio' name='display' value='thumb' checked='checked'>Display thumbnail</input><br />";
    91                                 h += "<input type='radio' name='display' value='full'>Display full-sized image</input><br /><br />";
     92                                h += "<tr><th style='padding-bottom:.5em'>Show</th><td style='padding-bottom:.5em'>";
     93                                h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> thumbnail</label><br />";
     94                                h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> full size</label>";
     95                                h += "</td></tr>";
    9296                        }
    9397
    94                         if ( this.currentImage.thumb ) {
    95                                 h += "<input type='radio' name='link' value='none' checked='checked'>Do not link to this file</input><br />";
    96                                 h += "<input type='radio' name='link' value='file'>Link directly to this file</input><br />";
    97                                 h += "<input type='radio' name='link' value='page'>Link to this file's blog page</input><br />";
    98                         } else {
    99                                 h += "<input type='radio' name='link' value='file'>Link directly to this file</input><br />";
    100                                 h += "<input type='radio' name='link' value='page' checked='checked'>Link to this file's blog page</input><br />";
    101                         }
     98                        h += "<tr><th>Link</th><td>";
     99                        h += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> file</label><br />";
     100                        h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> page</label><br />";
     101                        h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> none</label>";
     102                        h += "</td></tr>";
    102103
    103                         h += "<input type='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='Send to editor' />";
     104                        h += "<tr><td colspan='2'>";
     105                        h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='Send to editor &raquo;' />";
     106                        h += "</td></tr></table>";
    104107                        h += "</form>";
    105108
    106109                        h += "</div>";
     
    116119
    117120                        h += "<form id='upload-file' method='post' action='upload.php?style=inline&amp;tab=upload&amp;post_id=" + this.postID + "'>";
    118121                        h += "<div id='file-title'>"
    119                         h += "<h2><a href='" + this.currentImage.src + "' title='Direct Link to this file'>" + this.currentImage.title + "</a></h2>";
    120                         h += "<span>[&nbsp";
    121                         h += "<a href='" + this.currentImage.page + "' title='Permalink to the blog page for this file'>page link</a>"
     122                        if ( !this.currentImage.thumb )
     123                                h += "<h2><a href='" + this.currentImage.src + "' title='Direct link to file'>" + this.currentImage.title + "</a></h2>";
     124                        else
     125                                h += "<h2>" + this.currentImage.title + "</h2>";
     126                        h += "<span>[&nbsp;";
     127                        h += "<a href='#' onclick='theFileList.imageView(" + id + ")'>options</a>"
    122128                        h += '&nbsp;|&nbsp;';
    123                         h += "<a href='#' onclick='theFileList.imageView(" + id + ")'  title='View options for this file'>options</a>"
    124                         h += '&nbsp;|&nbsp;';
    125129                        if ( this.ID ) {
    126130                                var params = $H(this.params);
    127131                                params.ID = '';
     
    132136                        }
    133137                        h += "&nbsp;]</span>";
    134138                        h += '</div>'
    135                         h += "<div id='upload-file-view' class='left'>";
     139                        h += "<div id='upload-file-view' class='alignleft'>";
    136140                        if ( this.currentImage.thumb )
    137                                 h += "<img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
     141                                h += "<a href='" + this.currentImage.src + "' title='Direct link to file'><img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' /></a>";
    138142                        else
    139143                                h += '&nbsp;';
    140144                        h += "</div>";
     
    151155                        h += "<input type='hidden' name='action' id='action-value' value='save' />";
    152156                        h += "<input type='hidden' name='ID' value='" + id + "' />";
    153157                        h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
    154                         h += "<div id='submit'><input type='submit' value='Save' />";
     158                        h += "<div class='submit'><input type='submit' value='Save' />";
    155159                        h += "<input type='button' name='delete' class='delete' value='Delete' onclick='theFileList.deleteFile(" + id + ");' />";
    156160                        h += "</div></td></tr></table></form>";
    157161
  • wp-admin/upload.php

     
    8484                }
    8585        }
    8686
    87         echo "\t<li class='$class left'><div><a href='$_href' title='{$tab_array[0]}'>{$tab_array[0]}</a>$page_links</div></li>\n";
     87        echo "\t<li class='$class alignleft'><div><a href='$_href' title='{$tab_array[0]}'>{$tab_array[0]}</a>$page_links</div></li>\n";
    8888}
    8989unset($t, $tab_array, $href, $_href, $page_links, $total, $per, $class);
    9090echo "</ul>\n\n";
    9191
    92 echo "<div id='upload-content'>\n";
     92echo "<div id='upload-content' class='$tab'>\n";
    9393
    9494call_user_func( $wp_upload_tabs[$tab][2] );
    9595
  • wp-admin/upload-rtl.css

     
    77        border-left: 2px solid #448abd;
    88}
    99
    10 #file-title { margin: 0 15px 0 0; }
     10#upload-file-view { 0 15px 0 0 }
    1111
     12#file-title { margin: 0 15px .2em 0; }
     13
    1214h2 { margin: 0 0 0 .2em; }
    1315
    1416#upload-files li { margin: 0 15px 15px 0; }
    1517
    16 th { text-align: right; }
     18table { float: right; }
    1719
    18 .left, table { float: right; }
    19 
    20 .right, #the-attachment-links { float: left; }
    21 
    22 #submit input, #submit input:focus {
    23         border-left: 0;
    24         border-right-color: #ccc;
    25 }
    26 
    27 #submit input:active {
    28         border-left: 0;
    29         border-right-color: #999;
    30 }
     20#the-attachment-links { float: left; }
  • wp-admin/upload-functions.php

     
    4747function wp_upload_view() {
    4848        global $style, $post_id;
    4949        $id = get_the_ID();
     50        $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
    5051?>
    5152        <div id="upload-file">
    5253                <div id="file-title">
    53                         <h2><a href="<?php the_guid(); ?>" title="Direct link to this file"><?php the_title(); ?></a></h2>
     54                        <h2><?php if ( !isset($attachment_data['width']) )
     55                                        echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
     56                                the_title();
     57                                if ( !isset($attachment_data['width']) )
     58                                        echo '</a>';
     59                        ?></h2>
    5460                        <span><?php
    5561                                echo '[&nbsp;';
    56                                 echo '<a href="' . get_permalink() . '" title="' . ('Permalink to the blog page for this file') . '">' . __('page link') . '</a>';
     62                                echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
    5763                                echo '&nbsp;|&nbsp;';
    5864                                        echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'edit' ), 1 ) . '" title="' . __('Edit this file') . '">' . __('edit') . '</a>';
    5965                                echo '&nbsp;|&nbsp;';
     
    6167                                echo '&nbsp;]'; ?></span>
    6268                </div>
    6369
    64                 <div id="upload-file-view" class="left">
    65 <?php   echo wp_upload_display( array(171, 128)  ); ?>
     70                <div id="upload-file-view" class="alignleft">
     71<?php           if ( isset($attachment_data['width']) )
     72                        echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
     73                echo wp_upload_display( array(171, 128) );
     74                if ( isset($attachment_data['width']) )
     75                        echo '</a>'; ?>
    6676                </div>
    6777                <?php the_attachment_links( $id ); ?>
    6878        </div>
     
    7888<?php
    7989        if ( $id ) :
    8090                $attachment = get_post_to_edit( $id );
     91                $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
    8192?>
    8293                <div id="file-title">
    83                         <h2><a href="<?php the_guid(); ?>" title="Direct link to this file"><?php the_title(); ?></a></h2>
     94                        <h2><?php if ( !isset($attachment_data['width']) )
     95                                        echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
     96                                the_title();
     97                                if ( !isset($attachment_data['width']) )
     98                                        echo '</a>';
     99                        ?></h2>
    84100                        <span><?php
    85101                                echo '[&nbsp;';
    86                                 echo '<a href="' . get_permalink() . '" title="' . ('Permalink to the blog page for this file') . '">' . __('page link') . '</a>';
     102                                echo '<a href="' . get_permalink() . '">' . __('view') . '</a>';
    87103                                echo '&nbsp;|&nbsp;';
    88                                         echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '" title="' . __('View options for this file') . '">' . __('options') . '</a>';
     104                                        echo '<a href="' . wp_specialchars( add_query_arg( 'action', 'view' ), 1 ) . '">' . __('options') . '</a>';
    89105                                echo '&nbsp;|&nbsp;';
    90106                                echo '<a href="' . wp_specialchars( remove_query_arg( array('action','ID') ), 1 ) . '" title="' . __('Browse your files') . '">' . __('cancel') . '</a>';
    91107                                echo '&nbsp;]'; ?></span>
    92108                </div>
    93109
    94         <div id="upload-file-view" class="left">
    95 <?php           echo wp_upload_display( array(171, 128) ); ?>
     110        <div id="upload-file-view" class="alignleft">
     111<?php           if ( isset($attachment_data['width']) )
     112                        echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
     113                echo wp_upload_display( array(171, 128) );
     114                if ( isset($attachment_data['width']) )
     115                        echo '</a>'; ?>
    96116        </div>
    97117<?php   endif; ?>
    98118                <table>
     
    121141                                        <input type="hidden" name="ID" value="<?php echo $id; ?>" />
    122142<?php   endif; ?>
    123143                                        <?php wp_nonce_field( 'inlineuploading' ); ?>
    124                                         <div id="submit">
     144                                        <div class="submit">
    125145                                                <input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?>" />
    126146<?php   if ( $id ) : ?>
    127147                                                <input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" />
     
    293313
    294314                        echo "\t<li id='file-";
    295315                        the_ID();
    296                         echo "' class='left'>\n";
     316                        echo "' class='alignleft'>\n";
    297317                        echo wp_upload_display( array(128,128), $href );
    298318                        echo "\t</li>\n";
    299319                endwhile;
  • wp-admin/upload.css

     
    5959        background: #dfe8f1;
    6060}
    6161
    62 #upload-file-view { padding: 0 15px; }
     62form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; }
    6363
     64form#upload-file div.submit input { width: auto; }
     65
     66#upload-file-view { padding: 0 0 0 15px; }
     67
    6468#file-title {
    65         margin: 0 0 0 15px;
     69        margin: 0 0 .2em 15px;
    6670        padding: 0;
    6771        display: block;
    6872}
     
    7276        padding: 0;
    7377        display: inline;
    7478        border: none;
     79        color: #000;
    7580        font-weight: bold;
    7681        font-size: 1.4em;
    7782        line-height: 1.4em;
     
    105110        letter-spacing: 0;
    106111}
    107112
    108 #upload-files a.file-link img {
    109         vertical-align: middle;
    110 }
     113#upload-files a.file-link img { vertical-align: middle; }
    111114
    112115#the-attachment-links { float: right; }
    113116
     
    116119        overflow: hidden;
    117120}
    118121
    119 form table { float: none; }
     122form table { float: none; padding: 0 15px; }
    120123
    121124table {
    122125        float: left;
    123126        margin: 0;
    124         padding: 0 15px;
     127        padding: 0;
    125128}
    126129
    127 .left { float: left; }
     130th { vertical-align: text-top; }
    128131
    129 .right { float: right; }
    130 
    131 .center { text-align: center; }
    132 
    133 th { text-align: left; }
    134 
    135132tr, td, th {
    136133        margin-top: 0;
    137134        padding-top: 0;
    138135}
    139 
    140 #submit {
    141         margin: 1px;
    142         width: 99%;
    143 }
    144 
    145 #submit input, #submit input:focus {
    146         background: url( images/fade-butt.png );
    147         border: 3px double #999;
    148         border-left-color: #ccc;
    149         border-top-color: #ccc;
    150         color: #333;
    151         padding: 0.25em;
    152 }
    153 
    154 #submit input:active {
    155         background: #f4f4f4;
    156         border: 3px double #ccc;
    157         border-left-color: #999;
    158         border-top-color: #999;
    159 }
    160 
    161 #submit input.delete:hover {
    162         background: #ce0000;
    163         color: #fff;
    164 }