Ticket #28753: 28753.patch
| File 28753.patch, 11.4 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/css/forms.css
759 759 margin: -3px 3px; 760 760 } 761 761 762 /*------------------------------------------------------------------------------ 763 21.0 - Upload File 764 ------------------------------------------------------------------------------*/ 765 766 .wp-upload-container { 767 -webkit-box-sizing: border-box; 768 -moz-box-sizing: border-box; 769 box-sizing: border-box; 770 margin: 0px 0 0; 771 padding: 0; 772 width: 100%; 773 overflow: hidden; 774 position: relative; 775 top: 10px; 776 } 777 778 .wp-upload-container-toggle { 779 display: none; 780 } 781 782 .wp-upload-container .wp-upload-form { 783 background: #fafafa; 784 border: 1px solid #e5e5e5; 785 padding: 30px; 786 margin: 30px auto; 787 max-width: 380px; 788 } 789 790 .wp-upload-container .install-help { 791 color: #999; 792 font-size: 18px; 793 font-style: normal; 794 margin: 0; 795 padding: 40px 0 0; 796 text-align: center; 797 } 798 799 body.show-upload-container .hide-on-upload, 800 body.show-upload-container .wp-upload-show { 801 display: none; 802 } 803 804 body.show-upload-container .wp-upload-container-toggle { 805 display: block; 806 } 807 808 .wp-upload-hide { 809 display: none; 810 } 811 812 body.show-upload-container .wp-upload-hide { 813 display: inline; 814 } 815 762 816 /* =Media Queries 763 817 -------------------------------------------------------------- */ 764 818 819 @media only screen and (max-width: 1120px) { 820 .wp-upload-container .wp-upload-form { 821 margin: 20px 0; 822 max-width: 100%; 823 } 824 825 .wp-upload-container .install-help { 826 font-size: 15px; 827 padding: 20px 0 0; 828 text-align: left; 829 } 830 831 } 832 765 833 @media screen and ( max-width: 782px ) { 766 834 /* Input Elements */ 767 835 textarea { -
src/wp-admin/css/themes.css
1071 1071 display: none !important; 1072 1072 } 1073 1073 1074 .theme-install-php a.upload,1075 .theme-install-php a.browse-themes {1076 cursor: pointer;1077 }1078 .theme-install-php a.browse-themes,1079 .theme-install-php.show-upload-theme a.upload {1080 display: none;1081 }1082 .theme-install-php.show-upload-theme a.browse-themes {1083 display: inline;1084 }1085 .upload-theme {1086 -webkit-box-sizing: border-box;1087 -moz-box-sizing: border-box;1088 box-sizing: border-box;1089 display: none;1090 margin: 0;1091 padding: 0;1092 width: 100%;1093 overflow: hidden;1094 position: relative;1095 top: 10px;1096 }1097 body.show-upload-theme .upload-theme {1098 display: block;1099 }1100 .upload-theme .wp-upload-form {1101 background: #fafafa;1102 border: 1px solid #e5e5e5;1103 padding: 30px;1104 margin: 30px auto;1105 max-width: 380px;1106 }1107 .upload-theme .install-help {1108 color: #999;1109 font-size: 18px;1110 font-style: normal;1111 margin: 0;1112 padding: 40px 0 0;1113 text-align: center;1114 }1115 body.show-upload-theme .upload-theme + .wp-filter,1116 body.show-upload-theme .upload-theme + .wp-filter + .theme-browser {1117 display: none;1118 }1119 1120 1074 p.no-themes { 1121 1075 color: #999; 1122 1076 font-size: 18px; … … 1129 1083 body.no-results p.no-themes { 1130 1084 display: block; 1131 1085 } 1132 body.show-upload- themep.no-themes {1086 body.show-upload-container p.no-themes { 1133 1087 display: none !important; 1134 1088 } 1135 1089 … … 1137 1091 display: none !important; 1138 1092 } 1139 1093 1140 @media only screen and (max-width: 1120px) {1141 .upload-theme .wp-upload-form {1142 margin: 20px 0;1143 max-width: 100%;1144 }1145 .upload-theme .install-help {1146 font-size: 15px;1147 padding: 20px 0 0;1148 text-align: left;1149 }1150 }1151 1152 1094 .rating { 1153 1095 margin: 30px 0; 1154 1096 } -
src/wp-admin/includes/class-wp-plugin-install-list-table.php
215 215 $views = apply_filters( "views_{$this->screen->id}", $views ); 216 216 217 217 ?> 218 <div class="wp-filter ">218 <div class="wp-filter hide-on-upload"> 219 219 <ul class="wp-filter-links"> 220 220 <?php 221 221 if ( ! empty( $views ) ) { -
src/wp-admin/includes/plugin-install.php
196 196 */ 197 197 function install_plugins_upload( $page = 1 ) { 198 198 ?> 199 <h4><?php _e('Install a plugin in .zip format'); ?></h4> 200 <p class="install-help"><?php _e('If you have a plugin in a .zip format, you may install it by uploading it here.'); ?></p> 201 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-plugin'); ?>"> 202 <?php wp_nonce_field( 'plugin-upload'); ?> 203 <label class="screen-reader-text" for="pluginzip"><?php _e('Plugin zip file'); ?></label> 204 <input type="file" id="pluginzip" name="pluginzip" /> 205 <?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?> 206 </form> 199 <div class="wp-upload-container"> 200 <p class="install-help"><?php _e( 'If you have a plugin in a .zip format, you may install it by uploading it here.' ); ?></p> 201 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-plugin' ); ?>"> 202 <?php wp_nonce_field( 'plugin-upload' ); ?> 203 <label class="screen-reader-text" for="pluginzip"><?php _e( 'Plugin zip file' ); ?></label> 204 <input type="file" id="pluginzip" name="pluginzip" /> 205 <?php submit_button( __( 'Install Now' ), 'button', 'install-plugin-submit', false ); ?> 206 </form> 207 </div> 207 208 <?php 208 209 } 209 210 add_action('install_plugins_upload', 'install_plugins_upload', 10, 1); -
src/wp-admin/includes/theme-install.php
136 136 137 137 function install_themes_upload() { 138 138 ?> 139 <p class="install-help"><?php _e('If you have a theme in a .zip format, you may install it by uploading it here.'); ?></p> 140 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url('update.php?action=upload-theme'); ?>"> 141 <?php wp_nonce_field( 'theme-upload'); ?> 142 <input type="file" name="themezip" /> 143 <?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?> 144 </form> 145 <?php 139 <div class="wp-upload-container wp-upload-container-toggle"> 140 <p class="install-help"><?php _e( 'If you have a theme in a .zip format, you may install it by uploading it here.' ); ?></p> 141 <form method="post" enctype="multipart/form-data" class="wp-upload-form" action="<?php echo self_admin_url( 'update.php?action=upload-theme' ); ?>"> 142 <?php wp_nonce_field( 'theme-upload' ); ?> 143 <input type="file" name="themezip" /> 144 <?php submit_button( __( 'Install Now' ), 'button', 'install-theme-submit', false ); ?> 145 </form> 146 </div> 147 <?php 146 148 } 147 149 // add_action('install_themes_upload', 'install_themes_upload', 10, 0); 148 150 -
src/wp-admin/js/theme.js
1497 1497 searchContainer: $( '.wp-filter' ), 1498 1498 1499 1499 uploader: function() { 1500 $( ' a.upload' ).on( 'click', function( event ) {1500 $( '.wp-upload-show' ).on( 'click', function( event ) { 1501 1501 event.preventDefault(); 1502 $( 'body' ).addClass( 'show-upload- theme' );1502 $( 'body' ).addClass( 'show-upload-container' ); 1503 1503 themes.router.navigate( themes.router.baseUrl( '?upload' ), { replace: true } ); 1504 1504 }); 1505 $( ' a.browse-themes' ).on( 'click', function( event ) {1505 $( '.wp-upload-hide' ).on( 'click', function( event ) { 1506 1506 event.preventDefault(); 1507 $( 'body' ).removeClass( 'show-upload- theme' );1507 $( 'body' ).removeClass( 'show-upload-container' ); 1508 1508 themes.router.navigate( themes.router.baseUrl( '' ), { replace: true } ); 1509 1509 }); 1510 1510 }, … … 1642 1642 1643 1643 // Support the `upload` route by going straight to upload section 1644 1644 themes.router.on( 'route:upload', function() { 1645 $( ' a.upload' ).trigger( 'click' );1645 $( '.wp-upload-show' ).trigger( 'click' ); 1646 1646 }); 1647 1647 1648 1648 // The `search` route event. The router populates the input field. -
src/wp-admin/plugin-install.php
67 67 '<p>' . __('<a href="https://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>' 68 68 ); 69 69 70 function _wp_add_upload_container_class( $classes ) { 71 global $tab; 72 73 $class = ( 'upload' === $tab ) ? ' show-upload-container' : ' hide-upload-container'; 74 75 return $classes . $class; 76 } 77 78 add_filter( 'admin_body_class', '_wp_add_upload_container_class' ); 79 70 80 /** 71 81 * WordPress Administration Template Header. 72 82 */ … … 75 85 <div class="wrap"> 76 86 <h2> 77 87 <?php 78 echo esc_html( $title ); 79 $href = self_admin_url( 'plugin-install.php?tab=upload' ); 88 echo esc_html( $title ); 89 90 if ( 'upload' === $tab ) { 91 ?> 92 <a href="<?php echo esc_url( self_admin_url( 'plugin-install.php' ) ); ?>" class="browse-plugins add-new-h2"><?php _ex( 'Browse', 'plugins' ); ?></a> 93 <?php 94 } else { 95 ?> 96 <a href="<?php echo esc_url( self_admin_url( 'plugin-install.php?tab=upload' ) ); ?>" class="upload add-new-h2"><?php _e( 'Upload Plugin' ); ?></a> 97 <?php 98 } 80 99 ?> 81 <a href="<?php echo $href; ?>" class="upload add-new-h2"><?php _e( 'Upload Plugin' ); ?></a>82 100 </h2> 83 101 84 102 <?php $wp_list_table->views(); ?> 85 103 86 <br class="clear" />87 104 <?php 88 105 /** 89 106 * Fires after the plugins list table in each tab of the Install Plugins screen. -
src/wp-admin/theme-install.php
118 118 <?php 119 119 /** 120 120 * Filter the tabs shown on the Install Themes screen. 121 * 121 * 122 122 * @since 2.8.0 123 123 * @param array $tabs The tabs shown on the Install Themes screen. Defaults are 124 124 * 'upload' and 'browse-themes'. 125 125 */ 126 126 $tabs = apply_filters( 'install_themes_tabs', $tabs ); 127 127 foreach ( $tabs as $tab_slug => $tab_name ) { 128 echo '<a href="#" class="' . esc_attr( $tab_slug ) . ' add-new-h2">' . $tab_name . '</a>'; 128 $visibility = ''; 129 if ( 'upload' === $tab_slug ) { 130 $visibility = ' wp-upload-show'; 131 } else if ( 'browse-themes' === $tab_slug ) { 132 $visibility = ' wp-upload-hide'; 133 } 134 135 echo '<a href="#" class="' . esc_attr( $tab_slug ) . $visibility . ' add-new-h2">' . $tab_name . '</a>'; 129 136 } 130 137 ?> 131 138 </h2> 132 139 133 <div class="upload-theme">134 140 <?php install_themes_upload(); ?> 135 </div>136 141 137 <div class="wp-filter ">142 <div class="wp-filter hide-on-upload"> 138 143 <div class="wp-filter-count"> 139 144 <span class="count theme-count"></span> 140 145 </div> … … 179 184 </div> 180 185 </div> 181 186 </div> 182 <div class="theme-browser wp-filter-content"></div>183 <div class="theme-install-overlay wp-full-overlay expanded"></div>184 187 185 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 186 <span class="spinner"></span> 188 <div class="hide-on-upload"> 189 <div class="theme-browser wp-filter-content"></div> 190 <div class="theme-install-overlay wp-full-overlay expanded"></div> 187 191 192 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 193 <span class="spinner"></span> 194 </div> 195 188 196 <br class="clear" /> 189 197 <?php 190 198 /**