1(function($){ 2 3 $(document).ready(function(){ 4 5 $('img.svg').each(function(){ 6 _inline_svg($(this)); 7 }); 8 9 10 }); 11 12})(jQuery); 13 14function _inline_svg($img){ 15 var imgID = $img.attr('id'); 16 var imgClass = $img.attr('class'); 17 var imgURL = $img.attr('src'); 18 jQuery.get(imgURL, function(data) { 19 var $svg = jQuery(data).find('svg'); 20 if(typeof imgID !== 'undefined') $svg = $svg.attr('id', imgID); 21 if(typeof imgClass !== 'undefined') $svg = $svg.attr('class', imgClass+' replaced-svg'); 22 $svg = $svg.removeAttr('xmlns:a'); 23 if(!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width')) 24 $img.replaceWith($svg); 25 },'xml'); 26}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.