mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-16 23:55:12 +01:00
84aebb9896
Emoji 4 adds 32 new professions, (with variations for gender and skin tone), and updates 33 existing character for male and female variations. Fixes #38113 for trunk. Built from https://develop.svn.wordpress.org/trunk@38717 git-svn-id: http://core.svn.wordpress.org/trunk@38660 1a063a9b-81f0-0310-95a4-ce76da25c4cd
1 line
2.2 KiB
JavaScript
1 line
2.2 KiB
JavaScript
!function(a,b,c){function d(a){var c,d,e,f,g,h,i,j=b.createElement("canvas"),k=j.getContext&&j.getContext("2d"),l=String.fromCharCode;if(!k||!k.fillText)return!1;switch(k.textBaseline="top",k.font="600 32px Arial",a){case"flag":return k.fillText(l(55356,56806,55356,56826),0,0),j.toDataURL().length<3e3?!1:(k.clearRect(0,0,j.width,j.height),k.fillText(l(55356,57331,65039,8205,55356,57096),0,0),c=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(l(55356,57331,55356,57096),0,0),d=j.toDataURL(),c!==d);case"diversity":return k.fillText(l(55356,57221),0,0),e=k.getImageData(16,16,1,1).data,f=e[0]+","+e[1]+","+e[2]+","+e[3],k.fillText(l(55356,57221,55356,57343),0,0),e=k.getImageData(16,16,1,1).data,g=e[0]+","+e[1]+","+e[2]+","+e[3],f!==g;case"simple":return k.fillText(l(55357,56835),0,0),0!==k.getImageData(16,16,1,1).data[0];case"unicode8":return k.fillText(l(55356,57135),0,0),0!==k.getImageData(16,16,1,1).data[0];case"unicode9":return k.fillText(l(55358,56631),0,0),0!==k.getImageData(16,16,1,1).data[0];case"emoji4":return k.fillText(l(55357,56425,55356,57341,8205,55357,56507),0,0),h=j.toDataURL(),k.clearRect(0,0,j.width,j.height),k.fillText(l(55357,56425,55356,57341,55357,56507),0,0),i=j.toDataURL(),h!==i}return!1}function e(a){var c=b.createElement("script");c.src=a,c.type="text/javascript",b.getElementsByTagName("head")[0].appendChild(c)}var f,g,h,i;for(i=Array("simple","flag","unicode8","diversity","unicode9","emoji4"),c.supports={everything:!0,everythingExceptFlag:!0},h=0;h<i.length;h++)c.supports[i[h]]=d(i[h]),c.supports.everything=c.supports.everything&&c.supports[i[h]],"flag"!==i[h]&&(c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&c.supports[i[h]]);c.supports.everythingExceptFlag=c.supports.everythingExceptFlag&&!c.supports.flag,c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.everything||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener("DOMContentLoaded",g,!1),a.addEventListener("load",g,!1)):(a.attachEvent("onload",g),b.attachEvent("onreadystatechange",function(){"complete"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings); |