Restyles the modal for attaching media to posts, props avryl, see #26952
git-svn-id: https://develop.svn.wordpress.org/trunk@27401 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d87cac2093
commit
ce69c629ff
@ -233,41 +233,39 @@
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
.find-box {
|
||||
background-color: #fff;
|
||||
width: 600px;
|
||||
height: 300px;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
padding: 33px 0 51px;
|
||||
position: absolute;
|
||||
z-index: 1000;
|
||||
background-color: #444;
|
||||
margin-left: -300px;
|
||||
position: fixed;
|
||||
top: 30px;
|
||||
left: 50%;
|
||||
z-index: 160000;
|
||||
}
|
||||
|
||||
.find-box-head {
|
||||
cursor: move;
|
||||
color: #eee;
|
||||
background: #fcfcfc;
|
||||
border-bottom: 1px solid #dfdfdf;
|
||||
height: 40px;
|
||||
font-size: 22px;
|
||||
font-weight: 600;
|
||||
height: 2em;
|
||||
line-height: 2em;
|
||||
padding: 1px 12px;
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
width: 100%;
|
||||
line-height: 40px;
|
||||
padding: 0 40px 0 16px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.find-box-inside {
|
||||
overflow: auto;
|
||||
padding: 6px;
|
||||
height: 100%;
|
||||
padding: 16px;
|
||||
background-color: #fff;
|
||||
max-height: 300px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.find-box-search,
|
||||
.find-box-buttons {
|
||||
overflow: hidden;
|
||||
padding: 8px;
|
||||
position: relative;
|
||||
background-color: #f7f7f7;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
.find-box-search {
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.find-box-search .spinner {
|
||||
@ -277,29 +275,49 @@
|
||||
top: 9px;
|
||||
}
|
||||
|
||||
#find-posts-input {
|
||||
float: left;
|
||||
width: 140px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
#find-posts-input,
|
||||
#find-posts-search {
|
||||
float: left;
|
||||
margin: 1px 4px 0 3px;
|
||||
}
|
||||
|
||||
#find-posts-response {
|
||||
margin: 8px 0;
|
||||
padding: 0 1px 6px;
|
||||
#find-posts-input {
|
||||
width: 140px;
|
||||
height: 28px;
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
|
||||
#find-posts-response table {
|
||||
width: 100%;
|
||||
.found-radio {
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
#find-posts-response .found-radio {
|
||||
padding: 3px 0 0 8px;
|
||||
width: 15px;
|
||||
#find-posts-close {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#find-posts-close:hover {
|
||||
color: #2ea2cc;
|
||||
}
|
||||
|
||||
#find-posts-close:before {
|
||||
font: normal 20px/40px 'dashicons';
|
||||
vertical-align: top;
|
||||
speak: none;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
content: '\f158';
|
||||
}
|
||||
|
||||
.find-box-buttons {
|
||||
padding: 6px 16px;
|
||||
background: #fcfcfc;
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
.find-box #resize-se {
|
||||
@ -309,12 +327,14 @@
|
||||
}
|
||||
|
||||
.ui-find-overlay {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #000;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: #000;
|
||||
opacity: 0.7;
|
||||
z-index: 159900;
|
||||
}
|
||||
|
||||
ul#dismissed-updates {
|
||||
|
@ -1431,8 +1431,10 @@ function wp_ajax_find_posts() {
|
||||
wp_die( __('No items found.') );
|
||||
|
||||
$html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th class="no-break">'.__('Type').'</th><th class="no-break">'.__('Date').'</th><th class="no-break">'.__('Status').'</th></tr></thead><tbody>';
|
||||
$alt = '';
|
||||
foreach ( $posts as $post ) {
|
||||
$title = trim( $post->post_title ) ? $post->post_title : __( '(no title)' );
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
|
||||
switch ( $post->post_status ) {
|
||||
case 'publish' :
|
||||
@ -1457,7 +1459,7 @@ function wp_ajax_find_posts() {
|
||||
$time = mysql2date(__('Y/m/d'), $post->post_date);
|
||||
}
|
||||
|
||||
$html .= '<tr class="found-posts"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
|
||||
$html .= '<tr class="' . trim( 'found-posts ' . $alt ) . '"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
|
||||
$html .= '<td><label for="found-'.$post->ID.'">' . esc_html( $title ) . '</label></td><td class="no-break">' . esc_html( $post_types[$post->post_type]->labels->singular_name ) . '</td><td class="no-break">'.esc_html( $time ) . '</td><td class="no-break">' . esc_html( $stat ). ' </td></tr>' . "\n\n";
|
||||
}
|
||||
|
||||
|
@ -1376,26 +1376,29 @@ function settings_errors( $setting = '', $sanitize = false, $hide_on_update = fa
|
||||
*/
|
||||
function find_posts_div($found_action = '') {
|
||||
?>
|
||||
<div id="find-posts" class="find-box" style="display:none;">
|
||||
<div id="find-posts-head" class="find-box-head"><?php _e('Find Posts or Pages'); ?></div>
|
||||
<div id="find-posts" class="find-box" style="display: none;">
|
||||
<div id="find-posts-head" class="find-box-head">
|
||||
<?php _e( 'Find Posts or Pages' ); ?>
|
||||
<div id="find-posts-close"></div>
|
||||
</div>
|
||||
<div class="find-box-inside">
|
||||
<div class="find-box-search">
|
||||
<?php if ( $found_action ) { ?>
|
||||
<input type="hidden" name="found_action" value="<?php echo esc_attr($found_action); ?>" />
|
||||
<?php } ?>
|
||||
|
||||
<input type="hidden" name="affected" id="affected" value="" />
|
||||
<?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
|
||||
<label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
|
||||
<input type="text" id="find-posts-input" name="ps" value="" />
|
||||
<span class="spinner"></span>
|
||||
<input type="button" id="find-posts-search" value="<?php esc_attr_e( 'Search' ); ?>" class="button" />
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div id="find-posts-response"></div>
|
||||
</div>
|
||||
<div class="find-box-buttons">
|
||||
<input id="find-posts-close" type="button" class="button alignleft" value="<?php esc_attr_e('Close'); ?>" />
|
||||
<?php submit_button( __( 'Select' ), 'button-primary alignright', 'find-posts-submit', false ); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
@ -19,7 +19,11 @@ var findPosts;
|
||||
}
|
||||
$('#find-posts').show().draggable({
|
||||
handle: '#find-posts-head'
|
||||
}).css({'top':st + 50 + 'px','left':'50%','marginLeft':'-328px'});
|
||||
});
|
||||
|
||||
$('.find-box-inside').css({
|
||||
'max-height': $( window ).height() - ( ( 30 + 40 + 1 + 16 ) * 2 ) + 'px'
|
||||
});
|
||||
|
||||
$('#find-posts-input').focus().keyup(function(e){
|
||||
if (e.which == 27) { findPosts.close(); } // close on Escape
|
||||
@ -38,9 +42,7 @@ var findPosts;
|
||||
},
|
||||
|
||||
overlay : function() {
|
||||
$( '.ui-find-overlay' ).css(
|
||||
{ 'z-index': '999', 'width': $( document ).width() + 'px', 'height': $( document ).height() + 'px' }
|
||||
).on('click', function () {
|
||||
$( '.ui-find-overlay' ).on( 'click', function () {
|
||||
findPosts.close();
|
||||
});
|
||||
},
|
||||
@ -120,6 +122,8 @@ var findPosts;
|
||||
});
|
||||
});
|
||||
$(window).resize(function() {
|
||||
findPosts.overlay();
|
||||
$('.find-box-inside').css({
|
||||
'max-height': $( window ).height() - ( ( 30 + 40 + 1 + 16 ) * 2 ) + 'px'
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
|
@ -145,6 +145,8 @@ wp_enqueue_script( 'wp-ajax-response' );
|
||||
wp_enqueue_script( 'jquery-ui-draggable' );
|
||||
wp_enqueue_script( 'media' );
|
||||
|
||||
add_action( 'admin_print_footer_scripts', 'find_posts_div' );
|
||||
|
||||
add_screen_option( 'per_page', array('label' => _x( 'Media items', 'items per page (screen options)' )) );
|
||||
|
||||
get_current_screen()->add_help_tab( array(
|
||||
@ -238,12 +240,10 @@ if ( !empty($message) ) { ?>
|
||||
|
||||
<?php $wp_list_table->display(); ?>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
<?php find_posts_div(); ?>
|
||||
<br class="clear" />
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<?php
|
||||
include( ABSPATH . 'wp-admin/admin-footer.php' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user