Init
This commit is contained in:
106
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.js
vendored
Normal file
106
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.js
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
!function(root, factory) {
|
||||
"function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define([], function() {
|
||||
return root.svg4everybody = factory();
|
||||
}) : "object" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory() : root.svg4everybody = factory();
|
||||
}(this, function() {
|
||||
/*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */
|
||||
function embed(parent, svg, target) {
|
||||
// if the target exists
|
||||
if (target) {
|
||||
// create a document fragment to hold the contents of the target
|
||||
var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute("viewBox") && target.getAttribute("viewBox");
|
||||
// conditionally set the viewBox on the svg
|
||||
viewBox && svg.setAttribute("viewBox", viewBox);
|
||||
// copy the contents of the clone into the fragment
|
||||
for (// clone the target
|
||||
var clone = target.cloneNode(!0); clone.childNodes.length; ) {
|
||||
fragment.appendChild(clone.firstChild);
|
||||
}
|
||||
// append the fragment into the svg
|
||||
parent.appendChild(fragment);
|
||||
}
|
||||
}
|
||||
function loadreadystatechange(xhr) {
|
||||
// listen to changes in the request
|
||||
xhr.onreadystatechange = function() {
|
||||
// if the request is ready
|
||||
if (4 === xhr.readyState) {
|
||||
// get the cached html document
|
||||
var cachedDocument = xhr._cachedDocument;
|
||||
// ensure the cached html document based on the xhr response
|
||||
cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(""),
|
||||
cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item
|
||||
xhr._embeds.splice(0).map(function(item) {
|
||||
// get the cached target
|
||||
var target = xhr._cachedTarget[item.id];
|
||||
// ensure the cached target
|
||||
target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)),
|
||||
// embed the target into the svg
|
||||
embed(item.parent, item.svg, target);
|
||||
});
|
||||
}
|
||||
}, // test the ready state change immediately
|
||||
xhr.onreadystatechange();
|
||||
}
|
||||
function svg4everybody(rawopts) {
|
||||
function oninterval() {
|
||||
// while the index exists in the live <use> collection
|
||||
for (// get the cached <use> index
|
||||
var index = 0; index < uses.length; ) {
|
||||
// get the current <use>
|
||||
var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute("xlink:href") || use.getAttribute("href");
|
||||
if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)),
|
||||
svg && src) {
|
||||
if (polyfill) {
|
||||
if (!opts.validate || opts.validate(src, svg, use)) {
|
||||
// remove the <use> element
|
||||
parent.removeChild(use);
|
||||
// parse the src and get the url and id
|
||||
var srcSplit = src.split("#"), url = srcSplit.shift(), id = srcSplit.join("#");
|
||||
// if the link is external
|
||||
if (url.length) {
|
||||
// get the cached xhr request
|
||||
var xhr = requests[url];
|
||||
// ensure the xhr request exists
|
||||
xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open("GET", url), xhr.send(),
|
||||
xhr._embeds = []), // add the svg and id as an item to the xhr embeds list
|
||||
xhr._embeds.push({
|
||||
parent: parent,
|
||||
svg: svg,
|
||||
id: id
|
||||
}), // prepare the xhr ready state change event
|
||||
loadreadystatechange(xhr);
|
||||
} else {
|
||||
// embed the local id into the svg
|
||||
embed(parent, svg, document.getElementById(id));
|
||||
}
|
||||
} else {
|
||||
// increase the index when the previous value was not "valid"
|
||||
++index, ++numberOfSvgUseElementsToBypass;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// increase the index when the previous value was not "valid"
|
||||
++index;
|
||||
}
|
||||
}
|
||||
// continue the interval
|
||||
(!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);
|
||||
}
|
||||
var polyfill, opts = Object(rawopts), newerIEUA = /\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/, webkitUA = /\bAppleWebKit\/(\d+)\b/, olderEdgeUA = /\bEdge\/12\.(\d+)\b/, edgeUA = /\bEdge\/.(\d+)\b/, inIframe = window.top !== window.self;
|
||||
polyfill = "polyfill" in opts ? opts.polyfill : newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;
|
||||
// create xhr requests object
|
||||
var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName("use"), numberOfSvgUseElementsToBypass = 0;
|
||||
// conditionally start the interval if the polyfill is active
|
||||
polyfill && oninterval();
|
||||
}
|
||||
function getSVGAncestor(node) {
|
||||
for (var svg = node; "svg" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}
|
||||
return svg;
|
||||
}
|
||||
return svg4everybody;
|
||||
});
|
||||
127
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.legacy.js
vendored
Normal file
127
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.legacy.js
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
!function(root, factory) {
|
||||
"function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
|
||||
define([], function() {
|
||||
return root.svg4everybody = factory();
|
||||
}) : "object" == typeof module && module.exports ? // Node. Does not work with strict CommonJS, but
|
||||
// only CommonJS-like environments that support module.exports,
|
||||
// like Node.
|
||||
module.exports = factory() : root.svg4everybody = factory();
|
||||
}(this, function() {
|
||||
/*! svg4everybody v2.1.9 | github.com/jonathantneal/svg4everybody */
|
||||
function embed(parent, svg, target) {
|
||||
// if the target exists
|
||||
if (target) {
|
||||
// create a document fragment to hold the contents of the target
|
||||
var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute("viewBox") && target.getAttribute("viewBox");
|
||||
// conditionally set the viewBox on the svg
|
||||
viewBox && svg.setAttribute("viewBox", viewBox);
|
||||
// copy the contents of the clone into the fragment
|
||||
for (// clone the target
|
||||
var clone = target.cloneNode(!0); clone.childNodes.length; ) {
|
||||
fragment.appendChild(clone.firstChild);
|
||||
}
|
||||
// append the fragment into the svg
|
||||
parent.appendChild(fragment);
|
||||
}
|
||||
}
|
||||
function loadreadystatechange(xhr) {
|
||||
// listen to changes in the request
|
||||
xhr.onreadystatechange = function() {
|
||||
// if the request is ready
|
||||
if (4 === xhr.readyState) {
|
||||
// get the cached html document
|
||||
var cachedDocument = xhr._cachedDocument;
|
||||
// ensure the cached html document based on the xhr response
|
||||
cachedDocument || (cachedDocument = xhr._cachedDocument = document.implementation.createHTMLDocument(""),
|
||||
cachedDocument.body.innerHTML = xhr.responseText, xhr._cachedTarget = {}), // clear the xhr embeds list and embed each item
|
||||
xhr._embeds.splice(0).map(function(item) {
|
||||
// get the cached target
|
||||
var target = xhr._cachedTarget[item.id];
|
||||
// ensure the cached target
|
||||
target || (target = xhr._cachedTarget[item.id] = cachedDocument.getElementById(item.id)),
|
||||
// embed the target into the svg
|
||||
embed(item.parent, item.svg, target);
|
||||
});
|
||||
}
|
||||
}, // test the ready state change immediately
|
||||
xhr.onreadystatechange();
|
||||
}
|
||||
function svg4everybody(rawopts) {
|
||||
function oninterval() {
|
||||
// while the index exists in the live <use> collection
|
||||
for (// get the cached <use> index
|
||||
var index = 0; index < uses.length; ) {
|
||||
// get the current <use>
|
||||
var use = uses[index], parent = use.parentNode, svg = getSVGAncestor(parent), src = use.getAttribute("xlink:href") || use.getAttribute("href");
|
||||
if (!src && opts.attributeName && (src = use.getAttribute(opts.attributeName)),
|
||||
svg && src) {
|
||||
// if running with legacy support
|
||||
if (nosvg) {
|
||||
// create a new fallback image
|
||||
var img = document.createElement("img");
|
||||
// force display in older IE
|
||||
img.style.cssText = "display:inline-block;height:100%;width:100%", // set the fallback size using the svg size
|
||||
img.setAttribute("width", svg.getAttribute("width") || svg.clientWidth), img.setAttribute("height", svg.getAttribute("height") || svg.clientHeight),
|
||||
// set the fallback src
|
||||
img.src = fallback(src, svg, use), // replace the <use> with the fallback image
|
||||
parent.replaceChild(img, use);
|
||||
} else {
|
||||
if (polyfill) {
|
||||
if (!opts.validate || opts.validate(src, svg, use)) {
|
||||
// remove the <use> element
|
||||
parent.removeChild(use);
|
||||
// parse the src and get the url and id
|
||||
var srcSplit = src.split("#"), url = srcSplit.shift(), id = srcSplit.join("#");
|
||||
// if the link is external
|
||||
if (url.length) {
|
||||
// get the cached xhr request
|
||||
var xhr = requests[url];
|
||||
// ensure the xhr request exists
|
||||
xhr || (xhr = requests[url] = new XMLHttpRequest(), xhr.open("GET", url), xhr.send(),
|
||||
xhr._embeds = []), // add the svg and id as an item to the xhr embeds list
|
||||
xhr._embeds.push({
|
||||
parent: parent,
|
||||
svg: svg,
|
||||
id: id
|
||||
}), // prepare the xhr ready state change event
|
||||
loadreadystatechange(xhr);
|
||||
} else {
|
||||
// embed the local id into the svg
|
||||
embed(parent, svg, document.getElementById(id));
|
||||
}
|
||||
} else {
|
||||
// increase the index when the previous value was not "valid"
|
||||
++index, ++numberOfSvgUseElementsToBypass;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// increase the index when the previous value was not "valid"
|
||||
++index;
|
||||
}
|
||||
}
|
||||
// continue the interval
|
||||
(!uses.length || uses.length - numberOfSvgUseElementsToBypass > 0) && requestAnimationFrame(oninterval, 67);
|
||||
}
|
||||
var nosvg, fallback, opts = Object(rawopts);
|
||||
// configure the fallback method
|
||||
fallback = opts.fallback || function(src) {
|
||||
return src.replace(/\?[^#]+/, "").replace("#", ".").replace(/^\./, "") + ".png" + (/\?[^#]+/.exec(src) || [ "" ])[0];
|
||||
}, // set whether to shiv <svg> and <use> elements and use image fallbacks
|
||||
nosvg = "nosvg" in opts ? opts.nosvg : /\bMSIE [1-8]\b/.test(navigator.userAgent),
|
||||
// conditionally shiv <svg> and <use>
|
||||
nosvg && (document.createElement("svg"), document.createElement("use"));
|
||||
// set whether the polyfill will be activated or not
|
||||
var polyfill, olderIEUA = /\bMSIE [1-8]\.0\b/, newerIEUA = /\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/, webkitUA = /\bAppleWebKit\/(\d+)\b/, olderEdgeUA = /\bEdge\/12\.(\d+)\b/, edgeUA = /\bEdge\/.(\d+)\b/, inIframe = window.top !== window.self;
|
||||
polyfill = "polyfill" in opts ? opts.polyfill : olderIEUA.test(navigator.userAgent) || newerIEUA.test(navigator.userAgent) || (navigator.userAgent.match(olderEdgeUA) || [])[1] < 10547 || (navigator.userAgent.match(webkitUA) || [])[1] < 537 || edgeUA.test(navigator.userAgent) && inIframe;
|
||||
// create xhr requests object
|
||||
var requests = {}, requestAnimationFrame = window.requestAnimationFrame || setTimeout, uses = document.getElementsByTagName("use"), numberOfSvgUseElementsToBypass = 0;
|
||||
// conditionally start the interval if the polyfill is active
|
||||
polyfill && oninterval();
|
||||
}
|
||||
function getSVGAncestor(node) {
|
||||
for (var svg = node; "svg" !== svg.nodeName.toLowerCase() && (svg = svg.parentNode); ) {}
|
||||
return svg;
|
||||
}
|
||||
return svg4everybody;
|
||||
});
|
||||
1
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.legacy.min.js
vendored
Normal file
1
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.legacy.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.svg4everybody=b()}):"object"==typeof module&&module.exports?module.exports=b():a.svg4everybody=b()}(this,function(){function a(a,b,c){if(c){var d=document.createDocumentFragment(),e=!b.hasAttribute("viewBox")&&c.getAttribute("viewBox");e&&b.setAttribute("viewBox",e);for(var f=c.cloneNode(!0);f.childNodes.length;)d.appendChild(f.firstChild);a.appendChild(d)}}function b(b){b.onreadystatechange=function(){if(4===b.readyState){var c=b._cachedDocument;c||(c=b._cachedDocument=document.implementation.createHTMLDocument(""),c.body.innerHTML=b.responseText,b._cachedTarget={}),b._embeds.splice(0).map(function(d){var e=b._cachedTarget[d.id];e||(e=b._cachedTarget[d.id]=c.getElementById(d.id)),a(d.parent,d.svg,e)})}},b.onreadystatechange()}function c(c){function e(){for(var c=0;c<r.length;){var j=r[c],k=j.parentNode,l=d(k),m=j.getAttribute("xlink:href")||j.getAttribute("href");if(!m&&h.attributeName&&(m=j.getAttribute(h.attributeName)),l&&m){if(f){var n=document.createElement("img");n.style.cssText="display:inline-block;height:100%;width:100%",n.setAttribute("width",l.getAttribute("width")||l.clientWidth),n.setAttribute("height",l.getAttribute("height")||l.clientHeight),n.src=g(m,l,j),k.replaceChild(n,j)}else if(i)if(!h.validate||h.validate(m,l,j)){k.removeChild(j);var o=m.split("#"),t=o.shift(),u=o.join("#");if(t.length){var v=p[t];v||(v=p[t]=new XMLHttpRequest,v.open("GET",t),v.send(),v._embeds=[]),v._embeds.push({parent:k,svg:l,id:u}),b(v)}else a(k,l,document.getElementById(u))}else++c,++s}else++c}(!r.length||r.length-s>0)&&q(e,67)}var f,g,h=Object(c);g=h.fallback||function(a){return a.replace(/\?[^#]+/,"").replace("#",".").replace(/^\./,"")+".png"+(/\?[^#]+/.exec(a)||[""])[0]},f="nosvg"in h?h.nosvg:/\bMSIE [1-8]\b/.test(navigator.userAgent),f&&(document.createElement("svg"),document.createElement("use"));var i,j=/\bMSIE [1-8]\.0\b/,k=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,l=/\bAppleWebKit\/(\d+)\b/,m=/\bEdge\/12\.(\d+)\b/,n=/\bEdge\/.(\d+)\b/,o=window.top!==window.self;i="polyfill"in h?h.polyfill:j.test(navigator.userAgent)||k.test(navigator.userAgent)||(navigator.userAgent.match(m)||[])[1]<10547||(navigator.userAgent.match(l)||[])[1]<537||n.test(navigator.userAgent)&&o;var p={},q=window.requestAnimationFrame||setTimeout,r=document.getElementsByTagName("use"),s=0;i&&e()}function d(a){for(var b=a;"svg"!==b.nodeName.toLowerCase()&&(b=b.parentNode););return b}return c});
|
||||
1
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.min.js
vendored
Normal file
1
Prefab.Web/wwwroot/template/html/classic/vendor/svg4everybody/svg4everybody.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
!function(a,b){"function"==typeof define&&define.amd?define([],function(){return a.svg4everybody=b()}):"object"==typeof module&&module.exports?module.exports=b():a.svg4everybody=b()}(this,function(){function a(a,b,c){if(c){var d=document.createDocumentFragment(),e=!b.hasAttribute("viewBox")&&c.getAttribute("viewBox");e&&b.setAttribute("viewBox",e);for(var f=c.cloneNode(!0);f.childNodes.length;)d.appendChild(f.firstChild);a.appendChild(d)}}function b(b){b.onreadystatechange=function(){if(4===b.readyState){var c=b._cachedDocument;c||(c=b._cachedDocument=document.implementation.createHTMLDocument(""),c.body.innerHTML=b.responseText,b._cachedTarget={}),b._embeds.splice(0).map(function(d){var e=b._cachedTarget[d.id];e||(e=b._cachedTarget[d.id]=c.getElementById(d.id)),a(d.parent,d.svg,e)})}},b.onreadystatechange()}function c(c){function e(){for(var c=0;c<o.length;){var h=o[c],i=h.parentNode,j=d(i),k=h.getAttribute("xlink:href")||h.getAttribute("href");if(!k&&g.attributeName&&(k=h.getAttribute(g.attributeName)),j&&k){if(f)if(!g.validate||g.validate(k,j,h)){i.removeChild(h);var l=k.split("#"),q=l.shift(),r=l.join("#");if(q.length){var s=m[q];s||(s=m[q]=new XMLHttpRequest,s.open("GET",q),s.send(),s._embeds=[]),s._embeds.push({parent:i,svg:j,id:r}),b(s)}else a(i,j,document.getElementById(r))}else++c,++p}else++c}(!o.length||o.length-p>0)&&n(e,67)}var f,g=Object(c),h=/\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/,i=/\bAppleWebKit\/(\d+)\b/,j=/\bEdge\/12\.(\d+)\b/,k=/\bEdge\/.(\d+)\b/,l=window.top!==window.self;f="polyfill"in g?g.polyfill:h.test(navigator.userAgent)||(navigator.userAgent.match(j)||[])[1]<10547||(navigator.userAgent.match(i)||[])[1]<537||k.test(navigator.userAgent)&&l;var m={},n=window.requestAnimationFrame||setTimeout,o=document.getElementsByTagName("use"),p=0;f&&e()}function d(a){for(var b=a;"svg"!==b.nodeName.toLowerCase()&&(b=b.parentNode););return b}return c});
|
||||
Reference in New Issue
Block a user