jQuery(document).ready(function ($) { let bodhisvgsReplacements = 0; function bodhisvgsReplace(img) { var imgID = img.attr('id'); var imgClass = img.attr('class'); var imgURL = img.attr('src'); // Set svg size to the original img size // var imgWidth = $img.attr('width'); // var imgHeight = $img.attr('height'); if (!imgURL.endsWith('svg')) { return; } $.get(imgURL, function(data) { // Get the SVG tag, ignore the rest var $svg = $(data).find('svg'); var svgID = $svg.attr('id'); // Add replaced image's ID to the new SVG if necessary if(typeof imgID === 'undefined') { if(typeof svgID === 'undefined') { imgID = 'svg-replaced-'+bodhisvgsReplacements; $svg = $svg.attr('id', imgID); } else { imgID = svgID; } } else { $svg = $svg.attr('id', imgID); } // Add replaced image's classes to the new SVG if(typeof imgClass !== 'undefined') { $svg = $svg.attr('class', imgClass+' replaced-svg svg-replaced-'+bodhisvgsReplacements); } // Remove any invalid XML tags as per http://validator.w3.org $svg = $svg.removeAttr('xmlns:a'); if(frontSanitizationEnabled == 'on' && $svg[0]['outerHTML'] != "") { // Is sanitization enabled? $svg = DOMPurify.sanitize($svg[0]['outerHTML']); // Sanitize SVG code via DOMPurify library } // Add size attributes // $svg = $svg.attr('width', imgWidth); // $svg = $svg.attr('height', imgHeight); // Replace image with new SVG img.replaceWith($svg); $(document).trigger('svg.loaded', [imgID]); bodhisvgsReplacements++; }, 'xml'); } // Wrap in IIFE so that it can be called again later as bodhisvgsInlineSupport(); (bodhisvgsInlineSupport = function() { // If force inline SVG option is active then add class if ( ForceInlineSVGActive === 'true' ) { // Find all SVG inside img and add class if it hasn't got it jQuery('img').each(function() { // Check if the SRC attribute is present at all if ( typeof jQuery(this).attr('src') !== typeof undefined && jQuery(this).attr('src') !== false) { // Pick only those with the extension we want if ( jQuery(this).attr('src').match(/\.(svg)/) ) { // Add our class name if ( !jQuery(this).hasClass(cssTarget.ForceInlineSVG) ) { jQuery(this).addClass(cssTarget.ForceInlineSVG); } } } }); } // Polyfill to support all ye old browsers // delete when not needed in the future if (!String.prototype.endsWith) { String.prototype.endsWith = function(searchString, position) { var subjectString = this.toString(); if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { position = subjectString.length; } position -= searchString.length; var lastIndex = subjectString.lastIndexOf(searchString, position); return lastIndex !== -1 && lastIndex === position; }; } // end polyfill // Another snippet to support IE11 String.prototype.endsWith = function(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastIndexOf(pattern) === d; }; // End snippet to support IE11 // Check to see if user set alternate class if ( ForceInlineSVGActive === 'true' ) { var target = ( cssTarget.Bodhi !== 'img.' ? cssTarget.Bodhi : '.style-svg' ); } else { var target = ( cssTarget !== 'img.' ? cssTarget : '.style-svg' ); } target = target.replace("img",""); $(target).each(function(index){ // if image then send for replacement if ( typeof $(this).attr('src') !== typeof undefined && $(this).attr('src') !== false) { bodhisvgsReplace($(this)); }else{ // look for svg children and send for replacement $(this).find("img").each(function(i){ if( typeof $(this).attr('src') !== typeof undefined && $(this).attr('src') !== false ){ bodhisvgsReplace($(this)); } }); } }); })(); // Execute immediately }); تعليقات لموقع GK Parts https://gk-parts.co Auto Parts website Wed, 08 Nov 2023 05:03:54 +0000 hourly 1 https://wordpress.org/?v=6.6.2 تعليق على How to provide great car service to the customer بواسطة malen https://gk-parts.co/we-fix-cars-fast-so-you-can-get-back-driving/#comment-373 Mon, 15 May 2023 05:27:02 +0000 https://themeholy.com/wordpress/malen/?p=104#comment-373 There are many different types of roofing materials to choose from, including asphalt shingles, Metal roofing, wood shakes, clay tiles, and slate. Each material has

]]>
تعليق على Efficient repairs, reliable Results, every time here بواسطة malen https://gk-parts.co/efficient-repairs-reliable-results-every-time-here/#comment-382 Mon, 15 May 2023 05:26:59 +0000 https://themeholy.com/wordpress/malen/?p=107#comment-382 There are many different types of roofing materials to choose from, including asphalt shingles, Metal roofing, wood shakes, clay tiles, and slate. Each material has

]]>
تعليق على We’ll get your car back on the road in no time بواسطة malen https://gk-parts.co/well-get-your-car-back-on-the-road-in-no-time/#comment-379 Mon, 15 May 2023 05:26:56 +0000 https://themeholy.com/wordpress/malen/?p=106#comment-379 There are many different types of roofing materials to choose from, including asphalt shingles, Metal roofing, wood shakes, clay tiles, and slate. Each material has

]]>
تعليق على Quality repairs for your car at affordable prices بواسطة malen https://gk-parts.co/quality-repairs-for-your-car-at-affordable-prices/#comment-376 Mon, 15 May 2023 05:26:54 +0000 https://themeholy.com/wordpress/malen/?p=105#comment-376 There are many different types of roofing materials to choose from, including asphalt shingles, Metal roofing, wood shakes, clay tiles, and slate. Each material has

]]>
تعليق على We repair cars with care and attention to detail بواسطة malen https://gk-parts.co/we-repair-cars-with-care-and-attention-to-detail/#comment-385 Mon, 15 May 2023 05:26:51 +0000 https://themeholy.com/wordpress/malen/?p=88#comment-385 There are many different types of roofing materials to choose from, including asphalt shingles, Metal roofing, wood shakes, clay tiles, and slate. Each material has

]]>
تعليق على How to provide great car service to the customer بواسطة malen https://gk-parts.co/we-fix-cars-fast-so-you-can-get-back-driving/#comment-372 Mon, 15 May 2023 05:26:23 +0000 https://themeholy.com/wordpress/malen/?p=104#comment-372 ردًا على malen.

Is a statement that highlights the importance of providing high-quality auto repair services. It suggests that the company or individual

]]>
تعليق على Efficient repairs, reliable Results, every time here بواسطة malen https://gk-parts.co/efficient-repairs-reliable-results-every-time-here/#comment-381 Mon, 15 May 2023 05:26:18 +0000 https://themeholy.com/wordpress/malen/?p=107#comment-381 ردًا على malen.

Is a statement that highlights the importance of providing high-quality auto repair services. It suggests that the company or individual

]]>
تعليق على We’ll get your car back on the road in no time بواسطة malen https://gk-parts.co/well-get-your-car-back-on-the-road-in-no-time/#comment-378 Mon, 15 May 2023 05:26:12 +0000 https://themeholy.com/wordpress/malen/?p=106#comment-378 ردًا على malen.

Is a statement that highlights the importance of providing high-quality auto repair services. It suggests that the company or individual

]]>
تعليق على Quality repairs for your car at affordable prices بواسطة malen https://gk-parts.co/quality-repairs-for-your-car-at-affordable-prices/#comment-375 Mon, 15 May 2023 05:26:07 +0000 https://themeholy.com/wordpress/malen/?p=105#comment-375 ردًا على malen.

Is a statement that highlights the importance of providing high-quality auto repair services. It suggests that the company or individual

]]>
تعليق على We repair cars with care and attention to detail بواسطة malen https://gk-parts.co/we-repair-cars-with-care-and-attention-to-detail/#comment-384 Mon, 15 May 2023 05:26:01 +0000 https://themeholy.com/wordpress/malen/?p=88#comment-384 ردًا على malen.

Is a statement that highlights the importance of providing high-quality auto repair services. It suggests that the company or individual

]]>