Make WordPress Core

Ticket #3191: 3191e.2.diff

File 3191e.2.diff, 13.4 KB (added by mdawaffe, 18 years ago)

This is sucking out my will to live

  • wp-admin/wp-admin.css

     
    186186        border-style: none;
    187187        padding: 0px;
    188188        margin-bottom: 16px;
    189         height: 16em;
     189        height: 17em;
    190190        width: 100%;
    191191/*      overflow-y: hidden;*/
    192192}
  • wp-admin/admin-functions.php

     
    19721972
    19731973?>
    19741974<form id="the-attachment-links">
    1975 <table>
     1975<table class="data">
     1976        <col />
     1977        <col class="data-col" />
    19761978        <tr>
    1977                 <th scope="row"><?php _e('Text linked to file') ?></th>
    1978                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid) ?></a></textarea></td>
     1979                <th scope="row"><?php _e('URL') ?></th>
     1980                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><?php echo $post->guid ?></textarea></td>
    19791981        </tr>
    1980         <tr>
    1981                 <th scope="row"><?php _e('Text linked to subpost') ?></th>
    1982                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $post->post_title ?></a></textarea></td>
    1983         </tr>
    19841982<?php if ( $icon ) : ?>
    19851983        <tr>
    19861984                <th scope="row"><?php _e('Thumbnail linked to file') ?></th>
    1987                 <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo $icon ?></a></textarea></td>
     1985                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid; ?>" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td>
    19881986        </tr>
    19891987        <tr>
    1990                 <th scope="row"><?php _e('Thumbnail linked to subpost') ?></th>
     1988                <th scope="row"><?php _e('Thumbnail linked to page') ?></th>
    19911989                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php echo $icon ?></a></textarea></td>
    19921990        </tr>
     1991<?php else : ?>
     1992        <tr>
     1993                <th scope="row"><?php _e('Link to file') ?></th>
     1994                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo $post->guid ?>" class="attachmentlink"><?php echo basename($post->guid);  ?></a></textarea></td>
     1995        </tr>
     1996        <tr>
     1997                <th scope="row"><?php _e('Link to page') ?></th>
     1998                <td><textarea rows="1" cols="40" type="text" class="attachmentlinks" readonly="readonly"><a href="<?php echo get_attachment_link($post->ID) ?>" rel="attachment" id="<?php echo $post->ID ?>"><?php the_title(); ?></a></textarea></td>
     1999        </tr>
    19932000<?php endif; ?>
    19942001</table>
    19952002</form>
  • wp-admin/upload-js.php

     
    8080                        h += "&nbsp;]</span>";
    8181                        h += '</div>'
    8282                        h += "<div id='upload-file-view' class='alignleft'>";
    83                         if ( this.currentImage.thumb )
    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>";
    85                         else
     83                        if ( this.currentImage.thumb ) {
     84                                h += "<a href='" + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>";
     85                                h += "<img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
     86                                h += "</a>";
     87                        } else
    8688                                h += '&nbsp;';
    8789                        h += "</div>";
    8890
    89                         h += "<form name='uploadoptions' id='uploadoptions' class='alignleft'>";
    90                         h += "<table>";
     91                        h += "<form name='uploadoptions' id='uploadoptions'>";
     92
     93                        h += "<table class='data'><col /><col class='data-col' />";
    9194                        if ( this.currentImage.thumb ) {
    9295                                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>";
     96                                h += "<label for='display-thumb'><input type='radio' name='display' id='display-thumb' value='thumb' checked='checked' /> <?php _e('thumbnail'); ?></label><br />";
     97                                h += "<label for='display-full'><input type='radio' name='display' id='display-full' value='full' /> <?php _e('full size'); ?></label>";
    9598                                h += "</td></tr>";
    9699                        }
    97100
    98101                        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 += "<label for='link-file'><input type='radio' name='link' id='link-file' value='file' checked='checked'/> <?php _e('file'); ?></label><br />";
     103                        h += "<label for='link-page'><input type='radio' name='link' id='link-page' value='page' /> <?php _e('page'); ?></label><br />";
     104                        h += "<label for='link-none'><input type='radio' name='link' id='link-none' value='none' /> <?php _e('none'); ?></label>";
    102105                        h += "</td></tr>";
    103106
    104                         h += "<tr><td colspan='2'>";
     107                        h += "<tr id='buttons'><th colspan='2'>";
    105108                        h += "<input type='button' class='button' name='send' onclick='theFileList.sendToEditor(" + id + ")' value='Send to editor &raquo;' />";
    106                         h += "</td></tr></table>";
     109                        h += "</th></tr></table>";
    107110                        h += "</form>";
    108111
    109112                        h += "</div>";
     
    140143                        h += "&nbsp;]</span>";
    141144                        h += '</div>'
    142145                        h += "<div id='upload-file-view' class='alignleft'>";
    143                         if ( this.currentImage.thumb )
    144                                 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>";
    145                         else
     146                        if ( this.currentImage.thumb ) {
     147                                h += "<a href='" + this.currentImage.src + "' onclick='return false;' title='Direct link to file'>";
     148                                h += "<img src='" + this.currentImage.thumb + "' alt='" + this.currentImage.title + "' width='" + this.currentImage.width + "' height='" + this.currentImage.height + "' />";
     149                                h += "</a>";
     150                        } else
    146151                                h += '&nbsp;';
    147152                        h += "</div>";
    148153
    149154
    150                         h += "<table><tr>"
    151                         h += "<th scope='row'><label for='post_title'>Title:</label></th>";
     155                        h += "<table class='data'><col /><col class='data-col' /><tr>"
     156                        h += "<th scope='row'><label for='url'>URL</label></th>";
     157                        h += "<td><input type='text' id='url' readonly='readonly' value='" + this.currentImage.src + "' /></td>";
     158                        h += "</tr><tr>";
     159                        h += "<th scope='row'><label for='post_title'>Title</label></th>";
    152160                        h += "<td><input type='text' id='post_title' name='post_title' value='" + this.currentImage.title + "' /></td>";
    153161                        h += "</tr><tr>";
    154                         h += "<th scope='row'><label for='post_content'>Description:</label></th>";
     162                        h += "<th scope='row'><label for='post_content'>Description</label></th>";
    155163                        h += "<td><textarea name='post_content' id='post_content'>" + this.currentImage.description + "</textarea></td>";
    156164                        h += "</tr><tr id='buttons'><th></th><td>";
    157165                        h += "<input type='hidden' name='from_tab' value='" + this.tab + "' />";
     
    159167                        h += "<input type='hidden' name='ID' value='" + id + "' />";
    160168                        h += "<input type='hidden' name='_wpnonce' value='" + this.nonce + "' />";
    161169                        h += "<div class='submit'><input type='submit' value='Save' />";
    162                         h += "<input type='button' name='delete' class='delete' value='Delete' onclick='theFileList.deleteFile(" + id + ");' />";
     170                        h += "<input type='button' name='delete' class='delete' value='Delete Image' onclick='theFileList.deleteFile(" + id + ");' />";
    163171                        h += "</div></td></tr></table></form>";
    164172
    165173                        new Insertion.Top('upload-content', h);
     
    223231                                win.tinyMCE.execCommand('mceInsertContent', false, h);
    224232                        else
    225233                                win.edInsertContent(win.edCanvas, h);
    226                         this.cancelView();
     234                        if ( !this.ID )
     235                                this.cancelView();
    227236                        return false;
    228237                },
    229238
  • wp-admin/upload-functions.php

     
    4545}
    4646
    4747function wp_upload_view() {
    48         global $style, $post_id;
     48        global $style, $post_id, $style;
    4949        $id = get_the_ID();
    5050        $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true );
    5151?>
     
    6868                </div>
    6969
    7070                <div id="upload-file-view" class="alignleft">
    71 <?php           if ( isset($attachment_data['width']) )
     71<?php           if ( isset($attachment_data['width']) && 'inline' != $style )
    7272                        echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
    7373                echo wp_upload_display( array(171, 128) );
    74                 if ( isset($attachment_data['width']) )
     74                if ( isset($attachment_data['width']) && 'inline' != $style )
    7575                        echo '</a>'; ?>
    7676                </div>
    7777                <?php the_attachment_links( $id ); ?>
    7878        </div>
    79 <?php
     79<?php           echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' )  . "' /></form>\n";
    8080}
    8181
    8282function wp_upload_form() {
     
    108108                </div>
    109109
    110110        <div id="upload-file-view" class="alignleft">
    111 <?php           if ( isset($attachment_data['width']) )
     111<?php           if ( isset($attachment_data['width']) && 'inline' != $style )
    112112                        echo "<a href='" . get_the_guid() . "' title='" . __('Direct link to file') . "'>";
    113113                echo wp_upload_display( array(171, 128) );
    114                 if ( isset($attachment_data['width']) )
     114                if ( isset($attachment_data['width']) && 'inline' != $style )
    115115                        echo '</a>'; ?>
    116116        </div>
    117117<?php   endif; ?>
    118                 <table>
    119 <?php   if ( !$id ): ?>
     118                <table<?php if ( 'upload' != $tab ) echo ' class="data alignleft"'; ?>>
     119                        <col />
     120                        <col class="data-col" />
     121<?php   if ( $id ): ?>
    120122                        <tr>
    121                                 <th scope="row"><label for="upload"><?php _e('File:'); ?></label></th>
     123                                <th scope="row"><label for="url"><?php _e('URL'); ?></label></th>
     124                                <td><input type="text" id="url" name="" value="<?php the_guid(); ?>" readonly="readonly" /></td>
     125                        </tr>
     126<?php   else : ?>
     127                        <tr>
     128                                <th scope="row"><label for="upload"><?php _e('File'); ?></label></th>
    122129                                <td><input type="file" id="upload" name="image" /></td>
    123130                        </tr>
    124131<?php   endif; ?>
    125132                        <tr>
    126                                 <th scope="row"><label for="post_title"><?php _e('Title:'); ?></label></th>
     133                                <th scope="row"><label for="post_title"><?php _e('Title'); ?></label></th>
    127134                                <td><input type="text" id="post_title" name="post_title" value="<?php echo $attachment->post_title; ?>" /></td>
    128135                        </tr>
    129136                        <tr>
    130                                 <th scope="row"><label for="post_content"><?php _e('Description:'); ?></label></th>
     137                                <th scope="row"><label for="post_content"><?php _e('Description'); ?></label></th>
    131138                                <td><textarea name="post_content" id="post_content"><?php echo $attachment->post_content; ?></textarea></td>
    132139                        </tr>
    133140                        <tr id="buttons">
     
    144151                                        <div class="submit">
    145152                                                <input type="submit" value="<?php $id ? _e('Save') : _e('Upload'); ?>" />
    146153<?php   if ( $id ) : ?>
    147                                                 <input type="submit" name="delete" class="delete" value="<?php _e('Delete'); ?>" />
     154                                                <input type="submit" name="delete" class="delete" value="<?php _e('Delete Image'); ?>" />
    148155<?php   endif; ?>
    149156                                        </div>
    150157                                </td>
     
    349356                echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
    350357        if ( 'inline' == @$_GET['style'] ) {
    351358                echo "<style type='text/css'>\n";
    352                 echo "\tbody { height: 14em; overflow: hidden; }\n";
     359                echo "\tbody { height: 15em; overflow: hidden; }\n";
    353360                echo "\t#upload-content { overflow-y: auto; }\n";
    354361                echo "\t#upload-file { position: absolute; }\n";
    355362                echo "</style>";
  • wp-admin/upload.css

     
    5959        background: #dfe8f1;
    6060}
    6161
     62#upload-file input#url { background-color: #e6e6e6; }
     63
     64textarea#gen-html {
     65        width: 100%;
     66        height: 100px;
     67}
     68
     69
    6270form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; }
    6371
    6472form#upload-file div.submit input { width: auto; }
     
    114122
    115123#upload-files a.file-link img { vertical-align: middle; }
    116124
    117 #the-attachment-links { float: right; }
    118 
    119 #the-attachment-links textarea {
     125#the-attachment-links textarea, textarea#gen-html {
    120126        font-size: 10px;
    121127        overflow: hidden;
    122128}
    123129
    124 form table { float: none; padding: 0 15px; }
     130table.data {
     131        float: left;
     132        width: 99%;
     133        margin: 0 0 0 -200px;
     134        padding: 0 0 0 200px;
     135}
    125136
    126 table {
    127         float: left;
     137table { padding-right: 15px; }
     138
     139th {
    128140        margin: 0;
    129         padding: 0;
     141        padding: 0 .5ex 0 15px;
     142        text-align: right;
     143        vertical-align: text-top;
    130144}
    131145
    132 th { text-align: right; vertical-align: text-top; }
     146tr#buttons th { text-align: left; }
    133147
    134 tr, td, th {
    135         margin-top: 0;
    136         padding-top: 0;
     148tr, td{
     149        margin: 0;
     150        padding: 0;
    137151}
     152
     153col.data-col { width: 100%; }