diff --git src/wp-admin/css/color-schemes/_admin.scss src/wp-admin/css/color-schemes/_admin.scss
index f7a4bc2..0a467a4 100644
|
|
|
ul#adminmenu > li.current > a.current:after { |
| 366 | 366 | |
| 367 | 367 | /* Responsive Component */ |
| 368 | 368 | |
| 369 | | div#moby6-toggle a:before { |
| | 369 | div#responsive-toggle a:before { |
| 370 | 370 | color: $menu-icon; |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | | .moby6-open div#moby6-toggle a { |
| | 373 | .responsive-open div#responsive-toggle a { |
| 374 | 374 | // ToDo: make inset border |
| 375 | 375 | border-color: transparent; |
| 376 | 376 | background: $menu-highlight-background; |
diff --git src/wp-admin/css/wp-admin.css src/wp-admin/css/wp-admin.css
index fadb683..b67a721 100644
|
|
|
li#wp-admin-bar-toggle-button { |
| 11211 | 11211 | transition: left .05s ease-in-out, opacity .3s ease-in; |
| 11212 | 11212 | } |
| 11213 | 11213 | |
| 11214 | | .auto-fold .moby6-open #adminmenu { |
| | 11214 | .auto-fold .responsive-open #adminmenu { |
| 11215 | 11215 | -moz-opacity: 1; |
| 11216 | 11216 | -webkit-opacity: 1; |
| 11217 | 11217 | opacity: 1; |
| … |
… |
li#wp-admin-bar-toggle-button { |
| 11283 | 11283 | } |
| 11284 | 11284 | |
| 11285 | 11285 | /* Sidebar Toggle */ |
| 11286 | | #moby6-toggle { |
| | 11286 | #responsive-toggle { |
| 11287 | 11287 | position: fixed; |
| 11288 | 11288 | top: 5px; |
| 11289 | 11289 | left: 4px; |
| … |
… |
li#wp-admin-bar-toggle-button { |
| 11298 | 11298 | margin-top: -2px; |
| 11299 | 11299 | } |
| 11300 | 11300 | |
| 11301 | | .moby6-open #wpadminbar #wp-admin-bar-toggle-button a { |
| | 11301 | .responsive-open #wpadminbar #wp-admin-bar-toggle-button a { |
| 11302 | 11302 | background: #000; |
| 11303 | 11303 | } |
| 11304 | 11304 | |
| 11305 | | .moby6-open #wpbody { |
| | 11305 | .responsive-open #wpbody { |
| 11306 | 11306 | right: -190px; |
| 11307 | 11307 | } |
| 11308 | 11308 | |
| 11309 | | .auto-fold .moby6-open #adminmenuback, |
| 11310 | | .auto-fold .moby6-open #adminmenuwrap { |
| | 11309 | .auto-fold .responsive-open #adminmenuback, |
| | 11310 | .auto-fold .responsive-open #adminmenuwrap { |
| 11311 | 11311 | left: 0; |
| 11312 | 11312 | } |
| 11313 | 11313 | |
| … |
… |
li#wp-admin-bar-toggle-button { |
| 12372 | 12372 | |
| 12373 | 12373 | /* Smartphone */ |
| 12374 | 12374 | @media screen and (max-width: 480px) { |
| 12375 | | #moby6-overlay { |
| | 12375 | #responsive-overlay { |
| 12376 | 12376 | position: fixed; |
| 12377 | 12377 | top: 0; |
| 12378 | 12378 | left: 0; |
diff --git src/wp-admin/js/common.js src/wp-admin/js/common.js
index 3406ee0..fa5b995 100644
|
|
|
|
| 1 | | /* global setUserSetting, ajaxurl, commonL10n, alert, confirm, toggleWithKeyboard, pagenow */ |
| 2 | | var showNotice, adminMenu, columns, validateForm, screenMeta, stickyMenu; |
| | 1 | /* global setUserSetting, ajaxurl, commonL10n, alert, confirm, toggleWithKeyboard, pagenow, _ */ |
| | 2 | var showNotice, adminMenu, columns, validateForm, screenMeta, stickyMenu, responsive; |
| 3 | 3 | (function($){ |
| 4 | 4 | // Removed in 3.3. |
| 5 | 5 | // (perhaps) needed for back-compat |
| … |
… |
stickyMenu = { |
| 461 | 461 | |
| 462 | 462 | enable: function () { |
| 463 | 463 | if ( ! this.active ) { |
| 464 | | this.$window.on( 'resize.stickyMenu scroll.stickyMenu', this.debounce( |
| | 464 | this.$window.on( 'resize.stickyMenu scroll.stickyMenu', _.debounce( |
| 465 | 465 | $.proxy( this.update, this ), 200 |
| 466 | 466 | ) ); |
| 467 | 467 | this.$collapseMenu.on( 'click.stickyMenu', $.proxy( this.update, this ) ); |
| … |
… |
stickyMenu = { |
| 492 | 492 | this.$body.removeClass( 'sticky-menu' ); |
| 493 | 493 | } |
| 494 | 494 | } |
| 495 | | }, |
| 496 | | |
| 497 | | // Borrowed from Underscore.js |
| 498 | | debounce: function( func, wait, immediate ) { |
| 499 | | var timeout, args, context, timestamp, result; |
| 500 | | return function() { |
| 501 | | var later, callNow; |
| 502 | | context = this; |
| 503 | | args = arguments; |
| 504 | | timestamp = new Date().getTime(); |
| 505 | | later = function() { |
| 506 | | var last = new Date().getTime() - timestamp; |
| 507 | | if ( last < wait ) { |
| 508 | | timeout = setTimeout( later, wait - last ); |
| 509 | | } else { |
| 510 | | timeout = null; |
| 511 | | if ( ! immediate ) { |
| 512 | | result = func.apply( context, args ); |
| 513 | | context = args = null; |
| 514 | | } |
| 515 | | } |
| 516 | | }; |
| 517 | | callNow = immediate && !timeout; |
| 518 | | if ( ! timeout ) { |
| 519 | | timeout = setTimeout( later, wait ); |
| 520 | | } |
| 521 | | if ( callNow ) { |
| 522 | | result = func.apply( context, args ); |
| 523 | | context = args = null; |
| 524 | | } |
| 525 | | |
| 526 | | return result; |
| 527 | | }; |
| 528 | 495 | } |
| 529 | 496 | }; |
| 530 | 497 | |
| 531 | 498 | stickyMenu.init(); |
| 532 | 499 | |
| 533 | | var moby6 = { |
| | 500 | responsive = { |
| 534 | 501 | |
| 535 | 502 | init: function() { |
| 536 | 503 | // cached selectors |
| | 504 | this.$window = $( window ); |
| 537 | 505 | this.$html = $( document.documentElement ); |
| 538 | 506 | this.$body = $( document.body ); |
| 539 | 507 | this.$wpwrap = $( '#wpwrap' ); |
| 540 | 508 | this.$wpbody = $( '#wpbody' ); |
| 541 | 509 | this.$adminmenu = $( '#adminmenu' ); |
| 542 | | this.$overlay = $( '#moby6-overlay' ); |
| | 510 | this.$overlay = $( '#responsive-overlay' ); |
| 543 | 511 | this.$toolbar = $( '#wp-toolbar' ); |
| 544 | 512 | this.$toolbarPopups = this.$toolbar.find( 'a[aria-haspopup="true"]' ); |
| 545 | 513 | |
| 546 | 514 | // Modify functionality based on custom activate/deactivate event |
| 547 | 515 | this.$html |
| 548 | | .on( 'activate.moby6', function() { moby6.activate(); } ) |
| 549 | | .on( 'deactivate.moby6', function() { moby6.deactivate(); } ); |
| | 516 | .on( 'activate.responsive', function() { |
| | 517 | responsive.activate(); |
| | 518 | } ) |
| | 519 | .on( 'deactivate.responsive', function() { |
| | 520 | responsive.deactivate(); |
| | 521 | } ); |
| 550 | 522 | |
| 551 | 523 | // Toggle sidebar when toggle is clicked |
| 552 | | $( '#wp-admin-bar-toggle-button' ).on( 'click', function(evt) { |
| | 524 | $( '#wp-admin-bar-toggle-button' ).on( 'click', function( evt ) { |
| 553 | 525 | evt.preventDefault(); |
| 554 | | moby6.$wpwrap.toggleClass( 'moby6-open' ); |
| | 526 | responsive.$wpwrap.toggleClass( 'responsive-open' ); |
| 555 | 527 | } ); |
| 556 | 528 | |
| 557 | 529 | // Trigger custom events based on active media query. |
| 558 | | this.matchMedia(); |
| 559 | | $( window ).on( 'resize', $.proxy( this.matchMedia, this ) ); |
| | 530 | this.toggleElements(); |
| | 531 | this.$window.on( 'resize', _.debounce( |
| | 532 | $.proxy( this.toggleElements, this ), 150 |
| | 533 | ) ); |
| 560 | 534 | }, |
| 561 | 535 | |
| 562 | 536 | activate: function() { |
| | 537 | stickyMenu.disable(); |
| 563 | 538 | |
| 564 | | window.stickymenu && window.stickymenu.disable(); |
| 565 | | |
| 566 | | if ( ! moby6.$body.hasClass( 'auto-fold' ) ) |
| 567 | | moby6.$body.addClass( 'auto-fold' ); |
| | 539 | if ( ! this.$body.hasClass( 'auto-fold' ) ) { |
| | 540 | this.$body.addClass( 'auto-fold' ); |
| | 541 | } |
| 568 | 542 | |
| 569 | 543 | this.modifySidebarEvents(); |
| 570 | 544 | this.disableDraggables(); |
| 571 | 545 | this.movePostSearch(); |
| 572 | | |
| 573 | 546 | }, |
| 574 | 547 | |
| 575 | 548 | deactivate: function() { |
| 576 | | |
| 577 | | window.stickymenu && window.stickymenu.enable(); |
| 578 | | |
| | 549 | stickyMenu.enable(); |
| 579 | 550 | this.enableDraggables(); |
| 580 | | this.removeHamburgerButton(); |
| 581 | 551 | this.restorePostSearch(); |
| 582 | | |
| 583 | 552 | }, |
| 584 | 553 | |
| 585 | | matchMedia: function() { |
| 586 | | clearTimeout( this.resizeTimeout ); |
| 587 | | this.resizeTimeout = setTimeout( function() { |
| 588 | | |
| 589 | | if ( ! window.matchMedia ) |
| | 554 | toggleElements: function() { |
| | 555 | var width = this.$window.width(); |
| | 556 | if ( width <= 782 ) { |
| | 557 | if ( responsive.$html.hasClass( 'touch' ) ) { |
| 590 | 558 | return; |
| 591 | | |
| 592 | | if ( window.matchMedia( '(max-width: 782px)' ).matches ) { |
| 593 | | if ( moby6.$html.hasClass( 'touch' ) ) |
| 594 | | return; |
| 595 | | moby6.$html.addClass( 'touch' ).trigger( 'activate.moby6' ); |
| 596 | | } else { |
| 597 | | if ( ! moby6.$html.hasClass( 'touch' ) ) |
| 598 | | return; |
| 599 | | moby6.$html.removeClass( 'touch' ).trigger( 'deactivate.moby6' ); |
| 600 | 559 | } |
| 601 | 560 | |
| 602 | | if ( window.matchMedia( '(max-width: 480px)' ).matches ) { |
| 603 | | moby6.enableOverlay(); |
| 604 | | } else { |
| 605 | | moby6.disableOverlay(); |
| | 561 | responsive.$html.addClass( 'touch' ).trigger( 'activate.responsive' ); |
| | 562 | } else { |
| | 563 | if ( ! responsive.$html.hasClass( 'touch' ) ) { |
| | 564 | return; |
| 606 | 565 | } |
| 607 | 566 | |
| 608 | | }, 150 ); |
| | 567 | responsive.$html.removeClass( 'touch' ).trigger( 'deactivate.responsive' ); |
| | 568 | } |
| | 569 | |
| | 570 | if ( width <= 480 ) { |
| | 571 | responsive.enableOverlay(); |
| | 572 | } else { |
| | 573 | responsive.disableOverlay(); |
| | 574 | } |
| 609 | 575 | }, |
| 610 | 576 | |
| 611 | 577 | enableOverlay: function() { |
| 612 | 578 | if ( this.$overlay.length === 0 ) { |
| 613 | | this.$overlay = $( '<div id="moby6-overlay"></div>' ) |
| | 579 | this.$overlay = $( '<div id="responsive-overlay"></div>' ) |
| 614 | 580 | .insertAfter( '#wpcontent' ) |
| 615 | 581 | .hide() |
| 616 | | .on( 'click.moby6', function() { |
| 617 | | moby6.$toolbar.find( '.menupop.hover' ).removeClass( 'hover' ); |
| | 582 | .on( 'click.responsive', function() { |
| | 583 | responsive.$toolbar.find( '.menupop.hover' ).removeClass( 'hover' ); |
| 618 | 584 | $( this ).hide(); |
| 619 | 585 | }); |
| 620 | 586 | } |
| 621 | | this.$toolbarPopups.on( 'click.moby6', function() { |
| 622 | | moby6.$overlay.show(); |
| | 587 | this.$toolbarPopups.on( 'click.responsive', function() { |
| | 588 | responsive.$overlay.show(); |
| 623 | 589 | }); |
| 624 | 590 | }, |
| 625 | 591 | |
| 626 | 592 | disableOverlay: function() { |
| 627 | | this.$toolbarPopups.off( 'click.moby6' ); |
| | 593 | this.$toolbarPopups.off( 'click.responsive' ); |
| 628 | 594 | this.$overlay.hide(); |
| 629 | 595 | }, |
| 630 | 596 | |
| … |
… |
var moby6 = { |
| 633 | 599 | this.$adminmenu.find( 'a.wp-has-submenu' ).off( '.wp-mobile-hover' ); |
| 634 | 600 | |
| 635 | 601 | var scrollStart = 0; |
| 636 | | this.$adminmenu.on( 'touchstart.moby6', 'li.wp-has-submenu > a', function() { |
| 637 | | scrollStart = $( window ).scrollTop(); |
| | 602 | this.$adminmenu.on( 'touchstart.responsive', 'li.wp-has-submenu > a', function() { |
| | 603 | scrollStart = responsive.$window.scrollTop(); |
| 638 | 604 | }); |
| 639 | 605 | |
| 640 | | this.$adminmenu.on( 'touchend.moby6', 'li.wp-has-submenu > a', function( e ) { |
| | 606 | this.$adminmenu.on( 'touchend.responsive', 'li.wp-has-submenu > a', function( e ) { |
| 641 | 607 | e.preventDefault(); |
| 642 | 608 | |
| 643 | | if ( $( window ).scrollTop() !== scrollStart ) |
| 644 | | return false; |
| | 609 | if ( responsive.$window.scrollTop() !== scrollStart ) { |
| | 610 | return; |
| | 611 | } |
| 645 | 612 | |
| 646 | 613 | $( this ).find( 'li.wp-has-submenu' ).removeClass( 'selected' ); |
| 647 | 614 | $( this ).parent( 'li' ).addClass( 'selected' ); |
| … |
… |
var moby6 = { |
| 662 | 629 | .addClass( 'hndle' ); |
| 663 | 630 | }, |
| 664 | 631 | |
| 665 | | removeHamburgerButton: function() { |
| 666 | | if ( this.hamburgerButtonView !== undefined ) |
| 667 | | this.hamburgerButtonView.destroy(); |
| 668 | | }, |
| 669 | | |
| 670 | 632 | movePostSearch: function() { |
| 671 | 633 | this.searchBox = this.$wpbody.find( 'p.search-box' ); |
| 672 | 634 | if ( this.searchBox.length ) { |
| … |
… |
var moby6 = { |
| 681 | 643 | restorePostSearch: function() { |
| 682 | 644 | if ( this.searchBox !== undefined ) { |
| 683 | 645 | this.searchBox.show(); |
| 684 | | if ( this.searchBoxClone !== undefined ) |
| | 646 | if ( this.searchBoxClone !== undefined ) { |
| 685 | 647 | this.searchBoxClone.hide(); |
| | 648 | } |
| 686 | 649 | } |
| 687 | 650 | } |
| 688 | 651 | }; |
| 689 | 652 | |
| 690 | | // Fire moby6.init when document is ready |
| 691 | | $( document ).ready( $.proxy( moby6.init, moby6 ) ); |
| | 653 | // Fire responsive.init when document is ready |
| | 654 | $( document ).ready( $.proxy( responsive.init, responsive ) ); |
| 692 | 655 | |
| 693 | 656 | // make Windows 8 devices playing along nicely |
| 694 | 657 | (function(){ |
diff --git src/wp-includes/css/admin-bar.css src/wp-includes/css/admin-bar.css
index 0f1f5d8..35837de 100644
|
|
|
|
| 947 | 947 | |
| 948 | 948 | /* Smartphone */ |
| 949 | 949 | @media screen and (max-width: 480px) { |
| 950 | | #moby6-overlay { |
| | 950 | #responsive-overlay { |
| 951 | 951 | position: fixed; |
| 952 | 952 | top: 0; |
| 953 | 953 | left: 0; |
diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
index b1f0680..bfafa83 100644
|
|
|
function wp_default_scripts( &$scripts ) { |
| 72 | 72 | 'time' => (string) time(), |
| 73 | 73 | ) ); |
| 74 | 74 | |
| 75 | | $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), false, 1 ); |
| | 75 | $scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils', 'underscore'), false, 1 ); |
| 76 | 76 | did_action( 'init' ) && $scripts->localize( 'common', 'commonL10n', array( |
| 77 | 77 | 'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete.") |
| 78 | 78 | ) ); |