Ticket #28850: 28850.3.patch
File 28850.3.patch, 10.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/js/media.js
75 75 // Open up a manage media frame into the grid. 76 76 wp.media && wp.media({ 77 77 frame: 'manage', 78 container: $(' #wpbody-content')78 container: $('.wrap') 79 79 }).open(); 80 80 81 81 $( '#find-posts-submit' ).click( function( event ) { -
src/wp-admin/upload.php
24 24 wp_enqueue_media(); 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' ) ); 30 32 add_screen_option( 'title', array( 'label' => __( 'Name' ) ) ); … … 32 34 add_screen_option( 'dateFormatted', array( 'label' => __( 'Date' ) ) ); 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; 38 68 } -
src/wp-includes/css/media-views.css
2572 2572 /** 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; 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; 2583 2580 } 2584 2581 2585 .media-grid-view .view-switch { 2586 display: inline-block; 2587 float: none; 2588 margin-top: 13px; 2589 vertical-align: middle;2582 /* Regions we don't use at all */ 2583 .media-grid-view .media-frame-title, 2584 .media-grid-view .media-frame-toolbar, 2585 .media-grid-view .media-frame-menu { 2586 display: none; 2590 2587 } 2591 2588 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; 2589 .media-grid-view .media-frame-content { 2590 background-color: transparent; 2591 border: none; 2605 2592 } 2606 2593 2607 .media-grid-view-options { 2608 top: 120px; 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; 2609 2602 } 2610 2603 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 }2624 }2625 2626 /* Regions we don't use at all */2627 .media-grid-view .media-frame-toolbar,2628 .media-grid-view .media-frame-menu {2629 display: none;2630 }2631 2632 2604 /** 2633 2605 * Copied styles from the Add theme toolbar. 2634 2606 * … … 2644 2616 color: #555; 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; 2650 2625 } 2651 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; 2666 } 2667 2652 2668 /** 2653 2669 * The left and right buttons are copied from the expanded theme details modal. 2654 2670 * … … 2849 2865 margin-top: 3px; 2850 2866 } 2851 2867 2852 .media-grid-view.hide-router .media-frame-title { 2853 -webkit-box-shadow: none; 2854 box-shadow: none; 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; 2855 2872 } 2856 2873 2857 .media-grid-view .media-frame-content { 2858 background-color: transparent; 2859 bottom: 40px; 2874 .media-grid-view input[type="search"] { 2875 margin: 20px 0; 2876 position: static; 2877 width: 100%; 2878 max-width: none; 2860 2879 } 2861 @media screen and (max-width: 782px) {2862 .media-grid-view .media-frame-content {2863 border-bottom: none;2864 bottom: 0;2865 2880 } 2866 }2867 2881 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; 2882 @media only screen and (max-width: 960px) { 2883 .media-grid-view .media-frame-content .media-toolbar-primary .search { 2884 max-width: none; 2876 2885 } 2877 2886 } -
src/wp-includes/js/media-grid.js
1 /* global _wpMediaViewsL10n, MediaElementPlayer, mediaGridSettings*/1 /* global _wpMediaViewsL10n, MediaElementPlayer, _wpMediaGridSettings */ 2 2 (function($, _, Backbone, wp) { 3 3 var media = wp.media, l10n; 4 4 … … 91 91 initialize: function() { 92 92 var self = this; 93 93 _.defaults( this.options, { 94 title: l10n.mediaLibraryTitle,94 title: '', 95 95 modal: false, 96 96 selection: [], 97 97 library: {}, … … 169 169 // Verify pushState support and activate 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 }); 175 175 } … … 209 209 filterable: 'mime-types' 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([ 220 214 libraryState … … 229 223 this.on( 'edit:attachment', this.editAttachment, this ); 230 224 }, 231 225 232 addNewClickHandler: function() { 226 addNewClickHandler: function( event ) { 227 event.preventDefault(); 233 228 this.trigger( 'toggle:upload:attachment' ); 234 229 }, 235 230 … … 446 441 this.on( 'content:render:edit-image', this.editImageContentUgh, this ); 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(); 456 449 this.options.hasNext = this.hasNext(); … … 559 552 browseRouter: function( view ) { 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 572 571 resetContent: function() { … … 693 692 } 694 693 }); 695 694 696 }(jQuery, _, Backbone, wp)); 697 No newline at end of file 695 }(jQuery, _, Backbone, wp)); -
src/wp-includes/js/media-views.js
5772 5772 this.views.add( this.attachments ); 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 ); 5782 5783 -
src/wp-includes/media.php
2970 2970 'updateVideoPlaylist' => __( 'Update video playlist' ), 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 2975 2979 /** … … 3245 3249 if ( ! empty( $post_id ) ) { 3246 3250 return (int) $post_id; 3247 3251 } 3248 } 3249 No newline at end of file 3252 }