Inline uploader tweaks from mdawaffe. fixes #3360
git-svn-id: http://svn.automattic.com/wordpress/trunk@4466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
39dbda930c
commit
bc46166de6
|
@ -358,14 +358,15 @@ add_action( 'upload_files_browse-all', 'wp_upload_tab_browse_action' );
|
|||
|
||||
function wp_upload_admin_head() {
|
||||
global $wp_locale;
|
||||
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
|
||||
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload.css?version=' . get_bloginfo('version') . "a' type='text/css' />\n";
|
||||
if ( 'rtl' == $wp_locale->text_direction )
|
||||
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "' type='text/css' />\n";
|
||||
echo "<link rel='stylesheet' href='" . get_option('siteurl') . '/wp-admin/upload-rtl.css?version=' . get_bloginfo('version') . "a' type='text/css' />\n";
|
||||
if ( 'inline' == @$_GET['style'] ) {
|
||||
echo "<style type='text/css'>\n";
|
||||
echo "\tbody { height: 15em; overflow: hidden; }\n";
|
||||
echo "\t#upload-content { overflow-y: auto; }\n";
|
||||
echo "\t#upload-file { position: absolute; }\n";
|
||||
echo "<style type='text/css' media='screen'>\n";
|
||||
echo "\t#upload-menu { position: absolute; z-index: 2; }\n";
|
||||
echo "\tbody > #upload-menu { position: fixed; }\n";
|
||||
echo "\t#upload-content { top: 2em; }\n";
|
||||
echo "\t#upload-file { position: absolute; top: 15px; }\n";
|
||||
echo "</style>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ addLoadEvent( function() {
|
|||
params.action = '';
|
||||
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>";
|
||||
} else {
|
||||
h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>« Back</a>";
|
||||
h += "<a href='#' onclick='return theFileList.cancelView();' title='Browse your files' class='back'>« Back</a>";
|
||||
}
|
||||
h += "<div id='file-title'>"
|
||||
if ( !this.currentImage.isImage )
|
||||
|
@ -82,7 +82,7 @@ addLoadEvent( function() {
|
|||
else
|
||||
h += "<h2>" + this.currentImage.title + "</h2>";
|
||||
h += " — <span>";
|
||||
h += "<a href='#' onclick='theFileList.editView(" + id + ")'>Edit</a>"
|
||||
h += "<a href='#' onclick='return theFileList.editView(" + id + ");'>Edit</a>"
|
||||
h += "</span>";
|
||||
h += '</div>'
|
||||
h += "<div id='upload-file-view' class='alignleft'>";
|
||||
|
@ -136,7 +136,7 @@ addLoadEvent( function() {
|
|||
params.action = '';
|
||||
h += "<a href='" + this.urlData[0] + '?' + params.toQueryString() + "' title='Browse your files' class='back'>« Back</a>";
|
||||
} else {
|
||||
h += "<a href='#' onclick='theFileList.cancelView()' title='Browse your files' class='back'>« Back</a>";
|
||||
h += "<a href='#' onclick='return theFileList.cancelView();' title='Browse your files' class='back'>« Back</a>";
|
||||
}
|
||||
h += "<div id='file-title'>"
|
||||
if ( !this.currentImage.isImage )
|
||||
|
@ -144,7 +144,7 @@ addLoadEvent( function() {
|
|||
else
|
||||
h += "<h2>" + this.currentImage.title + "</h2>";
|
||||
h += " — <span>";
|
||||
h += "<a href='#' onclick='theFileList.imageView(" + id + ")'>Insert</a>"
|
||||
h += "<a href='#' onclick='return theFileList.imageView(" + id + ");'>Insert</a>"
|
||||
h += "</span>";
|
||||
h += '</div>'
|
||||
h += "<div id='upload-file-view' class='alignleft'>";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 "<ul id='upload-menu'>\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<li class='$class alignleft'><div><a href='$_href' title='{$tab_array[0]}'>{$tab_array[0]}</a>$page_links</div></li>\n";
|
||||
echo "\t<li class='$class'><a href='$_href' class='upload-tab-link' title='{$tab_array[0]}'>{$tab_array[0]}</a>$page_links</li>\n";
|
||||
}
|
||||
unset($t, $tab_array, $href, $_href, $page_links, $total, $per, $class);
|
||||
echo "</ul>\n\n";
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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' );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue