Ticket #41316: 41316.3.diff
File 41316.3.diff, 9.1 KB (added by , 6 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 .welcome-panel h3, 123 .try-gutenberg-panel h3 { 121 124 margin: 1.33em 0 0; 122 125 font-size: 16px; 123 126 } … … 126 129 font-size: 14px; 127 130 } 128 131 129 .welcome-panel p { 132 .welcome-panel p, 133 .try-gutenberg-panel p { 130 134 color: #72777c; 131 135 } 132 136 133 .welcome-panel a { 137 .welcome-panel a, 138 .try-gutenberg-panel a { 134 139 text-decoration: none; 135 140 } 136 141 137 .welcome-panel .about-description { 142 .welcome-panel .about-description, 143 .try-gutenberg-panel .about-description { 138 144 font-size: 16px; 139 145 margin: 0; 140 146 } 141 147 142 .welcome-panel .welcome-panel-close { 148 .welcome-panel .welcome-panel-close, 149 .try-gutenberg-panel .try-gutenberg-panel-close { 143 150 position: absolute; 144 151 top: 10px; 145 152 right: 10px; … … 149 156 text-decoration: none; 150 157 } 151 158 152 .welcome-panel .welcome-panel-close:before { 159 .welcome-panel .welcome-panel-close:before, 160 .try-gutenberg-panel .try-gutenberg-panel-close:before { 153 161 position: absolute; 154 162 top: 8px; 155 163 left: 0; … … 164 172 white-space: normal; 165 173 } 166 174 167 .welcome-panel-content { 168 margin-left: 13px; 175 .welcome-panel-content, 176 .try-gutenberg-panel-content { 177 margin: 0 13px; 169 178 max-width: 1500px; 170 179 } 171 180 181 .try-gutenberg-panel img { 182 width: 400px; 183 float: left; 184 padding: 0 20px 20px 0; 185 } 186 187 .try-gutenberg-panel .install-now.updating-message:before, 188 .try-gutenberg-panel .install-now.updated-message:before { 189 margin-top: 11px; 190 } 191 172 192 .welcome-panel .welcome-panel-column-container { 173 193 clear: both; 174 194 position: relative; … … 1224 1244 margin: 0.4em 0 0; 1225 1245 } 1226 1246 1247 .try-gutenberg-panel img { 1248 padding-top: 15px; 1249 width: 100%; 1250 } 1251 1227 1252 } 1228 1253 1229 1254 @media screen and ( max-width: 782px ) { … … 1266 1291 /* Smartphone */ 1267 1292 @media screen and (max-width: 600px) { 1268 1293 /* Keep the close icon from overlapping the Welcome text. */ 1269 .welcome-panel .welcome-panel-close { 1294 .welcome-panel .welcome-panel-close, 1295 .try-gutenberg-panel .try-gutenberg-panel-close { 1270 1296 overflow: hidden; 1271 1297 text-indent: 40px; 1272 1298 white-space: nowrap; … … 1278 1304 } 1279 1305 1280 1306 /* Make the close icon larger for tappability. */ 1281 .welcome-panel .welcome-panel-close:before { 1307 .welcome-panel .welcome-panel-close:before, 1308 .try-gutenberg-panel .try-gutenberg-panel-close:before { 1282 1309 font-size: 20px; 1283 1310 top: 5px; 1284 1311 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://wordpress.org/gutenberg/files/2017/08/colimage-Gutenberg-1.gif?<?php echo date( 'Ymd' ); ?>" alt="" /> 1647 <h2><?php _e( 'Try the new editing experience' ); ?></h2> 1648 <p class="about-description"><?php _e( 'Discover the project codenamed Gutenberg today' ); ?></p> 1649 <?php if ( $action ) { ?> 1650 <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> 1651 <?php } ?> 1652 <h3><?php _e( 'Want to get involved?' ); ?></h3> 1653 <p><?php printf( __( 'Learn more about this project <a href="%s">right here</a>.' ), 'https://wordpress.org/gutenberg/' ); ?></p> 1654 <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> 1655 </div> 1656 <?php 1657 } -
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