Changeset 29136
- Timestamp:
- 07/13/2014 04:15:36 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/media.js
r28682 r29136 76 76 wp.media && wp.media({ 77 77 frame: 'manage', 78 container: $('#wpbody-content ')78 container: $('#wpbody-content > .wrap') 79 79 }).open(); 80 80 -
trunk/src/wp-admin/upload.php
r29079 r29136 25 25 wp_enqueue_script( 'media-grid' ); 26 26 wp_enqueue_script( 'media' ); 27 wp_localize_script( 'media-grid', 'mediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ) ) ); 27 wp_localize_script( 'media-grid', '_wpMediaGridSettings', array( 28 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ), 29 ) ); 28 30 29 31 add_screen_option( 'misc_screen_options', array( 'option' => 'manageuploadgridcolumnshidden', 'id' => 'grid' ) ); … … 33 35 add_screen_option( 'mime', array( 'label' => __( 'Mime-type' ) ) ); 34 36 37 get_current_screen()->add_help_tab( array( 38 'id' => 'overview', 39 'title' => __( 'Overview' ), 40 'content' => 41 '<p>' . __( 'All the files you’ve uploaded are listed in the Media Library, with the most recent uploads listed first. You can use the Screen Options tab to customize the display of this screen.' ) . '</p>' 42 ) ); 43 44 get_current_screen()->set_help_sidebar( 45 '<p><strong>' . __( 'For more information:' ) . '</strong></p>' . 46 '<p>' . __( '<a href="http://codex.wordpress.org/Media_Library_Screen" target="_blank">Documentation on Media Library</a>' ) . '</p>' . 47 '<p>' . __( '<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>' 48 ); 49 50 $title = __('Media Library'); 51 $parent_file = 'upload.php'; 52 35 53 require_once( ABSPATH . 'wp-admin/admin-header.php' ); 54 ?> 55 <div class="wrap"> 56 <h2> 57 <?php 58 echo esc_html( $title ); 59 if ( current_user_can( 'upload_files' ) ) { ?> 60 <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'file' ); ?></a><?php 61 } 62 ?> 63 </h2> 64 </div> 65 <?php 36 66 include( ABSPATH . 'wp-admin/admin-footer.php' ); 37 67 exit; -
trunk/src/wp-includes/css/media-views.css
r29131 r29136 2573 2573 * Media Grid 2574 2574 */ 2575 2576 .media-grid-view h1 { 2577 color: #222; 2578 font-size: 23px; 2579 font-weight: 400; 2580 margin: 10px 0 0; 2581 padding: 9px 15px 4px 22px; 2582 line-height: 29px; 2583 } 2584 2585 .media-grid-view .view-switch { 2586 display: inline-block; 2587 float: none; 2588 margin-top: 13px; 2589 vertical-align: middle; 2590 } 2591 2592 /** 2593 * Position both the frame and the uploader window into the content 2594 * area of the screen. 2595 */ 2596 .media-grid-view { 2597 z-index: 1; 2598 position: fixed; 2599 bottom: 0; 2600 left: 160px; 2601 right: 0; 2602 top: 32px; 2603 -webkit-transition: 200ms ease-in-out; 2604 transition: 200ms ease-in-out; 2605 } 2606 2607 .media-grid-view-options { 2608 top: 120px; 2609 } 2610 2611 @media screen and (max-width: 900px) { 2612 .auto-fold .media-grid-view { 2613 left: 36px; 2614 } 2615 } 2616 @media screen and (max-width: 782px) { 2617 .media-grid-view { 2618 top: 46px; 2619 } 2620 .auto-fold .media-grid-view { 2621 left: 0px; 2622 bottom: 0px; 2623 } 2575 .media-grid-view, 2576 .media-grid-view .media-frame-content, 2577 .media-grid-view .attachments-browser .attachments, 2578 .media-grid-view .uploader-inline-content { 2579 position: static; 2624 2580 } 2625 2581 2626 2582 /* Regions we don't use at all */ 2583 .media-grid-view .media-frame-title, 2627 2584 .media-grid-view .media-frame-toolbar, 2628 2585 .media-grid-view .media-frame-menu { 2629 2586 display: none; 2587 } 2588 2589 .media-grid-view .media-frame-content { 2590 background-color: transparent; 2591 border: none; 2592 } 2593 2594 .media-grid-view .uploader-inline { 2595 position: relative; 2596 top: auto; 2597 right: auto; 2598 left: auto; 2599 bottom: auto; 2600 padding-top: 0; 2601 margin-top: 0; 2630 2602 } 2631 2603 … … 2645 2617 display: inline-block; 2646 2618 font-size: 13px; 2619 margin: 20px 0; 2647 2620 padding: 0 20px; 2648 2621 position: relative; 2649 2622 width: 100%; 2623 height: auto; 2624 border: none; 2625 } 2626 2627 .media-grid-view input[type="search"] { 2628 margin: 1px; 2629 padding: 3px 5px; 2630 position: absolute; 2631 right: 10px; 2632 top: 9px; 2633 font-size: 16px; 2634 font-weight: 300; 2635 line-height: 1.5; 2636 width: 280px; 2637 } 2638 2639 .media-grid-view .view-switch { 2640 display: inline-block; 2641 float: none; 2642 vertical-align: middle; 2643 padding: 15px 0; 2644 margin: 0 20px 0 0; 2645 } 2646 2647 .media-grid-view select.attachment-filters { 2648 margin: 0 10px 0 0; 2649 } 2650 2651 .media-grid-view .spinner { 2652 margin-top: 15px; 2653 } 2654 2655 .media-grid-view .attachments-browser { 2656 padding: 0; 2657 } 2658 2659 .media-grid-view .attachments-browser .no-media { 2660 color: #999; 2661 font-size: 18px; 2662 font-style: normal; 2663 margin: 0; 2664 padding: 100px 0 0; 2665 text-align: center; 2650 2666 } 2651 2667 … … 2850 2866 } 2851 2867 2852 .media-grid-view.hide-router .media-frame-title { 2853 -webkit-box-shadow: none; 2854 box-shadow: none; 2855 } 2856 2857 .media-grid-view .media-frame-content { 2858 background-color: transparent; 2859 bottom: 40px; 2860 } 2861 @media screen and (max-width: 782px) { 2862 .media-grid-view .media-frame-content { 2863 border-bottom: none; 2864 bottom: 0; 2865 } 2866 } 2867 2868 @media only screen and (max-width: 640px), screen and (max-height: 400px) { 2869 .media-grid-view .media-frame-title { 2870 display: block; 2871 width: auto; 2872 bottom: auto; 2873 right: 0; 2874 top: 0; 2875 height: 60px; 2876 } 2877 } 2868 @media only screen and (max-width: 1120px) { 2869 .media-grid-view .media-toolbar-primary, 2870 .media-grid-view .media-toolbar-secondary { 2871 float: none; 2872 } 2873 2874 .media-grid-view input[type="search"] { 2875 margin: 20px 0; 2876 position: static; 2877 width: 100%; 2878 max-width: none !important; 2879 } 2880 } 2881 -
trunk/src/wp-includes/js/media-grid.js
r29104 r29136 1 /* global _wpMediaViewsL10n, MediaElementPlayer, mediaGridSettings*/1 /* global _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ 2 2 (function($, _, Backbone, wp) { 3 3 var media = wp.media, l10n; … … 92 92 var self = this; 93 93 _.defaults( this.options, { 94 title: l10n.mediaLibraryTitle,94 title: '', 95 95 modal: false, 96 96 selection: [], … … 170 170 if ( window.history && window.history.pushState ) { 171 171 Backbone.history.start({ 172 root: mediaGridSettings.adminUrl,172 root: _wpMediaGridSettings.adminUrl, 173 173 pushState: true 174 174 }); … … 210 210 }); 211 211 212 libraryState._renderTitle = function( view ) {213 var text = this.get('title') || '';214 view.$el.addClass( 'wrap' );215 text += '<a class="add-new-h2">Add New</a>';216 view.$el.html( text );217 };218 212 // Add the default states. 219 213 this.states.add([ … … 230 224 }, 231 225 232 addNewClickHandler: function() { 226 addNewClickHandler: function( event ) { 227 event.preventDefault(); 233 228 this.trigger( 'toggle:upload:attachment' ); 234 229 }, … … 447 442 this.on( 'close', this.detach ); 448 443 449 // Only need a tab to Edit Image for images. 450 if ( 'undefined' !== typeof this.model && this.model.get( 'type' ) === 'image' ) { 444 451 445 this.on( 'router:create', this.createRouter, this ); 452 446 this.on( 'router:render', this.browseRouter, this ); 453 }454 447 455 448 this.options.hasPrevious = this.hasPrevious(); … … 560 553 view.set({ 561 554 'edit-metadata': { 562 text: 'Edit Metadata',555 text: l10n.editMetadata, 563 556 priority: 20 564 }, 557 } 558 }); 559 560 // Only need a tab to Edit Image for images. 561 if ( 'undefined' !== typeof this.model && this.model.get( 'type' ) === 'image' ) { 562 view.set({ 565 563 'edit-image': { 566 text: 'Edit Image',564 text: l10n.editImage, 567 565 priority: 40 568 566 } 569 567 }); 568 } 570 569 }, 571 570 -
trunk/src/wp-includes/js/media-views.js
r29105 r29136 5773 5773 5774 5774 this.attachmentsNoResults = new media.View({ 5775 controller: this.controller 5775 controller: this.controller, 5776 tagName: 'p' 5776 5777 }); 5777 5778 5778 5779 this.attachmentsNoResults.$el.addClass( 'hidden no-media' ); 5779 this.attachmentsNoResults.$el.html( 'No media found.');5780 this.attachmentsNoResults.$el.html( l10n.noMedia ); 5780 5781 5781 5782 this.views.add( this.attachmentsNoResults ); -
trunk/src/wp-includes/media.php
r29106 r29136 2971 2971 'addToVideoPlaylist' => __( 'Add to video playlist' ), 2972 2972 'addToVideoPlaylistTitle' => __( 'Add to Video Playlist' ), 2973 2974 // Media Library 2975 'editMetadata' => __( 'Edit Metadata' ), 2976 'noMedia' => __( 'No media found. Try a different search.' ), 2973 2977 ); 2974 2978
Note: See TracChangeset
for help on using the changeset viewer.