WordPress/wp-admin/js/svg-painter.min.js
desrosj 40a294d21e Build/Test Tools: Backport GitHub Action and build improvements to the 5.3 branch.
This backports several build and test tool improvements to the 5.3 branch. Most notably, this includes:

- The changes required to allow each workflow to be triggered by the `workflow_dispatch` event so that tests can be run on a schedule [50590].
- The ability to run PHPUnit tests from `src` instead of `build` [50441-50443].
- Splitting single site and multisite tests into parallel jobs [50379].
- Split slow tests into separate, parallel jobs for PHP 5.6 [50444].
- Better branch and path scoping for GitHub Action workflows when running on `pull_request` [50432,50479].
- Several `devDependency` updates.

Merges [50267,50299,50379,50387,50413,50416,50432,50435-50436,50441-50444,50446,50473-50474,50476,50479,50485-50487,50545,50579,50590,50598] to the 5.3 branch.
See #50401, #51734, #51801, #51802, #52548, #52608, #52612, #52623, #52624, #52625, #52645, #52653, #52658, #52660, #52667.
Built from https://develop.svn.wordpress.org/branches/5.3@50605


git-svn-id: http://core.svn.wordpress.org/branches/5.3@50218 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-03-26 19:23:55 +00:00

1 line
2.3 KiB
JavaScript

window.wp=window.wp||{},wp.svgPainter=function(e,i,n){"use strict";var t,o,a,m,r,s,c,u,l,f={},g=[];function p(){for(;l<256;)m=String.fromCharCode(l),s+=m,u[l]=l,c[l]=r.indexOf(m),++l}function d(n,t,e,a,i,o){for(var r,s=0,c=0,u="",l=0,f=(n=String(n)).length;c<f;){for(s=(s<<i)+(m=(m=n.charCodeAt(c))<256?e[m]:-1),l+=i;o<=l;)l-=o,u+=a.charAt(r=s>>l),s^=r<<l;++c}return!t&&0<l&&(u+=a.charAt(s<<o-l)),u}return e(n).ready(function(){n.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")&&(e(n.body).removeClass("no-svg").addClass("svg"),wp.svgPainter.init())}),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s="",c=[256],u=[256],l=0,o={atob:function(n){var t;for(m||p(),n=n.replace(/[^A-Za-z0-9\+\/\=]/g,""),n=String(n).split("="),t=n.length;n[--t]=d(n[t],!0,c,s,6,8),0<t;);return n=n.join("")},btoa:function(n){return m||p(),(n=d(n,!1,u,r,8,6))+"====".slice(n.length%4||4)}},{init:function(){a=this,t=e("#adminmenu .wp-menu-image, #wpadminbar .ab-item"),this.setColors(),this.findElements(),this.paint()},setColors:function(n){(n=void 0===n&&void 0!==i._wpColorScheme?i._wpColorScheme:n)&&n.icons&&n.icons.base&&n.icons.current&&n.icons.focus&&(f=n.icons)},findElements:function(){t.each(function(){var n=e(this),t=n.css("background-image");t&&-1!=t.indexOf("data:image/svg+xml;base64")&&g.push(n)})},paint:function(){e.each(g,function(n,t){var e=t.parent().parent();e.hasClass("current")||e.hasClass("wp-has-current-submenu")?a.paintElement(t,"current"):(a.paintElement(t,"base"),e.hover(function(){a.paintElement(t,"focus")},function(){i.setTimeout(function(){a.paintElement(t,"base")},100)}))})},paintElement:function(n,t){var e,a;if(t&&f.hasOwnProperty(t)&&(a=f[t],a.match(/^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i)&&"none"!==(e=n.data("wp-ui-svg-"+a)))){if(!e){if(!(t=n.css("background-image").match(/.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/))||!t[1])return void n.data("wp-ui-svg-"+a,"none");try{e=("atob"in i?i:o).atob(t[1])}catch(n){}if(!e)return void n.data("wp-ui-svg-"+a,"none");e=(e=(e=e.replace(/fill="(.+?)"/g,'fill="'+a+'"')).replace(/style="(.+?)"/g,'style="fill:'+a+'"')).replace(/fill:.*?;/g,"fill: "+a+";"),e=("btoa"in i?i:o).btoa(e),n.data("wp-ui-svg-"+a,e)}n.attr("style",'background-image: url("data:image/svg+xml;base64,'+e+'") !important;')}}}}(jQuery,window,document);