Ticket #41316: 41316.5.diff
| File 41316.5.diff, 9.2 KB (added by , 8 years ago) |
|---|
-
src/wp-admin/css/common.css
764 764 765 765 /* @todo can we combine these into a class or use an existing dashicon one? */ 766 766 .welcome-panel .welcome-panel-close:before, 767 .try-gutenberg-panel .try-gutenberg-panel-close:before, 767 768 .tagchecklist .ntdelbutton .remove-tag-icon:before, 768 769 #bulk-titles div a:before, 769 770 .notice-dismiss:before { -
src/wp-admin/css/dashboard.css
98 98 } 99 99 100 100 /* Welcome Panel */ 101 .welcome-panel { 101 .welcome-panel, 102 .try-gutenberg-panel { 102 103 position: relative; 103 104 overflow: auto; 104 105 margin: 16px 0; … … 110 111 line-height: 2.1em; 111 112 } 112 113 113 .welcome-panel h2 { 114 .welcome-panel h2, 115 .try-gutenberg-panel h2 { 114 116 margin: 0; 115 117 font-size: 21px; 116 118 font-weight: 400; … … 117 119 line-height: 1.2; 118 120 } 119 121 120 .welcome-panel h3 { 122 .try-gutenberg-panel h2 { 123 margin-bottom: 1em; 124 } 125 126 .welcome-panel h3, 127 .try-gutenberg-panel h3 { 121 128 margin: 1.33em 0 0; 122 129 font-size: 16px; 123 130 } … … 126 133 font-size: 14px; 127 134 } 128 135 129 .welcome-panel p { 136 .welcome-panel p, 137 .try-gutenberg-panel p { 130 138 color: #72777c; 131 139 } 132 140 133 .welcome-panel a { 141 .welcome-panel a, 142 .try-gutenberg-panel a { 134 143 text-decoration: none; 135 144 } 136 145 … … 139 148 margin: 0; 140 149 } 141 150 142 .welcome-panel .welcome-panel-close { 151 .welcome-panel .welcome-panel-close, 152 .try-gutenberg-panel .try-gutenberg-panel-close { 143 153 position: absolute; 144 154 top: 10px; 145 155 right: 10px; … … 149 159 text-decoration: none; 150 160 } 151 161 152 .welcome-panel .welcome-panel-close:before { 162 .welcome-panel .welcome-panel-close:before, 163 .try-gutenberg-panel .try-gutenberg-panel-close:before { 153 164 position: absolute; 154 165 top: 8px; 155 166 left: 0; … … 164 175 white-space: normal; 165 176 } 166 177 167 .welcome-panel-content { 168 margin-left: 13px; 178 .welcome-panel-content, 179 .try-gutenberg-panel-content { 180 margin: 0 13px; 169 181 max-width: 1500px; 170 182 } 171 183 184 .try-gutenberg-panel img { 185 width: 360px; 186 float: left; 187 padding: 0 20px 20px 0; 188 } 189 190 .try-gutenberg-panel .install-now.updating-message:before, 191 .try-gutenberg-panel .install-now.updated-message:before { 192 margin-top: 11px; 193 } 194 172 195 .welcome-panel .welcome-panel-column-container { 173 196 clear: both; 174 197 position: relative; … … 1207 1230 } 1208 1231 } 1209 1232 1233 @media screen and (max-width: 1024px) { 1234 .try-gutenberg-panel img { 1235 display: none; 1236 } 1237 } 1238 1210 1239 @media screen and (max-width: 870px) { 1211 1240 .welcome-panel .welcome-panel-column, 1212 1241 .welcome-panel .welcome-panel-column:first-child { … … 1223 1252 .welcome-panel .welcome-panel-column ul { 1224 1253 margin: 0.4em 0 0; 1225 1254 } 1226 1227 1255 } 1228 1256 1229 1257 @media screen and ( max-width: 782px ) { … … 1266 1294 /* Smartphone */ 1267 1295 @media screen and (max-width: 600px) { 1268 1296 /* Keep the close icon from overlapping the Welcome text. */ 1269 .welcome-panel .welcome-panel-close { 1297 .welcome-panel .welcome-panel-close, 1298 .try-gutenberg-panel .try-gutenberg-panel-close { 1270 1299 overflow: hidden; 1271 1300 text-indent: 40px; 1272 1301 white-space: nowrap; … … 1278 1307 } 1279 1308 1280 1309 /* Make the close icon larger for tappability. */ 1281 .welcome-panel .welcome-panel-close:before { 1310 .welcome-panel .welcome-panel-close:before, 1311 .try-gutenberg-panel .try-gutenberg-panel-close:before { 1282 1312 font-size: 20px; 1283 1313 top: 5px; 1284 1314 left: -35px; -
src/wp-admin/includes/dashboard.php
1619 1619 </div> 1620 1620 <?php 1621 1621 } 1622 1623 /** 1624 * Displays a Try Gutenberg Panel, to introduce people to Gutenberg 1625 * 1626 * @since 4.9.0 1627 */ 1628 function wp_try_gutenberg_panel() { 1629 $plugins = get_plugins(); 1630 $action = $url = $classes = ''; 1631 1632 if ( current_user_can( 'install_plugins' ) && empty( $plugins['gutenberg/gutenberg.php'] ) ) { 1633 $action = __( 'Download Today' ); 1634 $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=gutenberg' ), 'install-plugin_gutenberg' ); 1635 $classes = ' install-now'; 1636 } else if ( current_user_can( 'install_plugins' ) && is_plugin_inactive( 'gutenberg/gutenberg.php' ) ) { 1637 $action = __( 'Activate Today' ); 1638 $url = wp_nonce_url( self_admin_url( 'plugins.php?action=activate&plugin=gutenberg/gutenberg.php' ), 'activate-plugin_gutenberg/gutenberg.php' ); 1639 } else if ( current_user_can( 'edit_posts' ) ) { 1640 $action = __( 'Try Today' ); 1641 $url = admin_url( 'admin.php?page=gutenberg' ); 1642 } 1643 1644 ?> 1645 <div id="plugin-filter" class="try-gutenberg-panel-content plugin-card-gutenberg"> 1646 <img src="https://cldup.com/XYGWhewQOj.gif?<?php echo date( 'Ymd' ); ?>" alt="Gutenberg animated preview" /> 1647 <h2><?php _e( 'Try the new editing experience' ); ?></h2> 1648 <?php if ( $action ) { ?> 1649 <p><a class="button button-primary button-hero<?php echo $classes; ?>" data-slug="gutenberg" href="<?php echo esc_url( $url ); ?>"><?php echo $action; ?></a></p> 1650 <?php } ?> 1651 <h3><?php _e( 'Want to get involved?' ); ?></h3> 1652 <p><?php printf( __( 'Learn more about the project <a href="%s">codenamed Gutenberg</a>.' ), 'https://wordpress.org/gutenberg/' ); ?></p> 1653 <p><?php printf( __( 'Help <a href="%1$s">with testing</a>, or contribute on the <a href="%2$s">GitHub repository</a>.' ), '', 'https://github.com/WordPress/gutenberg/' ); ?></p> 1654 </div> 1655 <?php 1656 } -
src/wp-admin/index.php
103 103 <div class="wrap"> 104 104 <h1><?php echo esc_html( $title ); ?></h1> 105 105 106 <?php if ( has_action( 'try_gutenberg_panel' ) ) : 107 $classes = 'try-gutenberg-panel'; 108 109 $option = get_user_meta( get_current_user_id(), 'show_try_gutenberg_panel', true ); 110 echo $option; 111 // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner 112 $hide = 0 === $option || ( 2 === $option && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ); 113 if ( $hide ) 114 $classes .= ' hidden'; ?> 115 116 <div id="gutenpanel" class="<?php echo esc_attr( $classes ); ?>"> 117 <?php wp_nonce_field( 'try-gutenberg-panel-nonce', 'trygutenbergpanelnonce', false ); ?> 118 <a class="try-gutenberg-panel-close" href="<?php echo esc_url( admin_url( '?try_gutenberg=0' ) ); ?>" aria-label="<?php esc_attr_e( 'Dismiss the Try Gutenberg panel' ); ?>"><?php _e( 'Dismiss' ); ?></a> 119 <?php 120 /** 121 * Add content to the Try Gutenberg panel on the admin dashboard. 122 * 123 * To remove the Try Gutenberg panel, use remove_action(): 124 * 125 * remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' ); 126 * 127 * @since 4.9.0 128 */ 129 do_action( 'try_gutenberg_panel' ); 130 ?> 131 </div> 132 <?php endif; ?> 106 133 <?php if ( has_action( 'welcome_panel' ) && current_user_can( 'edit_theme_options' ) ) : 107 134 $classes = 'welcome-panel'; 108 135 -
src/wp-admin/js/updates.js
585 585 586 586 $message 587 587 .removeClass( 'updating-message' ) 588 .addClass( 'updated-message installed button-disabled' )588 .addClass( 'updated-message installed' ) 589 589 .attr( 'aria-label', wp.updates.l10n.pluginInstalledLabel.replace( '%s', response.pluginName ) ) 590 590 .text( wp.updates.l10n.pluginInstalled ); 591 591 592 if ( $message.hasClass( 'button-primary' ) ) { 593 $message.addClass( 'button-primary-disabled' ); 594 } else if ( $message.hasClass( 'button-secondary' ) ) { 595 $message.addClass( 'button-secondary-disabled' ); 596 } else { 597 $message.addClass( 'button-disabled' ); 598 } 599 592 600 wp.a11y.speak( wp.updates.l10n.installedMsg, 'polite' ); 593 601 594 602 $document.trigger( 'wp-plugin-install-success', response ); … … 597 605 setTimeout( function() { 598 606 599 607 // Transform the 'Install' button into an 'Activate' button. 600 $message.removeClass( 'install-now installed button-disabled updated-message' ).addClass( 'activate-now button-primary' ) 608 $message.removeClass( 'install-now installed button-primary-disabled button-secondary-disabled button-disabled updated-message' ) 609 .addClass( 'activate-now button-primary' ) 601 610 .attr( 'href', response.activateUrl ) 602 611 .attr( 'aria-label', wp.updates.l10n.activatePluginLabel.replace( '%s', response.pluginName ) ) 603 612 .text( wp.updates.l10n.activatePlugin ); -
src/wp-includes/default-filters.php
322 322 add_action( 'admin_init', 'send_frame_options_header', 10, 0 ); 323 323 add_action( 'importer_scheduled_cleanup', 'wp_delete_attachment' ); 324 324 add_action( 'upgrader_scheduled_cleanup', 'wp_delete_attachment' ); 325 add_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' ); 325 326 add_action( 'welcome_panel', 'wp_welcome_panel' ); 326 327 327 328 // Navigation menu actions