first commit
This commit is contained in:
1
wp-content/plugins/svg-support/js/min/gutenberg-filters-min.js
vendored
Normal file
1
wp-content/plugins/svg-support/js/min/gutenberg-filters-min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";function wrapPostFeaturedImage(e){return function(t){return el(wp.element.Fragment,{},"",el(e,t),el(composedCheckBox))}}const el=wp.element.createElement,withState=wp.compose.withState,withSelect=wp.data.withSelect,withDispatch=wp.data.withDispatch;wp.hooks.addFilter("editor.PostFeaturedImage","bodhi-svgs-featured-image/render-inline-image-checkbox",wrapPostFeaturedImage);class CheckBoxCustom extends React.Component{render(){const{meta:e,updateInlineFeaturedSvg:t}=this.props;return el(wp.components.CheckboxControl,{label:"Render this SVG inline (Advanced)",checked:e.inline_featured_image,onChange:o=>{this.setState({isChecked:o}),t(o,e)}})}}const composedCheckBox=wp.compose.compose([withState((e=>{})),withSelect((e=>{const t=undefined,o=undefined;return{meta:{...e("core/editor").getCurrentPostAttribute("meta"),...e("core/editor").getEditedPostAttribute("meta")}}})),withDispatch((e=>({updateInlineFeaturedSvg(t,o){o={...o,inline_featured_image:t},e("core/editor").editPost({meta:o})}})))])(CheckBoxCustom);
|
||||
1
wp-content/plugins/svg-support/js/min/jquery.dropdown-min.js
vendored
Normal file
1
wp-content/plugins/svg-support/js/min/jquery.dropdown-min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
wp-content/plugins/svg-support/js/min/svgs-inline-min.js
vendored
Normal file
1
wp-content/plugins/svg-support/js/min/svgs-inline-min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
jQuery(document).ready((function($){function t(t){var i=t.attr("id"),r=t.attr("class"),n=t.attr("src");n.endsWith("svg")?$.get(n,(function(s){var o=$(s).find("svg"),a=o.attr("id");void 0===i?void 0===a?(i="svg-replaced-"+e,o=o.attr("id",i)):i=a:o=o.attr("id",i),void 0!==r&&(o=o.attr("class",r+" replaced-svg svg-replaced-"+e)),o=o.removeAttr("xmlns:a"),"on"===frontSanitizationEnabled&&""!=o[0].outerHTML&&(console.log("Sanitizing SVG:",n),o=DOMPurify.sanitize(o[0].outerHTML)),t.replaceWith(o),$(document).trigger("svg.loaded",[i]),e++}),"xml").fail((function(){console.error("Failed to load SVG:",n)})):console.log("Not an SVG:",n)}let e=0;(bodhisvgsInlineSupport=function(){var e;console.log("Running bodhisvgsInlineSupport"),"true"===ForceInlineSVGActive&&jQuery("img").each((function(){void 0!==jQuery(this).attr("src")&&!1!==jQuery(this).attr("src")&&jQuery(this).attr("src").match(/\.(svg)/)&&(jQuery(this).hasClass(cssTarget.ForceInlineSVG)||jQuery(this).addClass(cssTarget.ForceInlineSVG))})),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var i=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>i.length)&&(e=i.length),e-=t.length;var r=i.lastIndexOf(t,e);return-1!==r&&r===e}),String.prototype.endsWith=function(t){var e=this.length-t.length;return e>=0&&this.lastIndexOf(t)===e},e="true"===ForceInlineSVGActive?"img."!==cssTarget.Bodhi?cssTarget.Bodhi:"img.style-svg":"img."!==cssTarget?cssTarget.Bodhi:"img.style-svg",console.log("Initial target:",e),"string"==typeof e?(e=e.replace("img",""),console.log("Modified target:",e),$(e).each((function(e){void 0!==$(this).attr("src")&&!1!==$(this).attr("src")?t($(this)):$(this).find("img").each((function(e){void 0!==$(this).attr("src")&&!1!==$(this).attr("src")&&t($(this))}))}))):console.error("Target is not a string:",e)})()}));
|
||||
1
wp-content/plugins/svg-support/js/min/svgs-inline-vanilla-min.js
vendored
Normal file
1
wp-content/plugins/svg-support/js/min/svgs-inline-vanilla-min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
document.addEventListener("DOMContentLoaded",(function(e){function t(e){if("IMG"===e.nodeName){var t=e.id,n=e.className,r=e.src;if(r.endsWith("svg")){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState&&200===i.status){var o=i.responseText;let r;const c=undefined;var a=(new DOMParser).parseFromString(o,"text/html").getElementsByTagName("svg")[0],l=a.id;if(void 0===t||""===t?void 0===l||""===l?(t="svg-replaced-"+s,a.setAttribute("id",t)):t=l:a.setAttribute("id",t),void 0!==n&&""!==n&&a.setAttribute("class",n+" replaced-svg svg-replaced-"+s),a.removeAttribute("xmlns:a"),"on"===frontSanitizationEnabled&&""!==a.outerHTML){var d=DOMPurify.sanitize(a.outerHTML);e.outerHTML=d}else e.replaceWith(a);s++}else 4===i.readyState&&200!==i.status&&console.error("Failed to load SVG:",r)},i.open("GET",r,!1),i.send(null)}}}function n(e){if(e.childNodes.length>0)for(var s=0;s<e.childNodes.length;s++){var r;if("IMG"===e.childNodes[s].nodeName)t(e.childNodes[s]);else n(e.childNodes[s])}}let s=0;(bodhisvgsInlineSupport=function(){if(console.log("Running bodhisvgsInlineSupport"),"true"===ForceInlineSVGActive)for(var e=document.getElementsByTagName("img"),s=0;s<e.length;s++)void 0!==e[s].src&&e[s].src.match(/\.(svg)/)&&(e[s].classList.contains(cssTarget.ForceInlineSVG)||e[s].classList.add(cssTarget.ForceInlineSVG));var r;if(String.prototype.endsWith||(String.prototype.endsWith=function(e,t){var n=this.toString();("number"!=typeof t||!isFinite(t)||Math.floor(t)!==t||t>n.length)&&(t=n.length),t-=e.length;var s=n.lastIndexOf(e,t);return-1!==s&&s===t}),String.prototype.endsWith=function(e){var t=this.length-e.length;return t>=0&&this.lastIndexOf(e)===t},"string"==typeof(r="true"===ForceInlineSVGActive?"string"==typeof cssTarget.Bodhi?cssTarget.ForceInlineSVG:"style-svg":"string"==typeof cssTarget?cssTarget:"style-svg")){r=r.replace("img.","");for(var e=document.getElementsByClassName(r),s=0;s<e.length;s++){var i;if(void 0===e[s].src)n(e[s]);else t(e[s])}}else console.error("Target is not a string:",r)})()}));
|
||||
Reference in New Issue
Block a user