Initial commit
This commit is contained in:
commit
57a2089dd9
1541 changed files with 595392 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
body #set-post-thumbnail,body #postimagediv .inside img[src$=".svg"]{width:100%}
|
|
@ -0,0 +1 @@
|
|||
.svgs-advanced{display:none}
|
1
wp-content/plugins/svg-support/css/svgs-admin.css
Normal file
1
wp-content/plugins/svg-support/css/svgs-admin.css
Normal file
|
@ -0,0 +1 @@
|
|||
.svgs-version{font-size:10px;margin-left:7px}.postbox .inside a{text-decoration:none}h3{padding:0 12px}.help-tab-content h3{padding:0}h3.inner-title{padding:0;font-size:1.2em}.metabox-holder .postbox>h3,.metabox-holder .stuffbox>h3,.metabox-holder h2.hndle,.metabox-holder h3.hndle{font-size:1.3em;font-weight:600}.shortpixel-logo img{position:absolute;right:10px;bottom:0;width:140px}table.media .column-title .media-icon img{width:60px}
|
1
wp-content/plugins/svg-support/css/svgs-attachment.css
Normal file
1
wp-content/plugins/svg-support/css/svgs-attachment.css
Normal file
|
@ -0,0 +1 @@
|
|||
.attachment svg,.widget_media_image svg{max-width:100%;height:auto}
|
1
wp-content/plugins/svg-support/js/min/svgs-admin-notice-update-min.js
vendored
Normal file
1
wp-content/plugins/svg-support/js/min/svgs-admin-notice-update-min.js
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
jQuery(document).ready(function($){function i(){jQuery.ajax({url:ajaxurl,data:{action:"bodhi_svgs_dismiss_admin_notice"}})}$(".svgs-upgrade-notice .notice-dismiss").click(i)});
|
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(t){(bodhisvgsInlineSupport=function(){if("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 r=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>r.length)&&(e=r.length),e-=t.length;var s=r.lastIndexOf(t,e);return-1!==s&&s===e}),String.prototype.endsWith=function(t){var e=this.length-t.length;return e>=0&&this.lastIndexOf(t)===e},"true"===ForceInlineSVGActive)var e="img."!==cssTarget.Bodhi?cssTarget.Bodhi:"img.style-svg";else var e="img."!==cssTarget?cssTarget:"img.style-svg";t(e).each((function(e){var r=jQuery(this),s=r.attr("id"),i=r.attr("class"),n=r.attr("src");n.endsWith("svg")&&t.get(n,(function(n){var a=t(n).find("svg"),c=a.attr("id");void 0===s?void 0===c?(s="svg-replaced-"+e,a=a.attr("id",s)):s=c:a=a.attr("id",s),void 0!==i&&(a=a.attr("class",i+" replaced-svg svg-replaced-"+e)),a=a.removeAttr("xmlns:a"),r.replaceWith(a),t(document).trigger("svg.loaded",[s])}),"xml")}))})()}));
|
|
@ -0,0 +1,16 @@
|
|||
jQuery(document).ready(function ($) {
|
||||
|
||||
function svgsDismissNotice(){
|
||||
|
||||
jQuery.ajax({
|
||||
url: ajaxurl,
|
||||
data: {
|
||||
action: 'bodhi_svgs_dismiss_admin_notice'
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$('.svgs-upgrade-notice .notice-dismiss').click(svgsDismissNotice);
|
||||
|
||||
});
|
110
wp-content/plugins/svg-support/js/svgs-inline.js
Normal file
110
wp-content/plugins/svg-support/js/svgs-inline.js
Normal file
|
@ -0,0 +1,110 @@
|
|||
jQuery(document).ready(function ($) {
|
||||
|
||||
// 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 : 'img.style-svg' );
|
||||
} else {
|
||||
var target = ( cssTarget !== 'img.' ? cssTarget : 'img.style-svg' );
|
||||
}
|
||||
|
||||
$(target).each(function(index){
|
||||
var $img = jQuery(this);
|
||||
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-'+index;
|
||||
$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-'+index);
|
||||
}
|
||||
|
||||
// Remove any invalid XML tags as per http://validator.w3.org
|
||||
$svg = $svg.removeAttr('xmlns:a');
|
||||
|
||||
// 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]);
|
||||
|
||||
}, 'xml');
|
||||
});
|
||||
|
||||
})(); // Execute immediately
|
||||
|
||||
});
|
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* Featured Image Display
|
||||
*
|
||||
* Fixes the 0px featured image on edit screen
|
||||
* WooCommerce Product, Sensei Course
|
||||
*/
|
||||
body #set-post-thumbnail,
|
||||
body #postimagediv .inside img[src$=".svg"] {
|
||||
width: 100%;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
/**
|
||||
* Hide advanced features
|
||||
*/
|
||||
.svgs-advanced {
|
||||
display: none;
|
||||
}
|
45
wp-content/plugins/svg-support/scss/svgs-admin.scss
Normal file
45
wp-content/plugins/svg-support/scss/svgs-admin.scss
Normal file
|
@ -0,0 +1,45 @@
|
|||
/**
|
||||
* Settings Page
|
||||
*/
|
||||
.svgs-version {
|
||||
font-size: 10px;
|
||||
margin-left: 7px;
|
||||
}
|
||||
.postbox .inside a {
|
||||
text-decoration: none;
|
||||
}
|
||||
h3 {
|
||||
padding: 0 12px;
|
||||
}
|
||||
.help-tab-content h3 {
|
||||
padding: 0;
|
||||
}
|
||||
h3.inner-title {
|
||||
padding: 0;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
.metabox-holder {
|
||||
.postbox>h3,
|
||||
.stuffbox>h3,
|
||||
h2.hndle,
|
||||
h3.hndle {
|
||||
font-size: 1.3em;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.shortpixel-logo img {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0;
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Media Library
|
||||
*/
|
||||
table.media .column-title .media-icon img {
|
||||
width: 60px;
|
||||
// height: 60px;
|
||||
}
|
17
wp-content/plugins/svg-support/scss/svgs-attachment.scss
Normal file
17
wp-content/plugins/svg-support/scss/svgs-attachment.scss
Normal file
|
@ -0,0 +1,17 @@
|
|||
// .attachment img[src$=".svg"],
|
||||
// .widget_media_image img[src$=".svg"] {
|
||||
// width: 100%;
|
||||
// }
|
||||
|
||||
.attachment,
|
||||
.widget_media_image {
|
||||
|
||||
// img[src$=".svg"] {
|
||||
// width: 100%;
|
||||
// }
|
||||
|
||||
svg {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue