Make WordPress Core

Ticket #38995: 38995.3.patch

File 38995.3.patch, 15.5 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..bf45c26 100644
    img { 
    6565        display: block;
    6666}
    6767
    68 .custom-header-image {
     68.custom-header-media {
    6969        background-position: bottom center;
    7070}
    7171
    img { 
    8484        width: 100%;
    8585}
    8686
    87 .has-header-image .custom-header-image img,
    88 .has-header-image .custom-header-image video {
     87.has-header-image .custom-header-media img {
    8988        left: 0;
    9089        top: 0;
    9190}
    img { 
    142141        padding-top: 0;
    143142}
    144143
    145 .twentyseventeen-front-page .custom-header-image,
    146 .blog.home .custom-header-image {
     144.twentyseventeen-front-page .custom-header-media,
     145.blog.home .custom-header-media {
    147146        background-position: center center;
    148147}
    149148
  • 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..11c9ed4 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 ).removeClass( 'has-header-video' );
     134                                }
    131135                        } );
    132136                } );
    133137        } );
  • 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..6e2f429 100644
     
    44        // Variables and DOM Caching.
    55        var $body = $( 'body' ),
    66                $customHeader = $body.find( '.custom-header' ),
    7                 $customHeaderImage = $customHeader.find( '.custom-header-image' ),
    87                $branding = $customHeader.find( '.site-branding' ),
    98                $navigation = $body.find( '.navigation-top' ),
    109                $navWrap = $navigation.find( '.wrap' ),
     
    6463                        // Make sure the nav isn't taller than two rows.
    6564                        if ( navIsNotTooTall ) {
    6665
    67                                 // When there's a custom header image, the header offset includes the height of the navigation.
    68                                 if ( isFrontPage && $customHeaderImage.length ) {
     66                                // When there's a custom header image or video, the header offset includes the height of the navigation.
     67                                if ( isFrontPage && ( $body.hasClass( 'has-header-image' ) || $body.hasClass( 'has-header-video' ) ) ) {
    6968                                        headerOffset = $customHeader.innerHeight() - navigationOuterHeight;
    7069                                } else {
    7170                                        headerOffset = $customHeader.innerHeight();
     
    242241                setTimeout( adjustHeaderHeight, 1000 );
    243242        });
    244243
     244        // Add header video class after the video is loaded.
     245        $( document ).on( 'wp-custom-header-video-loaded', function() {
     246                $body.addClass( 'has-header-video' );
     247        });
     248
    245249})( 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..55e39d7 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.has-header-image .site-description { 
    16091612        width: auto;
    16101613}
    16111614
    1612 body.home.title-tagline-hidden.has-header-image .custom-logo-link img {
     1615body.home.title-tagline-hidden.has-header-image .custom-logo-link img,
     1616body.home.title-tagline-hidden.has-header-video .custom-logo-link img {
    16131617        max-height: 200px;
    16141618        max-width: 100%;
    16151619}
    body:not(.title-tagline-hidden) .site-branding-text { 
    16291633}
    16301634
    16311635.has-header-image.twentyseventeen-front-page .custom-header,
    1632 .has-header-image.home.blog .custom-header {
     1636.has-header-video.twentyseventeen-front-page .custom-header,
     1637.has-header-image.home.blog .custom-header,
     1638.has-header-video.home.blog .custom-header {
    16331639        display: table;
    16341640        height: 300px;
    16351641        height: 75vh;
    16361642        width: 100%;
    16371643}
    16381644
    1639 .custom-header-image {
     1645.custom-header-media {
    16401646        bottom: 0;
    16411647        left: 0;
    16421648        overflow: hidden;
    body:not(.title-tagline-hidden) .site-branding-text { 
    16461652        width: 100%;
    16471653}
    16481654
    1649 .custom-header-image:before {
     1655.custom-header-media:before {
    16501656        /* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#000000+0,000000+100&0+0,0.3+75 */
    16511657        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 */
    16521658        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 { 
    16621668        z-index: 2;
    16631669}
    16641670
    1665 .has-header-image .custom-header-image img,
    1666 .has-header-image .custom-header-image video,
    1667 .has-header-image .custom-header-image iframe {
     1671.has-header-image .custom-header-media img,
     1672.has-header-video .custom-header-media video,
     1673.has-header-video .custom-header-media iframe {
    16681674        position: fixed;
    16691675        height: auto;
    16701676        left: 50%;
    body:not(.title-tagline-hidden) .site-branding-text { 
    17071713        top: 62px;
    17081714}
    17091715
    1710 .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image img {
     1716.has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media img {
    17111717        bottom: 0;
    17121718        position: absolute;
    17131719        top: auto;
    body:not(.title-tagline-hidden) .site-branding-text { 
    17191725
    17201726/* Hides div in Customizer preview when header images or videos change. */
    17211727
    1722 body:not(.has-header-image) .custom-header-image {
     1728body:not(.has-header-image):not(.has-header-video) .custom-header-media {
    17231729        display: none;
    17241730}
    17251731
    17261732.has-header-image.twentyseventeen-front-page .site-branding,
    1727 .has-header-image.home.blog .site-branding {
     1733.has-header-video.twentyseventeen-front-page .site-branding,
     1734.has-header-image.home.blog .site-branding,
     1735.has-header-video.home.blog .site-branding {
    17281736        display: table-cell;
    17291737        height: 100%;
    17301738        vertical-align: bottom;
    object { 
    32703278        }
    32713279
    32723280        .has-header-image.twentyseventeen-front-page .site-branding,
    3273         .has-header-image.home.blog .site-branding {
     3281        .has-header-video.twentyseventeen-front-page .site-branding,
     3282        .has-header-image.home.blog .site-branding,
     3283        .has-header-video.home.blog .site-branding {
    32743284                bottom: 0;
    32753285                display: block;
    32763286                left: 0;
    object { 
    32813291        }
    32823292
    32833293        .has-header-image.twentyseventeen-front-page .custom-header,
    3284         .has-header-image.home.blog .custom-header {
     3294        .has-header-video.twentyseventeen-front-page .custom-header,
     3295        .has-header-image.home.blog .custom-header,
     3296        .has-header-video.home.blog .custom-header {
    32853297                display: block;
    32863298                height: auto;
    32873299        }
    32883300
    3289         .custom-header-image {
     3301        .custom-header-media {
    32903302                height: 165px;
    32913303                position: relative;
    32923304        }
    32933305
    3294         .twentyseventeen-front-page.has-header-image .custom-header-image,
    3295         .home.blog.has-header-image .custom-header-image {
     3306        .twentyseventeen-front-page.has-header-image .custom-header-media,
     3307        .twentyseventeen-front-page.has-header-video .custom-header-media,
     3308        .home.blog.has-header-image .custom-header-media,
     3309        .home.blog.has-header-video .custom-header-media {
    32963310                height: 0;
    32973311                position: relative;
    32983312        }
    32993313
    3300         .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-image {
     3314        .has-header-image:not(.twentyseventeen-front-page):not(.home) .custom-header-media,
     3315        .has-header-video:not(.twentyseventeen-front-page):not(.home) .custom-header-media {
    33013316                bottom: 0;
    33023317                height: auto;
    33033318                left: 0;
    object { 
    33113326        }
    33123327
    33133328        .custom-logo-link img,
    3314         body.home.title-tagline-hidden.has-header-image .custom-logo-link img {
     3329        body.home.title-tagline-hidden.has-header-image .custom-logo-link img,
     3330        body.home.title-tagline-hidden.has-header-video .custom-logo-link img {
    33153331                max-width: 350px;
    33163332        }
    33173333
    3318         .title-tagline-hidden.home.has-header-image .custom-logo-link img {
     3334        .title-tagline-hidden.home.has-header-image .custom-logo-link img,
     3335        .title-tagline-hidden.home.has-header-video .custom-logo-link img {
    33193336                max-height: 200px;
    33203337        }
    33213338
    object { 
    35773594        /* Front Page */
    35783595
    35793596        .twentyseventeen-front-page.has-header-image .site-branding,
    3580         .home.blog.has-header-image .site-branding {
     3597        .twentyseventeen-front-page.has-header-video .site-branding,
     3598        .home.blog.has-header-image .site-branding,
     3599        .home.blog.has-header-video .site-branding {
    35813600                margin-bottom: 70px;
    35823601        }
    35833602
    3584         .twentyseventeen-front-page.has-header-image .custom-header-image,
    3585         .home.blog.has-header-image .custom-header-image {
     3603        .twentyseventeen-front-page.has-header-image .custom-header-media,
     3604        .twentyseventeen-front-page.has-header-video .custom-header-media,
     3605        .home.blog.has-header-image .custom-header-media,
     3606        .home.blog.has-header-video .custom-header-media {
    35863607                height: 1200px;
    35873608                height: 100vh;
    35883609                max-height: 100%;
    35893610                overflow: hidden;
    35903611        }
    35913612
    3592         .twentyseventeen-front-page.has-header-image .custom-header-image:before,
    3593         .home.blog.has-header-image .custom-header-image:before {
     3613        .twentyseventeen-front-page.has-header-image .custom-header-media:before,
     3614        .twentyseventeen-front-page.has-header-video .custom-header-media:before,
     3615        .home.blog.has-header-image .custom-header-media:before,
     3616        .home.blog.has-header-video .custom-header-media:before {
    35943617                height: 33%;
    35953618        }
    35963619
    3597         .admin-bar.twentyseventeen-front-page.has-header-image .custom-header-image,
    3598         .admin-bar.home.blog.has-header-image .custom-header-image {
     3620        .admin-bar.twentyseventeen-front-page.has-header-image .custom-header-media,
     3621        .admin-bar.twentyseventeen-front-page.has-header-video .custom-header-media,
     3622        .admin-bar.home.blog.has-header-image .custom-header-media,
     3623        .admin-bar.home.blog.has-header-video .custom-header-media {
    35993624                height: calc(100vh - 32px);
    36003625        }
    36013626
    object { 
    41054130                padding: 0;
    41064131        }
    41074132
    4108         .custom-header-image {
     4133        .custom-header-media {
    41094134                padding: 0;
    41104135        }
    41114136
    41124137        .twentyseventeen-front-page.has-header-image .site-branding,
    4113         .home.blog.has-header-image .site-branding {
     4138        .twentyseventeen-front-page.has-header-video .site-branding,
     4139        .home.blog.has-header-image .site-branding,
     4140        .home.blog.has-header-video .site-branding {
    41144141                position: relative;
    41154142        }
    41164143
    object { 
    41494176        a,
    41504177        .site-title a,
    41514178        .twentyseventeen-front-page.has-header-image .site-title,
    4152         .twentyseventeen-front-page.has-header-image .site-title a {
     4179        .twentyseventeen-front-page.has-header-video .site-title,
     4180        .twentyseventeen-front-page.has-header-image .site-title a,
     4181        .twentyseventeen-front-page.has-header-video .site-title a {
    41534182                color: #222 !important; /* Make sure color schemes don't affect to print */
    41544183        }
    41554184
    object { 
    41584187        blockquote,
    41594188        .site-description,
    41604189        .twentyseventeen-front-page.has-header-image .site-description,
     4190        .twentyseventeen-front-page.has-header-video .site-description,
    41614191        .entry-meta,
    41624192        .entry-meta a {
    41634193                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..6398b22 100644
     
    11<?php
    22/**
    3  * Displays header image
     3 * Displays header media
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Seventeen
     
    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