Make WordPress Core

Changeset 31758


Ignore:
Timestamp:
03/12/2015 09:59:04 PM (9 years ago)
Author:
ocean90
Message:

Update Twemoji to 1.3.0.

Includes a fix for Firefox: https://github.com/twitter/twemoji/commit/92d5bea1abf0183fd00d306511c541b55b414959
Since this fix breaks IE 11 we added modified = false; after subnode.parentNode.replaceChild(fragment, subnode).

props iseulde.
see #31242.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/twemoji.js

    r31756 r31758  
    11/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */
    2 var twemoji;
    3 twemoji = (function (
     2var twemoji = (function (
    43  /*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//*
    54    https://github.com/twitter/twemoji/blob/gh-pages/LICENSE
     
    328327      allText = grabAllTextNodes(node, []),
    329328      length = allText.length,
     329      modified = false,
    330330      fragment,
    331331      subnode,
     
    368368            img.alt = alt;
    369369            img.src = src;
     370            modified = true;
     371            fragment.appendChild(img);
    370372          }
    371373        }
    372         fragment.appendChild(img || createText(alt));
     374        if (!img) fragment.appendChild(createText(alt));
     375        img = null;
    373376      }
    374377      // is there actually anything to replace in here ?
    375       if (img) {
    376         img = null;
     378      if (modified) {
    377379        // any text left to be added ?
    378380        if (i < text.length) {
     
    384386        // anything else surrounding such text
    385387        subnode.parentNode.replaceChild(fragment, subnode);
     388        modified = false;
    386389      }
    387390    }
  • trunk/src/wp-includes/script-loader.php

    r31756 r31758  
    425425    $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 );
    426426
    427     $scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), false, 1 );
     427    $scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), '1.3.0', 1 );
    428428    $scripts->add( 'emoji', "/wp-includes/js/wp-emoji$suffix.js", array( 'twemoji' ), false, 1 );
    429429    did_action( 'init' ) && $scripts->localize( 'emoji', '_wpemojiSettings', array(
Note: See TracChangeset for help on using the changeset viewer.