Make WordPress Core

Ticket #34204: 34204.3.diff

File 34204.3.diff, 9.7 KB (added by peterwilsoncc, 9 years ago)
  • Gruntfile.js

    diff --git a/Gruntfile.js b/Gruntfile.js
    index b8dd5f8..29173b4 100644
    a b module.exports = function(grunt) { 
    233233
    234234                                        // Exceptions
    235235                                        '!wp-includes/css/dashicons.css',
    236                                         '!wp-includes/css/wp-oembed-embed.css'
     236                                        '!wp-includes/css/wp-oembed-embed.css',
     237                                        '!wp-includes/css/wp-oembed-embed-ie.css'
    237238                                ]
    238239                        },
    239240                        colors: {
  • src/wp-includes/css/wp-oembed-embed.css

    diff --git a/src/wp-includes/css/wp-oembed-embed.css b/src/wp-includes/css/wp-oembed-embed.css
    index 9ea586b..0e85aae 100644
    a b body { 
    1919/* Dashicons */
    2020.dashicons {
    2121        display: inline-block;
     22        *display: inline;
     23        *zoom: 1;
    2224        width: 20px;
    2325        height: 20px;
    2426        background-color: transparent;
    body { 
    4850        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%2382878c%27%2F%3E%3C%2Fsvg%3E");
    4951}
    5052
     53.no-js .dashicons-share {
     54        display: none;
     55}
     56
    5157.wp-embed-share-dialog-open:hover .dashicons-share {
    5258        background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.5%2012q1.24%200%202.12.88T17.5%2015t-.88%202.12-2.12.88-2.12-.88T11.5%2015q0-.34.09-.69l-4.38-2.3Q6.32%2013%205%2013q-1.24%200-2.12-.88T2%2010t.88-2.12T5%207q1.3%200%202.21.99l4.38-2.3q-.09-.35-.09-.69%200-1.24.88-2.12T14.5%202t2.12.88T17.5%205t-.88%202.12T14.5%208q-1.3%200-2.21-.99l-4.38%202.3Q8%209.66%208%2010t-.09.69l4.38%202.3q.89-.99%202.21-.99z%27%20fill%3D%27%230073aa%27%2F%3E%3C%2Fsvg%3E");
    5359}
    p.wp-embed-heading { 
    139145.wp-embed-site-title a {
    140146        position: relative;
    141147        display: inline-block;
     148        *display: inline;
     149        *zoom: 1;
    142150        padding-left: 35px;
    143151}
    144152
    145153.wp-embed-site-title,
    146154.wp-embed-meta {
    147155        display: table-cell;
     156        *display: inline;
     157        *zoom: 1;
    148158}
    149159
    150160.wp-embed-meta {
    p.wp-embed-heading { 
    156166.wp-embed-comments,
    157167.wp-embed-share {
    158168        display: inline;
     169        *zoom: 1;
    159170}
    160171
    161172.wp-embed-meta a:hover {
    p.wp-embed-heading { 
    166177.wp-embed-comments a {
    167178        line-height: 25px;
    168179        display: inline-block;
     180        *display: inline;
     181        *zoom: 1;
    169182}
    170183
    171184.wp-embed-comments + .wp-embed-share {
    p.wp-embed-heading { 
    178191        left: 0;
    179192        right: 0;
    180193        bottom: 0;
     194        background-color: #222;
    181195        background-color: rgba(10, 10, 10, 0.9);
    182196        color: #fff;
    183197        opacity: 1;
    p.wp-embed-heading { 
    254268}
    255269
    256270.wp-embed-share-tab-button {
    257         display: inline;
     271        display: inline-block;
     272        *display: inline;
     273        *zoom: 1;
    258274}
    259275
    260276.wp-embed-share-tab-button button {
    html[dir="rtl"] .wp-embed-share-tab-button + .wp-embed-share-tab-button { 
    355371        padding: 0 11px 0 0;
    356372        border-left: none;
    357373        border-right: 1px solid #aaa;
    358 }
     374}
     375 No newline at end of file
  • src/wp-includes/default-filters.php

    diff --git a/src/wp-includes/default-filters.php b/src/wp-includes/default-filters.php
    index 75dadfc..42491f3 100644
    a b add_action( 'parse_query', 'wp_oembed_parse_query' ); 
    446446add_action( 'wp_head',              'wp_oembed_add_discovery_links'        );
    447447add_action( 'wp_head',              'wp_oembed_add_host_js'                );
    448448
     449add_action( 'oembed_head',          'wp_oembed_enqueue_scripts',     1     );
    449450add_action( 'oembed_head',          'print_emoji_detection_script'         );
    450451add_action( 'oembed_head',          'print_emoji_styles'                   );
    451452add_action( 'oembed_head',          'print_oembed_embed_styles'            );
  • src/wp-includes/embed-functions.php

    diff --git a/src/wp-includes/embed-functions.php b/src/wp-includes/embed-functions.php
    index 094d8cd..70c8f0b 100644
    a b function wp_oembed_excerpt_attachment( $content ) { 
    802802}
    803803
    804804/**
     805 * Enqueue embed iframe default CSS and JS & fire do_action('wp_oembed_enqueue_scripts')
     806 *
     807 * Enqueue PNG fallback CSS for embed iframe for legacy versions of IE.
     808 *
     809 * Allows plugins to queue scripts for the embed iframe end using wp_enqueue_script().
     810 * Runs first in oembed_head().
     811 *
     812 * @since 4.4.0
     813 */
     814function wp_oembed_enqueue_scripts() {
     815        wp_enqueue_style( 'wp-oembed-embed-ie' );
     816        /**
     817         * Fires when scripts and styles are enqueued for the embed iframe.
     818         *
     819         * @since 4.4.0
     820         */
     821        do_action( 'wp_oembed_enqueue_scripts' );
     822}
     823
     824/**
    805825 * Prints the CSS in the embed iframe header.
    806826 *
    807827 * @since 4.4.0
  • src/wp-includes/embed-template.php

    diff --git a/src/wp-includes/embed-template.php b/src/wp-includes/embed-template.php
    index 9d5371c2..2cebdeb 100644
    a b wp_enqueue_style( 'open-sans' ); 
    1818
    1919?>
    2020<!DOCTYPE html>
    21 <html <?php language_attributes(); ?>>
     21<html <?php language_attributes(); ?> class="no-js">
    2222<head>
    2323        <title><?php wp_title( '-', true, 'right' ); ?></title>
    2424        <meta http-equiv="X-UA-Compatible" content="IE=edge">
  • src/wp-includes/js/wp-oembed-embed.js

    diff --git a/src/wp-includes/js/wp-oembed-embed.js b/src/wp-includes/js/wp-oembed-embed.js
    index 847ebcf..114a9e4 100644
    a b  
    22        'use strict';
    33
    44        var secret = window.location.hash.replace( /.*secret=([\d\w]{10}).*/, '$1' ),
     5                featuredBrowser = ( document.querySelector && window.addEventListener ),
     6                loaded = false,
    57                resizing;
    68
    79        function sendEmbedMessage( message, value ) {
     
    1315        }
    1416
    1517        function onLoad() {
     18                if ( loaded ) {
     19                        return;
     20                }
     21                loaded = true;
     22
    1623                var share_dialog = document.querySelector( '.wp-embed-share-dialog' ),
    1724                        share_dialog_open = document.querySelector( '.wp-embed-share-dialog-open' ),
    1825                        share_dialog_close = document.querySelector( '.wp-embed-share-dialog-close' ),
     
    141148                }
    142149        }
    143150
    144         document.addEventListener( 'DOMContentLoaded', onLoad, false );
    145 
    146151        /**
    147152         * Iframe resize handler.
    148153         */
     
    158163                }, 100 );
    159164        }
    160165
    161         window.addEventListener( 'resize', onResize, false );
     166        if ( featuredBrowser ) {
     167                document.documentElement.className = document.documentElement.className.replace( /\bno-js\b/, '' ) + ' js';
     168                document.addEventListener( 'DOMContentLoaded', onLoad, false );
     169                window.addEventListener( 'load', onLoad, false );
     170                window.addEventListener( 'resize', onResize, false );
     171        }
    162172})( window, document );
  • src/wp-includes/js/wp-oembed.js

    diff --git a/src/wp-includes/js/wp-oembed.js b/src/wp-includes/js/wp-oembed.js
    index dd03bc0..6e92082 100644
    a b  
    11(function ( window, document ) {
    22        'use strict';
    33
     4        var featuredBrowser = ( document.querySelector && window.addEventListener ),
     5                loaded = false;
     6
    47        window.wp = window.wp || {};
    58
    69        if ( !! window.wp.receiveEmbedMessage ) {
     
    4447                }
    4548        };
    4649
    47         window.addEventListener( 'message', window.wp.receiveEmbedMessage, false );
    48 
    4950        function onLoad() {
     51                if ( loaded ) {
     52                        return;
     53                }
     54                loaded = true;
     55
    5056                var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ),
    5157                        isIE11 = !!navigator.userAgent.match( /Trident.*rv\:11\./ );
    5258
     
    6369                }
    6470        }
    6571
    66         document.addEventListener( 'DOMContentLoaded', onLoad, false );
     72        if ( featuredBrowser ) {
     73                window.addEventListener( 'message', window.wp.receiveEmbedMessage, false );
     74                document.addEventListener( 'DOMContentLoaded', onLoad, false );
     75                window.addEventListener( 'load', onLoad, false );
     76        }
    6777})( window, document );
  • src/wp-includes/script-loader.php

    diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php
    index cb88adc..b5db5f2 100644
    a b function wp_default_styles( &$styles ) { 
    728728        $styles->add( 'open-sans', $open_sans_font_url );
    729729
    730730        // Includes CSS
    731         $styles->add( 'admin-bar',         "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) );
    732         $styles->add( 'wp-auth-check',     "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
    733         $styles->add( 'editor-buttons',    "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
    734         $styles->add( 'media-views',       "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
    735         $styles->add( 'wp-pointer',        "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
    736         $styles->add( 'customize-preview', "/wp-includes/css/customize-preview$suffix.css" );
     731        $styles->add( 'admin-bar',           "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) );
     732        $styles->add( 'wp-auth-check',       "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
     733        $styles->add( 'editor-buttons',      "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
     734        $styles->add( 'media-views',         "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
     735        $styles->add( 'wp-pointer',          "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
     736        $styles->add( 'customize-preview',   "/wp-includes/css/customize-preview$suffix.css" );
     737        $styles->add( 'wp-oembed-embed-ie',  "/wp-includes/css/wp-oembed-embed-ie$suffix.css" );
     738        $styles->add_data( 'wp-oembed-embed-ie', 'conditional', 'lte IE 8' );
    737739
    738740        // External libraries and friends
    739741        $styles->add( 'imgareaselect',       '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );