From bc46166de67b6eac580875c9464a272bea414cd5 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 14 Nov 2006 23:18:20 +0000 Subject: [PATCH] Inline uploader tweaks from mdawaffe. fixes #3360 git-svn-id: http://svn.automattic.com/wordpress/trunk@4466 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/upload-functions.php | 13 +++++----- wp-admin/upload-js.php | 8 +++--- wp-admin/upload-rtl.css | 14 ++++++++-- wp-admin/upload.css | 49 +++++++++++++++++++++++------------ wp-admin/upload.php | 6 ++--- wp-admin/wp-admin.css | 3 +-- wp-includes/script-loader.php | 2 +- 7 files changed, 60 insertions(+), 35 deletions(-) diff --git a/wp-admin/upload-functions.php b/wp-admin/upload-functions.php index 82392ba3ca..3900c6e677 100644 --- a/wp-admin/upload-functions.php +++ b/wp-admin/upload-functions.php @@ -358,14 +358,15 @@ add_action( 'upload_files_browse-all', 'wp_upload_tab_browse_action' ); function wp_upload_admin_head() { global $wp_locale; - echo "\n"; + echo "\n"; if ( 'rtl' == $wp_locale->text_direction ) - echo "\n"; + echo "\n"; if ( 'inline' == @$_GET['style'] ) { - echo ""; } } diff --git a/wp-admin/upload-js.php b/wp-admin/upload-js.php index a4f2eccbaf..25748eb1ec 100644 --- a/wp-admin/upload-js.php +++ b/wp-admin/upload-js.php @@ -74,7 +74,7 @@ addLoadEvent( function() { params.action = ''; h += "« Back"; } else { - h += "« Back"; + h += "« Back"; } h += "
" if ( !this.currentImage.isImage ) @@ -82,7 +82,7 @@ addLoadEvent( function() { else h += "

" + this.currentImage.title + "

"; h += " — "; - h += "Edit" + h += "Edit" h += ""; h += '
' h += "
"; @@ -136,7 +136,7 @@ addLoadEvent( function() { params.action = ''; h += "« Back"; } else { - h += "« Back"; + h += "« Back"; } h += "
" if ( !this.currentImage.isImage ) @@ -144,7 +144,7 @@ addLoadEvent( function() { else h += "

" + this.currentImage.title + "

"; h += " — "; - h += "Insert" + h += "Insert" h += ""; h += '
' h += "
"; diff --git a/wp-admin/upload-rtl.css b/wp-admin/upload-rtl.css index a085c869ed..cf1a7c251f 100644 --- a/wp-admin/upload-rtl.css +++ b/wp-admin/upload-rtl.css @@ -1,5 +1,16 @@ +#upload-menu li a.upload-tab-link { + float: right; + margin: 0 .75em 0 0; +} + table { float: right; } +#upload-menu li #current-tab-nav { + float: right; + padding: 5px 0 0 5px; + margin-right: -5px; +} + #upload-file th, #the-attachment-links textarea { text-align: left; } h2 { margin: 0 0 0 .2em; } @@ -9,12 +20,11 @@ h2 { margin: 0 0 0 .2em; } #upload-file-view { padding: 0 75px 0 0; } #upload-menu li { - margin: 0 .75em 0 0; display: block; float: right; } -#upload-menu .current div { +#upload-menu li.current { border-right: 0; border-left: 2px solid #448abd; } diff --git a/wp-admin/upload.css b/wp-admin/upload.css index 601f7e70e5..a74ec1897c 100644 --- a/wp-admin/upload.css +++ b/wp-admin/upload.css @@ -3,45 +3,60 @@ body { background: #f9fcfe; } .upload-file-data { display: none; } #upload-menu { - background: #247fab; - margin: 0px; + border-top: 2em solid #247fab; + margin: 0; padding: 0; + height: 0; list-style: none; - height: 2em; - border-bottom: 1px solid #448abd; width: 100%; } -#upload-menu li { margin: 0 0 0 .75em; } +body > #upload-menu { border-bottom: 7px solid #fff; } -#upload-menu li div { - padding: 5px; +#upload-menu li { + margin: 0; + position: relative; + top: -2em; + padding-bottom: 5px; + border: none; border-top: 3px solid #247fab; } -#upload-menu li a { +#upload-menu li a.upload-tab-link { + margin-left: 0.75em; + padding: 5px 5px 0; + display: block; + float: left; + height: 100%; text-decoration: none; border-bottom: none; color: #fff; } -#upload-menu li span a.page-numbers { color: #00019b; } - -#upload-menu .current div { - background: #f9fcfe; +#upload-menu li.current { border-right: 2px solid #448abd; color: #000; } -#upload-menu .current div a, #upload-menu div:hover a { - color: #000; -} - -#upload-menu div:hover { +#upload-menu li.current a.upload-tab-link, #upload-menu li a:hover { background: #f9fcfe; color: #000; } +#upload-menu li #current-tab-nav { + float: left; + padding: 5px 5px 0 0; + margin-left: -5px; +} + +#upload-menu li span .page-numbers { + padding: 0; + border: none; +} + +#upload-menu li span a.page-numbers { color: #00019b; } +#upload-menu li span a.page-numbers:hover { text-decoration: underline; } + #upload-content { position: relative; clear: both; diff --git a/wp-admin/upload.php b/wp-admin/upload.php index a992570506..53d1e56b29 100644 --- a/wp-admin/upload.php +++ b/wp-admin/upload.php @@ -35,7 +35,7 @@ if ( $pid ) { $wp_upload_tabs = array_merge($wp_upload_tabs, apply_filters( 'wp_upload_tabs', array() )); -if ( !function_exists($wp_upload_tabs[$tab][2]) ) { +if ( !is_callable($wp_upload_tabs[$tab][2]) ) { $to_tab = isset($wp_upload_tabs['upload']) ? 'upload' : 'browse-all'; wp_redirect( add_query_arg( 'tab', $to_tab ) ); exit; @@ -76,12 +76,12 @@ endif; echo "
    \n"; foreach ( $wp_upload_tabs as $t => $tab_array ) { // We've already done the current_user_can check - $class = 'upload-tab'; $href = add_query_arg( array('tab' => $t, 'ID' => '', 'action' => '', 'paged' => '') ); if ( isset($tab_array[4]) && is_array($tab_array[4]) ) add_query_arg( $tab_array[4], $href ); $_href = wp_specialchars( $href, 1 ); $page_links = ''; + $class = 'upload-tab alignleft'; if ( $tab == $t ) { $class .= ' current'; if ( $tab_array[3] ) { @@ -105,7 +105,7 @@ 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"; diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index a460923d86..803bc6e7b5 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -206,9 +206,8 @@ textarea, input, select { border-style: none; padding: 0px; margin-bottom: 16px; - height: 17em; + height: 18em; width: 100%; -/* overflow-y: hidden;*/ } form#upload th { diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 22c26af870..c7afd2d1a7 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -29,7 +29,7 @@ class WP_Scripts { $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3847' ); $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '3684' ); $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' ); - $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '4461' ); + $this->add( 'upload', '/wp-admin/upload-js.php', array('prototype'), '4466' ); } }