forked from jonathantneal/svg4everybody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
svg4everybody.ie8.min.js
2 lines (2 loc) · 1.33 KB
/
svg4everybody.ie8.min.js
1
2
/*! svg4everybody v1.0.0 | github.com/jonathantneal/svg4everybody */
(function(g,c,f,h,d,i){function e(j,l){if(l){var n=l.getAttribute("viewBox"),m=l.getAttribute("preserveAspectRatio"),k=g.createDocumentFragment(),o=l.cloneNode(true);if(n){j.setAttribute("viewBox",n)}if(m){j.setAttribute("preserveAspectRatio",m)}while(o.childNodes.length){k.appendChild(o.childNodes[0])}j.appendChild(k)}}function b(){var l=this,j=g.createElement("x"),k=l.s;j.innerHTML=l.responseText;l.onload=function(){k.splice(0).map(function(m){e(m[0],j.querySelector("#"+m[1].replace(/(\W)/g,"\\$1")))})};l.onload()}function a(){var j;while((j=c[0])){if(d){var m=new Image();m.src=j.getAttribute("xlink:href").replace("#",".").replace(/^\./,"")+".png";j.parentNode.replaceChild(m,j)}else{var l=j.parentNode,n=j.getAttribute("xlink:href").split("#"),o=n[0],k=n[1];l.removeChild(j);if(o.length){var p=h[o]=h[o]||new XMLHttpRequest();if(!p.s){p.s=[];p.open("GET",o);p.onload=b;p.send()}p.s.push([l,k]);if(p.readyState===4){p.onload()}}else{e(l,g.getElementById(k))}}}f(a)}if(d||i){a()}})(document,document.getElementsByTagName("use"),window.requestAnimationFrame||window.setTimeout,{},/MSIE\s[1-8]\b/.test(navigator.userAgent),/Trident\/[567]\b/.test(navigator.userAgent)||(navigator.userAgent.match(/AppleWebKit\/(\d+)/)||[])[1]<537,document.createElement("svg"),document.createElement("use"));