mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Emoji: Instead of having custom hooks for Ajax callbacks, use MutationObserver to re-parse any changed elements in the DOM.
Props iseulde See #31242 Built from https://develop.svn.wordpress.org/trunk@31750 git-svn-id: http://core.svn.wordpress.org/trunk@31731 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5b658df402
commit
b7546d798f
@ -272,7 +272,6 @@ inlineEditPost = {
|
||||
if ( -1 !== r.indexOf( '<tr' ) ) {
|
||||
$(inlineEditPost.what+id).siblings('tr.hidden').addBack().remove();
|
||||
$('#edit-'+id).before(r).remove();
|
||||
wp.emoji.parse( $( inlineEditPost.what + id ).get( 0 ) );
|
||||
$(inlineEditPost.what+id).hide().fadeIn();
|
||||
} else {
|
||||
r = r.replace( /<.[^<>]*?>/g, '' );
|
||||
|
2
wp-admin/js/inline-edit-post.min.js
vendored
2
wp-admin/js/inline-edit-post.min.js
vendored
File diff suppressed because one or more lines are too long
@ -117,8 +117,6 @@ inlineEditTax = {
|
||||
// Update the value in the Parent dropdown.
|
||||
$( '#parent' ).find( 'option[value=' + option_value + ']' ).text( row.find( '.row-title' ).text() );
|
||||
|
||||
wp.emoji.parse( row.get( 0 ) );
|
||||
|
||||
row.hide().fadeIn();
|
||||
} else {
|
||||
$('#edit-'+id+' .inline-edit-save .error').html(r).show();
|
||||
|
2
wp-admin/js/inline-edit-tax.min.js
vendored
2
wp-admin/js/inline-edit-tax.min.js
vendored
@ -1 +1 @@
|
||||
var inlineEditTax;!function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5),b.what="#"+b.type+"-",a("#the-list").on("click","a.editinline",function(){return inlineEditTax.edit(this),!1}),c.keyup(function(a){return 27===a.which?inlineEditTax.revert():void 0}),a("a.cancel",c).click(function(){return inlineEditTax.revert()}),a("a.save",c).click(function(){return inlineEditTax.save(this)}),a("input, select",c).keydown(function(a){return 13===a.which?inlineEditTax.save(this):void 0}),a('#posts-filter input[type="submit"]').mousedown(function(){b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},edit:function(b){var c,d,e,f=this;return f.revert(),"object"==typeof b&&(b=f.getId(b)),c=a("#inline-edit").clone(!0),d=a("#inline_"+b),a("td",c).attr("colspan",a(".widefat:first thead th:visible").length),a(f.what+b).hide().before(c).before('<tr class="hidden"></tr>'),e=a(".name",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="name"]',c).val(e),e=a(".slug",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="slug"]',c).val(e),a(c).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",c).eq(0).focus(),!1},save:function(b){var c,d,e=a('input[name="taxonomy"]').val()||"";return"object"==typeof b&&(b=this.getId(b)),a("table.widefat .spinner").show(),c={action:"inline-save-tax",tax_type:this.type,tax_ID:b,taxonomy:e},d=a("#edit-"+b).find(":input").serialize(),c=d+"&"+a.param(c),a.post(ajaxurl,c,function(c){var d,e,f;a("table.widefat .spinner").hide(),c?-1!==c.indexOf("<tr")?(a(inlineEditTax.what+b).siblings("tr.hidden").addBack().remove(),e=a(c).attr("id"),a("#edit-"+b).before(c).remove(),e?(f=e.replace(inlineEditTax.type+"-",""),d=a("#"+e)):(f=b,d=a(inlineEditTax.what+b)),a("#parent").find("option[value="+f+"]").text(d.find(".row-title").text()),wp.emoji.parse(d.get(0)),d.hide().fadeIn()):a("#edit-"+b+" .inline-edit-save .error").html(c).show():a("#edit-"+b+" .inline-edit-save .error").html(inlineEditL10n.error).show()}),!1},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");return b&&(a("table.widefat .spinner").hide(),a("#"+b).siblings("tr.hidden").addBack().remove(),b=b.substr(b.lastIndexOf("-")+1),a(this.what+b).show()),!1},getId:function(b){var c="TR"===b.tagName?b.id:a(b).parents("tr").attr("id"),d=c.split("-");return d[d.length-1]}},a(document).ready(function(){inlineEditTax.init()})}(jQuery);
|
||||
var inlineEditTax;!function(a){inlineEditTax={init:function(){var b=this,c=a("#inline-edit");b.type=a("#the-list").attr("data-wp-lists").substr(5),b.what="#"+b.type+"-",a("#the-list").on("click","a.editinline",function(){return inlineEditTax.edit(this),!1}),c.keyup(function(a){return 27===a.which?inlineEditTax.revert():void 0}),a("a.cancel",c).click(function(){return inlineEditTax.revert()}),a("a.save",c).click(function(){return inlineEditTax.save(this)}),a("input, select",c).keydown(function(a){return 13===a.which?inlineEditTax.save(this):void 0}),a('#posts-filter input[type="submit"]').mousedown(function(){b.revert()})},toggle:function(b){var c=this;"none"===a(c.what+c.getId(b)).css("display")?c.revert():c.edit(b)},edit:function(b){var c,d,e,f=this;return f.revert(),"object"==typeof b&&(b=f.getId(b)),c=a("#inline-edit").clone(!0),d=a("#inline_"+b),a("td",c).attr("colspan",a(".widefat:first thead th:visible").length),a(f.what+b).hide().before(c).before('<tr class="hidden"></tr>'),e=a(".name",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="name"]',c).val(e),e=a(".slug",d),e.find("img").replaceWith(function(){return this.alt}),e=e.text(),a(':input[name="slug"]',c).val(e),a(c).attr("id","edit-"+b).addClass("inline-editor").show(),a(".ptitle",c).eq(0).focus(),!1},save:function(b){var c,d,e=a('input[name="taxonomy"]').val()||"";return"object"==typeof b&&(b=this.getId(b)),a("table.widefat .spinner").show(),c={action:"inline-save-tax",tax_type:this.type,tax_ID:b,taxonomy:e},d=a("#edit-"+b).find(":input").serialize(),c=d+"&"+a.param(c),a.post(ajaxurl,c,function(c){var d,e,f;a("table.widefat .spinner").hide(),c?-1!==c.indexOf("<tr")?(a(inlineEditTax.what+b).siblings("tr.hidden").addBack().remove(),e=a(c).attr("id"),a("#edit-"+b).before(c).remove(),e?(f=e.replace(inlineEditTax.type+"-",""),d=a("#"+e)):(f=b,d=a(inlineEditTax.what+b)),a("#parent").find("option[value="+f+"]").text(d.find(".row-title").text()),d.hide().fadeIn()):a("#edit-"+b+" .inline-edit-save .error").html(c).show():a("#edit-"+b+" .inline-edit-save .error").html(inlineEditL10n.error).show()}),!1},revert:function(){var b=a("table.widefat tr.inline-editor").attr("id");return b&&(a("table.widefat .spinner").hide(),a("#"+b).siblings("tr.hidden").addBack().remove(),b=b.substr(b.lastIndexOf("-")+1),a(this.what+b).show()),!1},getId:function(b){var c="TR"===b.tagName?b.id:a(b).parents("tr").attr("id"),d=c.split("-");return d[d.length-1]}},a(document).ready(function(){inlineEditTax.init()})}(jQuery);
|
@ -741,8 +741,6 @@ jQuery(document).ready( function($) {
|
||||
});
|
||||
}
|
||||
|
||||
wp.emoji.parse( box.get( 0 ) );
|
||||
|
||||
b.html(revert_b);
|
||||
real_slug.val(new_slug);
|
||||
$('#view-post-btn').show();
|
||||
|
2
wp-admin/js/post.min.js
vendored
2
wp-admin/js/post.min.js
vendored
File diff suppressed because one or more lines are too long
@ -49,8 +49,6 @@ jQuery(document).ready(function($) {
|
||||
else
|
||||
$( '.tags' ).prepend( res.responses[0].supplemental.parents ); // As the parent is not visible, Insert the version with Parent - Child - ThisTerm
|
||||
|
||||
wp.emoji.parse( $( '.tags' ).get( 0 ) );
|
||||
|
||||
$('.tags .no-items').remove();
|
||||
|
||||
if ( form.find('select#parent') ) {
|
||||
|
2
wp-admin/js/tags.min.js
vendored
2
wp-admin/js/tags.min.js
vendored
@ -1 +1 @@
|
||||
jQuery(document).ready(function(a){a("#the-list").on("click",".delete-tag",function(){var b,c=a(this),d=c.parents("tr"),e=!0;return"undefined"!=showNotice&&(e=showNotice.warn()),e&&(b=c.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),a.post(ajaxurl,b,function(c){"1"==c?(a("#ajax-response").empty(),d.fadeOut("normal",function(){d.remove()}),a('select#parent option[value="'+b.match(/tag_ID=(\d+)/)[1]+'"]').remove(),a("a.tag-link-"+b.match(/tag_ID=(\d+)/)[1]).remove()):"-1"==c?(a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>"),d.children().css("backgroundColor","")):(a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>"),d.children().css("backgroundColor",""))}),d.children().css("backgroundColor","#f33")),!1}),a("#submit").click(function(){var b=a(this).parents("form");return validateForm(b)?(a.post(ajaxurl,a("#addtag").serialize(),function(c){var d,e,f,g,h;if(a("#ajax-response").empty(),d=wpAjax.parseAjaxResponse(c,"ajax-response"),d&&!d.errors){if(e=b.find("select#parent").val(),e>0&&a("#tag-"+e).length>0?a(".tags #tag-"+e).after(d.responses[0].supplemental.noparents):a(".tags").prepend(d.responses[0].supplemental.parents),wp.emoji.parse(a(".tags").get(0)),a(".tags .no-items").remove(),b.find("select#parent")){for(f=d.responses[1].supplemental,g="",h=0;h<d.responses[1].position;h++)g+=" ";b.find("select#parent option:selected").after('<option value="'+f.term_id+'">'+g+f.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")}}),!1):!1})});
|
||||
jQuery(document).ready(function(a){a("#the-list").on("click",".delete-tag",function(){var b,c=a(this),d=c.parents("tr"),e=!0;return"undefined"!=showNotice&&(e=showNotice.warn()),e&&(b=c.attr("href").replace(/[^?]*\?/,"").replace(/action=delete/,"action=delete-tag"),a.post(ajaxurl,b,function(c){"1"==c?(a("#ajax-response").empty(),d.fadeOut("normal",function(){d.remove()}),a('select#parent option[value="'+b.match(/tag_ID=(\d+)/)[1]+'"]').remove(),a("a.tag-link-"+b.match(/tag_ID=(\d+)/)[1]).remove()):"-1"==c?(a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.noPerm+"</p></div>"),d.children().css("backgroundColor","")):(a("#ajax-response").empty().append('<div class="error"><p>'+tagsl10n.broken+"</p></div>"),d.children().css("backgroundColor",""))}),d.children().css("backgroundColor","#f33")),!1}),a("#submit").click(function(){var b=a(this).parents("form");return validateForm(b)?(a.post(ajaxurl,a("#addtag").serialize(),function(c){var d,e,f,g,h;if(a("#ajax-response").empty(),d=wpAjax.parseAjaxResponse(c,"ajax-response"),d&&!d.errors){if(e=b.find("select#parent").val(),e>0&&a("#tag-"+e).length>0?a(".tags #tag-"+e).after(d.responses[0].supplemental.noparents):a(".tags").prepend(d.responses[0].supplemental.parents),a(".tags .no-items").remove(),b.find("select#parent")){for(f=d.responses[1].supplemental,g="",h=0;h<d.responses[1].position;h++)g+=" ";b.find("select#parent option:selected").after('<option value="'+f.term_id+'">'+g+f.name+"</option>")}a('input[type="text"]:visible, textarea:visible',b).val("")}}),!1):!1})});
|
@ -21,10 +21,10 @@
|
||||
typing = event.type === 'keydown';
|
||||
} );
|
||||
|
||||
editor.on( 'input setcontent', function() {
|
||||
editor.on( 'input setcontent', function( event ) {
|
||||
var selection, node, bookmark, imgs;
|
||||
|
||||
if ( typing ) {
|
||||
if ( typing && event.type === 'input' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
!function(a,b){a.PluginManager.add("wpemoji",function(c,d){var e;b.emoji.parseEmoji&&(c.on("init",function(){var a=c.dom.uniqueId(),b=c.dom.create("link",{id:a,rel:"stylesheet",href:d+"/css/editor.css"});c.getDoc().getElementsByTagName("head")[0].appendChild(b)}),c.on("keydown keyup",function(a){e="keydown"===a.type}),c.on("input setcontent",function(){var d,f,g,h;e||(d=c.selection,f=d.getNode(),g=d.getBookmark(),b.emoji.parse(f),h=c.dom.select("img.emoji",f),a.each(h,function(a){a.getAttribute("data-wp-emoji")||(a.setAttribute("data-mce-resize","false"),a.setAttribute("data-mce-placeholder","1"),a.setAttribute("data-wp-emoji",a.alt))}),d.moveToBookmark(g))}),c.on("postprocess",function(a){a.content&&(a.content=a.content.replace(/<img[^>]+data-wp-emoji="([^"]+)"[^>]*>/g,function(a,b){return b}))}),c.on("resolvename",function(a){"IMG"===a.target.nodeName&&c.dom.getAttrib(a.target,"data-wp-emoji")&&a.preventDefault()}))})}(window.tinymce,window.wp);
|
||||
!function(a,b){a.PluginManager.add("wpemoji",function(c,d){var e;b.emoji.parseEmoji&&(c.on("init",function(){var a=c.dom.uniqueId(),b=c.dom.create("link",{id:a,rel:"stylesheet",href:d+"/css/editor.css"});c.getDoc().getElementsByTagName("head")[0].appendChild(b)}),c.on("keydown keyup",function(a){e="keydown"===a.type}),c.on("input setcontent",function(d){var f,g,h,i;e&&"input"===d.type||(f=c.selection,g=f.getNode(),h=f.getBookmark(),b.emoji.parse(g),i=c.dom.select("img.emoji",g),a.each(i,function(a){a.getAttribute("data-wp-emoji")||(a.setAttribute("data-mce-resize","false"),a.setAttribute("data-mce-placeholder","1"),a.setAttribute("data-wp-emoji",a.alt))}),f.moveToBookmark(h))}),c.on("postprocess",function(a){a.content&&(a.content=a.content.replace(/<img[^>]+data-wp-emoji="([^"]+)"[^>]*>/g,function(a,b){return b}))}),c.on("resolvename",function(a){"IMG"===a.target.nodeName&&c.dom.getAttrib(a.target,"data-wp-emoji")&&a.preventDefault()}))})}(window.tinymce,window.wp);
|
Binary file not shown.
@ -1,34 +1,13 @@
|
||||
/* global _wpemojiSettings, twemoji */
|
||||
window.wp = window.wp || {};
|
||||
|
||||
(function() {
|
||||
var emoji;
|
||||
|
||||
wp.emoji = emoji = {
|
||||
/**
|
||||
* The CDN URL for where emoji files are hosted.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
baseUrl: '//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72',
|
||||
|
||||
/**
|
||||
* The extension of the hosted emoji files.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
ext: '.png',
|
||||
|
||||
( function( window, wp, twemoji, settings ) {
|
||||
var emoji = {
|
||||
/**
|
||||
* Flag to determine if we should parse all emoji characters into Twemoji images.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @var bool
|
||||
* @var Boolean
|
||||
*/
|
||||
parseAllEmoji: false,
|
||||
|
||||
@ -37,7 +16,7 @@ window.wp = window.wp || {};
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @var bool
|
||||
* @var Boolean
|
||||
*/
|
||||
parseEmoji: false,
|
||||
|
||||
@ -46,7 +25,7 @@ window.wp = window.wp || {};
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @var bool
|
||||
* @var Boolean
|
||||
*/
|
||||
parseFlags: false,
|
||||
|
||||
@ -56,17 +35,14 @@ window.wp = window.wp || {};
|
||||
* @since 4.2.0
|
||||
*/
|
||||
init: function() {
|
||||
if ( typeof _wpemojiSettings !== 'undefined' ) {
|
||||
emoji.baseUrl = _wpemojiSettings.baseUrl || emoji.baseUrl;
|
||||
emoji.ext = _wpemojiSettings.ext || emoji.ext;
|
||||
}
|
||||
|
||||
emoji.parseAllEmoji = ! emoji.browserSupportsEmoji();
|
||||
emoji.parseFlags = ! emoji.browserSupportsFlagEmoji();
|
||||
emoji.parseEmoji = emoji.parseAllEmoji || emoji.parseFlags;
|
||||
|
||||
if ( ! emoji.parseEmoji ) {
|
||||
return;
|
||||
if ( window.addEventListener ) {
|
||||
window.addEventListener( 'load', emoji.load, false );
|
||||
} else if ( window.attachEvent ) {
|
||||
window.attachEvent( 'onload', emoji.load );
|
||||
}
|
||||
},
|
||||
|
||||
@ -76,6 +52,35 @@ window.wp = window.wp || {};
|
||||
* @since 4.2.0
|
||||
*/
|
||||
load: function() {
|
||||
if ( MutationObserver ) {
|
||||
new MutationObserver( function( mutationRecords ) {
|
||||
var i = mutationRecords.length,
|
||||
ii,
|
||||
node;
|
||||
|
||||
while ( i-- ) {
|
||||
ii = mutationRecords[ i ].addedNodes.length;
|
||||
|
||||
while ( ii-- ) {
|
||||
node = mutationRecords[ i ].addedNodes[ ii ];
|
||||
|
||||
if ( node.nodeType === 3 ) {
|
||||
node = node.parentNode;
|
||||
}
|
||||
|
||||
if ( node.nodeType === 1 ) {
|
||||
emoji.parse( node );
|
||||
}
|
||||
}
|
||||
}
|
||||
} )
|
||||
|
||||
.observe( document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
} );
|
||||
}
|
||||
|
||||
emoji.parse( document.body );
|
||||
},
|
||||
|
||||
@ -84,22 +89,16 @@ window.wp = window.wp || {};
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @return {bool} True if the browser can render emoji, false if it cannot.
|
||||
* @return {Boolean} True if the browser can render emoji, false if it cannot.
|
||||
*/
|
||||
browserSupportsEmoji: function() {
|
||||
var context, smile;
|
||||
var canvas = document.createElement( 'canvas' ),
|
||||
context = canvas.getContext && canvas.getContext( '2d' );
|
||||
|
||||
if ( ! document.createElement( 'canvas' ).getContext ) {
|
||||
return;
|
||||
if ( ! context.fillText ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
context = document.createElement( 'canvas' ).getContext( '2d' );
|
||||
if ( typeof context.fillText != 'function' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
smile = String.fromCharCode( 55357 ) + String.fromCharCode( 56835 );
|
||||
|
||||
/*
|
||||
* Chrome OS X added native emoji rendering in M41. Unfortunately,
|
||||
* it doesn't work when the font is bolder than 500 weight. So, we
|
||||
@ -107,7 +106,7 @@ window.wp = window.wp || {};
|
||||
*/
|
||||
context.textBaseline = 'top';
|
||||
context.font = '600 32px Arial';
|
||||
context.fillText( smile, 0, 0 );
|
||||
context.fillText( String.fromCharCode( 55357, 56835 ), 0, 0 );
|
||||
|
||||
return context.getImageData( 16, 16, 1, 1 ).data[0] !== 0;
|
||||
},
|
||||
@ -117,29 +116,20 @@ window.wp = window.wp || {};
|
||||
* made of two characters, so some browsers (notably, Firefox OS X) don't support them.
|
||||
*
|
||||
* @since 4.2.0
|
||||
* @return {bool} True if the browser renders flag characters as a flag glyph, false if it does not.
|
||||
*
|
||||
* @return {Boolean} True if the browser renders flag characters as a flag glyph, false if it does not.
|
||||
*/
|
||||
browserSupportsFlagEmoji: function() {
|
||||
var context, flag, canvas;
|
||||
var canvas = document.createElement( 'canvas' ),
|
||||
context = canvas.getContext && canvas.getContext( '2d' );
|
||||
|
||||
canvas = document.createElement( 'canvas' );
|
||||
|
||||
if ( ! canvas.getContext ) {
|
||||
return;
|
||||
if ( ! context.fillText ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
context = canvas.getContext( '2d' );
|
||||
|
||||
if ( typeof context.fillText != 'function' ) {
|
||||
return;
|
||||
}
|
||||
|
||||
flag = String.fromCharCode(55356) + String.fromCharCode(56812); // [G]
|
||||
flag += String.fromCharCode(55356) + String.fromCharCode(56807); // [B]
|
||||
|
||||
context.textBaseline = 'top';
|
||||
context.font = '32px Arial';
|
||||
context.fillText( flag, 0, 0 );
|
||||
context.fillText( String.fromCharCode( 55356, 56812, 55356, 56807 ), 0, 0 );
|
||||
|
||||
/*
|
||||
* This works because the image will be one of three things:
|
||||
@ -151,24 +141,23 @@ window.wp = window.wp || {};
|
||||
* to a larger image (4-5KB data URL).
|
||||
*/
|
||||
return canvas.toDataURL().length > 3000;
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Given a DOM node, parse any emoji characters into Twemoji images.
|
||||
* Given an element or string, parse any emoji characters into Twemoji images.
|
||||
*
|
||||
* @since 4.2.0
|
||||
*
|
||||
* @param {Element} element The DOM node to parse.
|
||||
* @param {HTMLElement|String} object The element or string to parse.
|
||||
*/
|
||||
parse: function( element ) {
|
||||
parse: function( object ) {
|
||||
if ( ! emoji.parseEmoji ) {
|
||||
return;
|
||||
return object;
|
||||
}
|
||||
|
||||
return twemoji.parse( element, {
|
||||
base: emoji.baseUrl,
|
||||
ext: emoji.ext,
|
||||
return twemoji.parse( object, {
|
||||
base: settings.baseUrl,
|
||||
ext: settings.ext,
|
||||
callback: function( icon, options ) {
|
||||
// Ignore some standard characters that TinyMCE recommends in its character map.
|
||||
switch ( icon ) {
|
||||
@ -193,11 +182,7 @@ window.wp = window.wp || {};
|
||||
}
|
||||
};
|
||||
|
||||
if ( window.addEventListener ) {
|
||||
window.addEventListener( 'load', emoji.load, false );
|
||||
} else if ( window.attachEvent ) {
|
||||
window.attachEvent( 'onload', emoji.load );
|
||||
}
|
||||
|
||||
emoji.init();
|
||||
})();
|
||||
|
||||
wp.emoji = emoji;
|
||||
} )( window, window.wp, window.twemoji, window._wpemojiSettings );
|
||||
|
2
wp-includes/js/wp-emoji.min.js
vendored
2
wp-includes/js/wp-emoji.min.js
vendored
@ -1 +1 @@
|
||||
window.wp=window.wp||{},function(){var a;wp.emoji=a={baseUrl:"//s0.wp.com/wp-content/mu-plugins/emoji/twemoji/72x72",ext:".png",parseAllEmoji:!1,parseEmoji:!1,parseFlags:!1,init:function(){"undefined"!=typeof _wpemojiSettings&&(a.baseUrl=_wpemojiSettings.baseUrl||a.baseUrl,a.ext=_wpemojiSettings.ext||a.ext),a.parseAllEmoji=!a.browserSupportsEmoji(),a.parseFlags=!a.browserSupportsFlagEmoji(),a.parseEmoji=a.parseAllEmoji||a.parseFlags,!a.parseEmoji},load:function(){a.parse(document.body)},browserSupportsEmoji:function(){var a,b;if(document.createElement("canvas").getContext&&(a=document.createElement("canvas").getContext("2d"),"function"==typeof a.fillText))return b=String.fromCharCode(55357)+String.fromCharCode(56835),a.textBaseline="top",a.font="600 32px Arial",a.fillText(b,0,0),0!==a.getImageData(16,16,1,1).data[0]},browserSupportsFlagEmoji:function(){var a,b,c;return c=document.createElement("canvas"),c.getContext&&(a=c.getContext("2d"),"function"==typeof a.fillText)?(b=String.fromCharCode(55356)+String.fromCharCode(56812),b+=String.fromCharCode(55356)+String.fromCharCode(56807),a.textBaseline="top",a.font="32px Arial",a.fillText(b,0,0),c.toDataURL().length>3e3):void 0},parse:function(b){return a.parseEmoji?twemoji.parse(b,{base:a.baseUrl,ext:a.ext,callback:function(b,c){switch(b){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return!a.parseFlags||a.parseAllEmoji||b.match(/^1f1(e[6-9a-f]|f[1-9a-f])-1f1(e[6-9a-f]|f[1-9a-f])$/)?"".concat(c.base,"/",b,c.ext):!1}}):void 0}},window.addEventListener?window.addEventListener("load",a.load,!1):window.attachEvent&&window.attachEvent("onload",a.load),a.init()}();
|
||||
window.wp=window.wp||{},function(a,b,c,d){var e={parseAllEmoji:!1,parseEmoji:!1,parseFlags:!1,init:function(){e.parseAllEmoji=!e.browserSupportsEmoji(),e.parseFlags=!e.browserSupportsFlagEmoji(),e.parseEmoji=e.parseAllEmoji||e.parseFlags,a.addEventListener?a.addEventListener("load",e.load,!1):a.attachEvent&&a.attachEvent("onload",e.load)},load:function(){MutationObserver&&new MutationObserver(function(a){for(var b,c,d=a.length;d--;)for(b=a[d].addedNodes.length;b--;)c=a[d].addedNodes[b],3===c.nodeType&&(c=c.parentNode),1===c.nodeType&&e.parse(c)}).observe(document.body,{childList:!0,subtree:!0}),e.parse(document.body)},browserSupportsEmoji:function(){var a=document.createElement("canvas"),b=a.getContext&&a.getContext("2d");return b.fillText?(b.textBaseline="top",b.font="600 32px Arial",b.fillText(String.fromCharCode(55357,56835),0,0),0!==b.getImageData(16,16,1,1).data[0]):!1},browserSupportsFlagEmoji:function(){var a=document.createElement("canvas"),b=a.getContext&&a.getContext("2d");return b.fillText?(b.textBaseline="top",b.font="32px Arial",b.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),a.toDataURL().length>3e3):!1},parse:function(a){return e.parseEmoji?c.parse(a,{base:d.baseUrl,ext:d.ext,callback:function(a,b){switch(a){case"a9":case"ae":case"2122":case"2194":case"2660":case"2663":case"2665":case"2666":return!1}return!e.parseFlags||e.parseAllEmoji||a.match(/^1f1(e[6-9a-f]|f[1-9a-f])-1f1(e[6-9a-f]|f[1-9a-f])$/)?"".concat(b.base,"/",a,b.ext):!1}}):a}};e.init(),b.emoji=e}(window,window.wp,window.twemoji,window._wpemojiSettings);
|
@ -447,7 +447,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
$scripts->enqueue( 'emoji' );
|
||||
|
||||
if ( is_admin() ) {
|
||||
$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response', 'emoji' ), false, 1 );
|
||||
$scripts->add( 'admin-tags', "/wp-admin/js/tags$suffix.js", array( 'jquery', 'wp-ajax-response' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'admin-tags', 'tagsl10n', array(
|
||||
'noPerm' => __('You do not have permission to do that.'),
|
||||
'broken' => __('An unidentified error has occurred.')
|
||||
@ -470,7 +470,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'tagDelimiter' => _x( ',', 'tag delimiter' ),
|
||||
) );
|
||||
|
||||
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box', 'emoji' ), false, 1 );
|
||||
$scripts->add( 'post', "/wp-admin/js/post$suffix.js", array( 'suggest', 'wp-lists', 'postbox', 'tags-box' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'post', 'postL10n', array(
|
||||
'ok' => __('OK'),
|
||||
'cancel' => __('Cancel'),
|
||||
@ -522,7 +522,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
|
||||
$scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone' ), false, 1 );
|
||||
|
||||
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest', 'emoji' ), false, 1 );
|
||||
$scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'inline-edit-post', 'inlineEditL10n', array(
|
||||
'error' => __('Error while saving the changes.'),
|
||||
'ntdeltitle' => __('Remove From Bulk Edit'),
|
||||
@ -530,7 +530,7 @@ function wp_default_scripts( &$scripts ) {
|
||||
'comma' => trim( _x( ',', 'tag delimiter' ) ),
|
||||
) );
|
||||
|
||||
$scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery', 'emoji' ), false, 1 );
|
||||
$scripts->add( 'inline-edit-tax', "/wp-admin/js/inline-edit-tax$suffix.js", array( 'jquery' ), false, 1 );
|
||||
did_action( 'init' ) && $scripts->localize( 'inline-edit-tax', 'inlineEditL10n', array(
|
||||
'error' => __('Error while saving the changes.')
|
||||
) );
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31749';
|
||||
$wp_version = '4.2-alpha-31750';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user