diff --git a/README.md b/README.md index aeba22d..cf531cc 100644 --- a/README.md +++ b/README.md @@ -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) @@ -46,9 +46,9 @@ Include the SVGInject Javascript file in the `` element of your HTML docum ``` -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 diff --git a/dist/svg-inject.js b/dist/svg-inject.js index 8c2d6b3..ae415f2 100644 --- a/dist/svg-inject.js +++ b/dist/svg-inject.js @@ -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 @@ -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 @@ -433,7 +433,10 @@ SVGInject.create = createSVGInject; /** - * Used in onerror Event of an `` 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 `` 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 @@ -469,4 +472,4 @@ if (typeof module == 'object' && typeof module.exports == 'object') { module.exports = SVGInjectInstance; } -})(window, document); +})(window, document); \ No newline at end of file diff --git a/examples/svg-inject.js b/examples/svg-inject.js index 8c2d6b3..ae415f2 100644 --- a/examples/svg-inject.js +++ b/examples/svg-inject.js @@ -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 @@ -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 @@ -433,7 +433,10 @@ SVGInject.create = createSVGInject; /** - * Used in onerror Event of an `` 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 `` 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 @@ -469,4 +472,4 @@ if (typeof module == 'object' && typeof module.exports == 'object') { module.exports = SVGInjectInstance; } -})(window, document); +})(window, document); \ No newline at end of file diff --git a/package.json b/package.json index c9b4462..d4c5d96 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/svg-inject.js b/src/svg-inject.js index ade92e3..ae415f2 100644 --- a/src/svg-inject.js +++ b/src/svg-inject.js @@ -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 @@ -433,7 +433,10 @@ SVGInject.create = createSVGInject; /** - * Used in onerror Event of an `` 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 `` 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 @@ -469,4 +472,4 @@ if (typeof module == 'object' && typeof module.exports == 'object') { module.exports = SVGInjectInstance; } -})(window, document); +})(window, document); \ No newline at end of file