WordPress.org

Make WordPress Core

Changeset 18890


Ignore:
Timestamp:
10/05/11 21:07:04 (3 years ago)
Author:
nacin
Message:

UI touches for the single media button. see #17578.

Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin-rtl.dev.css

    r18802 r18890  
    697697} 
    698698 
    699 .postarea #add-media-button { 
    700     float: left; 
    701     right: auto; 
    702     left: 10px; 
    703 } 
    704  
    705699#edButtonPreview, 
    706700#edButtonHTML { 
     
    712706    margin-right: 0; 
    713707    margin-left: 15px; 
    714 } 
    715  
    716 .wp-media-buttons a { 
    717     padding: 0 10px 5px 0; 
    718708} 
    719709 
     
    15671557#dashboard_quick_press #media-buttons { 
    15681558    margin: 0 5em .5em 0; 
    1569     padding: 0 10px 0 0; 
    1570 } 
     1559    padding: 0; 
     1560} 
     1561 
    15711562#dashboard-widgets #dashboard_quick_press form p.submit { 
    15721563    margin-left: 0; 
  • trunk/wp-admin/css/wp-admin.dev.css

    r18881 r18890  
    28202820} 
    28212821 
    2822 .postarea #add-media-button { 
    2823     float: right; 
    2824     margin: 7px 0pt 0pt; 
    2825     position: relative; 
    2826     right: 10px; 
    2827 } 
    2828  
    2829 .wp-media-buttons { 
    2830     cursor: default; 
    2831     padding: 8px 8px 0; 
    2832 } 
    2833  
    2834 .wp-media-buttons a { 
    2835     cursor: pointer; 
    2836     padding: 0 0 5px 10px; 
    2837 } 
    2838  
    2839 .wp-media-buttons img { 
    2840     vertical-align: middle; 
    2841 } 
    2842  
    28432822#submitpost #ajax-loading, 
    28442823#submitpost .ajax-loading { 
     
    52925271} 
    52935272 
    5294 #media-buttons { 
     5273#dashboard_quick_press #media-buttons { 
    52955274    margin: 0 0 .5em 5em; 
    5296     padding: 0 0 0 10px; 
    5297     line-height: 17px; 
     5275    padding: 0; 
     5276} 
     5277 
     5278#dashboard_quick_press #media-buttons a { 
    52985279    color: #777; 
    5299     cursor: default; 
    5300 } 
    5301  
    5302 #media-buttons a { 
    5303     margin: 0 3px; 
    5304 } 
    5305  
    5306 #media-buttons a img { 
    5307     vertical-align: middle; 
    53085280} 
    53095281 
  • trunk/wp-admin/includes/media.php

    r18831 r18890  
    375375 */ 
    376376function media_buttons($editor_id = 'content') { 
    377     $out = _media_button(__('Add Media'), 'images/media-button-video.gif?ver=20100531', 'media', $editor_id); 
    378  
    379377    $context = apply_filters('media_buttons_context', __('Upload/Insert %s')); 
    380378 
    381     printf($context, $out); 
     379    $img = '<img src="' . esc_url( admin_url( 'images/media-button.png?ver=20111005' ) ) . '" width="15" height="15" />'; 
     380 
     381    echo '<a href="' . esc_url( get_upload_iframe_src() ) . '" class="thickbox add_media" id="$editor_id-add_media" title="' . esc_attr__( 'Add Media' ) . '" onclick="return false;">' . sprintf( $context, $img ) . '</a>'; 
    382382} 
    383383add_action( 'media_buttons', 'media_buttons' ); 
    384384 
    385385function _media_button($title, $icon, $type, $id) { 
    386     return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title='$title'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>"; 
    387 } 
    388  
    389 function get_upload_iframe_src($type) { 
     386    return "<a href='" . esc_url( get_upload_iframe_src($type) ) . "' id='{$id}-add_{$type}' class='thickbox add_$type' title='" . esc_attr( $title ) . "'><img src='" . esc_url( admin_url( $icon ) ) . "' alt='$title' onclick='return false;' /></a>"; 
     387} 
     388 
     389function get_upload_iframe_src( $type = null ) { 
    390390    global $post_ID; 
    391391 
     
    393393    $upload_iframe_src = add_query_arg( 'post_id', $uploading_iframe_ID, admin_url('media-upload.php') ); 
    394394 
    395     if ( 'media' != $type ) 
     395    if ( $type && 'media' != $type ) 
    396396        $upload_iframe_src = add_query_arg('type', $type, $upload_iframe_src); 
    397397 
     
    14571457<?php wp_nonce_field('media-form'); ?> 
    14581458 
    1459 <h3 class="media-title"><?php _e('Add media file from URL'); ?></h3> 
     1459<h3 class="media-title"><?php _e('Insert media from another website'); ?></h3> 
    14601460 
    14611461<script type="text/javascript"> 
     
    18911891 
    18921892    return ' 
    1893     <h4 class="media-sub-title">' . __('Insert media from another web site') . '</h4> 
    1894     <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Images' ) . '</label> &nbsp; &nbsp; <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Files' ) . '</label></p> 
     1893    <p class="media-types"><label><input type="radio" name="media_type" value="image" id="image-only"' . checked( 'image-only', $view, false ) . ' /> ' . __( 'Image' ) . '</label> &nbsp; &nbsp; <label><input type="radio" name="media_type" value="generic" id="not-image"' . checked( 'not-image', $view, false ) . ' /> ' . __( 'Audio, Video, or Other File' ) . '</label></p> 
    18951894    <table class="describe ' . $table_class . '"><tbody> 
    18961895        <tr> 
  • trunk/wp-includes/css/editor-buttons.dev.css

    r18865 r18890  
    10511051 
    10521052.wp-media-buttons { 
    1053     cursor: default; 
    1054     padding: 8px 8px 0; 
     1053    padding: .5em .5em 0; 
    10551054} 
    10561055 
    10571056.wp-media-buttons a { 
    10581057    cursor: pointer; 
    1059     padding: 0 0 5px 10px; 
     1058    text-decoration: none; 
     1059    color: #333; 
    10601060} 
    10611061 
    10621062.wp-media-buttons img { 
     1063    padding: 0 4px; 
    10631064    vertical-align: middle; 
    10641065} 
Note: See TracChangeset for help on using the changeset viewer.