From 66f5d2c2da41d4268b70afe95e0bcde1ed6ff5cd Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 4 Oct 2006 06:37:42 +0000 Subject: [PATCH] Uploader improvements from mdawaffe. fixes #3191 git-svn-id: http://svn.automattic.com/wordpress/trunk@4312 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload-functions.php | 42 ++++++++++++++++++------- wp-admin/upload-js.php | 58 +++++++++++++++++++---------------- wp-admin/upload-rtl.css | 20 +++--------- wp-admin/upload.css | 51 +++++++----------------------- wp-admin/upload.php | 4 +-- 5 files changed, 80 insertions(+), 95 deletions(-) diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index f1ce454b1..bd60fa678 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -47,13 +47,19 @@ function wp_upload_display( $dims = false, $href = '' ) { function wp_upload_view() { global $style, $post_id; $id = get_the_ID(); + $attachment_data = get_post_meta( $id, '_wp_attachment_metadata', true ); ?>
-

+

"; + the_title(); + if ( !isset($attachment_data['width']) ) + echo ''; + ?>

' . __('page link') . ''; + echo '' . __('view') . ''; echo ' | '; echo '' . __('edit') . ''; echo ' | '; @@ -61,8 +67,12 @@ function wp_upload_view() { echo ' ]'; ?>
-
- +
+"; + echo wp_upload_display( array(171, 128) ); + if ( isset($attachment_data['width']) ) + echo ''; ?>
@@ -78,21 +88,31 @@ function wp_upload_form() {
-

+

"; + the_title(); + if ( !isset($attachment_data['width']) ) + echo ''; + ?>

' . __('page link') . ''; + echo '' . __('view') . ''; echo ' | '; - echo '' . __('options') . ''; + echo '' . __('options') . ''; echo ' | '; echo '' . __('cancel') . ''; echo ' ]'; ?>
-
- +
+"; + echo wp_upload_display( array(171, 128) ); + if ( isset($attachment_data['width']) ) + echo ''; ?>
@@ -121,7 +141,7 @@ function wp_upload_form() { -
+
@@ -293,7 +313,7 @@ function wp_upload_tab_browse() { echo "\t
  • \n"; + echo "' class='alignleft'>\n"; echo wp_upload_display( array(128,128), $href ); echo "\t
  • \n"; endwhile; diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index 01c00556f..2293423a9 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -62,11 +62,12 @@ addLoadEvent( function() { h += "
    " h += "
    " - h += "

    " + this.currentImage.title + "

    "; - h += "[ "; - h += "page link" - h += ' | '; - h += "edit" + if ( !this.currentImage.thumb ) + h += "

    " + this.currentImage.title + "

    "; + else + h += "

    " + this.currentImage.title + "

    "; + h += "[ "; + h += "edit" h += ' | '; if ( this.ID ) { var params = $H(this.params); @@ -78,29 +79,31 @@ addLoadEvent( function() { } h += " ]"; h += '
    ' - h += "
    "; + h += "
    "; if ( this.currentImage.thumb ) - h += "" + this.currentImage.title + ""; + h += "" + this.currentImage.title + ""; else h += ' '; h += "
    "; - h += "
    "; + h += ""; + h += "
    "; if ( this.currentImage.thumb ) { - h += "Display thumbnail
    "; - h += "Display full-sized image

    "; + h += ""; } - if ( this.currentImage.thumb ) { - h += "Do not link to this file
    "; - h += "Link directly to this file
    "; - h += "Link to this file's blog page
    "; - } else { - h += "Link directly to this file
    "; - h += "Link to this file's blog page
    "; - } + h += ""; - h += ""; + h += "
    Show"; + h += "
    "; + h += ""; + h += "
    Link"; + h += "
    "; + h += "
    "; + h += ""; + h += "
    "; + h += ""; + h += "
    "; h += ""; h += "
    "; @@ -116,11 +119,12 @@ addLoadEvent( function() { h += "
    "; h += "
    " - h += "

    " + this.currentImage.title + "

    "; - h += "[ "; - h += "page link" - h += ' | '; - h += "options" + if ( !this.currentImage.thumb ) + h += "

    " + this.currentImage.title + "

    "; + else + h += "

    " + this.currentImage.title + "

    "; + h += "[ "; + h += "options" h += ' | '; if ( this.ID ) { var params = $H(this.params); @@ -132,9 +136,9 @@ addLoadEvent( function() { } h += " ]"; h += '
    ' - h += "
    "; + h += "
    "; if ( this.currentImage.thumb ) - h += "" + this.currentImage.title + ""; + h += "" + this.currentImage.title + ""; else h += ' '; h += "
    "; @@ -151,7 +155,7 @@ addLoadEvent( function() { h += ""; h += ""; h += ""; - h += "
    "; + h += "
    "; h += ""; h += "
    "; diff --git a/wp-admin/upload-rtl.css b/wp-admin/upload-rtl.css index 92d4d4770..20b75978f 100644 --- a/wp-admin/upload-rtl.css +++ b/wp-admin/upload-rtl.css @@ -7,24 +7,14 @@ body { font: 13px Tahoma, "Lucida Grande", "Lucida Sans Unicode", Verdana; } border-left: 2px solid #448abd; } -#file-title { margin: 0 15px 0 0; } +#upload-file-view { 0 15px 0 0 } + +#file-title { margin: 0 15px .2em 0; } h2 { margin: 0 0 0 .2em; } #upload-files li { margin: 0 15px 15px 0; } -th { text-align: right; } +table { float: right; } -.left, table { float: right; } - -.right, #the-attachment-links { float: left; } - -#submit input, #submit input:focus { - border-left: 0; - border-right-color: #ccc; -} - -#submit input:active { - border-left: 0; - border-right-color: #999; -} +#the-attachment-links { float: left; } diff --git a/wp-admin/upload.css b/wp-admin/upload.css index 217571b3a..f1f59b65f 100644 --- a/wp-admin/upload.css +++ b/wp-admin/upload.css @@ -59,10 +59,14 @@ body { background: #dfe8f1; } background: #dfe8f1; } -#upload-file-view { padding: 0 15px; } +form#upload-file input, form#upload-file textarea, div#upload-content.upload table { width: 100%; } + +form#upload-file div.submit input { width: auto; } + +#upload-file-view { padding: 0 0 0 15px; } #file-title { - margin: 0 0 0 15px; + margin: 0 0 .2em 15px; padding: 0; display: block; } @@ -72,6 +76,7 @@ h2 { padding: 0; display: inline; border: none; + color: #000; font-weight: bold; font-size: 1.4em; line-height: 1.4em; @@ -105,9 +110,7 @@ h2 { letter-spacing: 0; } -#upload-files a.file-link img { - vertical-align: middle; -} +#upload-files a.file-link img { vertical-align: middle; } #the-attachment-links { float: right; } @@ -116,49 +119,17 @@ h2 { overflow: hidden; } -form table { float: none; } +form table { float: none; padding: 0 15px; } table { float: left; margin: 0; - padding: 0 15px; + padding: 0; } -.left { float: left; } - -.right { float: right; } - -.center { text-align: center; } - -th { text-align: left; } +th { vertical-align: text-top; } tr, td, th { margin-top: 0; padding-top: 0; } - -#submit { - margin: 1px; - width: 99%; -} - -#submit input, #submit input:focus { - background: url( images/fade-butt.png ); - border: 3px double #999; - border-left-color: #ccc; - border-top-color: #ccc; - color: #333; - padding: 0.25em; -} - -#submit input:active { - background: #f4f4f4; - border: 3px double #ccc; - border-left-color: #999; - border-top-color: #999; -} - -#submit input.delete:hover { - background: #ce0000; - color: #fff; -} diff --git a/wp-admin/upload.php b/wp-admin/upload.php index d30110960..d266e7728 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -84,12 +84,12 @@ foreach ( $wp_upload_tabs as $t => $tab_array ) { // We've already done the curr } } - echo "\t
  • {$tab_array[0]}$page_links
  • \n"; + echo "\t
  • {$tab_array[0]}$page_links
  • \n"; } unset($t, $tab_array, $href, $_href, $page_links, $total, $per, $class); echo "\n\n"; -echo "
    \n"; +echo "
    \n"; call_user_func( $wp_upload_tabs[$tab][2] );