Ticket #28753: upload.diff
| File upload.diff, 9.1 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/css/forms.css
751 751 margin: -3px 3px; 752 752 } 753 753 754 /*------------------------------------------------------------------------------ 755 21.0 - Upload File 756 ------------------------------------------------------------------------------*/ 757 758 .wp-upload-container { 759 -webkit-box-sizing: border-box; 760 -moz-box-sizing: border-box; 761 box-sizing: border-box; 762 margin: 0px 0 0; 763 padding: 0; 764 width: 100%; 765 overflow: hidden; 766 position: relative; 767 top: 10px; 768 } 769 770 .wp-upload-container-toggle { 771 display: none; 772 } 773 774 .wp-upload-container .wp-upload-form { 775 background: #fafafa; 776 border: 1px solid #e5e5e5; 777 padding: 30px; 778 margin: 30px auto; 779 max-width: 380px; 780 } 781 782 .wp-upload-container .install-help { 783 color: #999; 784 font-size: 18px; 785 font-style: normal; 786 margin: 0; 787 padding: 40px 0 0; 788 text-align: center; 789 } 790 791 body.show-upload-container .hide-on-upload, 792 body.show-upload-container .wp-upload-show { 793 display: none; 794 } 795 796 body.show-upload-container .wp-upload-container-toggle { 797 display: block; 798 } 799 800 .wp-upload-hide { 801 display: none; 802 } 803 804 body.show-upload-container .wp-upload-hide { 805 display: inline; 806 } 807 754 808 /* =Media Queries 755 809 -------------------------------------------------------------- */ 756 810 811 @media only screen and (max-width: 1120px) { 812 .wp-upload-container .wp-upload-form { 813 margin: 20px 0; 814 max-width: 100%; 815 } 816 817 .wp-upload-container .install-help { 818 font-size: 15px; 819 padding: 20px 0 0; 820 text-align: left; 821 } 822 823 } 824 757 825 @media screen and ( max-width: 782px ) { 758 826 /* Input Elements */ 759 827 textarea { -
src/wp-admin/css/themes.css
1068 1068 display: none !important; 1069 1069 } 1070 1070 1071 .theme-install-php a.upload,1072 .theme-install-php a.browse-themes {1073 cursor: pointer;1074 }1075 .theme-install-php a.browse-themes,1076 .theme-install-php.show-upload-theme a.upload {1077 display: none;1078 }1079 .theme-install-php.show-upload-theme a.browse-themes {1080 display: inline;1081 }1082 .upload-theme {1083 -webkit-box-sizing: border-box;1084 -moz-box-sizing: border-box;1085 box-sizing: border-box;1086 display: none;1087 margin: 0;1088 padding: 0;1089 width: 100%;1090 overflow: hidden;1091 position: relative;1092 top: 10px;1093 }1094 body.show-upload-theme .upload-theme {1095 display: block;1096 }1097 .upload-theme .wp-upload-form {1098 background: #fafafa;1099 border: 1px solid #e5e5e5;1100 padding: 30px;1101 margin: 30px auto;1102 max-width: 380px;1103 }1104 .upload-theme .install-help {1105 color: #999;1106 font-size: 18px;1107 font-style: normal;1108 margin: 0;1109 padding: 40px 0 0;1110 text-align: center;1111 }1112 body.show-upload-theme .upload-theme + .wp-filter,1113 body.show-upload-theme .upload-theme + .wp-filter + .theme-browser {1114 display: none;1115 }1116 1117 1071 p.no-themes { 1118 1072 color: #999; 1119 1073 font-size: 18px; … … 1126 1080 body.no-results p.no-themes { 1127 1081 display: block; 1128 1082 } 1129 body.show-upload- themep.no-themes {1083 body.show-upload-container p.no-themes { 1130 1084 display: none !important; 1131 1085 } 1132 1086 … … 1134 1088 display: none !important; 1135 1089 } 1136 1090 1137 @media only screen and (max-width: 1120px) {1138 .upload-theme .wp-upload-form {1139 margin: 20px 0;1140 max-width: 100%;1141 }1142 .upload-theme .install-help {1143 font-size: 15px;1144 padding: 20px 0 0;1145 text-align: left;1146 }1147 }1148 1149 1091 .rating { 1150 1092 margin: 30px 0; 1151 1093 } -
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/theme-install.php
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 = $tab_slug == 'upload' ? ' wp-upload-show' : ' wp-upload-hide'; 129 130 echo '<a href="#" class="' . esc_attr( $tab_slug ) . $visibility . ' add-new-h2">' . $tab_name . '</a>'; 129 131 } 130 132 ?> 131 133 </h2> 132 134 133 <div class="upload-theme">134 135 <?php install_themes_upload(); ?> 135 </div>136 136 137 <div class="wp-filter ">137 <div class="wp-filter hide-on-upload"> 138 138 <div class="wp-filter-count"> 139 139 <span class="count theme-count"></span> 140 140 </div> … … 179 179 </div> 180 180 </div> 181 181 </div> 182 <div class="theme-browser wp-filter-content"></div> 183 <div class="theme-install-overlay wp-full-overlay expanded"></div> 184 185 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 186 <span class="spinner"></span> 187 182 183 <div class="hide-on-upload"> 184 <div class="theme-browser wp-filter-content"></div> 185 <div class="theme-install-overlay wp-full-overlay expanded"></div> 186 187 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 188 <span class="spinner"></span> 189 </div> 190 188 191 <br class="clear" /> 189 192 <?php 190 193 /**