Changeset 39141
- Timestamp:
- 11/04/2016 04:01:24 PM (8 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/admin-menu.css
r37365 r39141 265 265 .folded #adminmenu a.menu-top:focus + .wp-submenu, 266 266 .folded #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu, 267 .no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu 267 .no-js.folded #adminmenu .wp-has-submenu:hover .wp-submenu { 268 268 top: 0; 269 269 left: 36px; … … 548 548 } 549 549 550 #collapse-menu { 551 font-size: 13px; 550 #collapse-button { 551 display: block; 552 width: 100%; 553 height: 34px; 554 margin: 0; 555 border: none; 556 padding: 0; 557 position: relative; 558 overflow: visible; 552 559 line-height: 34px; 553 margin-top: 10px; 554 color: #a0a5aa; 555 color: rgba(240,245,250,0.6); 556 -webkit-transition: all .1s ease-in-out; 557 transition: all .1s ease-in-out; 558 } 559 560 #collapse-menu:hover, 561 #collapse-menu:hover #collapse-button div:after { 560 background: none; 561 color: #aaa; 562 cursor: pointer; 563 outline: 0; 564 } 565 566 #collapse-button:hover, 567 #collapse-button:focus { 562 568 color: #00b9eb; 563 569 } 564 570 565 .folded #collapse-menu span { 571 #collapse-button .collapse-button-icon, 572 #collapse-button .collapse-button-label { 573 /* absolutely positioned to avoid 1px shift in IE when button is pressed */ 574 display: block; 575 position: absolute; 576 top: 0; 577 left: 0; 578 line-height: 34px; 579 } 580 581 #collapse-button .collapse-button-icon { 582 width: 36px; 583 height: 34px; 584 } 585 586 #collapse-button .collapse-button-label { 587 padding: 0 0 0 36px; 588 } 589 590 .folded #collapse-button .collapse-button-label { 566 591 display: none; 567 592 } 568 593 569 #collapse-button, 570 #collapse-button div { 571 width: 15px; 572 height: 15px; 573 } 574 575 #collapse-button { 576 float: left; 577 height: 15px; 578 margin: 10px 8px 10px 11px; 579 width: 15px; 580 -webkit-border-radius: 10px; 581 border-radius: 10px; 582 } 583 584 #wpwrap #collapse-button div { 585 padding: 0; 586 } 587 588 #collapse-button div:after { 594 #collapse-button .collapse-button-icon:after { 589 595 content: "\f148"; 590 596 display: block; 591 line-height: 15px; 592 left: -3px; 593 top: -3px; 594 color: #a0a5aa; 595 color: rgba(240,245,250,0.6); 597 position: relative; 598 top: 7px; 599 text-align: center; 596 600 font: normal 20px/1 dashicons !important; 597 601 speak: none; 598 margin: 0 auto;599 padding: 0 !important;600 position: relative;601 text-align: center;602 width: 20px;603 -webkit-transition: all .1s ease-in-out;604 transition: all .1s ease-in-out;605 602 -webkit-font-smoothing: antialiased; 606 603 -moz-osx-font-smoothing: grayscale; … … 608 605 609 606 /* rtl:ignore */ 610 .folded #collapse-button div:after,611 .rtl #collapse-button div:after {607 .folded #collapse-button .collapse-button-icon:after, 608 .rtl #collapse-button .collapse-button-icon:after { 612 609 -webkit-transform: rotate(180deg); 613 610 -ms-transform: rotate(180deg); … … 615 612 } 616 613 617 .rtl.folded #collapse-button div:after {614 .rtl.folded #collapse-button .collapse-button-icon:after { 618 615 -webkit-transform: none; 619 616 -ms-transform: none; 620 617 transform: none; 618 } 619 620 #collapse-button .collapse-button-icon:after, 621 #collapse-button .collapse-button-label { 622 -webkit-transition: all .1s ease-in-out; 623 transition: all .1s ease-in-out; 621 624 } 622 625 … … 653 656 .auto-fold #adminmenu .wp-has-current-submenu.opensub .wp-submenu, 654 657 .auto-fold #adminmenu a.menu-top:focus + .wp-submenu, 655 .auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu 658 .auto-fold #adminmenu .wp-has-current-submenu a.menu-top:focus + .wp-submenu { 656 659 top: 0px; 657 660 left: 36px; … … 732 735 } 733 736 734 .auto-fold #collapse-menu span{737 .auto-fold #collapse-menu .collapse-button-label { 735 738 display: none; 736 739 } 737 740 738 .auto-fold #collapse-button div {739 background: none;740 }741 742 741 /* rtl:ignore */ 743 .auto-fold #collapse-button div:after {742 .auto-fold #collapse-button .collapse-button-icon:after { 744 743 -webkit-transform: rotate(180deg); 745 744 -ms-transform: rotate(180deg); … … 747 746 } 748 747 749 .rtl.auto-fold #collapse-button div:after {748 .rtl.auto-fold #collapse-button .collapse-button-icon:after { 750 749 -webkit-transform: none; 751 750 -ms-transform: none; -
trunk/src/wp-admin/css/colors/_admin.scss
r38660 r39141 228 228 /* Admin Menu: collapse button */ 229 229 230 #collapse- menu{230 #collapse-button { 231 231 color: $menu-collapse-text; 232 232 } 233 233 234 #collapse-menu:hover { 235 color: $menu-collapse-focus-text; 236 } 237 238 #collapse-button div:after { 239 color: $menu-collapse-icon; 240 } 241 242 #collapse-menu:hover #collapse-button div:after { 243 color: $menu-collapse-focus-icon; 244 } 245 234 #collapse-button:hover, 235 #collapse-button:focus { 236 color: $menu-submenu-focus-text; 237 } 246 238 247 239 /* Admin Bar */ -
trunk/src/wp-admin/js/common.js
r38983 r39141 197 197 pinnedMenuBottom = false, 198 198 menuTop = 0, 199 menuState, 199 200 menuIsPinned = false, 200 201 height = { … … 212 213 }); 213 214 214 $( '#collapse-menu').on('click.collapse-menu', function() {215 var respWidth, state;215 $( '#collapse-button' ).on( 'click.collapse-menu', function() { 216 var viewportWidth = getViewportWidth() || 961; 216 217 217 218 // reset any compensation for submenus near the bottom of the screen 218 219 $('#adminmenu div.wp-submenu').css('margin-top', ''); 219 220 220 if ( window.innerWidth ) { 221 // window.innerWidth is affected by zooming on phones 222 respWidth = Math.max( window.innerWidth, document.documentElement.clientWidth ); 223 } else { 224 // IE < 9 doesn't support @media CSS rules 225 respWidth = 961; 226 } 227 228 if ( respWidth && respWidth < 960 ) { 221 if ( viewportWidth < 960 ) { 229 222 if ( $body.hasClass('auto-fold') ) { 230 223 $body.removeClass('auto-fold').removeClass('folded'); 231 224 setUserSetting('unfold', 1); 232 225 setUserSetting('mfold', 'o'); 233 state = 'open';226 menuState = 'open'; 234 227 } else { 235 228 $body.addClass('auto-fold'); 236 229 setUserSetting('unfold', 0); 237 state = 'folded';230 menuState = 'folded'; 238 231 } 239 232 } else { … … 241 234 $body.removeClass('folded'); 242 235 setUserSetting('mfold', 'o'); 243 state = 'open';236 menuState = 'open'; 244 237 } else { 245 238 $body.addClass('folded'); 246 239 setUserSetting('mfold', 'f'); 247 state = 'folded'; 248 } 249 } 250 251 currentMenuItemHasPopup(); 252 $document.trigger( 'wp-collapse-menu', { state: state } ); 240 menuState = 'folded'; 241 } 242 } 243 244 $document.trigger( 'wp-collapse-menu', { state: menuState } ); 253 245 }); 254 246 255 247 // Handle the `aria-haspopup` attribute on the current menu item when it has a sub-menu. 256 248 function currentMenuItemHasPopup() { 257 var respWidth, 258 $current = $( 'a.wp-has-current-submenu' ); 259 260 if ( window.innerWidth ) { 261 respWidth = Math.max( window.innerWidth, document.documentElement.clientWidth ); 262 } else { 263 respWidth = 961; 264 } 265 266 if ( $body.hasClass( 'folded' ) || ( $body.hasClass( 'auto-fold' ) && respWidth && respWidth <= 960 && respWidth > 782 ) ) { 249 var $current = $( 'a.wp-has-current-submenu' ); 250 251 if ( 'folded' === menuState ) { 267 252 // When folded or auto-folded and not responsive view, the current menu item does have a fly-out sub-menu. 268 253 $current.attr( 'aria-haspopup', 'true' ); … … 273 258 } 274 259 275 $document.on( 'wp- window-resizedwp-responsive-activate wp-responsive-deactivate', currentMenuItemHasPopup );260 $document.on( 'wp-menu-state-set wp-collapse-menu wp-responsive-activate wp-responsive-deactivate', currentMenuItemHasPopup ); 276 261 277 262 /** … … 837 822 838 823 trigger: function() { 839 var width; 840 841 if ( window.innerWidth ) { 842 // window.innerWidth is affected by zooming on phones 843 width = Math.max( window.innerWidth, document.documentElement.clientWidth ); 844 } else { 845 // Exclude IE < 9, it doesn't support @media CSS rules 824 var viewportWidth = getViewportWidth(); 825 826 // Exclude IE < 9, it doesn't support @media CSS rules. 827 if ( ! viewportWidth ) { 846 828 return; 847 829 } 848 830 849 if ( width <= 782 ) {831 if ( viewportWidth <= 782 ) { 850 832 if ( ! wpResponsiveActive ) { 851 833 $document.trigger( 'wp-responsive-activate' ); … … 859 841 } 860 842 861 if ( width <= 480 ) {843 if ( viewportWidth <= 480 ) { 862 844 this.enableOverlay(); 863 845 } else { … … 913 895 }); 914 896 897 /** 898 * @summary Get the viewport width. 899 * 900 * @since 4.7 901 * 902 * @returns {number|boolean} The current viewport width or false if the 903 * browser doesn't support innerWidth (IE < 9). 904 */ 905 function getViewportWidth() { 906 var viewportWidth = false; 907 908 if ( window.innerWidth ) { 909 // On phones, window.innerWidth is affected by zooming. 910 viewportWidth = Math.max( window.innerWidth, document.documentElement.clientWidth ); 911 } 912 913 return viewportWidth; 914 } 915 916 /** 917 * @summary Set the admin menu collapsed/expanded state. 918 * 919 * Sets the global variable `menuState` and triggers a custom event passing 920 * the current menu state. 921 * 922 * @since 4.7 923 * 924 * @returns {void} 925 */ 926 function setMenuState() { 927 var viewportWidth = getViewportWidth() || 961; 928 929 if ( viewportWidth <= 782 ) { 930 menuState = 'responsive'; 931 } else if ( $body.hasClass( 'folded' ) || ( $body.hasClass( 'auto-fold' ) && viewportWidth <= 960 && viewportWidth > 782 ) ) { 932 menuState = 'folded'; 933 } else { 934 menuState = 'open'; 935 } 936 937 $document.trigger( 'wp-menu-state-set', { state: menuState } ); 938 } 939 940 // Set the menu state when the window gets resized. 941 $document.on( 'wp-window-resized.set-menu-state', setMenuState ); 942 943 /** 944 * @summary Set ARIA attributes on the collapse/expand menu button. 945 * 946 * When the admin menu is open or folded, updates the `aria-expanded` and 947 * `aria-label` attributes of the button to give feedback to assistive 948 * technologies. In the responsive view, the button is always hidden. 949 * 950 * @since 4.7 951 * 952 * @returns {void} 953 */ 954 $document.on( 'wp-menu-state-set wp-collapse-menu', function( event, eventData ) { 955 var $collapseButton = $( '#collapse-button' ), 956 ariaExpanded = 'true', 957 ariaLabelText = commonL10n.collapseMenu; 958 959 if ( 'folded' === eventData.state ) { 960 ariaExpanded = 'false'; 961 ariaLabelText = commonL10n.expandMenu; 962 } 963 964 $collapseButton.attr({ 965 'aria-expanded': ariaExpanded, 966 'aria-label': ariaLabelText 967 }); 968 }); 969 915 970 window.wpResponsive.init(); 916 971 setPinMenu(); 972 setMenuState(); 917 973 currentMenuItemHasPopup(); 918 974 makeNoticesDismissible(); -
trunk/src/wp-admin/menu-header.php
r37488 r39141 235 235 } 236 236 237 echo '<li id="collapse-menu" class="hide-if-no-js"><div id="collapse-button"><div></div></div>'; 238 echo '<span>' . esc_html__( 'Collapse menu' ) . '</span>'; 239 echo '</li>'; 237 echo '<li id="collapse-menu" class="hide-if-no-js">' . 238 '<button type="button" id="collapse-button" aria-label="' . esc_attr__( 'Collapse Main menu' ) . '" aria-expanded="true">' . 239 '<span class="collapse-button-icon" aria-hidden="true"></span>' . 240 '<span class="collapse-button-label">' . __( 'Collapse menu' ) . '</span>' . 241 '</button></li>'; 240 242 } 241 243 -
trunk/src/wp-includes/css/customize-preview.css
r39136 r39141 24 24 background: transparent; 25 25 color: transparent; 26 -webkit-box-shadow: none; 26 27 box-shadow: none; 27 28 outline: none; … … 49 50 background-color: #0085ba; 50 51 background: #0085ba; 52 -webkit-border-radius: 50%; 51 53 border-radius: 50%; 52 54 border: 2px solid #fff; 55 -webkit-box-shadow: 0 2px 1px rgba(46,68,83,0.15); 53 56 box-shadow: 0 2px 1px rgba(46,68,83,0.15); 54 57 text-align: center; 58 display: -webkit-box; 59 display: -webkit-flex; 60 display: -moz-box; 61 display: -ms-flexbox; 55 62 display: flex; 63 -webkit-box-orient: horizontal; 64 -webkit-box-direction: normal; 65 -webkit-flex-direction: row; 66 -moz-box-orient: horizontal; 67 -moz-box-direction: normal; 68 -ms-flex-direction: row; 56 69 flex-direction: row; 70 -webkit-box-pack: center; 71 -webkit-justify-content: center; 72 -moz-box-pack: center; 73 -ms-flex-pack: center; 57 74 justify-content: center; 75 -webkit-box-align: center; 76 -webkit-align-items: center; 77 -moz-box-align: center; 78 -ms-flex-align: center; 58 79 align-items: center; 59 80 cursor: pointer; 60 81 padding: 0; 82 -webkit-animation-fill-mode: both; 61 83 animation-fill-mode: both; 84 -webkit-animation-duration: .4s; 62 85 animation-duration: .4s; 63 86 opacity: 0; … … 85 108 86 109 body.customize-partial-edit-shortcuts-shown .customize-partial-edit-shortcut button { 110 -webkit-animation-name: customize-partial-edit-shortcut-bounce-appear; 87 111 animation-name: customize-partial-edit-shortcut-bounce-appear; 88 112 pointer-events: auto; 89 113 } 90 114 body.customize-partial-edit-shortcuts-hidden .customize-partial-edit-shortcut button { 115 -webkit-animation-name: customize-partial-edit-shortcut-bounce-disappear; 91 116 animation-name: customize-partial-edit-shortcut-bounce-disappear; 92 117 pointer-events: none; … … 102 127 } 103 128 129 @-webkit-keyframes customize-partial-edit-shortcut-bounce-appear { 130 from, 20%, 40%, 60%, 80%, to { 131 -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 132 animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 133 } 134 0% { 135 opacity: 0; 136 -webkit-transform: scale3d(.3, .3, .3); 137 transform: scale3d(.3, .3, .3); 138 } 139 20% { 140 -webkit-transform: scale3d(1.1, 1.1, 1.1); 141 transform: scale3d(1.1, 1.1, 1.1); 142 } 143 40% { 144 -webkit-transform: scale3d(.9, .9, .9); 145 transform: scale3d(.9, .9, .9); 146 } 147 60% { 148 opacity: 1; 149 -webkit-transform: scale3d(1.03, 1.03, 1.03); 150 transform: scale3d(1.03, 1.03, 1.03); 151 } 152 80% { 153 -webkit-transform: scale3d(.97, .97, .97); 154 transform: scale3d(.97, .97, .97); 155 } 156 to { 157 opacity: 1; 158 -webkit-transform: scale3d(1, 1, 1); 159 transform: scale3d(1, 1, 1); 160 } 161 } 162 104 163 @keyframes customize-partial-edit-shortcut-bounce-appear { 105 164 from, 20%, 40%, 60%, 80%, to { 106 animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 107 } 108 0% { 109 opacity: 0; 110 transform: scale3d(.3, .3, .3); 111 } 112 20% { 113 transform: scale3d(1.1, 1.1, 1.1); 114 } 115 40% { 116 transform: scale3d(.9, .9, .9); 117 } 118 60% { 119 opacity: 1; 120 transform: scale3d(1.03, 1.03, 1.03); 121 } 122 80% { 123 transform: scale3d(.97, .97, .97); 124 } 125 to { 126 opacity: 1; 127 transform: scale3d(1, 1, 1); 165 -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 166 animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 167 } 168 0% { 169 opacity: 0; 170 -webkit-transform: scale3d(.3, .3, .3); 171 transform: scale3d(.3, .3, .3); 172 } 173 20% { 174 -webkit-transform: scale3d(1.1, 1.1, 1.1); 175 transform: scale3d(1.1, 1.1, 1.1); 176 } 177 40% { 178 -webkit-transform: scale3d(.9, .9, .9); 179 transform: scale3d(.9, .9, .9); 180 } 181 60% { 182 opacity: 1; 183 -webkit-transform: scale3d(1.03, 1.03, 1.03); 184 transform: scale3d(1.03, 1.03, 1.03); 185 } 186 80% { 187 -webkit-transform: scale3d(.97, .97, .97); 188 transform: scale3d(.97, .97, .97); 189 } 190 to { 191 opacity: 1; 192 -webkit-transform: scale3d(1, 1, 1); 193 transform: scale3d(1, 1, 1); 194 } 195 } 196 197 @-webkit-keyframes customize-partial-edit-shortcut-bounce-disappear { 198 from, 20%, 40%, 60%, 80%, to { 199 -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 200 animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 201 } 202 0% { 203 opacity: 1; 204 -webkit-transform: scale3d(1, 1, 1); 205 transform: scale3d(1, 1, 1); 206 } 207 20% { 208 -webkit-transform: scale3d(.97, .97, .97); 209 transform: scale3d(.97, .97, .97); 210 } 211 40% { 212 opacity: 1; 213 -webkit-transform: scale3d(1.03, 1.03, 1.03); 214 transform: scale3d(1.03, 1.03, 1.03); 215 } 216 60% { 217 -webkit-transform: scale3d(.9, .9, .9); 218 transform: scale3d(.9, .9, .9); 219 } 220 80% { 221 -webkit-transform: scale3d(1.1, 1.1, 1.1); 222 transform: scale3d(1.1, 1.1, 1.1); 223 } 224 to { 225 opacity: 0; 226 -webkit-transform: scale3d(.3, .3, .3); 227 transform: scale3d(.3, .3, .3); 128 228 } 129 229 } … … 131 231 @keyframes customize-partial-edit-shortcut-bounce-disappear { 132 232 from, 20%, 40%, 60%, 80%, to { 133 animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 134 } 135 0% { 136 opacity: 1; 137 transform: scale3d(1, 1, 1); 138 } 139 20% { 140 transform: scale3d(.97, .97, .97); 141 } 142 40% { 143 opacity: 1; 144 transform: scale3d(1.03, 1.03, 1.03); 145 } 146 60% { 147 transform: scale3d(.9, .9, .9); 148 } 149 80% { 150 transform: scale3d(1.1, 1.1, 1.1); 151 } 152 to { 153 opacity: 0; 233 -webkit-animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 234 animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); 235 } 236 0% { 237 opacity: 1; 238 -webkit-transform: scale3d(1, 1, 1); 239 transform: scale3d(1, 1, 1); 240 } 241 20% { 242 -webkit-transform: scale3d(.97, .97, .97); 243 transform: scale3d(.97, .97, .97); 244 } 245 40% { 246 opacity: 1; 247 -webkit-transform: scale3d(1.03, 1.03, 1.03); 248 transform: scale3d(1.03, 1.03, 1.03); 249 } 250 60% { 251 -webkit-transform: scale3d(.9, .9, .9); 252 transform: scale3d(.9, .9, .9); 253 } 254 80% { 255 -webkit-transform: scale3d(1.1, 1.1, 1.1); 256 transform: scale3d(1.1, 1.1, 1.1); 257 } 258 to { 259 opacity: 0; 260 -webkit-transform: scale3d(.3, .3, .3); 154 261 transform: scale3d(.3, .3, .3); 155 262 } -
trunk/src/wp-includes/script-loader.php
r39132 r39141 78 78 $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 ); 79 79 did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array( 80 'warnDelete' => __( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ), 81 'dismiss' => __( 'Dismiss this notice.' ), 80 'warnDelete' => __( "You are about to permanently delete these items.\n 'Cancel' to stop, 'OK' to delete." ), 81 'dismiss' => __( 'Dismiss this notice.' ), 82 'collapseMenu' => __( 'Collapse Main menu' ), 83 'expandMenu' => __( 'Expand Main menu' ), 82 84 ) ); 83 85
Note: See TracChangeset
for help on using the changeset viewer.