WordPress/wp-includes/js/wp-emoji.min.js

1 line
1.6 KiB
JavaScript

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()}();