Make WordPress Core

Ticket #34204: 34204.6.diff

File 34204.6.diff, 12.4 KB (added by pento, 9 years ago)
  • Gruntfile.js

     
    233233
    234234                                        // Exceptions
    235235                                        '!wp-includes/css/dashicons.css',
    236                                         '!wp-includes/css/wp-embed-template.css'
     236                                        '!wp-includes/css/wp-embed-template.css',
     237                                        '!wp-includes/css/wp-embed-template-ie.css'
    237238                                ]
    238239                        },
    239240                        colors: {
  • src/wp-includes/css/wp-embed-template-ie.css

     
     1/* Dashicons */
     2.dashicons {
     3        *display: inline;
     4        *zoom: 1;
     5}
     6
     7.dashicons-no {
     8        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAQAAAAngNWGAAAAcElEQVR4AdXRVxmEMBAGwJMQCUhAIhKQECmRsFJwMFfp7HfP/E8pk0173CuKpt/0R+WaBaaZqogLagBMuh+DdoKbyRCwqZ/SnM0R5oQuZ2UHS8Z6k23qPxZCTrV5UlHMi8bsfHVXP7K/GXZHaTO7S54CWLdHlN2YIwAAAABJRU5ErkJggg==);
     9        *background-image: url(../images/embed/close.png);
     10}
     11
     12.dashicons-admin-comments {
     13        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAATUlEQVR4AWMYWqCpvUcAiA8A8X9iMFStAD4DG0AKScQNVDZw1MBRAwvIMLCA5jmFlCD4AMQGlOTtBgoNwzQQ3TCKDaTcMMxYN2AYVgAAYPKsEBxN0PIAAAAASUVORK5CYII=);
     14        *background-image: url(../images/embed/comment.png);
     15        *background-position: 0 0;
     16}
     17
     18.wp-embed-comments a:hover .dashicons-admin-comments {
     19        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAATElEQVR4AWMYYqB4lQAQHwDi/8RgqFoBfAY2gBSSiBuobOCogaMGFpBhYAEdcwrhIPgAxAaU5O0GCg3DNBDdMIoNpNwwzFg3YBhWAABG71qAFYcFqgAAAABJRU5ErkJggg==);
     20        *background-image: url(../images/embed/comment.png);
     21        *background-position: 0 -40px;
     22}
     23
     24.dashicons-share {
     25        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAc0lEQVR4AWMYfqCpvccAiBcA8X8gfgDEBZQaeAFkGBoOoMR1/7HgDeQa2ECZgQiDHID4AMwAor0MCmBoQP+HBnwAskFQdgBRkQJViGk7wiAHUr21AYdhDTA1dDOQHl6mPFLokmwoT9j0z3qUFw70L77oDwAiuzCIub1XpQAAAABJRU5ErkJggg==);
     26        *background-image: url(../images/embed/share.png);
     27        *background-position: 0 0;
     28}
     29
     30.wp-embed-share-dialog-open:hover .dashicons-share {
     31        background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAc0lEQVR4AWMYhqB4lQEQLwDi/0D8AIgLKDXwAsgwNBxAiev+Y8EbyDWwgTIDEQY5APEBmAFEexkUwNCA/g8N+ABkg6DsAKIiBaoQ03aEQQ6kemsDDsMaYEroZiA9vEx5pNAl2VCesOmf9SgvHOhffNEfAAAMqPR5IEZH5wAAAABJRU5ErkJggg==);
     32        *background-image: url(../images/embed/share.png);
     33        *background-position: 0 -40px;
     34}
     35
     36.wp-embed-share-dialog {
     37        *background-color: #222;
     38}
  • src/wp-includes/css/wp-embed-template.css

     
    1919/* Dashicons */
    2020.dashicons {
    2121        display: inline-block;
     22        *display: inline;
     23        *zoom: 1;
    2224        width: 20px;
    2325        height: 20px;
    2426        background-color: transparent;
     
    4648
    4749.dashicons-share {
    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");
     51        display: none;
    4952}
    5053
     54.js .dashicons-share {
     55        display: block;
     56}
     57
    5158.wp-embed-share-dialog-open:hover .dashicons-share {
    5259        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");
    5360}
     
    139146.wp-embed-site-title a {
    140147        position: relative;
    141148        display: inline-block;
     149        *display: inline;
     150        *zoom: 1;
    142151        padding-left: 35px;
    143152}
    144153
     
    145154.wp-embed-site-title,
    146155.wp-embed-meta {
    147156        display: table-cell;
     157        *display: inline;
     158        *zoom: 1;
    148159}
    149160
    150161.wp-embed-meta {
     
    156167.wp-embed-comments,
    157168.wp-embed-share {
    158169        display: inline;
     170        *zoom: 1;
    159171}
    160172
    161173.wp-embed-meta a:hover {
     
    166178.wp-embed-comments a {
    167179        line-height: 25px;
    168180        display: inline-block;
     181        *display: inline;
     182        *zoom: 1;
    169183}
    170184
    171185.wp-embed-comments + .wp-embed-share {
     
    178192        left: 0;
    179193        right: 0;
    180194        bottom: 0;
     195        background-color: #222;
    181196        background-color: rgba(10, 10, 10, 0.9);
    182197        color: #fff;
    183198        opacity: 1;
     
    254269}
    255270
    256271.wp-embed-share-tab-button {
    257         display: inline;
     272        display: inline-block;
     273        *display: inline;
     274        *zoom: 1;
    258275}
    259276
    260277.wp-embed-share-tab-button button {
  • src/wp-includes/default-filters.php

     
    443443add_action( 'wp_head',              'wp_oembed_add_discovery_links'        );
    444444add_action( 'wp_head',              'wp_oembed_add_host_js'                );
    445445
     446add_action( 'embed_head',           'enqueue_embed_scripts',          1    );
    446447add_action( 'embed_head',           'print_emoji_detection_script'         );
    447 add_action( 'embed_head',           'print_emoji_styles'                   );
    448448add_action( 'embed_head',           'print_embed_styles'                   );
    449449add_action( 'embed_head',           'wp_print_head_scripts',         20    );
    450450add_action( 'embed_head',           'wp_print_styles',               20    );
  • src/wp-includes/embed-functions.php

     
    376376        wp_enqueue_script( 'wp-embed' );
    377377}
    378378
    379 
    380379/**
    381380 * Retrieves the URL to embed a specific post in an iframe.
    382381 *
     
    805804}
    806805
    807806/**
     807 * Enqueue embed iframe default CSS and JS & fire do_action('enqueue_embed_scripts')
     808 *
     809 * Enqueue PNG fallback CSS for embed iframe for legacy versions of IE.
     810 *
     811 * Allows plugins to queue scripts for the embed iframe end using wp_enqueue_script().
     812 * Runs first in oembed_head().
     813 *
     814 * @since 4.4.0
     815 */
     816function enqueue_embed_scripts() {
     817        wp_enqueue_style( 'open-sans' );
     818        wp_enqueue_style( 'wp-embed-template-ie' );
     819
     820        /**
     821         * Fires when scripts and styles are enqueued for the embed iframe.
     822         *
     823         * @since 4.4.0
     824         */
     825        do_action( 'enqueue_embed_scripts' );
     826}
     827
     828/**
    808829 * Prints the CSS in the embed iframe header.
    809830 *
    810831 * @since 4.4.0
  • src/wp-includes/embed-template.php

     
    1414        header( 'X-WP-embed: true' );
    1515}
    1616
    17 wp_enqueue_style( 'open-sans' );
    18 
    1917?>
    2018<!DOCTYPE html>
    21 <html <?php language_attributes(); ?>>
     19<html <?php language_attributes(); ?> class="no-js">
    2220<head>
    2321        <title><?php echo wp_get_document_title(); ?></title>
    2422        <meta http-equiv="X-UA-Compatible" content="IE=edge">
  • src/wp-includes/js/wp-embed-template.js

     
    22        'use strict';
    33
    44        var secret = window.location.hash.replace( /.*secret=([\d\w]{10}).*/, '$1' ),
     5                supportedBrowser = ( 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 ( supportedBrowser ) {
     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-embed.js

     
    11(function ( window, document ) {
    22        'use strict';
    33
     4        var supportedBrowser = ( 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 );
     50        function onLoad() {
     51                if ( loaded ) {
     52                        return;
     53                }
     54                loaded = true;
    4855
    49         function onLoad() {
    5056                var isIE10 = -1 !== navigator.appVersion.indexOf( 'MSIE 10' ),
    5157                        isIE11 = !!navigator.userAgent.match( /Trident.*rv\:11\./ );
    5258
     
    5763                        for ( var i = 0; i < iframes.length; i++ ) {
    5864                                iframeClone = iframes[ i ].cloneNode( true );
    5965                                iframeClone.removeAttribute( 'security' );
    60                                 iframes[ i ].parentNode.insertBefore( iframeClone, iframes[ i ].nextSibling );
    61                                 iframes[ i ].parentNode.removeChild( iframes[ i ] );
     66                                iframes[ i ].parentNode.replaceChild( iframeClone, iframes[ i ] );
    6267                        }
    6368                }
    6469        }
    6570
    66         document.addEventListener( 'DOMContentLoaded', onLoad, false );
     71        if ( supportedBrowser ) {
     72                window.addEventListener( 'message', window.wp.receiveEmbedMessage, false );
     73                document.addEventListener( 'DOMContentLoaded', onLoad, false );
     74                window.addEventListener( 'load', onLoad, false );
     75        }
    6776})( window, document );
  • src/wp-includes/script-loader.php

     
    727727        $styles->add( 'open-sans', $open_sans_font_url );
    728728
    729729        // Includes CSS
    730         $styles->add( 'admin-bar',         "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) );
    731         $styles->add( 'wp-auth-check',     "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
    732         $styles->add( 'editor-buttons',    "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
    733         $styles->add( 'media-views',       "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
    734         $styles->add( 'wp-pointer',        "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
    735         $styles->add( 'customize-preview', "/wp-includes/css/customize-preview$suffix.css" );
     730        $styles->add( 'admin-bar',            "/wp-includes/css/admin-bar$suffix.css", array( 'open-sans', 'dashicons' ) );
     731        $styles->add( 'wp-auth-check',        "/wp-includes/css/wp-auth-check$suffix.css", array( 'dashicons' ) );
     732        $styles->add( 'editor-buttons',       "/wp-includes/css/editor$suffix.css", array( 'dashicons' ) );
     733        $styles->add( 'media-views',          "/wp-includes/css/media-views$suffix.css", array( 'buttons', 'dashicons', 'wp-mediaelement' ) );
     734        $styles->add( 'wp-pointer',           "/wp-includes/css/wp-pointer$suffix.css", array( 'dashicons' ) );
     735        $styles->add( 'customize-preview',    "/wp-includes/css/customize-preview$suffix.css" );
     736        $styles->add( 'wp-embed-template-ie', "/wp-includes/css/wp-embed-template-ie$suffix.css" );
     737        $styles->add_data( 'wp-embed-template-ie', 'conditional', 'lte IE 8' );
    736738
    737739        // External libraries and friends
    738740        $styles->add( 'imgareaselect',       '/wp-includes/js/imgareaselect/imgareaselect.css', array(), '0.9.8' );