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.
Built from https://develop.svn.wordpress.org/trunk@31758


git-svn-id: http://core.svn.wordpress.org/trunk@31739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2015-03-12 22:00:28 +00:00
parent 036f131b14
commit 8fc889b2da
4 changed files with 11 additions and 8 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;

File diff suppressed because one or more lines are too long

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(
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-alpha-31757';
$wp_version = '4.2-alpha-31758';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.