Update Twemoji to 1.3.0.

Includes a fix for Firefox: 92d5bea1ab
Since this fix breaks IE 11 we added `modified = false;` after `subnode.parentNode.replaceChild(fragment, subnode)`.

props iseulde.
see #31242.

git-svn-id: https://develop.svn.wordpress.org/trunk@31758 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2015-03-12 21:59:04 +00:00
parent ba3a48766e
commit c8cd080d1b
2 changed files with 9 additions and 6 deletions

View File

@ -1,6 +1,5 @@
/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */
var twemoji;
twemoji = (function (
var twemoji = (function (
/*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//*
https://github.com/twitter/twemoji/blob/gh-pages/LICENSE
*/
@ -327,6 +326,7 @@ twemoji = (function (
var
allText = grabAllTextNodes(node, []),
length = allText.length,
modified = false,
fragment,
subnode,
text,
@ -367,13 +367,15 @@ twemoji = (function (
img.setAttribute('draggable', 'false');
img.alt = alt;
img.src = src;
modified = true;
fragment.appendChild(img);
}
}
fragment.appendChild(img || createText(alt));
if (!img) fragment.appendChild(createText(alt));
img = null;
}
// is there actually anything to replace in here ?
if (img) {
img = null;
if (modified) {
// any text left to be added ?
if (i < text.length) {
fragment.appendChild(
@ -383,6 +385,7 @@ twemoji = (function (
// replace the text node only, leave intact
// anything else surrounding such text
subnode.parentNode.replaceChild(fragment, subnode);
modified = false;
}
}
return node;

View File

@ -424,7 +424,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'media-audiovideo', "/wp-includes/js/media/audio-video$suffix.js", array( 'media-editor' ), false, 1 );
$scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'media-models', 'media-audiovideo', 'wp-playlist' ), false, 1 );
$scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), false, 1 );
$scripts->add( 'twemoji', "/wp-includes/js/twemoji$suffix.js", array(), '1.3.0', 1 );
$scripts->add( 'emoji', "/wp-includes/js/wp-emoji$suffix.js", array( 'twemoji' ), false, 1 );
did_action( 'init' ) && $scripts->localize( 'emoji', '_wpemojiSettings', array(
/**