Make WordPress Core

Ticket #38995: 38995.1.patch

File 38995.1.patch, 16.0 KB (added by joemcgill, 9 years ago)
  • src/wp-content/themes/twentyseventeen/assets/css/ie8.css

    diff --git src/wp-content/themes/twentyseventeen/assets/css/ie8.css src/wp-content/themes/twentyseventeen/assets/css/ie8.css
    index 83342ba..624687b 100644
    img { 
    6161}
    6262
    6363.has-header-image.twentyseventeen-front-page .custom-header,
    64 .has-header-image.home.blog .custom-header {
     64.has-header-video.twentyseventeen-front-page .custom-header,
     65.has-header-image.home.blog .custom-header,
     66.has-header-video.home.blog .custom-header {
    6567        display: block;
    6668}
    6769
    68 .custom-header-image {
     70.custom-header-media {
    6971        background-position: bottom center;
    7072}
    7173
    img { 
    7476}
    7577
    7678.has-header-image.twentyseventeen-front-page .site-branding,
    77 .has-header-image.home.blog .site-branding {
     79.has-header-video.twentyseventeen-front-page .site-branding,
     80.has-header-image.home.blog .site-branding,
     81.has-header-video.home.blog .site-branding {
    7882        bottom: 0;
    7983        display: block;
    8084        left: 0;
    img { 
    8488        width: 100%;
    8589}
    8690
    87 .has-header-image .custom-header-image img,
    88 .has-header-image .custom-header-image video {
     91.has-header-image .custom-header-media img,
     92.has-header-video .custom-header-media video {
    8993        left: 0;
    9094        top: 0;
    9195}
    img { 
    135139/* Front Page */
    136140
    137141.twentyseventeen-front-page.has-header-image .custom-header,
     142.twentyseventeen-front-page.has-header-video .custom-header,
    138143.blog.home.has-header-image .custom-header,
     144.blog.home.has-header-video .custom-header,
    139145.panel-image {
    140146        height: 800px;
    141147        max-height: 800px;
    142148        padding-top: 0;
    143149}
    144150
    145 .twentyseventeen-front-page .custom-header-image,
    146 .blog.home .custom-header-image {
     151.twentyseventeen-front-page .custom-header-media,
     152.blog.home .custom-header-media {
    147153        background-position: center center;
    148154}
    149155
    150156.twentyseventeen-front-page.has-header-image .site-branding,
    151 .home.blog.has-header-image .site-branding {
     157.twentyseventeen-front-page.has-header-video .site-branding,
     158.home.blog.has-header-image .site-branding,
     159.home.blog.has-header-video .site-branding {
    152160        bottom: 20px;
    153161        position: absolute;
    154162        width: 100%;
    ol.children .children { 
    210218/* RTL Styles */
    211219
    212220.rtl .has-header-image.twentyseventeen-front-page .site-branding,
    213 .rtl .has-header-image.home.blog .site-branding {
     221.rtl .has-header-video.twentyseventeen-front-page .site-branding,
     222.rtl .has-header-image.home.blog .site-branding,
     223.rtl .has-header-video.home.blog .site-branding {
    214224        left: auto;
    215225        right: 0;
    216226}
  • src/wp-content/themes/twentyseventeen/assets/css/ie9.css

    diff --git src/wp-content/themes/twentyseventeen/assets/css/ie9.css src/wp-content/themes/twentyseventeen/assets/css/ie9.css
    index 24c8905..9f8f766 100644
    Description: IE9 specific styles. 
    44*/
    55
    66.has-header-image.twentyseventeen-front-page .custom-header,
    7 .has-header-image.home.blog .custom-header {
     7.has-header-video.twentyseventeen-front-page .custom-header,
     8.has-header-image.home.blog .custom-header,
     9.has-header-video.home.blog .custom-header {
    810        height: 300px;
    911}
    1012
    11 .has-header-image .custom-header-image img,
    12 .has-header-image .custom-header-image video,
    13 .has-header-image .custom-header-image iframe {
     13.has-header-image .custom-header-media img,
     14.has-header-video .custom-header-media video,
     15.has-header-video .custom-header-media iframe {
    1416        min-width: 100%;
    1517}
    1618
    1719@media screen and (min-width: 30em) {
    1820
    1921        .has-header-image.twentyseventeen-front-page .custom-header,
     22        .has-header-video.twentyseventeen-front-page .custom-header,
    2023        .has-header-image.home.blog .custom-header,
    21         .twentyseventeen-front-page.has-header-image .custom-header-image,
    22         .home.blog.has-header-image .custom-header-image,
     24        .has-header-video.home.blog .custom-header,
     25        .twentyseventeen-front-page.has-header-image .custom-header-media,
     26        .home.blog.has-header-image .custom-header-media,
    2327        .panel-image {
    2428                height: 700px;
    2529        }
    Description: IE9 specific styles. 
    2832@media screen and (min-width: 48em) {
    2933
    3034        .has-header-image.twentyseventeen-front-page .custom-header,
     35        .has-header-video.twentyseventeen-front-page .custom-header,
    3136        .has-header-image.home.blog .custom-header,
    32         .twentyseventeen-front-page.has-header-image .custom-header-image,
    33         .home.blog.has-header-image .custom-header-image,
     37        .has-header-video.home.blog .custom-header,
     38        .twentyseventeen-front-page.has-header-image .custom-header-media,
     39        .home.blog.has-header-image .custom-header-media,
    3440        .panel-image {
    3541                height: 1000px;
    3642        }
  • src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js

    diff --git src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js src/wp-content/themes/twentyseventeen/assets/js/customize-preview.js
    index 651e034..9105c0a 100644
     
    123123        $.each( [ 'external_header_video', 'header_image', 'header_video' ], function( index, settingId ) {
    124124                wp.customize( settingId, function( setting ) {
    125125                        setting.bind(function() {
    126                                 if ( hasHeaderImage() || ( hasHeaderVideo() && $( 'body' ).hasClass( 'twentyseventeen-front-page' ) ) ) {
     126                                if ( hasHeaderImage() ) {
    127127                                        $( document.body ).addClass( 'has-header-image' );
    128128                                } else {
    129129                                        $( document.body ).removeClass( 'has-header-image' );
    130130                                }
     131
     132                                if ( hasHeaderVideo() ) {
     133                                        $( document.body ).addClass( 'has-header-video' );
     134                                } else {
     135                                        $( document.body ).removeClass( 'has-header-video' );
     136                                }
    131137                        } );
    132138                } );
    133139        } );
  • src/wp-content/themes/twentyseventeen/assets/js/global.js

    diff --git src/wp-content/themes/twentyseventeen/assets/js/global.js src/wp-content/themes/twentyseventeen/assets/js/global.js
    index cb8a6ec..cf1b3a5 100644
     
    44        // Variables and DOM Caching.
    55        var $body = $( 'body' ),
    66                $customHeader = $body.find( '.custom-header' ),
    7                 $customHeaderImage = $customHeader.find( '.custom-header-image' ),
     7                $customHeaderMedia = $customHeader.find( '.custom-header-media' ),
    88                $branding = $customHeader.find( '.site-branding' ),
    99                $navigation = $body.find( '.navigation-top' ),
    1010                $navWrap = $navigation.find( '.wrap' ),
     
    6565                        if ( navIsNotTooTall ) {
    6666
    6767                                // When there's a custom header image, the header offset includes the height of the navigation.
    68                                 if ( isFrontPage && $customHeaderImage.length ) {
     68                                if ( isFrontPage && $customHeaderMedia.length ) {
    6969                                        headerOffset = $customHeader.innerHeight() - navigationOuterHeight;
    7070                                } else {
    7171                                        headerOffset = $customHeader.innerHeight();
     
    242242                setTimeout( adjustHeaderHeight, 1000 );
    243243        });
    244244
     245        // Add header video class after the video is loaded.
     246        $( document ).on( 'wp-custom-header-video-loaded', function() {
     247                $body.addClass( 'has-header-video' );
     248        });
     249
    245250})( jQuery );
  • src/wp-content/themes/twentyseventeen/inc/color-patterns.php

    diff --git src/wp-content/themes/twentyseventeen/inc/color-patterns.php src/wp-content/themes/twentyseventeen/inc/color-patterns.php
    index c3913e1..f1ae457 100644
    body.colors-custom, 
    443443.colors-custom .next.page-numbers:focus,
    444444.colors-custom .next.page-numbers:hover,
    445445.colors-custom.has-header-image .site-title,
     446.colors-custom.has-header-video .site-title,
    446447.colors-custom.has-header-image .site-title a,
    447 .colors-custom.has-header-image .site-description {
     448.colors-custom.has-header-video .site-title a,
     449.colors-custom.has-header-image .site-description,
     450.colors-custom.has-header-video .site-description {
    448451        color: hsl( ' . $hue . ', ' . $saturation . ', 100% ); /* base: #fff; */
    449452}
    450453
  • src/wp-content/themes/twentyseventeen/inc/template-functions.php

    diff --git src/wp-content/themes/twentyseventeen/inc/template-functions.php src/wp-content/themes/twentyseventeen/inc/template-functions.php
    index 4479f37..6b136c4 100644
    function twentyseventeen_body_classes( $classes ) { 
    3535        }
    3636
    3737        // Add a class if there is a custom header.
    38         if ( has_header_image() || has_header_video() && is_front_page() ) {
     38        if ( has_header_image() ) {
    3939                $classes[] = 'has-header-image';
    4040        }
    4141
  • src/wp-content/themes/twentyseventeen/style.css

    diff --git src/wp-content/themes/twentyseventeen/style.css src/wp-content/themes/twentyseventeen/style.css
    index 0f17b19..f9e5a8e 100644
    body { 
    15801580}
    15811581
    15821582body.has-header-image .site-title,
    1583 body.has-header-image .site-title a {
     1583body.has-header-video .site-title,
     1584body.has-header-image .site-title a,
     1585body.has-header-video .site-title a {
    15841586        color: #fff;
    15851587}
    15861588
    body.has-header-image .site-title a { 
    15911593        margin-bottom: 0;
    15921594}
    15931595
    1594 body.has-header-image .site-description {
     1596body.has-header-image .site-description,
     1597body.has-header-video .site-description {
    15951598        color: #fff;
    15961599        opacity: 0.8;
    15971600}
    body:not(.title-tagline-hidden) .site-branding-text { 
    16291632}
    16301633
    16311634.has-header-image.twentyseventeen-front-page .custom-header,
    1632 .has-header-image.home.blog .custom-header {
     1635.has-header-video.twentyseventeen-front-page .custom-header,
     1636.has-header-image.home.blog .custom-header,
     1637.has-header-video.home.blog .custom-header {
    16331638        display: table;
    16341639        height: 300px;
    16351640        height: 75vh;
    16361641        width: 100%;
    16371642}
    16381643
    1639 .custom-header-image {
     1644.custom-header-media {
    16401645        bottom: 0;
    16411646        left: 0;
    16421647        overflow: hidden;
    body:not(.title-tagline-hidden) .site-branding-text { 
    16461651        width: 100%;
    16471652}
    16481653
    1649 .custom-header-image:before {
     1654.custom-header-media:before {
    16501655        /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0+0,0.3+75 */
    16511656        background: -moz-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* FF3.6-15 */
    16521657        background: -webkit-linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.3) 75%, rgba(0, 0, 0, 0.3) 100%); /* Chrome10-25,Safari5.1-6 */
    body:not(.title-tagline-hidden) .site-branding-text { 
    16621667        z-index: 2;
    16631668}
    16641669
    1665 .has-header-image .custom-header-image img,
    1666 .has-header-image .custom-header-image video,
    1667 .has-header-image .custom-header-image iframe {
     1670.has-header-image .custom-header-media img,
     1671.has-header-video .custom-header-media video,
     1672.has-header-video .custom-header-media iframe {
    16681673        position: fixed;
    16691674        height: auto;
    16701675        left: 50%;
    body:not(.title-tagline-hidden) .site-branding-text { 
    17071712        top: 62px;
    17081713}
    17091714
    1710 .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image img {
     1715.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
    17111716        bottom: 0;
    17121717        position: absolute;
    17131718        top: auto;
    body:not(.title-tagline-hidden) .site-branding-text { 
    17191724
    17201725/* Hides div in Customizer preview when header images or videos change. */
    17211726
    1722 body:not(.has-header-image) .custom-header-image {
     1727body:not(.has-header-image):not(.has-header-video) .custom-header-media {
    17231728        display: none;
    17241729}
    17251730
    17261731.has-header-image.twentyseventeen-front-page .site-branding,
    1727 .has-header-image.home.blog .site-branding {
     1732.has-header-video.twentyseventeen-front-page .site-branding,
     1733.has-header-image.home.blog .site-branding,
     1734.has-header-video.home.blog .site-branding {
    17281735        display: table-cell;
    17291736        height: 100%;
    17301737        vertical-align: bottom;
    object { 
    32703277        }
    32713278
    32723279        .has-header-image.twentyseventeen-front-page .site-branding,
    3273         .has-header-image.home.blog .site-branding {
     3280        .has-header-video.twentyseventeen-front-page .site-branding,
     3281        .has-header-image.home.blog .site-branding,
     3282        .has-header-video.home.blog .site-branding {
    32743283                bottom: 0;
    32753284                display: block;
    32763285                left: 0;
    object { 
    32813290        }
    32823291
    32833292        .has-header-image.twentyseventeen-front-page .custom-header,
    3284         .has-header-image.home.blog .custom-header {
     3293        .has-header-video.twentyseventeen-front-page .custom-header,
     3294        .has-header-image.home.blog .custom-header,
     3295        .has-header-video.home.blog .custom-header {
    32853296                display: block;
    32863297                height: auto;
    32873298        }
    32883299
    3289         .custom-header-image {
     3300        .custom-header-media {
    32903301                height: 165px;
    32913302                position: relative;
    32923303        }
    32933304
    3294         .twentyseventeen-front-page.has-header-image .custom-header-image,
    3295         .home.blog.has-header-image .custom-header-image {
     3305        .twentyseventeen-front-page.has-header-image .custom-header-media,
     3306        .twentyseventeen-front-page.has-header-video .custom-header-media,
     3307        .home.blog.has-header-image .custom-header-media,
     3308        .home.blog.has-header-video .custom-header-media {
    32963309                height: 0;
    32973310                position: relative;
    32983311        }
    32993312
    3300         .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image {
     3313        .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media,
     3314        .has-header-video:not(.twentyseventeen-front-page):not(.home) .custom-header-media {
    33013315                bottom: 0;
    33023316                height: auto;
    33033317                left: 0;
    object { 
    35773591        /* Front Page */
    35783592
    35793593        .twentyseventeen-front-page.has-header-image .site-branding,
    3580         .home.blog.has-header-image .site-branding {
     3594        .twentyseventeen-front-page.has-header-video .site-branding,
     3595        .home.blog.has-header-image .site-branding,
     3596        .home.blog.has-header-video .site-branding {
    35813597                margin-bottom: 70px;
    35823598        }
    35833599
    3584         .twentyseventeen-front-page.has-header-image .custom-header-image,
    3585         .home.blog.has-header-image .custom-header-image {
     3600        .twentyseventeen-front-page.has-header-image .custom-header-media,
     3601        .twentyseventeen-front-page.has-header-video .custom-header-media,
     3602        .home.blog.has-header-image .custom-header-media,
     3603        .home.blog.has-header-image .custom-header-video {
    35863604                height: 1200px;
    35873605                height: 100vh;
    35883606                max-height: 100%;
    35893607                overflow: hidden;
    35903608        }
    35913609
    3592         .twentyseventeen-front-page.has-header-image .custom-header-image:before,
    3593         .home.blog.has-header-image .custom-header-image:before {
     3610        .twentyseventeen-front-page.has-header-image .custom-header-media:before,
     3611        .twentyseventeen-front-page.has-header-image .custom-header-video:before,
     3612        .home.blog.has-header-image .custom-header-media:before,
     3613        .home.blog.has-header-image .custom-header-video:before {
    35943614                height: 33%;
    35953615        }
    35963616
    3597         .admin-bar.twentyseventeen-front-page.has-header-image .custom-header-image,
    3598         .admin-bar.home.blog.has-header-image .custom-header-image {
     3617        .admin-bar.twentyseventeen-front-page.has-header-image .custom-header-media,
     3618        .admin-bar.twentyseventeen-front-page.has-header-video .custom-header-media,
     3619        .admin-bar.home.blog.has-header-image .custom-header-media,
     3620        .admin-bar.home.blog.has-header-video .custom-header-media {
    35993621                height: calc(100vh - 32px);
    36003622        }
    36013623
    object { 
    41054127                padding: 0;
    41064128        }
    41074129
    4108         .custom-header-image {
     4130        .custom-header-media {
    41094131                padding: 0;
    41104132        }
    41114133
    41124134        .twentyseventeen-front-page.has-header-image .site-branding,
    4113         .home.blog.has-header-image .site-branding {
     4135        .twentyseventeen-front-page.has-header-video .site-branding,
     4136        .home.blog.has-header-image .site-branding,
     4137        .home.blog.has-header-video .site-branding {
    41144138                position: relative;
    41154139        }
    41164140
    object { 
    41494173        a,
    41504174        .site-title a,
    41514175        .twentyseventeen-front-page.has-header-image .site-title,
    4152         .twentyseventeen-front-page.has-header-image .site-title a {
     4176        .twentyseventeen-front-page.has-header-video .site-title,
     4177        .twentyseventeen-front-page.has-header-image .site-title a,
     4178        .twentyseventeen-front-page.has-header-video .site-title a {
    41534179                color: #222 !important; /* Make sure color schemes don't affect to print */
    41544180        }
    41554181
    object { 
    41584184        blockquote,
    41594185        .site-description,
    41604186        .twentyseventeen-front-page.has-header-image .site-description,
     4187        .twentyseventeen-front-page.has-header-video .site-description,
    41614188        .entry-meta,
    41624189        .entry-meta a {
    41634190                color: #777 !important; /* Make sure color schemes don't affect to print */
  • src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php

    diff --git src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php src/wp-content/themes/twentyseventeen/template-parts/header/header-image.php
    index 5dea9d8..57f043f 100644
     
    1111?>
    1212<div class="custom-header">
    1313
    14         <div class="custom-header-image">
     14        <div class="custom-header-media">
    1515                <?php the_custom_header_markup(); ?>
    1616        </div>
    1717