Skip to content

Commit

Permalink
version 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dasboe committed Sep 20, 2018
1 parent e6e65ef commit a310fc3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![minified size](http://img.badgesize.io/iconfu/svg-inject/v1.0.1/dist/svg-inject.min.js?label=minified%20size) ![gzip size](http://img.badgesize.io/iconfu/svg-inject/v1.0.1/dist/svg-inject.min.js?compression=gzip) [![npm version](https://badge.fury.io/js/%40iconfu%2Fsvg-inject.svg)](https://badge.fury.io/js/%40iconfu%2Fsvg-inject)
![minified size](http://img.badgesize.io/iconfu/svg-inject/v1.0.2/dist/svg-inject.min.js?label=minified%20size) ![gzip size](http://img.badgesize.io/iconfu/svg-inject/v1.0.2/dist/svg-inject.min.js?compression=gzip) [![npm version](https://badge.fury.io/js/%40iconfu%2Fsvg-inject.svg)](https://badge.fury.io/js/%40iconfu%2Fsvg-inject)



Expand Down Expand Up @@ -46,9 +46,9 @@ Include the SVGInject Javascript file in the `<head>` element of your HTML docum
</head>
```

Download plain version (v1.0.1): [svg-inject.js](https://raw.githubusercontent.com/iconfu/svg-inject/v1.0.1/dist/svg-inject.js)
Download plain version (v1.0.2): [svg-inject.js](https://raw.githubusercontent.com/iconfu/svg-inject/v1.0.2/dist/svg-inject.js)

Download minified version (v1.0.1): [svg-inject.min.js](https://raw.githubusercontent.com/iconfu/svg-inject/v1.0.1/dist/svg-inject.min.js)
Download minified version (v1.0.2): [svg-inject.min.js](https://raw.githubusercontent.com/iconfu/svg-inject/v1.0.2/dist/svg-inject.min.js)

### npm

Expand Down
11 changes: 7 additions & 4 deletions dist/svg-inject.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* SVGInject - Version 1.0.1
* SVGInject - Version 1.0.2
* A tiny, intuitive, robust, caching solution for injecting SVG files inline into the DOM.
*
* https://github.com/iconfu/svg-inject
Expand Down Expand Up @@ -101,7 +101,7 @@
var firstElementChild = svg.firstElementChild;

if (firstElementChild && firstElementChild.tagName.toLowerCase() == 'title') {
// replace an existing title attribute if there is already one as the first child of the SVG element
// if the SVGs first child is a title element, replace it with the new title element
svg.replaceChild(title, firstElementChild);
} else {
// insert as first child
Expand Down Expand Up @@ -433,7 +433,10 @@
SVGInject.create = createSVGInject;

/**
* Used in onerror Event of an `<img>` element to handle cases when the loading the original src fails (for example if file is not found or if the browser does not support SVG). This triggers a call to the options onFail hook if available. The optional second parameter will be set as the new src attribute for the img element.
* Used in onerror Event of an `<img>` element to handle cases when the loading the original src fails
* (for example if file is not found or if the browser does not support SVG). This triggers a call to the
* options onFail hook if available. The optional second parameter will be set as the new src attribute
* for the img element.
*
* @param {HTMLImageElement} img - an img element
* @param {String} [fallbackSrc] - optional parameter fallback src
Expand Down Expand Up @@ -469,4 +472,4 @@
if (typeof module == 'object' && typeof module.exports == 'object') {
module.exports = SVGInjectInstance;
}
})(window, document);
})(window, document);
11 changes: 7 additions & 4 deletions examples/svg-inject.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* SVGInject - Version 1.0.1
* SVGInject - Version 1.0.2
* A tiny, intuitive, robust, caching solution for injecting SVG files inline into the DOM.
*
* https://github.com/iconfu/svg-inject
Expand Down Expand Up @@ -101,7 +101,7 @@
var firstElementChild = svg.firstElementChild;

if (firstElementChild && firstElementChild.tagName.toLowerCase() == 'title') {
// replace an existing title attribute if there is already one as the first child of the SVG element
// if the SVGs first child is a title element, replace it with the new title element
svg.replaceChild(title, firstElementChild);
} else {
// insert as first child
Expand Down Expand Up @@ -433,7 +433,10 @@
SVGInject.create = createSVGInject;

/**
* Used in onerror Event of an `<img>` element to handle cases when the loading the original src fails (for example if file is not found or if the browser does not support SVG). This triggers a call to the options onFail hook if available. The optional second parameter will be set as the new src attribute for the img element.
* Used in onerror Event of an `<img>` element to handle cases when the loading the original src fails
* (for example if file is not found or if the browser does not support SVG). This triggers a call to the
* options onFail hook if available. The optional second parameter will be set as the new src attribute
* for the img element.
*
* @param {HTMLImageElement} img - an img element
* @param {String} [fallbackSrc] - optional parameter fallback src
Expand Down Expand Up @@ -469,4 +472,4 @@
if (typeof module == 'object' && typeof module.exports == 'object') {
module.exports = SVGInjectInstance;
}
})(window, document);
})(window, document);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@iconfu/svg-inject",
"version": "1.0.1",
"version": "1.0.2",
"description": "simple bulletproof svg injector",
"main": "dist/svg-inject.js",
"repository": {
Expand Down
9 changes: 6 additions & 3 deletions src/svg-inject.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* SVGInject - Version 1.0.1
* SVGInject - Version 1.0.2
* A tiny, intuitive, robust, caching solution for injecting SVG files inline into the DOM.
*
* https://github.com/iconfu/svg-inject
Expand Down Expand Up @@ -433,7 +433,10 @@
SVGInject.create = createSVGInject;

/**
* Used in onerror Event of an `<img>` element to handle cases when the loading the original src fails (for example if file is not found or if the browser does not support SVG). This triggers a call to the options onFail hook if available. The optional second parameter will be set as the new src attribute for the img element.
* Used in onerror Event of an `<img>` element to handle cases when the loading the original src fails
* (for example if file is not found or if the browser does not support SVG). This triggers a call to the
* options onFail hook if available. The optional second parameter will be set as the new src attribute
* for the img element.
*
* @param {HTMLImageElement} img - an img element
* @param {String} [fallbackSrc] - optional parameter fallback src
Expand Down Expand Up @@ -469,4 +472,4 @@
if (typeof module == 'object' && typeof module.exports == 'object') {
module.exports = SVGInjectInstance;
}
})(window, document);
})(window, document);

0 comments on commit a310fc3

Please sign in to comment.