diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ddbae8c --- /dev/null +++ b/.editorconfig @@ -0,0 +1,21 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = false + + +[*] + +# Change these settings to your own preference +indent_style = space +indent_size = 2 + +# We recommend you to keep these unchanged +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore index 1a2db02..8e10021 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,11 @@ -node_modules -.tmp +#dirs +.idea +.vscode + .DS_Store + +node_modules + + +#files +npm-debug.log diff --git a/.jshintrc b/.jshintrc index 93eb348..e20530e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -21,8 +21,16 @@ "node": true, "jquery": false, "strict": false, + "sub": true, "globals": { + "angular":true, + "define":true, "app": true, - "ignore": true + "ignore": true, + "SVGSymbolElement": false, + "SVGViewElement": false, + "SVGUseElement": false, + "SVGSVGElement" :false, + "Document" :false } } diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..7e8bcdf --- /dev/null +++ b/.npmignore @@ -0,0 +1,14 @@ +#dirs +.idea +.DS_Store + +tests +examples +src + + +#files +.jshintrc +.editorconfig +bower.json +npm-debug.log diff --git a/CHANGELOG.md b/CHANGELOG.md index c297542..fd50ccb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,67 +1,390 @@ ## Change Log +### upcoming (2021/11/30 02:00 +00:00) +- [8c3d59a](https://github.com/flobacher/SVGInjector2/commit/8c3d59a1883bb50b6b9ff2285bd89c17eeb0e45b) update dependency (@flobacher) +- [330b01b](https://github.com/flobacher/SVGInjector2/commit/330b01b6e34eebfd76b61d17ca27a91a9316644f) fix update version script (@flobacher) +- [6a9cda1](https://github.com/flobacher/SVGInjector2/commit/6a9cda1006045e279d22fc506b017074869f8d21) document scripts (@flobacher) +- [324d99d](https://github.com/flobacher/SVGInjector2/commit/324d99df1ba7cae4e7008717e6b7fea6452dd830) update scripts (@flobacher) + +### v2.1.4 (2021/11/30 01:06 +00:00) +- [73e5a69](https://github.com/flobacher/SVGInjector2/commit/73e5a693ce13e409dfa90b5a085688b14bdf0772) 2.1.4 (@flobacher) +- [#29](https://github.com/flobacher/SVGInjector2/pull/29) fix onDoneCallback for empty array (@pga78) +- [d1de008](https://github.com/flobacher/SVGInjector2/commit/d1de008f11ff23255335914e82b70bcb2dade913) mind if onDoneCallback defined (@pga78) +- [9345475](https://github.com/flobacher/SVGInjector2/commit/934547569c25c6810f0712c7726ba72abe50da1d) fix onDoneCallback for empty array (@pga78) +- [a1c5b79](https://github.com/flobacher/SVGInjector2/commit/a1c5b79c45a1ddb572858b12dd7dcfdae515bb35) replace `yarn.lock` by `package-lock.json` + +### v2.1.3 (2017/10/09 11:01 +00:00) +- [1c7d9ca](https://github.com/flobacher/SVGInjector2/commit/1c7d9ca57c2c7803aef23e45daf995d8ef8b1bdf) 2.1.3 +- [7b60c1f](https://github.com/flobacher/SVGInjector2/commit/7b60c1f5c0a2dfe57f8a2afc4f23fe64c4484f44) get rid of `engines` field + +### v2.1.2 (2017/10/09 03:56 +00:00) +- [01e4044](https://github.com/flobacher/SVGInjector2/commit/01e404473c45d850bad145b3c8d1cc25dd099f8c) 2.1.2 +- [6de7b44](https://github.com/flobacher/SVGInjector2/commit/6de7b44afecdc73062e78400a34ae15c0c57194b) make the `update-version-comment` script work on windows as well +- [bd18b74](https://github.com/flobacher/SVGInjector2/commit/bd18b7472f7f3ce11676f060bbe725830886a692) update examples to test new `title`, `desc`, `aria-labelledby` and `aria-hidden` implementation +- [6eab4d9](https://github.com/flobacher/SVGInjector2/commit/6eab4d96a84d1cfd3b1317de5db52418d256064f) update logic for title and desc creation/adaption +- [fc49c49](https://github.com/flobacher/SVGInjector2/commit/fc49c49df789a580a611d121c09842d3cde7e166) add angular example +- [4f71cc4](https://github.com/flobacher/SVGInjector2/commit/4f71cc473843308259edb8741b8b61d6f5f696c1) add `h1` to titles to identify them easier +- [aafb1fe](https://github.com/flobacher/SVGInjector2/commit/aafb1fecda487a6e7ef7a6e9d96a6fcaac2a0dec) npm 5 support. hurray =) +- [c934bd3](https://github.com/flobacher/SVGInjector2/commit/c934bd357864bc9959aa4d20585f2ab26dfaf9a4) chore: update for usage with node 8 + +### v2.1.1 (2017/05/15 16:34 +00:00) +- [ba82a4c](https://github.com/flobacher/SVGInjector2/commit/ba82a4cb168afa4c0af668a03685597d1696d166) 2.1.1 +- [013bb9d](https://github.com/flobacher/SVGInjector2/commit/013bb9d31fcba2fc4061b08418cfda5d5576b277) codestyle +- [6221b19](https://github.com/flobacher/SVGInjector2/commit/6221b19f6f9f00344754304dfcea07ef35548e81) add width and height also on single elements (not spritesheet-fragments) that only specify a viewbox + +### v2.1.0 (2017/05/12 19:32 +00:00) +- [54fa00d](https://github.com/flobacher/SVGInjector2/commit/54fa00d7ca9b359cbcf99f0e9bfb5fdf06f94c48) 2.1.0 +- [de4a372](https://github.com/flobacher/SVGInjector2/commit/de4a372b6d28f22f747cffd7b574da6160c8a257) add the option to provide fallback svgs for fragment ids, that might not be found in the spritesheet + +### v2.0.37 (2017/05/12 17:31 +00:00) +- [e4d6f1a](https://github.com/flobacher/SVGInjector2/commit/e4d6f1a29b9cec3f6b9c6c803f8f6f6be00085bf) 2.0.37 +- [#22](https://github.com/flobacher/SVGInjector2/pull/22) bugfix, replace element (@sladiri) +- [9f81e08](https://github.com/flobacher/SVGInjector2/commit/9f81e0801f5edbd358cac5df7b7013b710d46983) bugfix, replace element (@sladiri) + +### v2.0.36 (2017/03/28 08:54 +00:00) +- [9cb552c](https://github.com/flobacher/SVGInjector2/commit/9cb552c103e32fb49efda3881272ba80fea81751) 2.0.36 (@flobacher) +- [9517d99](https://github.com/flobacher/SVGInjector2/commit/9517d9941b17d5dc1dece733fcf2bb1281e2852f) update version nr. on build (@flobacher) + +### v2.0.35 (2017/03/13 12:40 +00:00) +- [9b0617f](https://github.com/flobacher/SVGInjector2/commit/9b0617fdab9f178bb24922d1c610c66ccd85b873) 2.0.35 (@flobacher) +- [7897ca7](https://github.com/flobacher/SVGInjector2/commit/7897ca7c284d4162b4f9ceb9446b829f5bb6f2c3) update example (@flobacher) +- [6e7f25f](https://github.com/flobacher/SVGInjector2/commit/6e7f25f0f39ae0ec56ccbd24e58da9ee448e3c88) angular-directive: allow sprite-id class to be not the first in the classList (@flobacher) +- [9c09103](https://github.com/flobacher/SVGInjector2/commit/9c09103d35c60c2762d389fb556ce83715ace092) fix package-script (@flobacher) + +### v2.0.34 (2017/03/05 10:43 +00:00) +- [80f8b04](https://github.com/flobacher/SVGInjector2/commit/80f8b04c42104948937663a59f46fd751b1e5338) 2.0.34 (@flobacher) +- [699af49](https://github.com/flobacher/SVGInjector2/commit/699af496e1627e6b0a42a908671f39977d83e5b5) codestyle (@flobacher) +- [dedbd9b](https://github.com/flobacher/SVGInjector2/commit/dedbd9b181ffdf7450945c7642c2c658b58c173c) start adding support for interpolated data-src (@flobacher) +- [b1a17fc](https://github.com/flobacher/SVGInjector2/commit/b1a17fc1c7d2f05364a8e81d17872d734e6812da) add example for interpolation support of classnames (@flobacher) +- [1de9aa8](https://github.com/flobacher/SVGInjector2/commit/1de9aa8737a6e3d249c7c381c00f04f0d385cd2b) adapt example (@flobacher) +- [215638d](https://github.com/flobacher/SVGInjector2/commit/215638d7d4bad66921c11bc7b9c08ca3099f4998) only execute angular-directive code if src, data-src or sprite-class are present (@flobacher) +- [7eab253](https://github.com/flobacher/SVGInjector2/commit/7eab25323b2541640b3c5d143a525d3cd7f6ac69) codestyle (@flobacher) +- [a0459c8](https://github.com/flobacher/SVGInjector2/commit/a0459c855fdf258204dd77d783847fe17acd7dfb) getter for config (@flobacher) +- [3c4ba0e](https://github.com/flobacher/SVGInjector2/commit/3c4ba0e1bd1f48139d2673de3fc3732e2ba113c9) exit, when neither src, data-src, nor sprite sheet url are specified (@flobacher) +- [3aef12b](https://github.com/flobacher/SVGInjector2/commit/3aef12bf51f3fe0992618c3d2a50d921ba319c38) add inline svgs to examples (@flobacher) +- [ba2226f](https://github.com/flobacher/SVGInjector2/commit/ba2226fb08ca66d6f884d5ec3ef59a9911c307af) remove console.logs in minified version (@flobacher) +- [#16](https://github.com/flobacher/SVGInjector2/pull/16) Check for imgUrl (@TheCopartnery) +- [a188971](https://github.com/flobacher/SVGInjector2/commit/a188971bd5dbecea928eccc7e9d202ac0f46cecd) spelling correction (@Viveur) +- [3e72195](https://github.com/flobacher/SVGInjector2/commit/3e72195bb3c26348e12f8ae2ebf5e2cd4ec9af09) Check for imgUrl - inline svg’s will not have an imgUrl (src/data-src) causing imgUrl.split to error (@Viveur) + +### v2.0.33 (2017/02/27 23:25 +00:00) +- [73c3432](https://github.com/flobacher/SVGInjector2/commit/73c3432a5ea5d88bf0230cf2f7a90a47e138655f) 2.0.33 (@flobacher) +- [85086e0](https://github.com/flobacher/SVGInjector2/commit/85086e0d80344dd139ba32e0a6daa8377e2e61e9) do not change src (@flobacher) +- [147b953](https://github.com/flobacher/SVGInjector2/commit/147b9533c47e2874a8da757cc05e9023ca655e86) add options (@flobacher) +- [2658876](https://github.com/flobacher/SVGInjector2/commit/2658876a641c1384b5afe6877b3f5185612a5525) add options (@flobacher) +- [#14](https://github.com/flobacher/SVGInjector2/pull/14) Update README.md (@TheCopartnery) +- [#13](https://github.com/flobacher/SVGInjector2/pull/13) Add simple with img tag example (@TheCopartnery) +- [35a3f6a](https://github.com/flobacher/SVGInjector2/commit/35a3f6ab8efab2863c702738b546e717c7fb1eb5) update README.md (@flobacher) +- [00838d8](https://github.com/flobacher/SVGInjector2/commit/00838d84dcd7ebc746b21eef37c57426c7a85c89) Update README.md (@Viveur) +- [caedbeb](https://github.com/flobacher/SVGInjector2/commit/caedbebe345c666812600e2ec60b9468a16faff5) Add simple with img tag example (@Viveur) +- [69ecf67](https://github.com/flobacher/SVGInjector2/commit/69ecf67708ce5a60a2c32d5326f2a1761d40842b) update/streamline examples and read (@flobacher) + +### v2.0.32 (2017/02/22 22:58 +00:00) +- [d534db0](https://github.com/flobacher/SVGInjector2/commit/d534db0a68c66162165b190c5bb7249ec9bcc937) 2.0.32 (@flobacher) +- [794d4f5](https://github.com/flobacher/SVGInjector2/commit/794d4f5997fbbb4557e13c81bcfb2e9f47854c21) add a basic, non-spritesheet example (@flobacher) +- [50eaafb](https://github.com/flobacher/SVGInjector2/commit/50eaafb874c37b4dadc917c36a24f748206b3f29) always set data-src even if only src was specified (@flobacher) + +### v2.0.31 (2017/02/22 21:13 +00:00) +- [0c64792](https://github.com/flobacher/SVGInjector2/commit/0c647921b47e34714cbfe630295fa6c56125130f) v2.0.31 (@flobacher) +- [f19994c](https://github.com/flobacher/SVGInjector2/commit/f19994c8db700e4157581dc90103e48bbac4c651) fix main entry in bower.json (@flobacher) +- [dd3f7d0](https://github.com/flobacher/SVGInjector2/commit/dd3f7d0b97f119208a450ef7e9bcc3d774a7ce2b) add copy of file to stay compatible with file structure of version < v2.0.28 (@flobacher) +- [eb84ea3](https://github.com/flobacher/SVGInjector2/commit/eb84ea3a63962657606e454956ca38da1bb07e76) make sure script works on all platforms (@flobacher) +- [fd897d7](https://github.com/flobacher/SVGInjector2/commit/fd897d7de5b53dc71d9f3e272c4ca4655a0ac6b5) codestyle: streamline folder-pathes (@flobacher) +- [5803a9a](https://github.com/flobacher/SVGInjector2/commit/5803a9a9eb257b4dbb31d72d0cac2ba941c1f7f2) add copy command to stay compatible with file structure of version < v2.0.28 (@flobacher) +- [#10](https://github.com/flobacher/SVGInjector2/pull/10) Update README links (@TheCopartnery) +- [febe4b2](https://github.com/flobacher/SVGInjector2/commit/febe4b22d331baeafaabefb00171ca767f8942af) update links (@Viveur) + +### v2.0.30 (2017/02/21 18:10 +00:00) +- [759c681](https://github.com/flobacher/SVGInjector2/commit/759c681a56dcb88b3ac2aa64d8b448b115e15010) 2.0.30 (@flobacher) +- [41f49c8](https://github.com/flobacher/SVGInjector2/commit/41f49c8292c203b826b97f1bef5d8fe013909112) fix main entry in package.json (@flobacher) +- [60b98b1](https://github.com/flobacher/SVGInjector2/commit/60b98b1c2c0d089a3583aec252c5cd4c7ff512b8) fix package script (@flobacher) + +### v2.0.29 (2017/02/20 09:51 +00:00) +- [95bfd75](https://github.com/flobacher/SVGInjector2/commit/95bfd758356fc4839a028e6503dada49b6ceea2e) 2.0.29 (@flobacher) +- [c5e6c81](https://github.com/flobacher/SVGInjector2/commit/c5e6c816c42c247b709985b3789509ea87ec6381) fix package scripts (@flobacher) +- [b1ccb91](https://github.com/flobacher/SVGInjector2/commit/b1ccb91466fc96196da9fb69bd8dc7319ac1a866) update examples (@flobacher) +- [58f4acd](https://github.com/flobacher/SVGInjector2/commit/58f4acde207ac1d4ba8f797c52204e766902a47a) do not remove console.logs (@flobacher) +- [1aac685](https://github.com/flobacher/SVGInjector2/commit/1aac6854dca1c0fdace7b2f394028e62ab48f62e) fix fallbacks (@flobacher) +- [#7](https://github.com/flobacher/SVGInjector2/pull/7) Update broken examples/spritesheet link (@TheCopartnery) +- [7a39a24](https://github.com/flobacher/SVGInjector2/commit/7a39a24db30947640bacad3a4838d207865305ed) Update broken examples/spritesheet link (@Viveur) +- [3cd8015](https://github.com/flobacher/SVGInjector2/commit/3cd801542957142d650aa0a373d64bb3930a50de) update README +- [e6c040f](https://github.com/flobacher/SVGInjector2/commit/e6c040f450caa311cdd804fbe14e82d2c3396d7a) update examples +- [cadac66](https://github.com/flobacher/SVGInjector2/commit/cadac666ddfb4fec52a8bd6b63aba0e776cdf195) fix package-scripts +- [5da3c45](https://github.com/flobacher/SVGInjector2/commit/5da3c454e15a5034d8e6c8e44e89ae11d16e0cfb) reorganise folder-structure, update examples and copy all attributes of the injection-target node to the injected sag (@flobacher) + +### v2.0.28 (2016/04/04 00:19 +00:00) +- [f16c19a](https://github.com/flobacher/SVGInjector2/commit/f16c19a347a9577e1644579221098e27d84e5e58) 2.0.28 (@flobacher) +- [168c99d](https://github.com/flobacher/SVGInjector2/commit/168c99d8bfdcbab97b09301c21af6d1fc70437d8) respect aria-hidden also on injected sag (@flobacher) + +### v2.0.27 (2016/04/03 23:41 +00:00) +- [2cb030f](https://github.com/flobacher/SVGInjector2/commit/2cb030f52aacd9d4afebe00e70b9caabe3ed04d9) 2.0.27 (@flobacher) +- [aadf829](https://github.com/flobacher/SVGInjector2/commit/aadf8299ecae7b5cd1213802f84d4fc2617c3d8d) correct those id-refs in sample sprite sheet.. this needs fixing in injector though (@flobacher) +- [24e397d](https://github.com/flobacher/SVGInjector2/commit/24e397dae2b936829ecac1a4a42524faa4b11520) do not add role=presentation to title and desc (@flobacher) +- [bd6213b](https://github.com/flobacher/SVGInjector2/commit/bd6213b62931d61563579e0641d7b03c95aadfc1) update/move examples (@flobacher) +- [bc9aab5](https://github.com/flobacher/SVGInjector2/commit/bc9aab5a20292ce23657c01f229245b8613e227c) update scripts (@flobacher) +- [d01d011](https://github.com/flobacher/SVGInjector2/commit/d01d01169e69ce36647f5561b45f736a281b7a0a) suffix id-references in style-tags and refactor (@flobacher) +- [#3](https://github.com/flobacher/SVGInjector2/pull/3) added support for aria-hidden attribute on svg element (@dgoerdes) +- [f8cf0fe](https://github.com/flobacher/SVGInjector2/commit/f8cf0fe3706f6008eb39549363742dccc4c7ce0c) added support for aria-hidden attribute on svg element (@dgoerdes) + +### v2.0.26 (2016/03/22 13:47 +00:00) +- [9487319](https://github.com/flobacher/SVGInjector2/commit/94873198cca125917abf3a85baa7b803772e12ce) 2.0.26 +- [07217d8](https://github.com/flobacher/SVGInjector2/commit/07217d88739a7144c7f8c68846d8873a579457fb) codestyle +- [8310c96](https://github.com/flobacher/SVGInjector2/commit/8310c9672b423acd866ea469aa454576452613b3) add accessibility section + +### v2.0.25 (2016/03/22 13:07 +00:00) +- [94916ed](https://github.com/flobacher/SVGInjector2/commit/94916ed7ceebebf4802bff9a6081f13e718ac674) 2.0.25 +- [b59d1d8](https://github.com/flobacher/SVGInjector2/commit/b59d1d8488187815cd5664fc96d8d642cf79cc76) Merge branch 'hochitom-master' +- [4ce5a2b](https://github.com/flobacher/SVGInjector2/commit/4ce5a2bc873a8145b6d71b6a5a39ec51a69efe48) Conflicts: svg-injector.js + +### v2.0.24 (2016/03/22 12:55 +00:00) +- [dec40de](https://github.com/flobacher/SVGInjector2/commit/dec40de1191c38fea293eb639082b51cbcc3876f) 2.0.24 +- [7ae93d3](https://github.com/flobacher/SVGInjector2/commit/7ae93d321ec228339c1ac7c2871a222f9fb0ad06) add shortcut script +- [5b5b00a](https://github.com/flobacher/SVGInjector2/commit/5b5b00aae15bca85c5367b4d2c0475a7f4fcb4ce) make npm scripts work on windows as well +- [a721de4](https://github.com/flobacher/SVGInjector2/commit/a721de4e732e5551a4afea529148c4e5c5256c0d) make npm scripts work on windows as well +- [9480d16](https://github.com/flobacher/SVGInjector2/commit/9480d167c1b9310edf307311d356cc1a106b03e2) codestyle +- [d945474](https://github.com/flobacher/SVGInjector2/commit/d9454742b29e0ea5f040f7eec544adef1dd074f4) make npm scripts work on windows as well +- [216993c](https://github.com/flobacher/SVGInjector2/commit/216993c903adcc3d51519d18e531fe1e2516e33c) 2.0.23 +- [e425f4e](https://github.com/flobacher/SVGInjector2/commit/e425f4e5366c85548fcd75a77091a81216259edd) avoid latedef warnings +- [ff5578d](https://github.com/flobacher/SVGInjector2/commit/ff5578d442010529db2d133deb7837611f9f4616) ${npm_package_version} +- [ec44146](https://github.com/flobacher/SVGInjector2/commit/ec44146b4b52dc7156fd296411e108cd848edc26) IE does not support Children on SVGElement! +- [66f4ede](https://github.com/flobacher/SVGInjector2/commit/66f4ede7820ab4b5b6a5bfab7022912e7b5871a5) use .trim() only if element has a class attribute (@hochitom) + +### 2.0.22 (2016/03/22 10:22 +00:00) +- [8453317](https://github.com/flobacher/SVGInjector2/commit/8453317d09226d4295f72775d1c6fe4117194f62) 2.0.22 (@flobacher) +- [84fd93c](https://github.com/flobacher/SVGInjector2/commit/84fd93cd5a406d1f119f207a67c72e4a19cf5c82) update ignore rules (@flobacher) + +### 2.0.21 (2016/03/22 10:11 +00:00) +- [33afd04](https://github.com/flobacher/SVGInjector2/commit/33afd04de4a5d745d6faaa6efa3a23c69e27cb3e) 2.0.21 (@flobacher) +- [4f2317e](https://github.com/flobacher/SVGInjector2/commit/4f2317e21d8d02b59bd8cfd94636071144062514) update readme (@flobacher) + +### 2.0.20 (2016/03/22 09:47 +00:00) +- [c508c18](https://github.com/flobacher/SVGInjector2/commit/c508c1852a94e3f9d11e5613cce086e69c1da17b) 2.0.20 (@flobacher) +- [cfa5475](https://github.com/flobacher/SVGInjector2/commit/cfa5475d847d20603e20253a354210b7841e94c8) update scripts (@flobacher) + +### 2.0.19 (2016/03/22 09:30 +00:00) +- [045205b](https://github.com/flobacher/SVGInjector2/commit/045205b03426ce7dd904cda3a96734bcb4898f26) 2.0.19 (@flobacher) +- [da5f9e4](https://github.com/flobacher/SVGInjector2/commit/da5f9e4a7a98d59a361f9bf260039417a2b2a18d) cleanup (@flobacher) + +### 2.0.18 (2016/03/22 09:23 +00:00) +- [52f5fe4](https://github.com/flobacher/SVGInjector2/commit/52f5fe4fd4cf79c1cde6903a3011664e69807cb4) 2.0.18 (@flobacher) + +### 2.0.17 (2016/03/22 09:19 +00:00) +- [c39a16f](https://github.com/flobacher/SVGInjector2/commit/c39a16faac8b1fdb4eab78d68aae3caf7151dc3c) 2.0.17 (@flobacher) +- [41f86cc](https://github.com/flobacher/SVGInjector2/commit/41f86cc92455d76f075de681ee2a433c6084a58e) update scripts (@flobacher) +- [49cceae](https://github.com/flobacher/SVGInjector2/commit/49cceaea132570c55414a884cdb099c26d28a78a) update repo url and scripts (@flobacher) + +### 2.0.16 (2016/03/22 09:14 +00:00) +- [5e7774e](https://github.com/flobacher/SVGInjector2/commit/5e7774ecb413d477b35868c1ce7d00225702f122) 2.0.16 (@flobacher) +- [6292886](https://github.com/flobacher/SVGInjector2/commit/629288681977a04c9b85277ec833766801c56fdd) update repo url and scripts (@flobacher) + +### 2.0.15 (2016/03/22 09:07 +00:00) +- [fc29aea](https://github.com/flobacher/SVGInjector2/commit/fc29aea8a6406b0fb4831da03613034984071a9e) 2.0.15 (@flobacher) +- [9d91dc3](https://github.com/flobacher/SVGInjector2/commit/9d91dc380bf490c457b74eac75d9fc25308d0dc0) update gitignore (@flobacher) +- [359a256](https://github.com/flobacher/SVGInjector2/commit/359a256235e33953308e185a0c2e4f49e1be561c) add support for the desc element and add the role="presentation" to all elements +- [ef029f2](https://github.com/flobacher/SVGInjector2/commit/ef029f2748469fac90f4f292b53d7fd3f8a3f117) add support to set title for accessibility + +### 2.0.14 (2016/03/21 14:33 +00:00) +- [7c25536](https://github.com/flobacher/SVGInjector2/commit/7c25536aeeb61eaadd7dad4d00c11314e74c58fd) 2.0.14 (@flobacher) +- [571dec2](https://github.com/flobacher/SVGInjector2/commit/571dec21fa1b716f7148f46d94f3b03313dec435) add support for IE +- [f189ab4](https://github.com/flobacher/SVGInjector2/commit/f189ab46d1773468b1719485c07d834cbcf0b9d8) elements can also be referenced via xlink:href. this time it works +- [eccb575](https://github.com/flobacher/SVGInjector2/commit/eccb575bf60a9fcc02a1c339a79fce5414926156) fix: previous version added suffix multiple times (@flobacher) +- [ffc0ad2](https://github.com/flobacher/SVGInjector2/commit/ffc0ad241a6960afd7fdbf57842bc96fef8847f7) elements can also be referenced via xlink:href.. need to suffix them as well (@flobacher) +- [e9ef3ed](https://github.com/flobacher/SVGInjector2/commit/e9ef3ed1de30eec4b6515db3aee7be19245feac0) cleanup logs (@flobacher) +- [507212f](https://github.com/flobacher/SVGInjector2/commit/507212fa1db669480f69dd42ee5d486c0aa17257) ignore tests and examples when installed via nom (@flobacher) +- [990d68d](https://github.com/flobacher/SVGInjector2/commit/990d68dd1b31211032c17290d16dbc00749cec34) rearange npm scripts for better readability (@flobacher) +- [303c20c](https://github.com/flobacher/SVGInjector2/commit/303c20c50e06370894389ab89b1ced216fe19934) update dependency (@flobacher) +- [a5bc1b3](https://github.com/flobacher/SVGInjector2/commit/a5bc1b3eedb6c8cc7a5b53b24e0cbb59322ddff0) remove deprecated version from bower (@flobacher) +- [e44352e](https://github.com/flobacher/SVGInjector2/commit/e44352e29f8c1f8f22e3d5b6ddfbde2676e59f19) build scripts updated (@flobacher) + +### 2.0.13 (2016/03/01 23:35 +00:00) +- [5164dea](https://github.com/flobacher/SVGInjector2/commit/5164deabf4796a9418227965bfadf08cda4f2b2c) 2.0.13 (@flobacher) +- [8612dea](https://github.com/flobacher/SVGInjector2/commit/8612dea502bf308e16746955e0353be2a63e3c58) build scripts updated (@flobacher) +- [8281b74](https://github.com/flobacher/SVGInjector2/commit/8281b741f9ffe2c3df9a571f2cb2caa6603a64ef) additional iri references are matched (@flobacher) + +### 2.0.12 (2016/03/01 22:11 +00:00) +- [a5ee0c8](https://github.com/flobacher/SVGInjector2/commit/a5ee0c8536d9d1122cd2892e4af109a0e8cb0ac3) 2.0.12 (@flobacher) +- [#1](https://github.com/flobacher/SVGInjector2/pull/1) fixed bug to work with multiple spritemaps (@hochitom) +- [#1](https://github.com/flobacher/SVGInjector2/pull/1) fixed bug to work with multiple spritemaps (@hochitom) +- [d2eb782](https://github.com/flobacher/SVGInjector2/commit/d2eb78263ed0ab26aad5c66be1ca146ee067ca0c) fixed bug to work with multiple spritemaps (@hochitom) + +### 2.0.11 (2015/07/28 23:25 +00:00) +- [e562641](https://github.com/flobacher/SVGInjector2/commit/e5626412455a0c08a66d202c4e6083102f2887f9) Updated CHANGELOG (@flobacher) +- [3e86de1](https://github.com/flobacher/SVGInjector2/commit/3e86de1b801ef14317700bea265b5f3be90211de) 2.0.11 (@flobacher) +- [29f99e2](https://github.com/flobacher/SVGInjector2/commit/29f99e28674154fac5ac5ecf45a55ffa3bead497) bugfix angular directive (@flobacher) +- [a0c06d9](https://github.com/flobacher/SVGInjector2/commit/a0c06d99dc0d0cc11f9a768e2795d972186bdc60) Updated CHANGELOG (@flobacher) + +### 2.0.10 (2015/07/28 21:19 +00:00) +- [05f6d56](https://github.com/flobacher/SVGInjector2/commit/05f6d5680634a285bbab9d7f5bb49804969b45f3) 2.0.10 (@flobacher) +- [d29eb5b](https://github.com/flobacher/SVGInjector2/commit/d29eb5b367750c3b88cfc0f29f8f35647a45115b) wrap angular directive into $observe so injection will trigger even if classname is result of an expression evaluation (@flobacher) +- [768c624](https://github.com/flobacher/SVGInjector2/commit/768c624a82d05adf566c20722e99b6b9340ee76c) remove unused variable (@flobacher) +- [72e5a02](https://github.com/flobacher/SVGInjector2/commit/72e5a0204f24667e0857cbff06604fefa0873948) abort injection if no sprite-- class and no data-src found (@flobacher) +- [2255226](https://github.com/flobacher/SVGInjector2/commit/2255226fdf63f91b5e1cb7116df9d2f3d0fa992d) 2.0.9 (@flobacher) + +### 2.0.9 (2015/07/14 05:56 +00:00) +- [64b1a8d](https://github.com/flobacher/SVGInjector2/commit/64b1a8da26665d0e296402a666c0cc274d6a929d) prefix style-blocks if injected svg is not a spritesheet (@flobacher) +- [2dfc3e6](https://github.com/flobacher/SVGInjector2/commit/2dfc3e6facfb56b75f952e6e444cb033fa62b31c) start prefixing of style-blocks if injected svg is not a spritesheet (@flobacher) + +### 2.0.8 (2015/07/09 13:41 +00:00) +- [37aca0a](https://github.com/flobacher/SVGInjector2/commit/37aca0ad994b0e250d8dec908b413cdab3874108) 2.0.8 +- [c8bd742](https://github.com/flobacher/SVGInjector2/commit/c8bd7426603b2459e7779eaef22f98ea6f023a69) remove console-logs +- [c08fe76](https://github.com/flobacher/SVGInjector2/commit/c08fe76bf96b22115eecbe585ec3a5096610d90c) improve support for combining single svgs with a spritesheet +- [4203538](https://github.com/flobacher/SVGInjector2/commit/4203538f7db9a3061b8d7d366af72949f063a8c2) fix indentations +- [990f631](https://github.com/flobacher/SVGInjector2/commit/990f63122c5a7e2a1ccb95da2252a7cda75f1ccf) fix indentations +- [35d29ae](https://github.com/flobacher/SVGInjector2/commit/35d29ae172b60ed50c104e74a515ec21c4314a39) Updated CHANGELOG + +### 2.0.7 (2015/07/09 12:46 +00:00) +- [82d7c05](https://github.com/flobacher/SVGInjector2/commit/82d7c05017e0b435d521093fbd76c3cf0f1c1f27) 2.0.7 +- [5dd714b](https://github.com/flobacher/SVGInjector2/commit/5dd714b557f1c152dedfd178746cbf0753d64816) enable use of data-src in combination with spritesheet + +### 2.0.6 (2015/06/18 06:13 +00:00) +- [f25e199](https://github.com/flobacher/SVGInjector2/commit/f25e199212ebcaf1fe77abfb2d94fbf6ecf86fd8) 2.0.6 (@flobacher) +- [623b590](https://github.com/flobacher/SVGInjector2/commit/623b5900916eb9f643852d1362de1b0b2d6b418b) bugfix (@flobacher) + +### 2.0.5 (2015/06/18 06:09 +00:00) +- [eb677a0](https://github.com/flobacher/SVGInjector2/commit/eb677a09a8a55aeef027fe97d7c098157ad4ba48) 2.0.5 (@flobacher) +- [6766656](https://github.com/flobacher/SVGInjector2/commit/676665617710bc473c3445530ce9d109885de6f6) bugfix (@flobacher) + +### 2.0.4 (2015/06/18 05:31 +00:00) +- [dc90149](https://github.com/flobacher/SVGInjector2/commit/dc901496e2e8b0ed5891d97310ecd5bab4a7c30a) Updated CHANGELOG (@flobacher) +- [2067b0c](https://github.com/flobacher/SVGInjector2/commit/2067b0cbfca30ee52caf18ae91c089aeaf8becc1) bug fix: find symbol by view box returned more than one symbol (@flobacher) +- [861ed83](https://github.com/flobacher/SVGInjector2/commit/861ed834528c0377a8714ced68c84dfb1322dae3) change name + +### 2.0.3 (2015/06/15 14:33 +00:00) +- [d660786](https://github.com/flobacher/SVGInjector2/commit/d6607867b8097e834f97b91454adf4573e0c7080) replace angular.value by provider + +### 2.0.2 (2015/06/15 13:10 +00:00) +- [9f959a3](https://github.com/flobacher/SVGInjector2/commit/9f959a3531c6645af4de9686eccf077b9bc48646) 2.0.2 +- [1529207](https://github.com/flobacher/SVGInjector2/commit/152920770e1a1ca39a3a9b69f79e838bf70d9830) 2.0.2 +- [73e1ed3](https://github.com/flobacher/SVGInjector2/commit/73e1ed32f6d0bd4cb3b412b046be40b0329e9852) simplify build-setup + +### 2.0.1 (2015/06/15 11:42 +00:00) +- [1d1a757](https://github.com/flobacher/SVGInjector2/commit/1d1a7574036da96fee5017dc1fdd354fbefcab70) simplify build-setup +- [f1aa85b](https://github.com/flobacher/SVGInjector2/commit/f1aa85b9b2cfd272b62bc8eb4d464a74d5b9bc7a) refactor angular support (@flobacher) +- [3d91982](https://github.com/flobacher/SVGInjector2/commit/3d91982ef08dea95b13ab7bc24dbac3773c26201) add angular suport 2 (@flobacher) +- [543fc97](https://github.com/flobacher/SVGInjector2/commit/543fc97f1e9fb3898598a65b21f3b3d56b54f11e) add angular suport (@flobacher) +- [4be677c](https://github.com/flobacher/SVGInjector2/commit/4be677c0e82f1805b31b581c3c019e4e098ae265) cleanup the oop approach (@flobacher) +- [06e6dfd](https://github.com/flobacher/SVGInjector2/commit/06e6dfdbd355286255a293510382672dc62d2ec5) refactor to use an oop approach + +### 1.2.2 (2015/06/10 09:32 +00:00) +- [70b802e](https://github.com/flobacher/SVGInjector2/commit/70b802e16b980dd54f2b32b2a402a7d33f27df26) change the default classnames that should be removed upon injection, disable debug.logs +- [99ed486](https://github.com/flobacher/SVGInjector2/commit/99ed486792c2b5755c1e22f707057ae83673a880) 1.2.2 + +### 1.2.1 (2015/06/09 08:54 +00:00) +- [b9c3944](https://github.com/flobacher/SVGInjector2/commit/b9c39448cecb26a7eebcc611f8d1a7f59e86eacc) version bump +- [0b67cff](https://github.com/flobacher/SVGInjector2/commit/0b67cffb236d8874b58c8ea44505f7ccd4dfb2fe) cleanup logs (@flobacher) +- [2b31cb7](https://github.com/flobacher/SVGInjector2/commit/2b31cb75295982b4ae6864db25adabc86e7063e8) unify id-prefixing (@flobacher) +- [15e1754](https://github.com/flobacher/SVGInjector2/commit/15e175418b29f4f6aa15b2bdb1119558309baa25) prefix all attributes that reference an id from defs + +### 1.2.0 (2015/06/02 07:26 +00:00) +- [d68f27f](https://github.com/flobacher/SVGInjector2/commit/d68f27f82854092da2ee0291e8c77383e098a9be) version bump (@flobacher) +- [7c23f6e](https://github.com/flobacher/SVGInjector2/commit/7c23f6edbc7c93bc0a7a78bd1e0bd524e07f803b) optional prefix for fragIdClass assigned upon injection (@flobacher) +- [6f4863a](https://github.com/flobacher/SVGInjector2/commit/6f4863a8f203c619886f1cc07addb6a2f05a8445) add possibility to add a common spritesheetURL for all svg instances +- [b6693a4](https://github.com/flobacher/SVGInjector2/commit/b6693a4c3b1dc4c9f44601629f6471420c9f67df) Copy preserveAspectRatio of elem if exists +- [9198950](https://github.com/flobacher/SVGInjector2/commit/919895086d512c7ba239e25c6957099efb492519) add option to keep inline-styles for some elems (specify via class) even if remove all style-tags = true (@flobacher) +- [d7893d4](https://github.com/flobacher/SVGInjector2/commit/d7893d49ec7e4db901d1aff2ccd1c7611df2b8f6) add option to remove all style-tags upon injection (@flobacher) +- [1a3a7b0](https://github.com/flobacher/SVGInjector2/commit/1a3a7b0798dd74203c1af8f5679080c851ef3c3b) edit fallback classnames list (@flobacher) +- [5e277e4](https://github.com/flobacher/SVGInjector2/commit/5e277e462e4608c867dc90ef5ab91196b9cfd85e) do not write default removeStyleClass if it is specified in the options +- [e38b86d](https://github.com/flobacher/SVGInjector2/commit/e38b86dfb7df6a8dc9fa80c2e7a0645987f4734d) prefix styletags upon injection (@flobacher) +- [d317caa](https://github.com/flobacher/SVGInjector2/commit/d317caab138624da7e7e2ad2697c6b543265cdce) add default icon class -> if inect-target has this class, all styles within the svg-symbol will be removed and a default icon class will be applied +- [9e7b071](https://github.com/flobacher/SVGInjector2/commit/9e7b0712f156da3a03711229fc9f741cf6766115) update minified version +- [d9c017c](https://github.com/flobacher/SVGInjector2/commit/d9c017cdaf33bdc5d36c43936c9bf0c88bce005a) fix remove style tag from parent, which can be a as well as the svg-root element +- [eb0d92e](https://github.com/flobacher/SVGInjector2/commit/eb0d92e1e6ae1db1a21d534343a756d157a6bef4) output correct logs +- [d1c81ce](https://github.com/flobacher/SVGInjector2/commit/d1c81ce2ff208755536c3cbc211d1896877fc363) do not remove classnames if not there (@flobacher) +- [55c6657](https://github.com/flobacher/SVGInjector2/commit/55c6657de945b457b452c1a7c07b971e6a9fce5f) remove fallback classes on injection +- [59c2c17](https://github.com/flobacher/SVGInjector2/commit/59c2c1783e420ad23dbfb43ea10aad69ba36f192) remove no-svg class from html element is svg is supported +- [34cb3ba](https://github.com/flobacher/SVGInjector2/commit/34cb3ba47db35b33c96bea3b2625623e37a43f87) optimise classname creation +- [fe09f74](https://github.com/flobacher/SVGInjector2/commit/fe09f74d48a39d0d54b0a64b26c4d36978c672d4) bugfix fallback classname creation +- [3978592](https://github.com/flobacher/SVGInjector2/commit/39785924ef7af039038307ca8d6aaa19943c583b) bugfix fallback classname creation +- [2229e36](https://github.com/flobacher/SVGInjector2/commit/2229e36f089195851d966d0695a979785d065845) provide array with fallback classnames that contain a replacement-char +- [1131a95](https://github.com/flobacher/SVGInjector2/commit/1131a95804f7dc6303d8c97524b3a469be0760f8) png-fallbacks +- [5efa1de](https://github.com/flobacher/SVGInjector2/commit/5efa1de97215517f4be0f33de0acb432b55b248e) png fallbacks work +- [01e5a0c](https://github.com/flobacher/SVGInjector2/commit/01e5a0ce06bbadaa1c2fe43041184f3e33a15ada) cleanup, add drop_console to uglify options -> remove calls to console.log in dist, but leave in debug version +- [a6f31d2](https://github.com/flobacher/SVGInjector2/commit/a6f31d2ba0f63c40633fad9152ed854258c62097) add dist files (@flobacher) +- [588bac2](https://github.com/flobacher/SVGInjector2/commit/588bac2944848875d0dde08752dbf5a11b1de836) add editor-config (@flobacher) +- [1ce9a4a](https://github.com/flobacher/SVGInjector2/commit/1ce9a4a4f4904b55cb600710dc98b08e72c67783) style tags will be removed if special class is found on injection-target, name of this class is configurable via options (@flobacher) +- [e80cbdd](https://github.com/flobacher/SVGInjector2/commit/e80cbdd710f91c57e01772ec9fa8c0a9e8f5137b) queryselector is used to speed up finding of the svg shape inside the referenced view's viewbox (@flobacher) +- [fecb5a7](https://github.com/flobacher/SVGInjector2/commit/fecb5a7ec1cdd6001cc637eb55048ab7cb7b1a7d) update fragment-id example (@flobacher) +- [b37313e](https://github.com/flobacher/SVGInjector2/commit/b37313ecf87f6bff62ba4581c934e9fadf34e78c) if view displays a use tag, the referenced symbol is injected (@flobacher) +- [2f35d0e](https://github.com/flobacher/SVGInjector2/commit/2f35d0efbe45c9e67fe1b5ff1a4e6678b1d4f2db) extend fragment-id example by a spritesheet generated with grunt-svg-sprite (@flobacher) +- [fd16ef5](https://github.com/flobacher/SVGInjector2/commit/fd16ef578304b398f4ec6f8d18a198a05e644ac9) enable default fallback for sprites referenced via fragment-id (@flobacher) +- [5966d86](https://github.com/flobacher/SVGInjector2/commit/5966d86d7159c87a954abbcff6b039db7dce1432) add option, to only insert visible part specified via fragment-id of a view-elem (@flobacher) +- [925c812](https://github.com/flobacher/SVGInjector2/commit/925c8120991ba94aeca0718e64221dc55b98afeb) changed indentation (@flobacher) + +### 1.1.3-RC (2015/03/28 01:58 +00:00) +- [541df26](https://github.com/flobacher/SVGInjector2/commit/541df26a9bf1c7ac4081824d405a3d60ef9dd7de) update version number for bower (@flobacher) +- [d728414](https://github.com/flobacher/SVGInjector2/commit/d7284140d1fbaa7604dba622dd4005b653c6cf92) add example for symbol and view referencing via fragment-ids +- [a9840d8](https://github.com/flobacher/SVGInjector2/commit/a9840d89aac57890efb519779cc4a0990665d8c2) add support for fragment-ids specifying views or symbols +- [e84f9b4](https://github.com/flobacher/SVGInjector2/commit/e84f9b47eadb501e68a4d0d5b6593935e8d25c19) version bump for RC 1.1.3 testing (@protodave) +- [fae3a70](https://github.com/flobacher/SVGInjector2/commit/fae3a704af7283277051bd038760a656fff3a37f) Workaround/Fix for IE not using style tags from injected SVG files. Ref: issue #23 - Internet Explorer 11 svg images appears all black (@protodave) +- [2b209bb](https://github.com/flobacher/SVGInjector2/commit/2b209bbc0de09ce9257cf55b582ebf859f444d8b) Added npm install details (@protodave) +- [9f25052](https://github.com/flobacher/SVGInjector2/commit/9f25052fcc815aa719ba86506470b6ac2003612a) Updated author info in prep for npm publishing (@protodave) +- [db7f1e7](https://github.com/flobacher/SVGInjector2/commit/db7f1e7d2c1ecbf00e0abc2cd81dc07b631f8d08) Added CORS test in prep for adding XDomainRequest for IE9 (@protodave) +- [77ce693](https://github.com/flobacher/SVGInjector2/commit/77ce693181ba059714081ead83b598e70ebed162) Added keyword (@protodave) +- [d00ef1f](https://github.com/flobacher/SVGInjector2/commit/d00ef1f0d8ddfff7e61147ca48955ef740d3a226) updated svg/png assets and js library for examples and tests (@protodave) +- [e01b63e](https://github.com/flobacher/SVGInjector2/commit/e01b63e586b8ab61203eb58e1d94b3b2626873ec) changelog update (@protodave) + ### 1.1.2 (2014/10/27 21:50 +00:00) -- [8da3cfb](https://github.com/iconic/SVGInjector/commit/8da3cfbf239b286c6046f7cd1f80261690ad9a5d) changelog update (@protodave) -- [e498e03](https://github.com/iconic/SVGInjector/commit/e498e03eb2c40d3907c5cddb035a1705bfa5f384) Make sure any mask ids and their references are unique so we can safely use the same SVG multiple times on the same page (like we already do for clipPaths) (@protodave) -- [eae8b22](https://github.com/iconic/SVGInjector/commit/eae8b2268f5cc3a1430f76a318b7eac3c31fdc3d) New build and version bump (@protodave) -- [7266bcf](https://github.com/iconic/SVGInjector/commit/7266bcf7eeda3e4c33d2fa15bc9365ea57985959) updated changelog (@protodave) +- [7266bcf](https://github.com/flobacher/SVGInjector2/commit/7266bcf7eeda3e4c33d2fa15bc9365ea57985959) updated changelog (@protodave) +- [eae8b22](https://github.com/flobacher/SVGInjector2/commit/eae8b2268f5cc3a1430f76a318b7eac3c31fdc3d) New build and version bump (@protodave) +- [e498e03](https://github.com/flobacher/SVGInjector2/commit/e498e03eb2c40d3907c5cddb035a1705bfa5f384) Make sure any mask ids and their references are unique so we can safely use the same SVG multiple times on the same page (like we already do for clipPaths) (@protodave) +- [8da3cfb](https://github.com/flobacher/SVGInjector2/commit/8da3cfbf239b286c6046f7cd1f80261690ad9a5d) changelog update (@protodave) ### 1.1.1 (2014/10/15 21:08 +00:00) -- [55ac808](https://github.com/iconic/SVGInjector/commit/55ac808b03bf691d69230359d2436156def0d0bd) Fix for issue #17 - "SVG Injector doesn't work if there is a URL parameter". Updated the regex that was matching for an svg file extension to allow for query strings. (@protodave) -- [0b76f3b](https://github.com/iconic/SVGInjector/commit/0b76f3b82529757508d0fb7a9fba582089f16abe) version bump, v1.1.1 (@protodave) +- [0b76f3b](https://github.com/flobacher/SVGInjector2/commit/0b76f3b82529757508d0fb7a9fba582089f16abe) version bump, v1.1.1 (@protodave) +- [55ac808](https://github.com/flobacher/SVGInjector2/commit/55ac808b03bf691d69230359d2436156def0d0bd) Fix for issue #17 - "SVG Injector doesn't work if there is a URL parameter". Updated the regex that was matching for an svg file extension to allow for query strings. (@protodave) ### 1.1.0 (2014/07/01 21:01 +00:00) -- [e2d6d62](https://github.com/iconic/SVGInjector/commit/e2d6d626560911154257367d629e6a59d6e239b2) Updated bower package name in the install command (@protodave) -- [972fdf6](https://github.com/iconic/SVGInjector/commit/972fdf62f98ee2c68c8c8f132c2e2f64867581ff) different forEach approach (@stryju) -- [207dee9](https://github.com/iconic/SVGInjector/commit/207dee91f44423c8396d8c8f157c22d37834bb72) small cleanup (@stryju) -- [1814600](https://github.com/iconic/SVGInjector/commit/18146006fc751a484aff0ecba473b0d7ef276a7d) TODO: don't add dups (@stryju) -- [1f09fd9](https://github.com/iconic/SVGInjector/commit/1f09fd944b32071cf6cb00448806085fda474e87) Added per-element PNG fallback functionality via setting a data-fallback or data-png attribute. (@protodave) -- [#11](https://null/iconic/SVGInjector/pull/11) TODO: don't add class dups (@stryju) -- [4350111](https://github.com/iconic/SVGInjector/commit/43501118d127c678dbe5adb951ec7b88d4f7ff5b) Simplified class merging (@protodave) -- [8066bf6](https://github.com/iconic/SVGInjector/commit/8066bf60026ec8c98af36d30a2cd3f1c3cbb65a2) updated dist build and examples svg-injector.min.js files (@protodave) -- [56d22c0](https://github.com/iconic/SVGInjector/commit/56d22c06b02cfc6faae090a2943f38a060e07eff) Conflicts: svg-injector.js (@protodave) -- [fa118b0](https://github.com/iconic/SVGInjector/commit/fa118b0f8df40885ebe0c2698f1749ad36b46a75) Merge branch 'stryju-patch-1' (@protodave) -- [70ec72e](https://github.com/iconic/SVGInjector/commit/70ec72e1901e33c3687d25b1ce93af6632a0f1a0) updated dist build and examples (@protodave) -- [8f04917](https://github.com/iconic/SVGInjector/commit/8f04917452f0ad18903ea0281c4be04716f5977b) Conflicts: svg-injector.js (@protodave) -- [fd321d6](https://github.com/iconic/SVGInjector/commit/fd321d61f8108fedb49c34d3b6bfb6c7ae65ca16) to explain why this merge is necessary, (@protodave) -- [f6eb3a7](https://github.com/iconic/SVGInjector/commit/f6eb3a740dc2884d96a1b97156b1926933544ac1) reverted the isFunction() and isDefined() refactor PR since you can't pass undefined/undeclared vars to functions in JS (@protodave) -- [88778d7](https://github.com/iconic/SVGInjector/commit/88778d7a9491af523d48ece8595c6abd8f8e8430) new dist build and examples updates (@protodave) -- [26545d9](https://github.com/iconic/SVGInjector/commit/26545d96dc3a889c35350a79f98a89ed2473f1d4) readme update (@protodave) -- [10c2a24](https://github.com/iconic/SVGInjector/commit/10c2a244e50a1680001ad657803cfcd92b76f055) removed some extra classes that were added for testing in the all-the-things examples (@protodave) -- [f37d0ad](https://github.com/iconic/SVGInjector/commit/f37d0adafc1ecc90e3e6cf0cca4525b752276321) added "examples" to bower.json ignore (@protodave) -- [2ee9f87](https://github.com/iconic/SVGInjector/commit/2ee9f87c8ba0a8c97eddfcb8d64006c603a7bbf5) Address Issue #12 - Injection race condition (@protodave) -- [67c2355](https://github.com/iconic/SVGInjector/commit/67c2355f260c8f277efa9983ceeb01160c48e56a) Added test for race condition during injection, Issue #12 (@protodave) -- [96cb187](https://github.com/iconic/SVGInjector/commit/96cb187a14e14dfda303612d1b66d8477643d9c8) Updated build and examples svg-injector.min.js files (@protodave) -- [f3e1bfb](https://github.com/iconic/SVGInjector/commit/f3e1bfb77358ca6404c3aeffea9aae316cc5d919) Clean up references to the replaced elements during injection, which end up as detached DOM elements, so they can be GC'd (@protodave) -- [ce1eaa8](https://github.com/iconic/SVGInjector/commit/ce1eaa84eef55776926799818c4f8fcdbe43725a) Move the use of injectOf() until _after_ the check for SVG support during injection so we can avoid adding the extra code for an IE8 indexOf() polyfill (@protodave) -- [9be5041](https://github.com/iconic/SVGInjector/commit/9be50413b67bff29d9fc799c0553dbee06fb2fad) min/map dist build and updated lib in examples and tests (@protodave) -- [e2e2438](https://github.com/iconic/SVGInjector/commit/e2e24383f97a60adbc64cfe546f21813964f9bd9) Unlink elements var to aid GC and avoid detacted DOM elements (@protodave) -- [fe70317](https://github.com/iconic/SVGInjector/commit/fe703175448b3ba2768b8425eebf7f01ee3ae2c8) updated min/map dist build (@protodave) -- [0e1cce5](https://github.com/iconic/SVGInjector/commit/0e1cce5e792358bc0ce4ac3158cd3e77e10c5245) Updated CHANGELOG for 1.1.0 release (@protodave) -- [173dc9b](https://github.com/iconic/SVGInjector/commit/173dc9b9c205c8ff1441391d3fb70e7172caf162) update version in bower.json (@protodave) +- [173dc9b](https://github.com/flobacher/SVGInjector2/commit/173dc9b9c205c8ff1441391d3fb70e7172caf162) update version in bower.json (@protodave) +- [0e1cce5](https://github.com/flobacher/SVGInjector2/commit/0e1cce5e792358bc0ce4ac3158cd3e77e10c5245) Updated CHANGELOG for 1.1.0 release (@protodave) +- [fe70317](https://github.com/flobacher/SVGInjector2/commit/fe703175448b3ba2768b8425eebf7f01ee3ae2c8) updated min/map dist build (@protodave) +- [e2e2438](https://github.com/flobacher/SVGInjector2/commit/e2e24383f97a60adbc64cfe546f21813964f9bd9) Unlink elements var to aid GC and avoid detacted DOM elements (@protodave) +- [9be5041](https://github.com/flobacher/SVGInjector2/commit/9be50413b67bff29d9fc799c0553dbee06fb2fad) min/map dist build and updated lib in examples and tests (@protodave) +- [ce1eaa8](https://github.com/flobacher/SVGInjector2/commit/ce1eaa84eef55776926799818c4f8fcdbe43725a) Move the use of injectOf() until _after_ the check for SVG support during injection so we can avoid adding the extra code for an IE8 indexOf() polyfill (@protodave) +- [f3e1bfb](https://github.com/flobacher/SVGInjector2/commit/f3e1bfb77358ca6404c3aeffea9aae316cc5d919) Clean up references to the replaced elements during injection, which end up as detached DOM elements, so they can be GC'd (@protodave) +- [96cb187](https://github.com/flobacher/SVGInjector2/commit/96cb187a14e14dfda303612d1b66d8477643d9c8) Updated build and examples svg-injector.min.js files (@protodave) +- [67c2355](https://github.com/flobacher/SVGInjector2/commit/67c2355f260c8f277efa9983ceeb01160c48e56a) Added test for race condition during injection, Issue #12 (@protodave) +- [2ee9f87](https://github.com/flobacher/SVGInjector2/commit/2ee9f87c8ba0a8c97eddfcb8d64006c603a7bbf5) Address Issue #12 - Injection race condition (@protodave) +- [f37d0ad](https://github.com/flobacher/SVGInjector2/commit/f37d0adafc1ecc90e3e6cf0cca4525b752276321) added "examples" to bower.json ignore (@protodave) +- [10c2a24](https://github.com/flobacher/SVGInjector2/commit/10c2a244e50a1680001ad657803cfcd92b76f055) removed some extra classes that were added for testing in the all-the-things examples (@protodave) +- [26545d9](https://github.com/flobacher/SVGInjector2/commit/26545d96dc3a889c35350a79f98a89ed2473f1d4) readme update (@protodave) +- [88778d7](https://github.com/flobacher/SVGInjector2/commit/88778d7a9491af523d48ece8595c6abd8f8e8430) new dist build and examples updates (@protodave) +- [f6eb3a7](https://github.com/flobacher/SVGInjector2/commit/f6eb3a740dc2884d96a1b97156b1926933544ac1) reverted the isFunction() and isDefined() refactor PR since you can't pass undefined/undeclared vars to functions in JS (@protodave) +- [fd321d6](https://github.com/flobacher/SVGInjector2/commit/fd321d61f8108fedb49c34d3b6bfb6c7ae65ca16) to explain why this merge is necessary, (@protodave) +- [8f04917](https://github.com/flobacher/SVGInjector2/commit/8f04917452f0ad18903ea0281c4be04716f5977b) Conflicts: svg-injector.js (@protodave) +- [70ec72e](https://github.com/flobacher/SVGInjector2/commit/70ec72e1901e33c3687d25b1ce93af6632a0f1a0) updated dist build and examples (@protodave) +- [fa118b0](https://github.com/flobacher/SVGInjector2/commit/fa118b0f8df40885ebe0c2698f1749ad36b46a75) Merge branch 'stryju-patch-1' (@protodave) +- [56d22c0](https://github.com/flobacher/SVGInjector2/commit/56d22c06b02cfc6faae090a2943f38a060e07eff) Conflicts: svg-injector.js (@protodave) +- [8066bf6](https://github.com/flobacher/SVGInjector2/commit/8066bf60026ec8c98af36d30a2cd3f1c3cbb65a2) updated dist build and examples svg-injector.min.js files (@protodave) +- [4350111](https://github.com/flobacher/SVGInjector2/commit/43501118d127c678dbe5adb951ec7b88d4f7ff5b) Simplified class merging (@protodave) +- [#11](https://github.com/flobacher/SVGInjector2/pull/11) TODO: don't add class dups (@stryju) +- [1f09fd9](https://github.com/flobacher/SVGInjector2/commit/1f09fd944b32071cf6cb00448806085fda474e87) Added per-element PNG fallback functionality via setting a data-fallback or data-png attribute. (@protodave) +- [1814600](https://github.com/flobacher/SVGInjector2/commit/18146006fc751a484aff0ecba473b0d7ef276a7d) TODO: don't add dups (@stryju) +- [207dee9](https://github.com/flobacher/SVGInjector2/commit/207dee91f44423c8396d8c8f157c22d37834bb72) small cleanup (@stryju) +- [972fdf6](https://github.com/flobacher/SVGInjector2/commit/972fdf62f98ee2c68c8c8f132c2e2f64867581ff) different forEach approach (@stryju) +- [e2d6d62](https://github.com/flobacher/SVGInjector2/commit/e2d6d626560911154257367d629e6a59d6e239b2) Updated bower package name in the install command (@protodave) ### 1.0.1 (2014/05/08 22:31 +00:00) -- [13a2af6](https://github.com/iconic/SVGInjector/commit/13a2af6af1bd61dab6b1ff34c84c7d6f6fd79dcf) Added jshintrc and some jshint wrapper rules to svg-injector.js (@protodave) -- [3c69267](https://github.com/iconic/SVGInjector/commit/3c692679056e3270b97e0718d50255983b05e8e5) added a package.json and .gitignore (@protodave) -- [f61e766](https://github.com/iconic/SVGInjector/commit/f61e766220e3c70e98704b265d653977a96344a7) created first min/map dist build (@protodave) -- [9a4a8ba](https://github.com/iconic/SVGInjector/commit/9a4a8ba8910fc991a76ac889b43bbf1993571321) Updated CHANGELOG (@protodave) -- [f40df63](https://github.com/iconic/SVGInjector/commit/f40df632f1e413eb1bdcfa2a036ad845edba7af3) Update README.md (@protodave) -- [60c74dc](https://github.com/iconic/SVGInjector/commit/60c74dc119c24e6ae160c86031be0128da625979) Missing a closing `)` on example console.log (@FStop) -- [#2](https://null/iconic/SVGInjector/pull/2) Missing a closing `)` on example console.log (@FStop) -- [172e267](https://github.com/iconic/SVGInjector/commit/172e267b7cd119728070003675e0a6453df32442) Update README.md (@protodave) -- [7adef6e](https://github.com/iconic/SVGInjector/commit/7adef6e409bef6e490524f33b831eab2089e39eb) Updated documentation (@protodave) -- [4fc172a](https://github.com/iconic/SVGInjector/commit/4fc172a2d54b7ed02e5dd42165b970db398bb4ff) Added examples (@protodave) -- [c5a7fb4](https://github.com/iconic/SVGInjector/commit/c5a7fb40e379b566c7577f0f3b9b1c00d2c7278c) Fixed a link in the README (@protodave) -- [52b0483](https://github.com/iconic/SVGInjector/commit/52b0483e913fe89c1aeafefd6d3399ab75f77b07) init bower (@hoetmaaiers) -- [7d78660](https://github.com/iconic/SVGInjector/commit/7d786602a1b62c327a21cbaaf9a9bef36e772fe6) add install with bower to README (@hoetmaaiers) -- [#5](https://null/iconic/SVGInjector/pull/5) Bower (@hoetmaaiers) -- [b0c055c](https://github.com/iconic/SVGInjector/commit/b0c055c778430878e8a12ce14389c9812fbe9ffc) Bump to v1.0.1 (@protodave) -- [fbb6fce](https://github.com/iconic/SVGInjector/commit/fbb6fce1c9670c160f2c23638e759ed6fa304225) updated changelog (@protodave) +- [fbb6fce](https://github.com/flobacher/SVGInjector2/commit/fbb6fce1c9670c160f2c23638e759ed6fa304225) updated changelog (@protodave) +- [b0c055c](https://github.com/flobacher/SVGInjector2/commit/b0c055c778430878e8a12ce14389c9812fbe9ffc) Bump to v1.0.1 (@protodave) +- [#5](https://github.com/flobacher/SVGInjector2/pull/5) Bower (@hoetmaaiers) +- [7d78660](https://github.com/flobacher/SVGInjector2/commit/7d786602a1b62c327a21cbaaf9a9bef36e772fe6) add install with bower to README (@hoetmaaiers) +- [52b0483](https://github.com/flobacher/SVGInjector2/commit/52b0483e913fe89c1aeafefd6d3399ab75f77b07) init bower (@hoetmaaiers) +- [c5a7fb4](https://github.com/flobacher/SVGInjector2/commit/c5a7fb40e379b566c7577f0f3b9b1c00d2c7278c) Fixed a link in the README (@protodave) +- [4fc172a](https://github.com/flobacher/SVGInjector2/commit/4fc172a2d54b7ed02e5dd42165b970db398bb4ff) Added examples (@protodave) +- [7adef6e](https://github.com/flobacher/SVGInjector2/commit/7adef6e409bef6e490524f33b831eab2089e39eb) Updated documentation (@protodave) +- [172e267](https://github.com/flobacher/SVGInjector2/commit/172e267b7cd119728070003675e0a6453df32442) Update README.md (@protodave) +- [#2](https://github.com/flobacher/SVGInjector2/pull/2) Missing a closing `)` on example console.log (@FStop) +- [60c74dc](https://github.com/flobacher/SVGInjector2/commit/60c74dc119c24e6ae160c86031be0128da625979) Missing a closing `)` on example console.log (@isGabe) +- [f40df63](https://github.com/flobacher/SVGInjector2/commit/f40df632f1e413eb1bdcfa2a036ad845edba7af3) Update README.md (@protodave) +- [9a4a8ba](https://github.com/flobacher/SVGInjector2/commit/9a4a8ba8910fc991a76ac889b43bbf1993571321) Updated CHANGELOG (@protodave) +- [f61e766](https://github.com/flobacher/SVGInjector2/commit/f61e766220e3c70e98704b265d653977a96344a7) created first min/map dist build (@protodave) +- [3c69267](https://github.com/flobacher/SVGInjector2/commit/3c692679056e3270b97e0718d50255983b05e8e5) added a package.json and .gitignore (@protodave) +- [13a2af6](https://github.com/flobacher/SVGInjector2/commit/13a2af6af1bd61dab6b1ff34c84c7d6f6fd79dcf) Added jshintrc and some jshint wrapper rules to svg-injector.js (@protodave) ### 1.0.0 (2014/03/31 17:33 +00:00) -- [0280954](https://github.com/iconic/SVGInjector/commit/02809541241ab8ebf88135124bac2be27d9e2538) Initial commit (@protodave) -- [49adbde](https://github.com/iconic/SVGInjector/commit/49adbde371b3d9d7fcdaab411d01a976a46ef41c) first code commit (@protodave) -- [ff3b341](https://github.com/iconic/SVGInjector/commit/ff3b34194cab2a4655463c7d2f3cabbd242fcb28) copy formatting update (@protodave) -- [495f468](https://github.com/iconic/SVGInjector/commit/495f4681485831140d417003eac7b734430ab388) spelling fix (@protodave) -- [af53074](https://github.com/iconic/SVGInjector/commit/af530747f8039ddabb41d5238a5cd120d4989a51) code format fixes (@protodave) -- [9aeec36](https://github.com/iconic/SVGInjector/commit/9aeec3623a33770ddebdfbe54c6585e0d63a60e3) copy header update (@protodave) \ No newline at end of file +- [9aeec36](https://github.com/flobacher/SVGInjector2/commit/9aeec3623a33770ddebdfbe54c6585e0d63a60e3) copy header update (@protodave) +- [af53074](https://github.com/flobacher/SVGInjector2/commit/af530747f8039ddabb41d5238a5cd120d4989a51) code format fixes (@protodave) +- [495f468](https://github.com/flobacher/SVGInjector2/commit/495f4681485831140d417003eac7b734430ab388) spelling fix (@protodave) +- [ff3b341](https://github.com/flobacher/SVGInjector2/commit/ff3b34194cab2a4655463c7d2f3cabbd242fcb28) copy formatting update (@protodave) +- [49adbde](https://github.com/flobacher/SVGInjector2/commit/49adbde371b3d9d7fcdaab411d01a976a46ef41c) first code commit (@protodave) +- [0280954](https://github.com/flobacher/SVGInjector2/commit/02809541241ab8ebf88135124bac2be27d9e2538) Initial commit (@protodave) \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 044dd81..8a992b1 --- a/README.md +++ b/README.md @@ -1,15 +1,16 @@ SVGInjector ========= -A fast, caching, dynamic inline SVG DOM injection library. Developed by [Waybury](http://waybury.com/) for use in [iconic.js](https://useiconic.com/tools/iconic-js/), part of the [Iconic](https://useiconic.com/) icon system. +A fast, caching, dynamic inline SVG DOM injection library. Originally developed by [Waybury](http://waybury.com/) for use in [iconic.js](https://useiconic.com/tools/iconic-js/), part of the [Iconic](https://useiconic.com/) icon system. +Extended by Flobacher to be able to use with spritesheets and in AngularJS Applications ## Why? -There are a number of ways to use SVG on a page (`object`, `embed`, `iframe`, `img`, CSS `background-image`) but to unlock the full potential of SVG, including full element-level CSS styling and evaluation of embedded JavaScript, the full SVG markup must be included directly in the DOM. +Linking to an external SVG on a page (via `object`, `embed`, `iframe`, `img`, CSS `background-image`) usually only allows you to display the SVG 'as is'. To unlock the full potential of SVG, including full element-level CSS styling and evaluation of embedded JavaScript, the markup of the SVG must be included directly in the DOM. -Wrangling and maintaining a bunch of inline SVG on your pages isn't anyone's idea of good time, so **SVGInjector** lets you work with simple `img` tag elements (or other tag of your choosing) and does the heavy lifting of swapping in the SVG markup inline for you. +Maintaining a bunch of inline SVG on your pages isn't anyone's idea of good time, so **SVGInjector** lets you specify external SVGs and embeds the contents directly into the DOM alongside your HTML. ## How? -* Any DOM element, or array of elements, passed to **SVGInjector** with an SVG file `src` or `data-src` attribute will be replaced with the full SVG markup inline. The async loaded SVG is also cached so multiple uses of an SVG only requires a single server request. +* Any DOM element or array of elements (recommended are `svg`-tags for clarity or `img`-tags if you need support for fallback pngs, but there are no technical limitations), passed to **SVGInjector** that contains a `data-src` attribute will be replaced with the full SVG markup available via this URL inline. The async loaded SVG is also cached so multiple uses of an SVG only requires a single server request. * Any embedded JavaScript in the SVG will optionally be extracted, cached and evaluated. @@ -20,22 +21,23 @@ Wrangling and maintaining a bunch of inline SVG on your pages isn't anyone's ide ## Install -> **SVGInjector** is compatible with: +> **SVGInjector2** is compatible with: * [CommonJS](http://commonjs.org/) via `module.exports` for use with [Browserify](http://browserify.org/) or [Node](http://nodejs.org/)/[PhantomJS](http://phantomjs.org/) * [AMD API](https://github.com/amdjs/amdjs-api/blob/master/AMD.md) usage with [RequireJS](http://requirejs.org/) * Plain ol' JavaScript via creation of a global function - + * AngularJS + ### npm - npm install svg-injector + npm install svg-injector-2 ### Bower - bower install svg-injector - + bower install svg-injector-2 + ### Manually -Download the [dist/svg-injector.min.js](https://github.com/iconic/SVGInjector/blob/master/dist/svg-injector.min.js) file from this repository and add it to your project. +Download the [dist/svg-injector.min.js](https://github.com/flobacher/SVGInjector2/blob/master/dist/svg-injector.min.js) file from this repository and add it to your project. ## Usage @@ -48,47 +50,92 @@ Include the **SVGInjector** script on your page. ``` -Add some SVG `img` tags. +Add some `svg` tags. ```html - - + + ``` Inject 'em. ```html ``` -The `img` tags have now been replaced with the full SVG markup. +The `svg` tags have now been replaced with the full SVG markup. +Also see [examples/simple](https://github.com/flobacher/SVGInjector2/blob/master/examples/simple.html) for another example that illustrates how to inject `svg` elements using `data-src` with a specific classname such as `inject-me`. -### Configuration -In addition to passing elements to inject, an options object and callback function can optionally be defined. +### Full Example incl. Configuration -```js -SVGInjector(elements, options, callback); +In addition to passing elements to inject, an options object to configure the injector instance and callback functions for the injections can optionally be defined. + + +```html + + ``` -#### `elements` +```js +// Elements to inject +var elementsToInject = document.querySelectorAll('svg[data-src]'); + +// Options +var injectorOptions = { + evalScripts: 'once', + pngFallback: 'assets/png' +}; + +var afterAllInjectionsFinishedCallback = function (totalSVGsInjected) { + // Callback after all SVGs are injected + console.log('We injected ' + totalSVGsInjected + ' SVG(s)!'); +}; + +var perInjectionCallback = function (svg) { + // Callback after each SVG is injected + console.log('SVG injected: ' + svg); +}; -A single DOM element or array of elements, with `src` or `data-src` attributes defined, to inject. +// create injector configured by options +var injector = new SVGInjector(injectorOptions); + +// Trigger the injection +injector.inject( + elementsToInject, + afterAllInjectionsFinishedCallback, + perInjectionCallback +); +``` +Also see [examples/everything](https://github.com/flobacher/SVGInjector2/blob/master/examples/everything.html) for more details. #### `options` ```js +// default values as comment after the line { - evalScripts: [always|once|never], - pngFallback: [PNG directory], - each: [function] + evalScripts: 'always'|'once'|'never', // 'always' + pngFallback: 'url to directory with fallbackpngs', // false + keepStylesClass: 'className', // '' + spriteClassName: 'className', // 'sprite' + spriteClassIdName: 'classNameInclSeperator', // 'sprite--' + removeStylesClass: 'className', // 'icon' -> this will remove all styles from the svg so it is easy to style with external css. works best with monochrome icons + removeAllStyles: true|false, // false + fallbackClassName: 'className', // 'sprite' + prefixStyleTags: true|false, // true + + // spritesheet relevant options + spritesheetURL: 'urlToSpritesheet', false // only needed for classbased injection + onlyInjectVisiblePart: true|false, // true -> if the fragmentId specifies an svg-view element, only inject the part that is visible due to the specified view + svgFallbackDir: 'urlToFragmentsThatMightNotBeInSpritesheetAnymore', // false -> it can make sense to remove fragments from a spritesheet after some time.. to be sure that nothin breaks, they can be put as single files to a fallback directory and injector tries to find them there + + + // testing + forceFallbacks: true|false, // false } ``` @@ -102,60 +149,88 @@ A single DOM element or array of elements, with `src` or `data-src` attributes d * `pngFallback` - String - The directory where fallback PNGs are located for use if the browser doesn't [support SVG](http://caniuse.com/svg). This will look for a file with a `.png` extension matching the SVG filename defined in the `src` (or `data-src`). + The directory where fallback PNGs are located for use if the browser doesn't [support SVG](http://caniuse.com/svg). This will look for a file with a `.png` extension matching the SVG filename defined in the `data-src`. For this to work, use `img` instead of `svg` elements. For additional flexibility, per-element fallbacks are also [available](#per-element-png-fallback). -* `each(svg)` - function - A function to call after each SVG is injected. Receives the newly injected SVG DOM element as a parameter. +#### `elements` -#### `callback(count)` - function +A single DOM element or array of elements, with `data-src` attributes defined, to inject. -A function to call once all the requested SVG elements have been injected. Receives a count of the total SVGs injected as a parameter. -### Full Example +#### `perInjectionCallback(svg)` - function -```html - - -``` + A function to call after each SVG is injected. Receives the newly injected SVG DOM element as a parameter. -```js -// Elements to inject -var mySVGsToInject = document.querySelectorAll('img.inject-me'); +#### `afterAllInjectionsFinishedCallback(count)` - function + +A function to call once all the requested SVG elements have been injected. Receives a count of the total SVGs injected as a parameter. -// Options -var injectorOptions = { - evalScripts: 'once', - pngFallback: 'assets/png', - each: function (svg) { - // Callback after each SVG is injected - console.log('SVG injected: ' + svg.getAttribute('id')); - } -}; -// Trigger the injection -SVGInjector(mySVGsToInject, injectorOptions, function (totalSVGsInjected) { - // Callback after all SVGs are injected - console.log('We injected ' + totalSVGsInjected + ' SVG(s)!'); -}); -``` ### Per-element PNG fallback -Since you might be using a single SVG styled in multiple ways, you can also define per-element fallbacks by adding a `data-fallback` or `data-png` attribute to your `img` tags to define a unique PNG for each context. +Since you might be using a single SVG styled in multiple ways, you can also define per-element fallbacks by adding a `data-fallback` or `data-png` attribute to your `img` tags (remember for png fallbacks to work you need to use img-tags) to define a unique PNG for each context. -See [examples/fallbacks](https://github.com/iconic/SVGInjector/tree/master/examples/fallbacks) for more details. +See [examples/fallbacks](https://github.com/flobacher/SVGInjector2/blob/master/examples/fallbacks.html) for more details. ```html - + ``` +### Spritesheets + +To save http requests, you can combine your svgs to a spritesheet, where every single svg is represented +as a `` or an ``. To inject the symbol with the id `thumb-up` from a spritesheet, on the element where you want +the injection to happen write : `data-src = "url-to-spritesheet.svg#thumb-up"`. +Besides spritesheets consisting of symbols, you can also use Spritesheets that specify `` elements with +ids (it is possible to create a fallback-png spritesheet for those). The injector will try to find the symbol/svg element +via comparing its viewbox to that of the view. If no png fallback is needed, the first approach is the most +prefereable. If using nodejs build-tools like gulp or grunt, take a look at [svg-sprite](https://github.com/jkphl/svg-sprite). +See [examples/spritesheet](https://github.com/flobacher/SVGInjector2/blob/master/examples/angular-spritesheet.html) for more details. + +#### Classbased fragment ids + +When using spritesheets, having to type the same data-src=urltospritesheet.svg#fragmentid can become cumbersome. +Thats why there is a config options that allows to set a default url to a spritesheet. The fragment id can then be provided via +a simple class. +See [examples/fallbacks](https://github.com/flobacher/SVGInjector2/blob/master/examples/spritesheet-classbased.html) for more details. +There is an additional option to add a fallback svg in case the fragmentid cannot be found in the spritesheet. +Specify it via `data-fallback-svg = "url-to-fallback-image.svg"` + +### AngularJS + +SVGInjector is also available as configurable Service / Directive combination. +The svg-element-directive will automatically inject the svg. Just define the `svginjector` module as a dependency of your module. +See [examples/angular-simple](https://github.com/flobacher/SVGInjector2/blob/master/examples/angular-simple.html) for more details. + +To configure the SVGInjector Service use the svgInjectorOptionsProvider available during the config-phase and use it to set +the options-object. For details +see [examples/angular-spritesheet](https://github.com/flobacher/SVGInjector2/blob/master/examples/angular-spritesheet.html). +This example also demonstrates, that of course the angular wrapper can also be used in combination with a spritesheet. + +Last but not least check [examples/angular-spritesheet-classbased](https://github.com/flobacher/SVGInjector2/blob/master/examples/angular-spritesheet-classbased.html) to see the convenience the use of classbased injection offers. + + +#### Performance tip +add +```html + +``` +to let the browser download the file, even before it was requested via xhr + +### Accessibility +`role="img"` and `aria-labelledby` gets added to the root svg element. `aria-labelledby` points to the id of the `desc` and `title` tags inside the injected svg. +The contents of those tags comes from corresponding tags inside the element which is the injection target, if not found there, they are taken from the svg-instance that gets +injected, and if missing there as well defaults to the fragmentid or filename of the injectable. `role="presentation"` gets added to all elements +in all proper browsers (so no IE). + + # Licence The MIT License (MIT) diff --git a/bower.json b/bower.json index 862217a..a8a4f45 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,12 @@ { - "name": "svg-injector", - "version": "1.1.2", - "homepage": "https://github.com/iconic/SVGInjector", + "name": "svg-injector-2", + "homepage": "https://github.com/flobacher/SVGInjector2", "authors": [ - "Iconic " + "Iconic ", + "Flo Bacher " ], "description": "Fast, caching, dynamic inline SVG DOM injection library", - "main": "svg-injector.js", + "main": "dist/svg-injector.min.js", "moduleType": [ "node", "amd", diff --git a/dist/svg-injector.map.js b/dist/svg-injector.map.js index 8135d73..9fff49f 100644 --- a/dist/svg-injector.map.js +++ b/dist/svg-injector.map.js @@ -1 +1 @@ -{"version":3,"file":"./svg-injector.min.js","sources":["./svg-injector.js"],"names":["window","document","uniqueClasses","list","split","hash","i","length","out","hasOwnProperty","unshift","join","isLocal","location","protocol","hasSvgSupport","implementation","hasFeature","forEach","Array","prototype","fn","scope","this","TypeError","len","call","svgCache","injectCount","injectedElements","requestQueue","ranScripts","cloneSvg","sourceSvg","cloneNode","queueRequest","url","callback","push","processRequestQueue","index","setTimeout","loadSvg","undefined","SVGSVGElement","XMLHttpRequest","httpRequest","onreadystatechange","readyState","status","responseXML","statusText","Document","documentElement","DOMParser","Function","xmlDoc","parser","parseFromString","responseText","e","getElementsByTagName","open","overrideMimeType","send","injectElement","el","evalScripts","pngFallback","imgUrl","getAttribute","test","perElementFallback","setAttribute","pop","replace","indexOf","svg","imgId","imgTitle","classMerge","concat","imgStyle","imgData","filter","attributes","at","name","dataAttr","value","newClipPathName","clipPaths","querySelectorAll","g","clipPathsLen","id","usingClipPath","h","usingClipPathLen","newMaskName","masks","masksLen","usingMask","j","usingMaskLen","removeAttribute","script","scriptType","scripts","scriptsToEval","k","scriptsLen","innerText","textContent","removeChild","l","scriptsToEvalLen","styleTags","styleTag","parentNode","replaceChild","SVGInjector","elements","options","done","eachCallback","each","elementsLoaded","element","module","exports","define","amd"],"mappings":"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"} \ No newline at end of file +{"version":3,"sources":["./src/svg-injector.js"],"names":["window","document","SVGInjector","options","instanceCounter","this","init","svgCache","injections","requestQueue","ranScripts","config","env","setFallbackClassNames","removeFallbackClassNames","suffixIdReferences","suffixIdReferencesInStyles","copyAttributes","cloneSymbolAsSVG","doPrefixStyleTags","getClassList","getSpriteIdFromClass","cloneSvg","queueRequest","processRequestQueue","loadSvg","writeDefaultClass","replaceNoSVGClass","onLoadSVG","uniqueClasses","isFunction","isArray","svgElemSetClassName","forEach","setRootLevelElem","addRootLevelElem","injectElement","SVG_NS","XLINK_NS","DEFAULT_FALLBACK_CLASS_NAMES","prototype","isLocal","location","protocol","hasSvgSupport","implementation","hasFeature","count","elements","evalScripts","pngFallback","svgFallbackDir","onlyInjectVisiblePart","keepStylesClass","spriteClassName","spriteClassIdName","DEFAULT_SPRITE_CLASS_NAME","removeStylesClass","removeAllStyles","fallbackClassName","prefixStyleTags","spritesheetURL","prefixFragIdClass","forceFallbacks","querySelector","inject","onDoneCallback","eachCallback","undefined","length","elementsLoaded","ctx","call","element","svg","el","onElementInjectedCallback","spriteId","imgUrl","getAttribute","setAttribute","imgUrlSplitByFId","split","push","fallbackUrl","test","perElementFallback","pop","replace","indexOf","getEnv","getConfig","symbolId","classNames","className","slice","curClassName","idx","fallbackClassNames","idxOfCurClass","curClassNames","classAttribute","curFallbackClassName","join","styleTag","suffix","name","numRefs","textContent","match","newName","definitions","defLen","defIdx","refrences","refLen","refIdx","attrs","attrLen","attrIdx","allLinks","allLinksLen","allLinksIdx","links","linkLen","linkIdx","defs","def","elem","querySelectorAll","id","getAttributeNS","toString","setAttributeNS","svgElemSource","svgElemTarget","attributesToIgnore","curAttr","i","attributes","item","value","svgSymbol","createElementNS","childNodes","child","appendChild","cloneNode","injectCount","regex","origPrefixClassName","newPrefixClassName","srcFileNameArr","regexSearchResult","selectorArr","srcArr","styleTagContent","newContent","prefixSelector","arr","RegExp","exec","trim","svgToCheck","curClassAttr","classes","curClass","sourceSvg","fragId","svgElem","viewBox","viewBoxAttr","symbolAttributesToFind","curClassList","symobolList","newSVG","setViewboxOnNewSVG","setDimensionsOnNewSVG","symbolElem","getElementById","SVGSymbolElement","SVGViewElement","selector","Math","abs","parseInt","x","y","SVGSVGElement","prop","removeAttribute","SVGUseElement","referencedSymbol","substr","fragIdClassName","fileName","callback","fragmentId","url","requestQueueElem","len","index","setTimeout","urlArr","fileUrl","pathArr","XMLHttpRequest","httpRequest","onreadystatechange","readyState","status","responseXML","statusText","Document","documentElement","DOMParser","Function","xmlDoc","parser","parseFromString","responseText","e","getElementsByTagName","open","overrideMimeType","send","css","head","style","createElement","type","styleSheet","cssText","createTextNode","noSVGClassName","titleId","descId","ariaHidden","fallbackSvg","labeledBy","titleTagExisting","descTagExisting","splice","children","curChildElem","SVGDefsElement","SVGTitleElement","SVGDescElement","removeChild","classMerge","concat","script","scriptType","scripts","scriptsToEval","k","scriptsLen","innerText","l","scriptsToEvalLen","styleTags","svgClassList","stylesUntouched","parentNode","replaceChild","list","hash","out","hasOwnProperty","unshift","obj","constructor","apply","Object","newClassNames","curClasses","Array","fn","scope","TypeError","addDefault","existingElem","elemId","firstChild","text","insertBefore","newElem","angular","module","provider","injectorOpts","set","opts","$get","factory","svgInjectorOptions","directive","svgInjectorFactory","cfg","restrict","link","$observe","dataSrc","src","exports","define","amd"],"mappings":"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","file":"./dist/svg-injector.min.js","sourcesContent":["/*!\n * SVGInjector v${VERSION} - Fast, caching, dynamic inline SVG DOM injection library\n * https://github.com/flobacher/SVGInjector2\n * forked from:\n * https://github.com/iconic/SVGInjector\n *\n * Copyright (c) 2015 flobacher \n * @license MIT\n *\n * original Copyright (c) 2014 Waybury \n * @license MIT\n */\n(function(window, document) {\n 'use strict';\n /**\n * SVGInjector\n *\n * Replace the given elements with their full inline SVG DOM elements.\n *\n * :NOTE: We are using get/setAttribute with SVG because the SVG DOM spec differs from HTML DOM and\n * can return other unexpected object types when trying to directly access svg properties.\n * ex: \"className\" returns a SVGAnimatedString with the class value found in the \"baseVal\" property,\n * instead of simple string like with HTML Elements.\n */\n var SVGInjector = (function () {\n\n\n /**\n * Constructor Function\n * @param {object} options\n */\n function SVGInjector (options) {\n SVGInjector.instanceCounter++;\n this.init(options);\n }\n\n // - private constants -----------------------------------------\n var SVG_NS = 'http://www.w3.org/2000/svg';\n var XLINK_NS = 'http://www.w3.org/1999/xlink';\n var DEFAULT_SPRITE_CLASS_NAME = 'sprite';\n var DEFAULT_SPRITE_CLASS_ID_NAME = DEFAULT_SPRITE_CLASS_NAME + '--';\n var DEFAULT_FALLBACK_CLASS_NAMES = [DEFAULT_SPRITE_CLASS_NAME];\n var DEFAULT_REMOVESTYLES_CLASS_NAME = 'icon';\n\n // - private member vars ---------------------------------------\n var svgCache;\n var injections;\n var requestQueue;\n var ranScripts;\n var config;\n var env;\n\n // - private member funcs --------------------------------------\n var\n setFallbackClassNames,\n removeFallbackClassNames,\n suffixIdReferences,\n suffixIdReferencesInStyles,\n copyAttributes,\n cloneSymbolAsSVG,\n doPrefixStyleTags,\n getClassList,\n getSpriteIdFromClass,\n cloneSvg,\n queueRequest,\n processRequestQueue,\n loadSvg,\n writeDefaultClass,\n replaceNoSVGClass,\n onLoadSVG,\n uniqueClasses,\n isFunction,\n isArray,\n svgElemSetClassName,\n forEach,\n setRootLevelElem,\n addRootLevelElem,\n injectElement\n ;\n\n\n\n requestQueue = [];\n\n // - static vars -----------------------------------------------\n SVGInjector.instanceCounter = 0;\n\n // - public member vars ----------------------------------------\n //SVGInjector.prototype.varName = {};\n\n\n\n // - public member functions ---------------------------------------\n /**\n * @param {object} options\n */\n SVGInjector.prototype.init = function(options) {\n options = options || {};\n svgCache = {};\n env = {};\n env.isLocal = window.location.protocol === 'file:';\n env.hasSvgSupport = document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1');\n\n injections = {\n count: 0,\n elements: []\n };\n\n ranScripts = {};\n config = {};\n\n // Should we run the scripts blocks found in the SVG\n // 'always' - Run them every time\n // 'once' - Only run scripts once for each SVG\n // [false|'never'] - Ignore scripts\n config.evalScripts = options.evalScripts || 'always';\n\n // Location of fallback pngs, if desired\n config.pngFallback = options.pngFallback || false;\n\n // Location of fallback svgs, if desired\n config.svgFallbackDir = options.svgFallbackDir || false;\n\n // Only inject the part of the svg, that is specified\n // as visible through the id of an SVGViewElement\n // is default mode\n config.onlyInjectVisiblePart = options.onlyInjectVisiblePart || true;\n\n config.keepStylesClass = (typeof options.keepStylesClass === 'undefined') ?\n '' : options.keepStylesClass;\n\n config.spriteClassName = (typeof options.spriteClassName === 'undefined') ?\n DEFAULT_SPRITE_CLASS_NAME : options.spriteClassName;\n\n config.spriteClassIdName = (typeof options.spriteClassIdName === 'undefined') ?\n DEFAULT_SPRITE_CLASS_ID_NAME : options.spriteClassIdName;\n\n config.removeStylesClass = (typeof options.removeStylesClass === 'undefined') ?\n DEFAULT_REMOVESTYLES_CLASS_NAME : options.removeStylesClass;\n\n config.removeAllStyles = (typeof options.removeAllStyles === 'undefined') ?\n false : options.removeAllStyles;\n\n config.fallbackClassName = (typeof options.fallbackClassName === 'undefined') ?\n DEFAULT_FALLBACK_CLASS_NAMES : options.fallbackClassName;\n\n config.prefixStyleTags = (typeof options.prefixStyleTags === 'undefined') ?\n true : options.prefixStyleTags;\n\n config.spritesheetURL = (typeof options.spritesheetURL === 'undefined' || options.spritesheetURL === '') ?\n false : options.spritesheetURL;\n\n config.prefixFragIdClass = config.spriteClassIdName;\n\n config.forceFallbacks = (typeof options.forceFallbacks === 'undefined') ?\n false : options.forceFallbacks;\n\n if (config.forceFallbacks){\n env.hasSvgSupport = false;\n }\n\n replaceNoSVGClass(document.querySelector('html'), 'no-svg', env.hasSvgSupport);\n\n if (env.hasSvgSupport && typeof options.removeStylesClass === 'undefined' ){ // user does not want to use his own custom class -> write this style tag\n writeDefaultClass(config.removeStylesClass);\n }\n };\n\n /**\n * Inject 1+ elements\n * @param {elements} Array of or single DOM element\n * @param {function} onDoneCallback\n * @param {function} eachCallback\n */\n SVGInjector.prototype.inject = function(elements, onDoneCallback, eachCallback) {\n if (elements.length !== undefined) {\n if (0 === elements.length) {\n if (onDoneCallback) onDoneCallback(0);\n }\n else {\n var elementsLoaded = 0;\n var ctx = this;\n forEach.call(elements, function (element) {\n ctx.injectElement(element, function (svg) {\n if (eachCallback && typeof eachCallback === 'function') eachCallback(svg);\n if (onDoneCallback && elements.length === ++elementsLoaded) onDoneCallback(elementsLoaded);\n });\n });\n }\n }\n else {\n if (elements) {\n this.injectElement(elements, function (svg) {\n if (eachCallback && typeof eachCallback === 'function') eachCallback(svg);\n if (onDoneCallback) onDoneCallback(1);\n elements = null;\n });\n }\n else {\n if (onDoneCallback) onDoneCallback(0);\n }\n }\n };\n\n\n /**\n * Inject a single element\n * @param {elements} Array of or single DOM element\n * @param {function} onDoneCallback\n * @param {function} eachCallback\n */\n injectElement = SVGInjector.prototype.injectElement = function (el, onElementInjectedCallback) {\n var imgUrl = el.getAttribute('data-src') || el.getAttribute('src'),\n spriteId;\n\n if (!imgUrl) {\n if (config.spritesheetURL) {\n spriteId = getSpriteIdFromClass(el);\n if (spriteId === '') {\n // console.warn('neither data-src nor spriteId class found! Nothing to inject here!');\n return;\n }\n imgUrl = config.spritesheetURL + '#' + spriteId;\n // console.log('imgURL: ' + imgUrl);\n } else {\n // console.warn('neither data-src nor spritesheetURL specified! Nothing to inject here!');\n return;\n }\n }\n\n el.setAttribute('data-src', imgUrl);\n\n var imgUrlSplitByFId = imgUrl.split('#');\n if (imgUrlSplitByFId.length === 1) {\n imgUrlSplitByFId.push('');\n }\n\n var fallbackUrl;\n\n // We can only inject SVG\n if (!(/\\.svg/i).test(imgUrl)) {\n onElementInjectedCallback('Attempted to inject a file with a non-svg extension: ' + imgUrl);\n return;\n }\n\n\n if (env.hasSvgSupport) {\n if (isArray(config.fallbackClassName)) {\n removeFallbackClassNames(el, imgUrlSplitByFId[1], config.fallbackClassName);\n }\n }\n else {\n // If we don't have SVG support try to fall back to a png,\n // either defined per-element via data-fallback or data-png,\n // or globally via the pngFallback directory setting\n\n var perElementFallback = el.getAttribute('data-fallback') || el.getAttribute('data-png');\n\n // Per-element specific PNG fallback defined, so use that\n if (perElementFallback) {\n el.setAttribute('src', perElementFallback);\n onElementInjectedCallback(null);\n }\n // Global PNG fallback directory defined, use the same-named PNG\n else if (config.pngFallback) {\n\n if (imgUrlSplitByFId.length > 1 && imgUrlSplitByFId[1]) {\n fallbackUrl = imgUrlSplitByFId[1] + '.png';\n if (isArray(config.fallbackClassName)) {\n setFallbackClassNames(el, imgUrlSplitByFId[1], config.fallbackClassName);\n }\n else if (isFunction(config.fallbackClassName)) {\n // console.info('custom function to create fallbackClassName');\n config.fallbackClassName(el, imgUrlSplitByFId[1]);\n }\n else if (typeof config.fallbackClassName === 'string') {\n svgElemSetClassName(el, config.fallbackClassName);\n }\n else {\n el.setAttribute('src', config.pngFallback + '/' + fallbackUrl);\n }\n }\n else {\n fallbackUrl = imgUrl.split('/').pop().replace('.svg', '.png');\n el.setAttribute('src', config.pngFallback + '/' + fallbackUrl);\n }\n\n onElementInjectedCallback(null);\n }\n // um...\n else {\n onElementInjectedCallback('This browser does not support SVG and no PNG fallback was defined.');\n }\n\n return;\n }\n\n // Make sure we aren't already in the process of injecting this element to\n // avoid a race condition if multiple injections for the same element are run.\n // :NOTE: Using indexOf() only _after_ we check for SVG support and bail,\n // so no need for IE8 indexOf() polyfill\n if (injections.elements.indexOf(el) !== -1) {\n console.warn('race', el);\n return;\n }\n\n // Remember the request to inject this element, in case other injection\n // calls are also trying to replace this element before we finish\n injections.elements.push(el);\n\n // Try to avoid loading the orginal image src if possible.\n // el.setAttribute('src', '');\n\n // Load it up\n loadSvg(onElementInjectedCallback, imgUrl, el);\n\n };\n\n SVGInjector.prototype.getEnv = function() {\n return env;\n };\n\n SVGInjector.prototype.getConfig = function() {\n return config;\n };\n\n // - private member functions -----------------------------------------------\n setFallbackClassNames = function (element, symbolId, classNames) {\n var className = (typeof classNames === 'undefined') ? DEFAULT_FALLBACK_CLASS_NAMES : classNames.slice(0);\n\n // replace %s by symbolId\n forEach.call(\n className,\n function(curClassName, idx) {\n className[idx] = curClassName.replace('%s', symbolId);\n }\n );\n\n svgElemSetClassName(element, className);\n };\n\n removeFallbackClassNames = function (element, symbolId, fallbackClassNames) {\n fallbackClassNames = (typeof fallbackClassNames === 'undefined') ? DEFAULT_FALLBACK_CLASS_NAMES.slice(0) : fallbackClassNames.slice(0);\n\n var idxOfCurClass,\n curClassNames,\n classAttribute = element.getAttribute('class');\n\n if (typeof classAttribute === 'undefined' || classAttribute === null) {\n return;\n }\n\n curClassNames = classAttribute.split(' ');\n if (curClassNames) {\n // replace %s by symbolId\n forEach.call(\n fallbackClassNames,\n function(curFallbackClassName) {\n curFallbackClassName = curFallbackClassName.replace('%s', symbolId);\n idxOfCurClass = curClassNames.indexOf(curFallbackClassName);\n if (idxOfCurClass >= 0){\n // console.log('remove class ' + curClassName);\n curClassNames[idxOfCurClass] = '';\n }\n\n }\n );\n\n element.setAttribute('class', uniqueClasses(curClassNames.join(' ')));\n }\n\n };\n\n suffixIdReferencesInStyles = function (styleTag, suffix, svg, name) {\n //var referencedIds = styleTag.textContent.match(/url\\(('|\")*#.+('|\")*\\)/g) || [];\n /*referencedIds.forEach(function (elem, idx, arr) {\n //elem = elem.replace(/url\\(('|\")*#/g, '');\n arr[idx] = elem.replace(/\\)/g, '-' + suffix + ')');\n console.log('style', arr[idx]);\n });\n */\n var numRefs = 0;\n styleTag.textContent = styleTag.textContent.replace(/url\\(('|\")*#.+('|\")*(?=\\))/g, function (match) {\n //console.log('match', match + '-' + suffix);\n numRefs++;\n return match + '-' + suffix;\n });\n return numRefs;\n };\n\n suffixIdReferences = function (svg, suffix) {\n var defs = [\n {def:'linearGradient', attrs: ['fill', 'stroke']},\n {def:'radialGradient', attrs: ['fill', 'stroke']},\n {def:'clipPath', attrs: ['clip-path']},\n {def:'mask', attrs: ['mask']},\n {def:'filter', attrs: ['filter']},\n {def:'color-profile', attrs: ['color-profile']},\n {def:'cursor', attrs: ['cursor']},\n {def:'marker', attrs: ['marker', 'marker-start', 'marker-mid', 'marker-end']}\n ];\n\n var newName,\n definitions,\n defLen,\n defIdx,\n refrences,\n refLen,\n refIdx,\n attrs,\n attrLen,\n attrIdx,\n allLinks,\n allLinksLen,\n allLinksIdx,\n links,\n linkLen,\n linkIdx\n ;\n\n forEach.call(defs, function(elem) {\n\n definitions = svg.querySelectorAll(elem.def + '[id]');\n for (defIdx = 0, defLen = definitions.length; defIdx < defLen; defIdx++) {\n newName = definitions[defIdx].id + '-' + suffix;\n\n attrs = elem.attrs;\n for (attrIdx = 0, attrLen = attrs.length; attrIdx < attrLen; attrIdx++) {\n\n // console.log('suffixxed ' + attribute + ': ' + newName);\n // :NOTE: using a substring match attr selector here to deal with IE \"adding extra quotes in url() attrs\"\n refrences = svg.querySelectorAll('[' + attrs[attrIdx] + '=\"url(#' + definitions[defIdx].id + ')\"]');\n for (refIdx = 0, refLen = refrences.length; refIdx < refLen; refIdx++) {\n // console.log('set url', newName);\n refrences[refIdx].setAttribute(attrs[attrIdx], 'url(#' + newName + ')');\n }\n }\n\n // handle xlink:refrences\n // :NOTE: IE does not like the easy way: links = svg.querySelectorAll('[*|href=\"#' + definitions[defIdx].id + '\"]');\n allLinks = svg.querySelectorAll('[*|href]');\n links = [];\n for (allLinksIdx = 0, allLinksLen = allLinks.length; allLinksIdx < allLinksLen; allLinksIdx++) {\n if (allLinks[allLinksIdx].getAttributeNS(XLINK_NS, 'href').toString() === '#' + definitions[defIdx].id ) {\n links.push(allLinks[allLinksIdx]);\n }\n }\n\n for (linkIdx = 0, linkLen = links.length; linkIdx < linkLen; linkIdx++) {\n links[linkIdx].setAttributeNS(XLINK_NS, 'href', '#' + newName);\n // console.log('set link', newName, links[linkIdx]);\n }\n definitions[defIdx].id = newName;\n }\n });\n };\n\n copyAttributes = function (svgElemSource, svgElemTarget, attributesToIgnore) {\n var curAttr;\n if (typeof attributesToIgnore === 'undefined') { attributesToIgnore = ['id', 'viewBox']; }\n\n for(var i=0; i 1) {\n origPrefixClassName = srcArr[1];\n newPrefixClassName = origPrefixClassName + '-' + injectCount;\n regex = new RegExp('\\\\.' + origPrefixClassName + ' ', 'g');\n styleTag.textContent = styleTagContent.replace(regex, '.' + newPrefixClassName + ' ');\n }\n else { //inject a single element.. this has most probaly not gone through preprocessing\n srcFileNameArr = srcArr[0].split('/');\n newPrefixClassName = srcFileNameArr[srcFileNameArr.length-1].replace('.svg', '') + '-' + injectCount;\n // console.info('inject complete file: ' + srcArr[0]);\n //https://medium.com/jotform-form-builder/writing-a-css-parser-in-javascript-3ecaa1719a43\n regex = new RegExp('([\\\\s\\\\S]*?){([\\\\s\\\\S]*?)}', 'g');\n\n while ((regexSearchResult = regex.exec(styleTagContent)) !== null) {\n selectorArr = regexSearchResult[1].trim().split(', ');\n selectorArr.forEach(prefixSelector);\n\n var tmp = selectorArr.join(', ') + '{' + regexSearchResult[2] + '}\\n';\n newContent += tmp;\n }\n styleTag.textContent = newContent;\n }\n\n svg.setAttribute('class', (svg.getAttribute('class') + ' ' + newPrefixClassName));\n };\n\n getClassList = function (svgToCheck) {\n var curClassAttr = svgToCheck.getAttribute('class');\n return (curClassAttr) ? curClassAttr.trim().split(' ') : [];\n };\n\n getSpriteIdFromClass = function (element) {\n var classes = getClassList(element);\n var id = '';\n forEach.call(classes, function (curClass) {\n if (curClass.indexOf(config.spriteClassIdName) >= 0) {\n id = curClass.replace(config.spriteClassIdName, '');\n // console.log('class with prefix ' + config.spriteClassIdName + ' found. id: ' + id);\n }\n });\n return id;\n };\n\n cloneSvg = function (config, sourceSvg, fragId) {\n\n var svgElem,\n newSVG = null,\n viewBox,\n viewBoxAttr,\n symbolAttributesToFind,\n curClassList,\n setViewboxOnNewSVG = false,\n setDimensionsOnNewSVG = false,\n symbolElem = null,\n symobolList;\n\n if (fragId === undefined){\n svgElem = newSVG = sourceSvg.cloneNode(true);\n if (!newSVG.getAttribute('width') && !sourceSvg.getAttribute('width')) {\n setDimensionsOnNewSVG = true;\n }\n\n }\n else {\n svgElem = sourceSvg.getElementById(fragId);\n if (!svgElem) {\n console.warn(fragId + ' not found in svg');\n return;\n }\n }\n viewBoxAttr = svgElem.getAttribute('viewBox');\n viewBox = viewBoxAttr.split(' ');\n if (!newSVG) {\n if (svgElem instanceof SVGSymbolElement) {\n\n newSVG = cloneSymbolAsSVG(svgElem);\n setDimensionsOnNewSVG = setViewboxOnNewSVG = true;\n\n }\n else if (svgElem instanceof SVGViewElement) {\n symbolElem = null;\n if (config.onlyInjectVisiblePart) {\n var selector = '*[width=\"' + viewBox[2] + '\"][height=\"' + viewBox[3] + '\"]';\n\n symbolAttributesToFind = {};\n if (Math.abs(parseInt(viewBox[0])) === 0) {\n selector += ':not([x])';\n }\n else {\n symbolAttributesToFind.x = viewBox[0];\n selector += '[x=\"' + viewBox[0] + '\"]';\n }\n\n if (Math.abs(parseInt(viewBox[1])) === 0) {\n selector += ':not([y])';\n }\n else {\n symbolAttributesToFind.y = viewBox[1];\n selector += '[y=\"' + viewBox[1] + '\"]';\n }\n symobolList = sourceSvg.querySelectorAll(selector);\n if (symobolList.length > 1) {\n console.warn('more than one item, with the matching viewbox found!', symobolList);\n }\n symbolElem = symobolList[0];\n }\n if (symbolElem && (symbolElem instanceof SVGSVGElement)) {\n newSVG = symbolElem.cloneNode(true);\n\n for (var prop in symbolAttributesToFind) {\n if (prop !== 'width' && prop !== 'height') {\n newSVG.removeAttribute(prop);\n }\n }\n }\n else if (symbolElem && (symbolElem instanceof SVGUseElement)) {\n // console.log('referenced view shows a SVGUseElement');\n var referencedSymbol = sourceSvg.getElementById(\n symbolElem.getAttributeNS(XLINK_NS, 'href').substr(1)\n );\n newSVG = cloneSymbolAsSVG(referencedSymbol);\n viewBoxAttr = referencedSymbol.getAttribute('viewBox');\n viewBox = viewBoxAttr.split(' ');\n setDimensionsOnNewSVG = setViewboxOnNewSVG = true;\n }\n else {\n console.info(\n ((config.onlyInjectVisiblePart) ? 'symbol referenced via view' + fragId + ' not found' : 'option.onlyInjectVisiblePart: false') + ' -> clone complete svg!'\n );\n setDimensionsOnNewSVG = setViewboxOnNewSVG = true;\n newSVG = sourceSvg.cloneNode(true);\n\n }\n }\n\n curClassList = getClassList(newSVG);\n var fragIdClassName = config.prefixFragIdClass + fragId;\n if (curClassList.indexOf(fragIdClassName)<0) {\n curClassList.push(fragIdClassName);\n newSVG.setAttribute('class', curClassList.join(' '));\n }\n }\n\n if (setViewboxOnNewSVG) {\n newSVG.setAttribute('viewBox', viewBox.join(' '));\n }\n if (setDimensionsOnNewSVG) {\n newSVG.setAttribute('width', viewBox[2]+'px');\n newSVG.setAttribute('height', viewBox[3]+'px');\n }\n newSVG.setAttribute('xmlns', SVG_NS);\n newSVG.setAttribute('xmlns:xlink', XLINK_NS);\n return newSVG;\n };\n\n //queueRequest(requestQueue, fileName, fragId, onElementInjectedCallback, el);\n queueRequest = function (fileName, fragId, callback, el) {\n requestQueue[fileName] = requestQueue[fileName] || [];\n requestQueue[fileName].push({callback:callback, fragmentId:fragId, element:el, name: name});\n };\n\n processRequestQueue = function (url) {\n var requestQueueElem;\n for (var i = 0, len = requestQueue[url].length; i < len; i++) {\n // Make these calls async so we avoid blocking the page/renderer\n /* jshint loopfunc: true */\n (function (index) {\n setTimeout(function () {\n requestQueueElem = requestQueue[url][index];\n onLoadSVG(url, requestQueueElem.fragmentId, requestQueueElem.callback, requestQueueElem.element, requestQueueElem.name);\n }, 0);\n })(i);\n /* jshint loopfunc: false */\n }\n };\n\n loadSvg = function (onElementInjectedCallback, url, el) {\n var urlArr, fileUrl, fragId, name, pathArr;\n //var state = {onElementInjectedCallback:onElementInjectedCallback, injections:injections, config:config, url:url, el:el, ranScripts:ranScripts};\n // console.log('loadSvg', url);\n urlArr = url.split('#');\n fileUrl = urlArr[0];\n fragId = (urlArr.length === 2) ? urlArr[1] : undefined;\n //name = fragId ? undefined : ;\n if (typeof fragId !== 'undefined') {\n pathArr = fileUrl.split('/');\n name = pathArr[pathArr.length-1].replace('.svg', '');\n }\n\n if (svgCache[fileUrl] !== undefined) {\n if (svgCache[fileUrl] instanceof SVGSVGElement) {\n // We already have it in cache, so use it\n // console.log('We already have it in cache, so use it', fileName, fragId);\n onLoadSVG(fileUrl, fragId, onElementInjectedCallback, el, name);\n }\n else {\n // console.log('We don\\'t have it in cache yet, but we are loading it, so queue this request', fileName, fragId);\n // We don't have it in cache yet, but we are loading it, so queue this request\n queueRequest(fileUrl, fragId, onElementInjectedCallback, el, name);\n }\n }\n else {\n\n if (!window.XMLHttpRequest) {\n onElementInjectedCallback('Browser does not support XMLHttpRequest');\n return false;\n }\n\n // Seed the cache to indicate we are loading this URL already\n svgCache[fileUrl] = {};\n queueRequest(fileUrl, fragId, onElementInjectedCallback, el, name);\n\n var httpRequest = new XMLHttpRequest();\n\n httpRequest.onreadystatechange = function () {\n // readyState 4 = complete\n if (httpRequest.readyState === 4) {\n\n // Handle status\n if (httpRequest.status === 404 || httpRequest.responseXML === null) {\n onElementInjectedCallback('Unable to load SVG file: ' + fileUrl);\n\n // @check this!\n //if (env.isLocal) {\n // onLoadCompleteCb('Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver.');\n //}\n //\n //onLoadCompleteCb();\n return false;\n }\n\n // 200 success from server, or 0 when using file:// protocol locally\n if (httpRequest.status === 200 || (env.isLocal && httpRequest.status === 0)) {\n\n if (httpRequest.responseXML instanceof Document) {\n // Cache it\n svgCache[fileUrl] = httpRequest.responseXML.documentElement;\n }\n\n // IE9 doesn't create a responseXML Document object from loaded SVG,\n // and throws a \"DOM Exception: HIERARCHY_REQUEST_ERR (3)\" error when injected.\n //\n // So, we'll just create our own manually via the DOMParser using\n // the the raw XML responseText.\n //\n // :NOTE: IE8 and older doesn't have DOMParser, but they can't do SVG either, so...\n else if (DOMParser && (DOMParser instanceof Function)) {\n var xmlDoc;\n try {\n var parser = new DOMParser();\n xmlDoc = parser.parseFromString(httpRequest.responseText, 'text/xml');\n }\n catch (e) {\n xmlDoc = undefined;\n }\n\n if (!xmlDoc || xmlDoc.getElementsByTagName('parsererror').length) {\n onElementInjectedCallback('Unable to parse SVG file: ' + url);\n return false;\n }\n else {\n // Cache it\n svgCache[fileUrl] = xmlDoc.documentElement;\n }\n }\n\n // We've loaded a new asset, so process any requests waiting for it\n processRequestQueue(fileUrl);\n }\n else {\n onElementInjectedCallback('There was a problem injecting the SVG: ' + httpRequest.status + ' ' + httpRequest.statusText);\n return false;\n }\n }\n };\n\n httpRequest.open('GET', fileUrl);\n\n // Treat and parse the response as XML, even if the\n // server sends us a different mimetype>\n if (httpRequest.overrideMimeType) httpRequest.overrideMimeType('text/xml');\n\n httpRequest.send();\n }\n };\n\n writeDefaultClass = function(removeStylesClass) {\n var css = 'svg.' + removeStylesClass + ' {fill: currentColor;}',\n head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n\n style.type = 'text/css';\n if (style.styleSheet){\n style.styleSheet.cssText = css;\n }\n else {\n style.appendChild(document.createTextNode(css));\n }\n head.appendChild(style);\n // console.info( 'default class written: ', css );\n };\n\n replaceNoSVGClass = function(element, noSVGClassName, hasSvgSupport) {\n if (hasSvgSupport) {\n element.className.replace(noSVGClassName, '');\n }\n else{\n element.className += ' ' + noSVGClassName;\n }\n };\n\n\n onLoadSVG = function(url, fragmentId, onElementInjectedCallback, el, name){\n // console.log('onLoadSVG', url, fragmentId, onElementInjectedCallback, el, name);\n var svg,\n imgId,\n titleId,\n descId,\n ariaHidden,\n fallbackSvg,\n labeledBy,\n titleTagExisting,\n descTagExisting\n ;\n\n svg = cloneSvg(config, svgCache[url], fragmentId);\n if (typeof svg === 'undefined' || typeof svg === 'string') {\n fallbackSvg = el.getAttribute('data-fallback-svg');\n fallbackSvg = fallbackSvg || config.svgFallbackDir ? config.svgFallbackDir + '/' + fragmentId + '.svg' : false;\n if (fallbackSvg) {\n // console.log('use fallback-svg', fallbackSvg);\n el.setAttribute('data-src', fallbackSvg);\n injections.elements.splice(injections.elements.indexOf(el), 1);\n injectElement(el, onElementInjectedCallback);\n } else {\n onElementInjectedCallback(svg);\n }\n return false;\n }\n\n // take care of accessibility\n svg.setAttribute('role', 'img');\n forEach.call(svg.children || [], function (curChildElem) { // IE does not support Children on SVGElement!\n if (\n !(curChildElem instanceof SVGDefsElement) &&\n !(curChildElem instanceof SVGTitleElement) &&\n !(curChildElem instanceof SVGDescElement)\n ) {\n curChildElem.setAttribute('role', 'presentation');\n }\n });\n\n\n // set aria-hidden attribute\n ariaHidden = el.getAttribute('aria-hidden') || svg.getAttribute('aria-hidden');\n\n if (ariaHidden) {\n svg.setAttribute('aria-hidden', 'true');\n titleTagExisting = svg.querySelector('title');\n descTagExisting = svg.querySelector('desc');\n if (titleTagExisting) {\n svg.removeChild(titleTagExisting);\n }\n if (descTagExisting) {\n svg.removeChild(descTagExisting);\n }\n\n } else {\n // set desc + title\n descId = setRootLevelElem('desc', svg, el, fragmentId, false);\n titleId = setRootLevelElem('title', svg, el, fragmentId, false);\n if (descId.length > 0 || titleId.length > 0) {\n labeledBy = titleId + ' ' + descId;\n svg.setAttribute('aria-labelledby', labeledBy.trim());\n }\n\n }\n\n // copy attributes of original element to new svg excluding class\n copyAttributes(el, svg, ['class']);\n\n\n // Concat the SVG classes + 'injected-svg' + the img classes\n var classMerge = [].concat(svg.getAttribute('class') || [], 'injected-svg', el.getAttribute('class') || []).join(' ');\n svg.setAttribute('class', uniqueClasses(classMerge));\n\n // Make sure any internally referenced ids and their\n // references are unique.\n //\n // This addresses the issue of having multiple instances of the\n // same SVG on a page and only the first clipPath, gradient, mask or filter id is referenced.\n suffixIdReferences(svg, injections.count, name);\n\n\n // Remove any unwanted/invalid namespaces that might have been added by SVG editing tools\n svg.removeAttribute('xmlns:a');\n\n // Post page load injected SVGs don't automatically have their script\n // elements run, so we'll need to make that happen, if requested\n\n // Find then prune the scripts\n var scripts = svg.querySelectorAll('script');\n var scriptsToEval = [];\n var script, scriptType;\n\n for (var k = 0, scriptsLen = scripts.length; k < scriptsLen; k++) {\n scriptType = scripts[k].getAttribute('type');\n\n // Only process javascript types.\n // SVG defaults to 'application/ecmascript' for unset types\n if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript') {\n\n // innerText for IE, textContent for other browsers\n script = scripts[k].innerText || scripts[k].textContent;\n\n // Stash\n scriptsToEval.push(script);\n\n // Tidy up and remove the script element since we don't need it anymore\n svg.removeChild(scripts[k]);\n }\n }\n\n // Run/Eval the scripts if needed\n if (scriptsToEval.length > 0 && (config.evalScripts === 'always' || (config.evalScripts === 'once' && ! ranScripts[url]))) {\n for (var l = 0, scriptsToEvalLen = scriptsToEval.length; l < scriptsToEvalLen; l++) {\n\n // :NOTE: Yup, this is a form of eval, but it is being used to eval code\n // the caller has explictely asked to be loaded, and the code is in a caller\n // defined SVG file... not raw user input.\n //\n // Also, the code is evaluated in a closure and not in the global scope.\n // If you need to put something in global scope, use 'window'\n new Function(scriptsToEval[l])(window); // jshint ignore:line\n }\n\n // Remember we already ran scripts for this svg\n ranScripts[url] = true;\n }\n\n // :NOTE: handle styles in style-tags\n var styleTags = svg.querySelectorAll('style');\n\n forEach.call(styleTags, function (styleTag) {\n var svgClassList = getClassList(svg),\n stylesUntouched = true;\n if ((svgClassList.indexOf(config.removeStylesClass)>=0 || config.removeAllStyles) && (svgClassList.indexOf(config.keepStylesClass)<0) ) {\n\n // remove the styletag if the removeStylesClass is applied to the SVG\n // console.log('remove styleTag', styleTag);\n styleTag.parentNode.removeChild(styleTag);\n }\n else {\n\n if (suffixIdReferencesInStyles(styleTag, injections.count, svg, name) > 0) {\n stylesUntouched = false;\n }\n\n if (config.prefixStyleTags){\n doPrefixStyleTags(styleTag, injections.count, svg, name);\n stylesUntouched = false;\n }\n\n if (stylesUntouched) {\n // :WORKAROUND:\n // IE doesn't evaluate + SVGInjector Example: Simple + + + + + + + + Default Tilte replace + Same thing for description + + + + + + + + + diff --git a/examples/angular-spritesheet-classbased.html b/examples/angular-spritesheet-classbased.html new file mode 100644 index 0000000..e867dd7 --- /dev/null +++ b/examples/angular-spritesheet-classbased.html @@ -0,0 +1,77 @@ + + + + + SVGInjector Example: SVG Sprites + + + +

Spritesheet Classbased with AngularJS

+ + + + + + + + + + + + Default Tilte replace + Same thing for description + + + + + Circle Title Generated (not there in orig) + Circle Desc Generated (not there in orig) + + + Square Title Generated (not there in orig, only title generated, desc not set) + + + + + + Only Title Overridden + + + + + + + + + + + diff --git a/examples/angular-spritesheet.html b/examples/angular-spritesheet.html new file mode 100644 index 0000000..0d6bf31 --- /dev/null +++ b/examples/angular-spritesheet.html @@ -0,0 +1,69 @@ + + + + + SVGInjector Example: SVG Sprites + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/fallbacks/assets/png/thumb-up-default.png b/examples/assets/png/thumb-up-default.png similarity index 100% rename from examples/fallbacks/assets/png/thumb-up-default.png rename to examples/assets/png/thumb-up-default.png diff --git a/examples/fallbacks/assets/png/thumb-up-green.png b/examples/assets/png/thumb-up-green.png similarity index 100% rename from examples/fallbacks/assets/png/thumb-up-green.png rename to examples/assets/png/thumb-up-green.png diff --git a/examples/all-the-things/assets/png/thumb-up.png b/examples/assets/png/thumb-up.png similarity index 100% rename from examples/all-the-things/assets/png/thumb-up.png rename to examples/assets/png/thumb-up.png diff --git a/examples/assets/svg/circle.svg b/examples/assets/svg/circle.svg new file mode 100644 index 0000000..670b3a2 --- /dev/null +++ b/examples/assets/svg/circle.svg @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/assets/svg/logo-gradients.svg b/examples/assets/svg/logo-gradients.svg new file mode 100644 index 0000000..aad422e --- /dev/null +++ b/examples/assets/svg/logo-gradients.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + Generic Logo + Generic Logo that contains gradients + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ie-style-tag-eval/style-tag-test.svg b/examples/assets/svg/style-tag-test.svg similarity index 100% rename from tests/ie-style-tag-eval/style-tag-test.svg rename to examples/assets/svg/style-tag-test.svg diff --git a/examples/assets/svg/symbols-n-views.svg b/examples/assets/svg/symbols-n-views.svg new file mode 100644 index 0000000..867c53c --- /dev/null +++ b/examples/assets/svg/symbols-n-views.svg @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/all-the-things/assets/svg/thumb-up.svg b/examples/assets/svg/thumb-up.svg similarity index 100% rename from examples/all-the-things/assets/svg/thumb-up.svg rename to examples/assets/svg/thumb-up.svg diff --git a/examples/assets/svg/views.svg b/examples/assets/svg/views.svg new file mode 100755 index 0000000..ad476a1 --- /dev/null +++ b/examples/assets/svg/views.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + Orig Triangle Tilte + Orig Triangle Desc + + + + + + + + Generic Logo + Generic Logo that contains gradients + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/cors.html b/examples/cors.html new file mode 100755 index 0000000..7d08339 --- /dev/null +++ b/examples/cors.html @@ -0,0 +1,34 @@ + + + + + + SVGInjector Test: CORS + + + + + + + + + + + + + + diff --git a/examples/all-the-things/index.html b/examples/everything.html similarity index 56% rename from examples/all-the-things/index.html rename to examples/everything.html index ddd228d..f2405b1 100755 --- a/examples/all-the-things/index.html +++ b/examples/everything.html @@ -5,42 +5,46 @@ SVGInjector Example: All The Things +

Everything

+ - thumb - - + diff --git a/examples/fallbacks/index.html b/examples/fallbacks.html similarity index 90% rename from examples/fallbacks/index.html rename to examples/fallbacks.html index 7fec14b..66b6a8b 100755 --- a/examples/fallbacks/index.html +++ b/examples/fallbacks.html @@ -30,15 +30,13 @@

Per-element Fallback Setting

thumb thumb - + diff --git a/examples/fallbacks/assets/png/thumb-up.png b/examples/fallbacks/assets/png/thumb-up.png deleted file mode 100755 index f141d75..0000000 Binary files a/examples/fallbacks/assets/png/thumb-up.png and /dev/null differ diff --git a/examples/fallbacks/assets/svg/thumb-up.svg b/examples/fallbacks/assets/svg/thumb-up.svg deleted file mode 100755 index 2c936b6..0000000 --- a/examples/fallbacks/assets/svg/thumb-up.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/examples/fallbacks/js/svg-injector.min.js b/examples/fallbacks/js/svg-injector.min.js deleted file mode 100755 index dcdb71e..0000000 --- a/examples/fallbacks/js/svg-injector.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * SVGInjector v1.1.2 - Fast, caching, dynamic inline SVG DOM injection library - * https://github.com/iconic/SVGInjector - * - * Copyright (c) 2014 Waybury - * @license MIT - */ -!function(t,e){"use strict";function r(t){t=t.split(" ");for(var e={},r=t.length,n=[];r--;)e.hasOwnProperty(t[r])||(e[t[r]]=1,n.unshift(t[r]));return n.join(" ")}var n="file:"===t.location.protocol,i=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),o=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var r,n=this.length>>>0;for(r=0;n>r;++r)r in this&&t.call(e,this[r],r,this)},a={},s=0,l=[],u=[],c={},f=function(t){return t.cloneNode(!0)},p=function(t,e){u[t]=u[t]||[],u[t].push(e)},d=function(t){for(var e=0,r=u[t].length;r>e;e++)!function(e){setTimeout(function(){u[t][e](f(a[t]))},0)}(e)},h=function(e,r){if(void 0!==a[e])a[e]instanceof SVGSVGElement?r(f(a[e])):p(e,r);else{if(!t.XMLHttpRequest)return r("Browser does not support XMLHttpRequest"),!1;a[e]={},p(e,r);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return r("Unable to load SVG file: "+e),n&&r("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),r(),!1;if(!(200===i.status||n&&0===i.status))return r("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)a[e]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var t;try{var o=new DOMParser;t=o.parseFromString(i.responseText,"text/xml")}catch(s){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)return r("Unable to parse SVG file: "+e),!1;a[e]=t.documentElement}d(e)}},i.open("GET",e),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},v=function(e,n,a,u){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!/\.svg/i.test(f))return void u("Attempted to inject a file with a non-svg extension: "+f);if(!i){var p=e.getAttribute("data-fallback")||e.getAttribute("data-png");return void(p?(e.setAttribute("src",p),u(null)):a?(e.setAttribute("src",a+"/"+f.split("/").pop().replace(".svg",".png")),u(null)):u("This browser does not support SVG and no PNG fallback was defined."))}-1===l.indexOf(e)&&(l.push(e),e.setAttribute("src",""),h(f,function(i){if("undefined"==typeof i||"string"==typeof i)return u(i),!1;var a=e.getAttribute("id");a&&i.setAttribute("id",a);var p=e.getAttribute("title");p&&i.setAttribute("title",p);var d=[].concat(i.getAttribute("class")||[],"injected-svg",e.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(d));var h=e.getAttribute("style");h&&i.setAttribute("style",h);var v=[].filter.call(e.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});o.call(v,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});for(var g,b=i.querySelectorAll("defs clipPath[id]"),m=0,y=b.length;y>m;m++){g=b[m].id+"-"+s;for(var A=i.querySelectorAll('[clip-path*="'+b[m].id+'"]'),w=0,S=A.length;S>w;w++)A[w].setAttribute("clip-path","url(#"+g+")");b[m].id=g}for(var x,j=i.querySelectorAll("defs mask[id]"),T=0,G=j.length;G>T;T++){x=j[T].id+"-"+s;for(var M=i.querySelectorAll('[mask*="'+j[T].id+'"]'),V=0,q=M.length;q>V;V++)M[V].setAttribute("mask","url(#"+x+")");j[T].id=x}i.removeAttribute("xmlns:a");for(var k,E,O=i.querySelectorAll("script"),L=[],P=0,X=O.length;X>P;P++)E=O[P].getAttribute("type"),E&&"application/ecmascript"!==E&&"application/javascript"!==E||(k=O[P].innerText||O[P].textContent,L.push(k),i.removeChild(O[P]));if(L.length>0&&("always"===n||"once"===n&&!c[f])){for(var F=0,N=L.length;N>F;F++)new Function(L[F])(t);c[f]=!0}e.parentNode.replaceChild(i,e),delete l[l.indexOf(e)],e=null,s++,u(i)}))},g=function(t,e,r){e=e||{};var n=e.evalScripts||"always",i=e.pngFallback||!1,a=e.each;if(void 0!==t.length){var s=0;o.call(t,function(e){v(e,n,i,function(e){a&&"function"==typeof a&&a(e),r&&t.length===++s&&r(s)})})}else t?v(t,n,i,function(e){a&&"function"==typeof a&&a(e),r&&r(1),t=null}):r&&r(0)};"object"==typeof module&&"object"==typeof module.exports?module.exports=exports=g:"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof t&&(t.SVGInjector=g)}(window,document); -//# sourceMappingURL=svg-injector.map.js \ No newline at end of file diff --git a/examples/ie-style-tag-eval.html b/examples/ie-style-tag-eval.html new file mode 100755 index 0000000..5814d69 --- /dev/null +++ b/examples/ie-style-tag-eval.html @@ -0,0 +1,28 @@ + + + + + + SVGInjector Test: IE Style Tag Use + + + + +

IE doesn't evaluate and use style tags on injected SVGs.

+

This page tests if the SVGInjector workaround for this issue is effective.

+

Reference

+ + + + + + + diff --git a/examples/index.html b/examples/index.html new file mode 100755 index 0000000..49d5fd3 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,19 @@ + + + + + SVGInjector Examples and tests: SVG Sprites + + + + + + + + + + diff --git a/tests/race-condition/index.html b/examples/race-condition.html similarity index 51% rename from tests/race-condition/index.html rename to examples/race-condition.html index 620524f..964acaf 100755 --- a/tests/race-condition/index.html +++ b/examples/race-condition.html @@ -31,19 +31,55 @@ // Call the same injection call lots of time to try and trigger a race condition var x = 0; + var injector = new SVGInjector(); + var doneCallback = function (totalSVGsInjected) { + console.log('[Stress Test] We injected ' + totalSVGsInjected + ' SVG(s)!'); + }; + + var eachCallback = function (svg) { + if (svg) { + console.log('[Stress Test] SVG injected: ' + svg.getAttribute('id')); + svg.setAttribute('style', 'fill:plum'); + } + }; + + var eachCallbackOne = function (svg) { + if (svg) { + console.log('[One] SVG injected: ' + svg.getAttribute('id')); + svg.setAttribute('style', 'fill:plum'); + } + }; + + var doneCallbackOne = function (totalSVGsInjected) { + console.log('[One] We injected ' + totalSVGsInjected + ' SVG(s)!'); + }; + + var eachCallbackTwo = function (svg) { + if (svg) { + console.log('[Two] SVG injected: ' + svg.getAttribute('id')); + svg.setAttribute('style', 'fill:wheat'); + } + }; + + var doneCallbackTwo = function (totalSVGsInjected) { + console.log('[Two] We injected ' + totalSVGsInjected + ' SVG(s)!'); + }; + + var eachCallbackThree = function (svg) { + if (svg) { + console.log('[Three] SVG injected: ' + svg.getAttribute('id')); + svg.setAttribute('style', 'fill:maroon'); + } + }; + + var doneCallbackThree = function (totalSVGsInjected) { + console.log('[Three] We injected ' + totalSVGsInjected + ' SVG(s)!'); + }; + while (x < 1000) { - SVGInjector(document.querySelectorAll('img.inject-me'), { - each: function (svg) { - // Callback after each SVG is injected - if (svg) { - console.log('[Stress Test] SVG injected: ' + svg.getAttribute('id')); - svg.setAttribute('style', 'fill:plum'); - } - } - }, function (totalSVGsInjected) { - // Callback after all SVGs are injected - console.log('[Stress Test] We injected ' + totalSVGsInjected + ' SVG(s)!'); - }); + injector.inject( + document.querySelectorAll('img.inject-me'), doneCallback, eachCallback + ); x++; } @@ -51,48 +87,27 @@ // Trigger an injection. // Inject all the SVGs a first time... should make them Plum colored - SVGInjector(document.querySelectorAll('img.inject-me-once, img.inject-me-twice, img.inject-me-three-times'), { - each: function (svg) { - // Callback after each SVG is injected - if (svg) { - console.log('[One] SVG injected: ' + svg.getAttribute('id')); - svg.setAttribute('style', 'fill:plum'); - } - } - }, function (totalSVGsInjected) { - // Callback after all SVGs are injected - console.log('[One] We injected ' + totalSVGsInjected + ' SVG(s)!'); - }); + injector.inject( + document.querySelectorAll('img.inject-me-once, img.inject-me-twice, img.inject-me-three-times'), + doneCallbackOne, + eachCallbackOne + ); // Trigger another injection of the second and third SVG in attempt to cause a race condition // These should not trigger since ideally the previous injection already did it (or is doing it) - SVGInjector(document.querySelectorAll('img.inject-me-twice, img.inject-me-three-times'), { - each: function (svg) { - // Callback after each SVG is injected - if (svg) { - console.log('[Two] SVG injected: ' + svg.getAttribute('id')); - svg.setAttribute('style', 'fill:wheat'); - } - } - }, function (totalSVGsInjected) { - // Callback after all SVGs are injected - console.log('[Two] We injected ' + totalSVGsInjected + ' SVG(s)!'); - }); + injector.inject( + document.querySelectorAll('img.inject-me-twice, img.inject-me-three-times'), + doneCallbackTwo, + eachCallbackTwo + ); // Trigger yet another injection of the third SVG in attempt to cause a race condition. // ...this too should be skipped - SVGInjector(document.querySelectorAll('img.inject-me-three-times'), { - each: function (svg) { - // Callback after each SVG is injected - if (svg) { - console.log('[Three] SVG injected: ' + svg.getAttribute('id')); - svg.setAttribute('style', 'fill:maroon'); - } - } - }, function (totalSVGsInjected) { - // Callback after all SVGs are injected - console.log('[Three] We injected ' + totalSVGsInjected + ' SVG(s)!'); - }); + injector.inject( + document.querySelectorAll('img.inject-me-three-times'), + doneCallbackThree, + eachCallbackThree + ); diff --git a/examples/simple.html b/examples/simple.html new file mode 100755 index 0000000..8a52e9f --- /dev/null +++ b/examples/simple.html @@ -0,0 +1,27 @@ + + + + SVGInjector Example: Simple + + + +

Simple

+ + + + + + + diff --git a/examples/simple/index.html b/examples/simple/index.html deleted file mode 100755 index 12846d0..0000000 --- a/examples/simple/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - SVGInjector Example: Simple - - - - - thumb - - - - - - diff --git a/examples/simple/svg-injector.min.js b/examples/simple/svg-injector.min.js deleted file mode 100755 index dcdb71e..0000000 --- a/examples/simple/svg-injector.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * SVGInjector v1.1.2 - Fast, caching, dynamic inline SVG DOM injection library - * https://github.com/iconic/SVGInjector - * - * Copyright (c) 2014 Waybury - * @license MIT - */ -!function(t,e){"use strict";function r(t){t=t.split(" ");for(var e={},r=t.length,n=[];r--;)e.hasOwnProperty(t[r])||(e[t[r]]=1,n.unshift(t[r]));return n.join(" ")}var n="file:"===t.location.protocol,i=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),o=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var r,n=this.length>>>0;for(r=0;n>r;++r)r in this&&t.call(e,this[r],r,this)},a={},s=0,l=[],u=[],c={},f=function(t){return t.cloneNode(!0)},p=function(t,e){u[t]=u[t]||[],u[t].push(e)},d=function(t){for(var e=0,r=u[t].length;r>e;e++)!function(e){setTimeout(function(){u[t][e](f(a[t]))},0)}(e)},h=function(e,r){if(void 0!==a[e])a[e]instanceof SVGSVGElement?r(f(a[e])):p(e,r);else{if(!t.XMLHttpRequest)return r("Browser does not support XMLHttpRequest"),!1;a[e]={},p(e,r);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return r("Unable to load SVG file: "+e),n&&r("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),r(),!1;if(!(200===i.status||n&&0===i.status))return r("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)a[e]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var t;try{var o=new DOMParser;t=o.parseFromString(i.responseText,"text/xml")}catch(s){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)return r("Unable to parse SVG file: "+e),!1;a[e]=t.documentElement}d(e)}},i.open("GET",e),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},v=function(e,n,a,u){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!/\.svg/i.test(f))return void u("Attempted to inject a file with a non-svg extension: "+f);if(!i){var p=e.getAttribute("data-fallback")||e.getAttribute("data-png");return void(p?(e.setAttribute("src",p),u(null)):a?(e.setAttribute("src",a+"/"+f.split("/").pop().replace(".svg",".png")),u(null)):u("This browser does not support SVG and no PNG fallback was defined."))}-1===l.indexOf(e)&&(l.push(e),e.setAttribute("src",""),h(f,function(i){if("undefined"==typeof i||"string"==typeof i)return u(i),!1;var a=e.getAttribute("id");a&&i.setAttribute("id",a);var p=e.getAttribute("title");p&&i.setAttribute("title",p);var d=[].concat(i.getAttribute("class")||[],"injected-svg",e.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(d));var h=e.getAttribute("style");h&&i.setAttribute("style",h);var v=[].filter.call(e.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});o.call(v,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});for(var g,b=i.querySelectorAll("defs clipPath[id]"),m=0,y=b.length;y>m;m++){g=b[m].id+"-"+s;for(var A=i.querySelectorAll('[clip-path*="'+b[m].id+'"]'),w=0,S=A.length;S>w;w++)A[w].setAttribute("clip-path","url(#"+g+")");b[m].id=g}for(var x,j=i.querySelectorAll("defs mask[id]"),T=0,G=j.length;G>T;T++){x=j[T].id+"-"+s;for(var M=i.querySelectorAll('[mask*="'+j[T].id+'"]'),V=0,q=M.length;q>V;V++)M[V].setAttribute("mask","url(#"+x+")");j[T].id=x}i.removeAttribute("xmlns:a");for(var k,E,O=i.querySelectorAll("script"),L=[],P=0,X=O.length;X>P;P++)E=O[P].getAttribute("type"),E&&"application/ecmascript"!==E&&"application/javascript"!==E||(k=O[P].innerText||O[P].textContent,L.push(k),i.removeChild(O[P]));if(L.length>0&&("always"===n||"once"===n&&!c[f])){for(var F=0,N=L.length;N>F;F++)new Function(L[F])(t);c[f]=!0}e.parentNode.replaceChild(i,e),delete l[l.indexOf(e)],e=null,s++,u(i)}))},g=function(t,e,r){e=e||{};var n=e.evalScripts||"always",i=e.pngFallback||!1,a=e.each;if(void 0!==t.length){var s=0;o.call(t,function(e){v(e,n,i,function(e){a&&"function"==typeof a&&a(e),r&&t.length===++s&&r(s)})})}else t?v(t,n,i,function(e){a&&"function"==typeof a&&a(e),r&&r(1),t=null}):r&&r(0)};"object"==typeof module&&"object"==typeof module.exports?module.exports=exports=g:"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof t&&(t.SVGInjector=g)}(window,document); -//# sourceMappingURL=svg-injector.map.js \ No newline at end of file diff --git a/examples/simple/thumb-up.svg b/examples/simple/thumb-up.svg deleted file mode 100755 index 2c936b6..0000000 --- a/examples/simple/thumb-up.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/examples/spritesheet-classbased.html b/examples/spritesheet-classbased.html new file mode 100755 index 0000000..c0f5ae5 --- /dev/null +++ b/examples/spritesheet-classbased.html @@ -0,0 +1,62 @@ + + + + + SVGInjector Example: SVG Sprites + + + +

Spritesheet Classbased

+
+ + +
+ +
+ + + +
+ +
+

+ +

+ +
+ + + + + diff --git a/examples/spritesheet.html b/examples/spritesheet.html new file mode 100644 index 0000000..298db1f --- /dev/null +++ b/examples/spritesheet.html @@ -0,0 +1,47 @@ + + + + + SVGInjector Example: SVG Sprites + + + +

Spritesheet

+ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..6a8002f --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3622 @@ +{ + "name": "svg-injector-2", + "version": "2.1.5", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", + "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.16.0" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.15.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", + "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", + "dev": true + }, + "@babel/highlight": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", + "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.15.7", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "@octokit/auth-token": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", + "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", + "dev": true, + "requires": { + "@octokit/types": "^6.0.3" + } + }, + "@octokit/core": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.5.1.tgz", + "integrity": "sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw==", + "dev": true, + "requires": { + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.0", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/endpoint": { + "version": "6.0.12", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", + "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", + "dev": true, + "requires": { + "@octokit/types": "^6.0.3", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/graphql": { + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", + "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", + "dev": true, + "requires": { + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/openapi-types": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", + "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==", + "dev": true + }, + "@octokit/plugin-paginate-rest": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz", + "integrity": "sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw==", + "dev": true, + "requires": { + "@octokit/types": "^6.34.0" + } + }, + "@octokit/plugin-request-log": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", + "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", + "dev": true + }, + "@octokit/plugin-rest-endpoint-methods": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz", + "integrity": "sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA==", + "dev": true, + "requires": { + "@octokit/types": "^6.34.0", + "deprecation": "^2.3.1" + } + }, + "@octokit/request": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.2.tgz", + "integrity": "sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA==", + "dev": true, + "requires": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.1", + "universal-user-agent": "^6.0.0" + } + }, + "@octokit/request-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", + "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "dev": true, + "requires": { + "@octokit/types": "^6.0.3", + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "18.12.0", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-18.12.0.tgz", + "integrity": "sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q==", + "dev": true, + "requires": { + "@octokit/core": "^3.5.1", + "@octokit/plugin-paginate-rest": "^2.16.8", + "@octokit/plugin-request-log": "^1.0.4", + "@octokit/plugin-rest-endpoint-methods": "^5.12.0" + } + }, + "@octokit/types": { + "version": "6.34.0", + "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", + "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", + "dev": true, + "requires": { + "@octokit/openapi-types": "^11.2.0" + } + }, + "abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true + }, + "accepts": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.4.tgz", + "integrity": "sha1-hiRnWMfdbSGmR0/whKR0DsBesh8=", + "dev": true, + "requires": { + "mime-types": "~2.1.16", + "negotiator": "0.6.1" + } + }, + "after": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/after/-/after-0.8.1.tgz", + "integrity": "sha1-q11PuIP1loFtNRX495HAr0ht1ic=", + "dev": true + }, + "ajv": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", + "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", + "dev": true, + "requires": { + "co": "^4.6.0", + "json-stable-stringify": "^1.0.1" + } + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "dev": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "application-config": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/application-config/-/application-config-2.0.0.tgz", + "integrity": "sha512-NC5/0guSZK3/UgUDfCk/riByXzqz0owL1L3r63JPSBzYk5QALrp3bLxbsR7qeSfvYfFmAhnp3dbqYsW3U9MpZQ==", + "dev": true, + "requires": { + "application-config-path": "^0.1.0", + "load-json-file": "^6.2.0", + "write-json-file": "^4.2.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "dev": true + }, + "load-json-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz", + "integrity": "sha512-gUD/epcRms75Cw8RT1pUdHugZYM5ce64ucs2GEISABwkRsOQr0q2wm/MV2TKThycIe5e0ytRweW2RZxclogCdQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "parse-json": "^5.0.0", + "strip-bom": "^4.0.0", + "type-fest": "^0.6.0" + } + }, + "parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true + } + } + }, + "application-config-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/application-config-path/-/application-config-path-0.1.0.tgz", + "integrity": "sha1-GTxfCoZUGkxm+6Hi3DhYM2LqXo8=", + "dev": true + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arraybuffer.slice": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.6.tgz", + "integrity": "sha1-8zshWfBTKj8xB6JywMz70a0peco=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "assert-plus": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", + "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", + "dev": true + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "dev": true + }, + "async-each-series": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/async-each-series/-/async-each-series-0.1.1.tgz", + "integrity": "sha1-dhfBkXQB/Yykooqtzj266Yr+tDI=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-arraybuffer": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", + "dev": true + }, + "base64id": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz", + "integrity": "sha1-As4P3u4M709ACA4ec+g08LG/zj8=", + "dev": true + }, + "batch": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/batch/-/batch-0.5.3.tgz", + "integrity": "sha1-PzQU84AyF0O/wQQvmoP/HVgk1GQ=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "before-after-hook": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", + "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==", + "dev": true + }, + "better-assert": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", + "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", + "dev": true, + "requires": { + "callsite": "1.0.0" + } + }, + "binary-extensions": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.10.0.tgz", + "integrity": "sha1-muuabF6IY4qtFx4Wf1kAq+JINdA=", + "dev": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "blob": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", + "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=", + "dev": true + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true + }, + "boom": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", + "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "browser-sync": { + "version": "2.18.13", + "resolved": "https://registry.npmjs.org/browser-sync/-/browser-sync-2.18.13.tgz", + "integrity": "sha512-qhdrmgshVGwweogT/bdOKkZDxVxqiF4+9mibaDeAxvDBeoUtdgABk5x7YQ1KCcLRchAfv8AVtp9NuITl5CTNqg==", + "dev": true, + "requires": { + "browser-sync-client": "2.5.1", + "browser-sync-ui": "0.6.3", + "bs-recipes": "1.3.4", + "chokidar": "1.7.0", + "connect": "3.5.0", + "dev-ip": "^1.0.1", + "easy-extender": "2.3.2", + "eazy-logger": "3.0.2", + "emitter-steward": "^1.0.0", + "fs-extra": "3.0.1", + "http-proxy": "1.15.2", + "immutable": "3.8.1", + "localtunnel": "1.8.3", + "micromatch": "2.3.11", + "opn": "4.0.2", + "portscanner": "2.1.1", + "qs": "6.2.1", + "resp-modifier": "6.0.2", + "rx": "4.1.0", + "serve-index": "1.8.0", + "serve-static": "1.12.2", + "server-destroy": "1.0.1", + "socket.io": "1.6.0", + "socket.io-client": "1.6.0", + "ua-parser-js": "0.7.12", + "yargs": "6.4.0" + } + }, + "browser-sync-client": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/browser-sync-client/-/browser-sync-client-2.5.1.tgz", + "integrity": "sha1-7BrWmknC4tS2RbGLHAbCmz2a+Os=", + "dev": true, + "requires": { + "etag": "^1.7.0", + "fresh": "^0.3.0" + } + }, + "browser-sync-ui": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/browser-sync-ui/-/browser-sync-ui-0.6.3.tgz", + "integrity": "sha1-ZApTfBgGiTA9W+krxHa568RBwLw=", + "dev": true, + "requires": { + "async-each-series": "0.1.1", + "connect-history-api-fallback": "^1.1.0", + "immutable": "^3.7.6", + "server-destroy": "1.0.1", + "stream-throttle": "^0.1.3", + "weinre": "^2.0.0-pre-I0Z7U9OV" + } + }, + "bs-recipes": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/bs-recipes/-/bs-recipes-1.3.4.tgz", + "integrity": "sha1-DS1NSKcYyMBEdp/cT4lZLci2lYU=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", + "dev": true + }, + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "requires": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "dev": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "cli": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz", + "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=", + "dev": true, + "requires": { + "exit": "0.1.2", + "glob": "^7.1.1" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-spinners": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "dev": true + }, + "cliui": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", + "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" + } + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/colors/-/colors-0.5.1.tgz", + "integrity": "sha1-fQAj6usVTo7p/Oddy5I9DtFmd3Q=", + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "integrity": "sha1-k4NwpXtKUd6ix3wV1cX9+JUWQAk=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "component-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", + "dev": true + }, + "component-emitter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.1.2.tgz", + "integrity": "sha1-KWWU8nU9qmOZbSrwjRWpURbJrsM=", + "dev": true + }, + "component-inherit": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "connect": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.5.0.tgz", + "integrity": "sha1-s1dSWgtMH1BZnNmD4dnv7qlncZg=", + "dev": true, + "requires": { + "debug": "~2.2.0", + "finalhandler": "0.5.0", + "parseurl": "~1.3.1", + "utils-merge": "1.0.0" + } + }, + "connect-history-api-fallback": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/connect-history-api-fallback/-/connect-history-api-fallback-1.3.0.tgz", + "integrity": "sha1-5R0X+PDvDbkKZP20feMFFVbp8Wk=", + "dev": true + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", + "dev": true, + "requires": { + "boom": "2.x.x" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "dev": true, + "requires": { + "ms": "0.7.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "depd": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz", + "integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k=", + "dev": true + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==", + "dev": true + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=", + "dev": true + }, + "detect-indent": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", + "integrity": "sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==", + "dev": true + }, + "dev-ip": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dev-ip/-/dev-ip-1.0.1.tgz", + "integrity": "sha1-p2o+0YVb56ASu4rBbLgPPADcKPA=", + "dev": true + }, + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "~1.1.1", + "entities": "~1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + } + } + }, + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", + "dev": true + }, + "domhandler": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz", + "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=", + "dev": true, + "requires": { + "domelementtype": "1" + } + }, + "domutils": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", + "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=", + "dev": true, + "requires": { + "dom-serializer": "0", + "domelementtype": "1" + } + }, + "easy-extender": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.2.tgz", + "integrity": "sha1-PTJI/r4rFZYHMW2PnPSRwWZIIh0=", + "dev": true, + "requires": { + "lodash": "^3.10.1" + } + }, + "eazy-logger": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/eazy-logger/-/eazy-logger-3.0.2.tgz", + "integrity": "sha1-oyWqXlPROiIliJsqxBE7K5Y29Pw=", + "dev": true, + "requires": { + "tfunk": "^3.0.1" + } + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=", + "dev": true + }, + "emitter-steward": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/emitter-steward/-/emitter-steward-1.0.0.tgz", + "integrity": "sha1-80Ea3pdYp1Zd+Eiy2gy70bRsvWQ=", + "dev": true + }, + "encodeurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.1.tgz", + "integrity": "sha1-eePVhlU0aQn+bw9Fpd5oEDspTSA=", + "dev": true + }, + "engine.io": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-1.8.0.tgz", + "integrity": "sha1-PutfJky3XbvsG6rqJtYfWk6s4qo=", + "dev": true, + "requires": { + "accepts": "1.3.3", + "base64id": "0.1.0", + "cookie": "0.3.1", + "debug": "2.3.3", + "engine.io-parser": "1.3.1", + "ws": "1.1.1" + }, + "dependencies": { + "accepts": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.3.tgz", + "integrity": "sha1-w8p0NJOGSMPg2cHjKN1otiLChMo=", + "dev": true, + "requires": { + "mime-types": "~2.1.11", + "negotiator": "0.6.1" + } + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "engine.io-client": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-1.8.0.tgz", + "integrity": "sha1-e3MOQSdBQIdZbZvjyI0rxf22z1w=", + "dev": true, + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "2.3.3", + "engine.io-parser": "1.3.1", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parsejson": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "1.1.1", + "xmlhttprequest-ssl": "1.5.3", + "yeast": "0.1.2" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "engine.io-parser": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-1.3.1.tgz", + "integrity": "sha1-lVTxrjMQfW+9FwylRm0vgz9qB88=", + "dev": true, + "requires": { + "after": "0.8.1", + "arraybuffer.slice": "0.0.6", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.4", + "has-binary": "0.1.6", + "wtf-8": "1.0.0" + }, + "dependencies": { + "has-binary": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.6.tgz", + "integrity": "sha1-JTJvOc+k9hath4eJTjryz7x7bhA=", + "dev": true, + "requires": { + "isarray": "0.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "entities": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz", + "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "dev": true + }, + "eventemitter3": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha1-HIaZHYFq0eUEdQ5zh0Ik7PO+xQg=", + "dev": true + }, + "exec-sh": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", + "integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "dev": true, + "requires": { + "merge": "^1.1.3" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "express": { + "version": "2.5.11", + "resolved": "https://registry.npmjs.org/express/-/express-2.5.11.tgz", + "integrity": "sha1-TOjqHzY15p5J8Ou0l7aksKUc5vA=", + "dev": true, + "requires": { + "connect": "1.x", + "mime": "1.2.4", + "mkdirp": "0.3.0", + "qs": "0.4.x" + }, + "dependencies": { + "connect": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/connect/-/connect-1.9.2.tgz", + "integrity": "sha1-QogKIulDiuWait105Df1iujlKAc=", + "dev": true, + "requires": { + "formidable": "1.0.x", + "mime": ">= 0.0.1", + "qs": ">= 0.4.0" + } + }, + "qs": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.4.2.tgz", + "integrity": "sha1-PKxMhh43GoycR3CsI82o3mObjl8=", + "dev": true + } + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^1.1.3", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "finalhandler": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.5.0.tgz", + "integrity": "sha1-6VCKvs6bbbqHGmlCodeRG5GRGsc=", + "dev": true, + "requires": { + "debug": "~2.2.0", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "statuses": "~1.3.0", + "unpipe": "~1.0.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", + "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.0.17", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.17.tgz", + "integrity": "sha1-71SRSQ+UM7cF+qdyScmQKa40hVk=", + "dev": true + }, + "fresh": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.3.0.tgz", + "integrity": "sha1-ZR+DjiJCTnVm3hYdg1jKoZn4PU8=", + "dev": true + }, + "fs-extra": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", + "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^3.0.0", + "universalify": "^0.1.0" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "ghauth": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ghauth/-/ghauth-5.0.1.tgz", + "integrity": "sha512-WzgL12dczZX/VrvVTkoFAJLU3pb6PDT+TS60kLlaU51fuNEv6VoYpRXlnwIjkMIhqWead9+dLBEzj0E1ghYMkg==", + "dev": true, + "requires": { + "application-config": "^2.0.0", + "node-fetch": "^2.6.0", + "ora": "^4.0.5", + "read": "^1.0.7" + } + }, + "github-changes": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/github-changes/-/github-changes-2.0.3.tgz", + "integrity": "sha512-GWsas6RcQhuevU3reOAcLedwG3quEPhAcfNyL0Uqz/3qJjhey5S3grtOCVJaKDCxEsE3vgAq4niDYh7mFQ2rnw==", + "dev": true, + "requires": { + "@octokit/rest": "^18.0.12", + "bluebird": "^3.5.4", + "commander": "^6.2.1", + "ghauth": "^5.0.0", + "lodash": "^4.17.11", + "moment-timezone": "^0.5.23", + "semver": "^6.0.0" + }, + "dependencies": { + "commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", + "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", + "dev": true + }, + "har-validator": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", + "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", + "dev": true, + "requires": { + "ajv": "^4.9.1", + "har-schema": "^1.0.5" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-binary": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-binary/-/has-binary-0.1.7.tgz", + "integrity": "sha1-aOYesWIQyVRaClzOBqhzkS/h5ow=", + "dev": true, + "requires": { + "isarray": "0.0.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "has-cors": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "hawk": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", + "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", + "dev": true, + "requires": { + "boom": "2.x.x", + "cryptiles": "2.x.x", + "hoek": "2.x.x", + "sntp": "1.x.x" + } + }, + "hoek": { + "version": "2.16.3", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", + "dev": true + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "htmlparser2": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz", + "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=", + "dev": true, + "requires": { + "domelementtype": "1", + "domhandler": "2.3", + "domutils": "1.5", + "entities": "1.0", + "readable-stream": "1.1" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "http-errors": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.5.1.tgz", + "integrity": "sha1-eIwNLB3iyBuebowBhDtrl+uSB1A=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "setprototypeof": "1.0.2", + "statuses": ">= 1.3.1 < 2" + } + }, + "http-proxy": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.15.2.tgz", + "integrity": "sha1-ZC/cr/5S00SNK9o7AHnpQJBk2jE=", + "dev": true, + "requires": { + "eventemitter3": "1.x.x", + "requires-port": "1.x.x" + } + }, + "http-signature": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", + "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", + "dev": true, + "requires": { + "assert-plus": "^0.2.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "immutable": { + "version": "3.8.1", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-3.8.1.tgz", + "integrity": "sha1-IAgH8Rqw9ycQ6khVQt4IgHX2jNI=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "^1.0.0" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-number-like": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/is-number-like/-/is-number-like-1.0.8.tgz", + "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", + "dev": true, + "requires": { + "lodash.isfinite": "^3.3.2" + } + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true + }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "dev": true + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "jshint": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz", + "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=", + "dev": true, + "requires": { + "cli": "~1.0.0", + "console-browserify": "1.1.x", + "exit": "0.1.x", + "htmlparser2": "3.8.x", + "lodash": "3.7.x", + "minimatch": "~3.0.2", + "shelljs": "0.3.x", + "strip-json-comments": "1.0.x" + }, + "dependencies": { + "lodash": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz", + "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=", + "dev": true + } + } + }, + "json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "~0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json3": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", + "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", + "dev": true + }, + "jsonfile": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", + "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "dev": true, + "requires": { + "invert-kv": "^1.0.0" + } + }, + "limiter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/limiter/-/limiter-1.1.2.tgz", + "integrity": "sha512-JIKZ0xb6fZZYa3deZ0BgXCgX6HgV8Nx3mFGeFHmFWW8Fb2c08e0CyE+G3nalpD0xGvGssjGb1UdFr+PprxZEbw==", + "dev": true + }, + "lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" + } + }, + "localtunnel": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/localtunnel/-/localtunnel-1.8.3.tgz", + "integrity": "sha1-3MWSL9hWUQN9S94k/ZMkjQsk6wU=", + "dev": true, + "requires": { + "debug": "2.6.8", + "openurl": "1.1.1", + "request": "2.81.0", + "yargs": "3.29.0" + }, + "dependencies": { + "debug": { + "version": "2.6.8", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", + "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "yargs": { + "version": "3.29.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", + "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", + "dev": true, + "requires": { + "camelcase": "^1.2.1", + "cliui": "^3.0.3", + "decamelize": "^1.0.0", + "os-locale": "^1.4.0", + "window-size": "^0.1.2", + "y18n": "^3.2.0" + } + } + } + }, + "lodash": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz", + "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=", + "dev": true + }, + "lodash.isfinite": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz", + "integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M=", + "dev": true + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "merge": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.0.tgz", + "integrity": "sha1-dTHjnUlJwoGma4xabgJl6LBYlNo=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "mime": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.4.tgz", + "integrity": "sha1-EbX9rynCUJJVF2uArVIClPXekrc=", + "dev": true + }, + "mime-db": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.30.0.tgz", + "integrity": "sha1-dMZD2i3Z1qRTmZY0ZbJtXKfXHwE=", + "dev": true + }, + "mime-types": { + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.17.tgz", + "integrity": "sha1-Cdejk/A+mVp5+K+Fe3Cp4KsWVXo=", + "dev": true, + "requires": { + "mime-db": "~1.30.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "mkdirp": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.0.tgz", + "integrity": "sha1-G79asbqCevI1dRQ0kEJkVfSB/h4=", + "dev": true + }, + "moment": { + "version": "2.29.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz", + "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==", + "dev": true + }, + "moment-timezone": { + "version": "0.5.34", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.34.tgz", + "integrity": "sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==", + "dev": true, + "requires": { + "moment": ">= 2.9.0" + } + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, + "nan": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", + "dev": true, + "optional": true + }, + "negotiator": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz", + "integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk=", + "dev": true + }, + "node-fetch": { + "version": "2.6.6", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz", + "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==", + "dev": true, + "requires": { + "whatwg-url": "^5.0.0" + } + }, + "nomnom": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.6.2.tgz", + "integrity": "sha1-hKZqJgF0QI/Ft3oY+IjszET7aXE=", + "dev": true, + "requires": { + "colors": "0.5.x", + "underscore": "~1.4.4" + }, + "dependencies": { + "underscore": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.4.4.tgz", + "integrity": "sha1-YaajIBBiKvoHljvzJSA88SI51gQ=", + "dev": true + } + } + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-component": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", + "dev": true + }, + "object-path": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.9.2.tgz", + "integrity": "sha1-D9mnT8X60a45aLWGvaXGMr1sBaU=", + "dev": true + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "dev": true, + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "openurl": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz", + "integrity": "sha1-OHW0sO96UsFW8NtB1GCduw+Us4c=", + "dev": true + }, + "opn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/opn/-/opn-4.0.2.tgz", + "integrity": "sha1-erwi5kTf9jsKltWrfyeQwPAavJU=", + "dev": true, + "requires": { + "object-assign": "^4.0.1", + "pinkie-promise": "^2.0.0" + } + }, + "options": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/options/-/options-0.0.6.tgz", + "integrity": "sha1-7CLTEoBrtT5zF3Pnza788cZDEo8=", + "dev": true + }, + "ora": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.1.1.tgz", + "integrity": "sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A==", + "dev": true, + "requires": { + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.2.0", + "is-interactive": "^1.0.0", + "log-symbols": "^3.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "os-locale": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", + "dev": true, + "requires": { + "lcid": "^1.0.0" + } + }, + "parallelshell": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/parallelshell/-/parallelshell-3.0.1.tgz", + "integrity": "sha512-xsSQGhJTFjbSW3WGsnSFTg1G17dcDU+gMH7bWxjAiy/3H579KPFbSp3fhkZ+jx2wcZuoav46nq+QVX0I0xPcyA==", + "dev": true + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "^1.2.0" + } + }, + "parsejson": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", + "integrity": "sha1-q343WfIJ7OmUN5c/fQ8fZK4OZKs=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseqs": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", + "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseuri": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", + "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", + "dev": true, + "requires": { + "better-assert": "~1.0.0" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "^2.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + } + }, + "performance-now": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", + "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "portscanner": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/portscanner/-/portscanner-2.1.1.tgz", + "integrity": "sha1-6rtAnk3iSVD1oqUW01rnaTQ/u5Y=", + "dev": true, + "requires": { + "async": "1.5.2", + "is-number-like": "^1.0.3" + } + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz", + "integrity": "sha1-zgPF/wk1vB2daanxTL0Y5WjWdiU=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "range-parser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz", + "integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4=", + "dev": true + }, + "read": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=", + "dev": true, + "requires": { + "mute-stream": "~0.0.4" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.0.3", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "replace": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/replace/-/replace-0.3.0.tgz", + "integrity": "sha1-YAgXIRiGWFlatqeU63/ty0yNOcc=", + "dev": true, + "requires": { + "colors": "0.5.x", + "minimatch": "~0.2.9", + "nomnom": "1.6.x" + }, + "dependencies": { + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2", + "sigmund": "~1.0.0" + } + } + } + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" + }, + "dependencies": { + "qs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", + "dev": true + }, + "resp-modifier": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/resp-modifier/-/resp-modifier-6.0.2.tgz", + "integrity": "sha1-sSTeXE+6/LpUH0j/pzlw9KpFa08=", + "dev": true, + "requires": { + "debug": "^2.2.0", + "minimatch": "^3.0.2" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "requires": { + "align-text": "^0.1.1" + } + }, + "rx": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/rx/-/rx-4.1.0.tgz", + "integrity": "sha1-pfE/957zt0D+MKqAP7CfmIBdR4I=", + "dev": true + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + }, + "send": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.15.2.tgz", + "integrity": "sha1-+R+rRAO8+H5xb3DOtdsvV4vcF9Y=", + "dev": true, + "requires": { + "debug": "2.6.4", + "depd": "~1.1.0", + "destroy": "~1.0.4", + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "etag": "~1.8.0", + "fresh": "0.5.0", + "http-errors": "~1.6.1", + "mime": "1.3.4", + "ms": "1.0.0", + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.3.1" + }, + "dependencies": { + "debug": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.4.tgz", + "integrity": "sha1-dYaps8OXQcAoKuM0RcTorHRzT+A=", + "dev": true, + "requires": { + "ms": "0.7.3" + }, + "dependencies": { + "ms": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.3.tgz", + "integrity": "sha1-cIFVpeROM/X9D8U+gdDUCpG+H/8=", + "dev": true + } + } + }, + "fresh": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.0.tgz", + "integrity": "sha1-9HTKXmqSRtb9jglTz6m5yAWvp44=", + "dev": true + }, + "http-errors": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz", + "integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=", + "dev": true, + "requires": { + "depd": "1.1.1", + "inherits": "2.0.3", + "setprototypeof": "1.0.3", + "statuses": ">= 1.3.1 < 2" + } + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=", + "dev": true + }, + "ms": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-1.0.0.tgz", + "integrity": "sha1-Wa3NIu3FQ/e1OBhi0xOHsfS8lHM=", + "dev": true + }, + "setprototypeof": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", + "integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ=", + "dev": true + } + } + }, + "serve-index": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.8.0.tgz", + "integrity": "sha1-fF2WwT+xMRAfk8HFd0+FFqHnjTs=", + "dev": true, + "requires": { + "accepts": "~1.3.3", + "batch": "0.5.3", + "debug": "~2.2.0", + "escape-html": "~1.0.3", + "http-errors": "~1.5.0", + "mime-types": "~2.1.11", + "parseurl": "~1.3.1" + } + }, + "serve-static": { + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.12.2.tgz", + "integrity": "sha1-5UbicmCBuBtLzsjpCAjrzdMjr7o=", + "dev": true, + "requires": { + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "parseurl": "~1.3.1", + "send": "0.15.2" + } + }, + "server-destroy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", + "dev": true + }, + "setprototypeof": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.2.tgz", + "integrity": "sha1-gaVSFB7BBLiOic44MQOtXGZWTQg=", + "dev": true + }, + "shelljs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz", + "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=", + "dev": true + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "signal-exit": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", + "dev": true + }, + "sntp": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", + "dev": true, + "requires": { + "hoek": "2.x.x" + } + }, + "socket.io": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-1.6.0.tgz", + "integrity": "sha1-PkDZMmN+a9kjmBslyvfFPoO24uE=", + "dev": true, + "requires": { + "debug": "2.3.3", + "engine.io": "1.8.0", + "has-binary": "0.1.7", + "object-assign": "4.1.0", + "socket.io-adapter": "0.5.0", + "socket.io-client": "1.6.0", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + }, + "object-assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "integrity": "sha1-ejs9DpgGPUP0wD8uiubNUahog6A=", + "dev": true + } + } + }, + "socket.io-adapter": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-0.5.0.tgz", + "integrity": "sha1-y21LuL7IHhB4uZZ3+c7QBGBmu4s=", + "dev": true, + "requires": { + "debug": "2.3.3", + "socket.io-parser": "2.3.1" + }, + "dependencies": { + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "socket.io-client": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-1.6.0.tgz", + "integrity": "sha1-W2aPT3cTBN/u0XkGRwg4b6ZxeFM=", + "dev": true, + "requires": { + "backo2": "1.0.2", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "2.3.3", + "engine.io-client": "1.8.0", + "has-binary": "0.1.7", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseuri": "0.0.5", + "socket.io-parser": "2.3.1", + "to-array": "0.1.4" + }, + "dependencies": { + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "dev": true + }, + "debug": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.3.3.tgz", + "integrity": "sha1-QMRT5n5uE8kB3ewxeviYbNqe/4w=", + "dev": true, + "requires": { + "ms": "0.7.2" + } + }, + "ms": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.2.tgz", + "integrity": "sha1-riXPJRKziFodldfwN4aNhDESR2U=", + "dev": true + } + } + }, + "socket.io-parser": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-2.3.1.tgz", + "integrity": "sha1-3VMgJRA85Clpcya+/WQAX8/ltKA=", + "dev": true, + "requires": { + "component-emitter": "1.1.2", + "debug": "2.2.0", + "isarray": "0.0.1", + "json3": "3.3.2" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "sort-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/sort-keys/-/sort-keys-4.2.0.tgz", + "integrity": "sha512-aUYIEU/UviqPgc8mHR6IW1EGxkAXpeRETYcrzg8cLAvUPZcpAlleSXHV2mY7G12GphSH6Gzv+4MMVSSkbdteHg==", + "dev": true, + "requires": { + "is-plain-obj": "^2.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "^1.0.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "statuses": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", + "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=", + "dev": true + }, + "stream-throttle": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/stream-throttle/-/stream-throttle-0.1.3.tgz", + "integrity": "sha1-rdV8jXzHOoFjDTHNVdOWHPr7qcM=", + "dev": true, + "requires": { + "commander": "^2.2.0", + "limiter": "^1.0.5" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "^0.2.0" + } + }, + "strip-json-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz", + "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=", + "dev": true + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "tfunk": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/tfunk/-/tfunk-3.1.0.tgz", + "integrity": "sha1-OORBT8ZJd9h6/apy+sttKfgve1s=", + "dev": true, + "requires": { + "chalk": "^1.1.1", + "object-path": "^0.9.0" + } + }, + "to-array": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", + "dev": true + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "dev": true, + "requires": { + "punycode": "^1.4.1" + } + }, + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "ua-parser-js": { + "version": "0.7.12", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.12.tgz", + "integrity": "sha1-BMgamb3V3FImPqKdJMa/jUgYpLs=", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "requires": { + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" + }, + "dependencies": { + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "requires": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "requires": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + } + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "ultron": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.0.2.tgz", + "integrity": "sha1-rOEWq1V80Zc4ak6I9GhTeMiy5Po=", + "dev": true + }, + "underscore": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.7.0.tgz", + "integrity": "sha1-a7rwh3UA02vjTsqlhODbn+8DUgk=", + "dev": true + }, + "universal-user-agent": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", + "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==", + "dev": true + }, + "universalify": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", + "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utils-merge": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.0.tgz", + "integrity": "sha1-ApT7kiu5N1FTVBxPcJYjHyh8ivg=", + "dev": true + }, + "uuid": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.1.0.tgz", + "integrity": "sha512-DIWtzUkw04M4k3bf1IcpS2tngXEL26YUD2M0tMDUpnUrz2hgzUBlD55a4FjdLGPvfHxS6uluGWvaVEqgBcVa+g==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "~1.0.0", + "spdx-expression-parse": "~1.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + } + } + }, + "watch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/watch/-/watch-1.0.2.tgz", + "integrity": "sha1-NApxe952Vyb6CqB9ch4BR6VR3ww=", + "dev": true, + "requires": { + "exec-sh": "^0.2.0", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=", + "dev": true + }, + "weinre": { + "version": "2.0.0-pre-I0Z7U9OV", + "resolved": "https://registry.npmjs.org/weinre/-/weinre-2.0.0-pre-I0Z7U9OV.tgz", + "integrity": "sha1-/viqIjkh97QLu71MPtQwL2/QqBM=", + "dev": true, + "requires": { + "express": "2.5.x", + "nopt": "3.0.x", + "underscore": "1.7.x" + } + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "which-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", + "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "dev": true + }, + "window-size": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.4.tgz", + "integrity": "sha1-+OGqHuWlPsW/FR/6CXQqatdpeHY=", + "dev": true + }, + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "write-json-file": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/write-json-file/-/write-json-file-4.3.0.tgz", + "integrity": "sha512-PxiShnxf0IlnQuMYOPPhPkhExoCQuTUNPOa/2JWCYTmBquU9njyyDuwRKN26IZBlp4yn1nt+Agh2HOOBl+55HQ==", + "dev": true, + "requires": { + "detect-indent": "^6.0.0", + "graceful-fs": "^4.1.15", + "is-plain-obj": "^2.0.0", + "make-dir": "^3.0.0", + "sort-keys": "^4.0.0", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==", + "dev": true + } + } + }, + "ws": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-1.1.1.tgz", + "integrity": "sha1-CC3bbGQehdS7RR8D1S8G6r2x8Bg=", + "dev": true, + "requires": { + "options": ">=0.0.5", + "ultron": "1.0.x" + } + }, + "wtf-8": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wtf-8/-/wtf-8-1.0.0.tgz", + "integrity": "sha1-OS2LotDxw00e4tYw8V0O+2jhBIo=", + "dev": true + }, + "xmlhttprequest-ssl": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", + "integrity": "sha1-GFqIjATspGw+QHDZn3tJ3jUomS0=", + "dev": true + }, + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "dev": true + }, + "yargs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.4.0.tgz", + "integrity": "sha1-gW4ahm1VmMzzTlWW3c4i2S2kkNQ=", + "dev": true, + "requires": { + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.1.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + }, + "window-size": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz", + "integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz", + "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", + "dev": true, + "requires": { + "camelcase": "^3.0.0" + }, + "dependencies": { + "camelcase": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", + "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "dev": true + } + } + }, + "yeast": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", + "dev": true + } + } +} diff --git a/package.json b/package.json old mode 100644 new mode 100755 index da54164..53868a1 --- a/package.json +++ b/package.json @@ -1,17 +1,24 @@ { - "name": "svg-injector", - "description": "Fast, caching, dynamic inline SVG DOM injection library", - "version": "1.1.3-RC", - "author": { - "name": "Iconic", - "email": "yourfriends@useiconic.com", - "url": "https://useiconic.com/" - }, - "main": "svg-injector.js", - "homepage": "https://github.com/iconic/SVGInjector", + "name": "svg-injector-2", + "description": "forked version of iconic/SVGInjector, extended by the ability to use spritesheets and support for angularjs", + "version": "2.1.5", + "author": "", + "contributors": [ + { + "name": "Iconic", + "email": "yourfriends@useiconic.com", + "url": "https://useiconic.com/" + }, + { + "name": "Florian Bacher", + "email": "flo@digital-fuse.net" + } + ], + "main": "dist/svg-injector.min.js", + "homepage": "https://github.com/flobacher/SVGInjector2", "repository": { "type": "git", - "url": "https://github.com/iconic/SVGInjector" + "url": "https://github.com/flobacher/SVGInjector2.git" }, "keywords": [ "SVG", @@ -24,17 +31,32 @@ ], "license": "MIT", "devDependencies": { + "browser-sync": "^2.18.6", + "github-changes": "^2.0.3", "jshint": "^2.5.0", + "parallelshell": "^3.0.1", + "replace": "^0.3.0", "uglify-js": "^2.4.13", - "github-changes": "0.0.11" + "watch": "^1.0.1" }, "scripts": { - "test": "jshint svg-injector.js", - "build": "uglifyjs ./svg-injector.js --stats --compress --mangle --comments --output ./svg-injector.min.js --source-map svg-injector.map.js && mv -f svg-injector.{map,min}.js ./dist", - "changelog": "github-changes -o iconic -r SVGInjector --use-commit-body", - "changelog-post": "git add CHANGELOG.md && git commit -m 'Updated CHANGELOG'", - "release": "for TASK in (test build changelog changelog-post tag); do npm run $TASK; done", - "tag": "git tag ${npm_package_version} && git push --tags", - "test-version": "bash -c 'echo $npm_package_version'" + "// - end-user scripts ------- ": "", + "start": "parallelshell \"npm run browser-sync\" \"npm run watch\"", + "?release": "increase the version, triggers the version script and commits with the version as message", + "release": "npm version patch", + "push": "npm publish", + "// -------------------------": "", + "// - internal scripts ------": "", + "update-version-comment": "replace '\\$\\{VERSION\\}' $npm_package_version svg-injector.js ./dist/svg-injector.min.js", + "test": "jshint ./src/svg-injector.js", + "copy": "uglifyjs ./src/svg-injector.js -b --comments --output svg-injector.js", + "minify": "uglifyjs ./src/svg-injector.js --stats --compress drop_console=true --mangle --comments --output ./dist/svg-injector.min.js --source-map ./dist/svg-injector.map.js --source-map-include-sources", + "build": "npm run copy && npm run minify && npm run update-version-comment", + "watch": "watch \"npm run build\" ./src", + "changelog": "github-changes -o flobacher -r SVGInjector2 --use-commit-body --auth", + "add": "git add .", + "version": "npm run changelog && npm run test && npm run build && npm run add", + "prepush": "git push && git push --tags", + "browser-sync": "browser-sync start -s . -f ./dist/*.js --index --directory --startPath ./examples/index.html" } } diff --git a/src/svg-injector.js b/src/svg-injector.js new file mode 100755 index 0000000..edaf48b --- /dev/null +++ b/src/svg-injector.js @@ -0,0 +1,1160 @@ +/*! + * SVGInjector v${VERSION} - Fast, caching, dynamic inline SVG DOM injection library + * https://github.com/flobacher/SVGInjector2 + * forked from: + * https://github.com/iconic/SVGInjector + * + * Copyright (c) 2015 flobacher + * @license MIT + * + * original Copyright (c) 2014 Waybury + * @license MIT + */ +(function(window, document) { + 'use strict'; + /** + * SVGInjector + * + * Replace the given elements with their full inline SVG DOM elements. + * + * :NOTE: We are using get/setAttribute with SVG because the SVG DOM spec differs from HTML DOM and + * can return other unexpected object types when trying to directly access svg properties. + * ex: "className" returns a SVGAnimatedString with the class value found in the "baseVal" property, + * instead of simple string like with HTML Elements. + */ + var SVGInjector = (function () { + + + /** + * Constructor Function + * @param {object} options + */ + function SVGInjector (options) { + SVGInjector.instanceCounter++; + this.init(options); + } + + // - private constants ----------------------------------------- + var SVG_NS = 'http://www.w3.org/2000/svg'; + var XLINK_NS = 'http://www.w3.org/1999/xlink'; + var DEFAULT_SPRITE_CLASS_NAME = 'sprite'; + var DEFAULT_SPRITE_CLASS_ID_NAME = DEFAULT_SPRITE_CLASS_NAME + '--'; + var DEFAULT_FALLBACK_CLASS_NAMES = [DEFAULT_SPRITE_CLASS_NAME]; + var DEFAULT_REMOVESTYLES_CLASS_NAME = 'icon'; + + // - private member vars --------------------------------------- + var svgCache; + var injections; + var requestQueue; + var ranScripts; + var config; + var env; + + // - private member funcs -------------------------------------- + var + setFallbackClassNames, + removeFallbackClassNames, + suffixIdReferences, + suffixIdReferencesInStyles, + copyAttributes, + cloneSymbolAsSVG, + doPrefixStyleTags, + getClassList, + getSpriteIdFromClass, + cloneSvg, + queueRequest, + processRequestQueue, + loadSvg, + writeDefaultClass, + replaceNoSVGClass, + onLoadSVG, + uniqueClasses, + isFunction, + isArray, + svgElemSetClassName, + forEach, + setRootLevelElem, + addRootLevelElem, + injectElement + ; + + + + requestQueue = []; + + // - static vars ----------------------------------------------- + SVGInjector.instanceCounter = 0; + + // - public member vars ---------------------------------------- + //SVGInjector.prototype.varName = {}; + + + + // - public member functions --------------------------------------- + /** + * @param {object} options + */ + SVGInjector.prototype.init = function(options) { + options = options || {}; + svgCache = {}; + env = {}; + env.isLocal = window.location.protocol === 'file:'; + env.hasSvgSupport = document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1'); + + injections = { + count: 0, + elements: [] + }; + + ranScripts = {}; + config = {}; + + // Should we run the scripts blocks found in the SVG + // 'always' - Run them every time + // 'once' - Only run scripts once for each SVG + // [false|'never'] - Ignore scripts + config.evalScripts = options.evalScripts || 'always'; + + // Location of fallback pngs, if desired + config.pngFallback = options.pngFallback || false; + + // Location of fallback svgs, if desired + config.svgFallbackDir = options.svgFallbackDir || false; + + // Only inject the part of the svg, that is specified + // as visible through the id of an SVGViewElement + // is default mode + config.onlyInjectVisiblePart = options.onlyInjectVisiblePart || true; + + config.keepStylesClass = (typeof options.keepStylesClass === 'undefined') ? + '' : options.keepStylesClass; + + config.spriteClassName = (typeof options.spriteClassName === 'undefined') ? + DEFAULT_SPRITE_CLASS_NAME : options.spriteClassName; + + config.spriteClassIdName = (typeof options.spriteClassIdName === 'undefined') ? + DEFAULT_SPRITE_CLASS_ID_NAME : options.spriteClassIdName; + + config.removeStylesClass = (typeof options.removeStylesClass === 'undefined') ? + DEFAULT_REMOVESTYLES_CLASS_NAME : options.removeStylesClass; + + config.removeAllStyles = (typeof options.removeAllStyles === 'undefined') ? + false : options.removeAllStyles; + + config.fallbackClassName = (typeof options.fallbackClassName === 'undefined') ? + DEFAULT_FALLBACK_CLASS_NAMES : options.fallbackClassName; + + config.prefixStyleTags = (typeof options.prefixStyleTags === 'undefined') ? + true : options.prefixStyleTags; + + config.spritesheetURL = (typeof options.spritesheetURL === 'undefined' || options.spritesheetURL === '') ? + false : options.spritesheetURL; + + config.prefixFragIdClass = config.spriteClassIdName; + + config.forceFallbacks = (typeof options.forceFallbacks === 'undefined') ? + false : options.forceFallbacks; + + if (config.forceFallbacks){ + env.hasSvgSupport = false; + } + + replaceNoSVGClass(document.querySelector('html'), 'no-svg', env.hasSvgSupport); + + if (env.hasSvgSupport && typeof options.removeStylesClass === 'undefined' ){ // user does not want to use his own custom class -> write this style tag + writeDefaultClass(config.removeStylesClass); + } + }; + + /** + * Inject 1+ elements + * @param {elements} Array of or single DOM element + * @param {function} onDoneCallback + * @param {function} eachCallback + */ + SVGInjector.prototype.inject = function(elements, onDoneCallback, eachCallback) { + if (elements.length !== undefined) { + if (0 === elements.length) { + if (onDoneCallback) onDoneCallback(0); + } + else { + var elementsLoaded = 0; + var ctx = this; + forEach.call(elements, function (element) { + ctx.injectElement(element, function (svg) { + if (eachCallback && typeof eachCallback === 'function') eachCallback(svg); + if (onDoneCallback && elements.length === ++elementsLoaded) onDoneCallback(elementsLoaded); + }); + }); + } + } + else { + if (elements) { + this.injectElement(elements, function (svg) { + if (eachCallback && typeof eachCallback === 'function') eachCallback(svg); + if (onDoneCallback) onDoneCallback(1); + elements = null; + }); + } + else { + if (onDoneCallback) onDoneCallback(0); + } + } + }; + + + /** + * Inject a single element + * @param {elements} Array of or single DOM element + * @param {function} onDoneCallback + * @param {function} eachCallback + */ + injectElement = SVGInjector.prototype.injectElement = function (el, onElementInjectedCallback) { + var imgUrl = el.getAttribute('data-src') || el.getAttribute('src'), + spriteId; + + if (!imgUrl) { + if (config.spritesheetURL) { + spriteId = getSpriteIdFromClass(el); + if (spriteId === '') { + // console.warn('neither data-src nor spriteId class found! Nothing to inject here!'); + return; + } + imgUrl = config.spritesheetURL + '#' + spriteId; + // console.log('imgURL: ' + imgUrl); + } else { + // console.warn('neither data-src nor spritesheetURL specified! Nothing to inject here!'); + return; + } + } + + el.setAttribute('data-src', imgUrl); + + var imgUrlSplitByFId = imgUrl.split('#'); + if (imgUrlSplitByFId.length === 1) { + imgUrlSplitByFId.push(''); + } + + var fallbackUrl; + + // We can only inject SVG + if (!(/\.svg/i).test(imgUrl)) { + onElementInjectedCallback('Attempted to inject a file with a non-svg extension: ' + imgUrl); + return; + } + + + if (env.hasSvgSupport) { + if (isArray(config.fallbackClassName)) { + removeFallbackClassNames(el, imgUrlSplitByFId[1], config.fallbackClassName); + } + } + else { + // If we don't have SVG support try to fall back to a png, + // either defined per-element via data-fallback or data-png, + // or globally via the pngFallback directory setting + + var perElementFallback = el.getAttribute('data-fallback') || el.getAttribute('data-png'); + + // Per-element specific PNG fallback defined, so use that + if (perElementFallback) { + el.setAttribute('src', perElementFallback); + onElementInjectedCallback(null); + } + // Global PNG fallback directory defined, use the same-named PNG + else if (config.pngFallback) { + + if (imgUrlSplitByFId.length > 1 && imgUrlSplitByFId[1]) { + fallbackUrl = imgUrlSplitByFId[1] + '.png'; + if (isArray(config.fallbackClassName)) { + setFallbackClassNames(el, imgUrlSplitByFId[1], config.fallbackClassName); + } + else if (isFunction(config.fallbackClassName)) { + // console.info('custom function to create fallbackClassName'); + config.fallbackClassName(el, imgUrlSplitByFId[1]); + } + else if (typeof config.fallbackClassName === 'string') { + svgElemSetClassName(el, config.fallbackClassName); + } + else { + el.setAttribute('src', config.pngFallback + '/' + fallbackUrl); + } + } + else { + fallbackUrl = imgUrl.split('/').pop().replace('.svg', '.png'); + el.setAttribute('src', config.pngFallback + '/' + fallbackUrl); + } + + onElementInjectedCallback(null); + } + // um... + else { + onElementInjectedCallback('This browser does not support SVG and no PNG fallback was defined.'); + } + + return; + } + + // Make sure we aren't already in the process of injecting this element to + // avoid a race condition if multiple injections for the same element are run. + // :NOTE: Using indexOf() only _after_ we check for SVG support and bail, + // so no need for IE8 indexOf() polyfill + if (injections.elements.indexOf(el) !== -1) { + console.warn('race', el); + return; + } + + // Remember the request to inject this element, in case other injection + // calls are also trying to replace this element before we finish + injections.elements.push(el); + + // Try to avoid loading the orginal image src if possible. + // el.setAttribute('src', ''); + + // Load it up + loadSvg(onElementInjectedCallback, imgUrl, el); + + }; + + SVGInjector.prototype.getEnv = function() { + return env; + }; + + SVGInjector.prototype.getConfig = function() { + return config; + }; + + // - private member functions ----------------------------------------------- + setFallbackClassNames = function (element, symbolId, classNames) { + var className = (typeof classNames === 'undefined') ? DEFAULT_FALLBACK_CLASS_NAMES : classNames.slice(0); + + // replace %s by symbolId + forEach.call( + className, + function(curClassName, idx) { + className[idx] = curClassName.replace('%s', symbolId); + } + ); + + svgElemSetClassName(element, className); + }; + + removeFallbackClassNames = function (element, symbolId, fallbackClassNames) { + fallbackClassNames = (typeof fallbackClassNames === 'undefined') ? DEFAULT_FALLBACK_CLASS_NAMES.slice(0) : fallbackClassNames.slice(0); + + var idxOfCurClass, + curClassNames, + classAttribute = element.getAttribute('class'); + + if (typeof classAttribute === 'undefined' || classAttribute === null) { + return; + } + + curClassNames = classAttribute.split(' '); + if (curClassNames) { + // replace %s by symbolId + forEach.call( + fallbackClassNames, + function(curFallbackClassName) { + curFallbackClassName = curFallbackClassName.replace('%s', symbolId); + idxOfCurClass = curClassNames.indexOf(curFallbackClassName); + if (idxOfCurClass >= 0){ + // console.log('remove class ' + curClassName); + curClassNames[idxOfCurClass] = ''; + } + + } + ); + + element.setAttribute('class', uniqueClasses(curClassNames.join(' '))); + } + + }; + + suffixIdReferencesInStyles = function (styleTag, suffix, svg, name) { + //var referencedIds = styleTag.textContent.match(/url\(('|")*#.+('|")*\)/g) || []; + /*referencedIds.forEach(function (elem, idx, arr) { + //elem = elem.replace(/url\(('|")*#/g, ''); + arr[idx] = elem.replace(/\)/g, '-' + suffix + ')'); + console.log('style', arr[idx]); + }); + */ + var numRefs = 0; + styleTag.textContent = styleTag.textContent.replace(/url\(('|")*#.+('|")*(?=\))/g, function (match) { + //console.log('match', match + '-' + suffix); + numRefs++; + return match + '-' + suffix; + }); + return numRefs; + }; + + suffixIdReferences = function (svg, suffix) { + var defs = [ + {def:'linearGradient', attrs: ['fill', 'stroke']}, + {def:'radialGradient', attrs: ['fill', 'stroke']}, + {def:'clipPath', attrs: ['clip-path']}, + {def:'mask', attrs: ['mask']}, + {def:'filter', attrs: ['filter']}, + {def:'color-profile', attrs: ['color-profile']}, + {def:'cursor', attrs: ['cursor']}, + {def:'marker', attrs: ['marker', 'marker-start', 'marker-mid', 'marker-end']} + ]; + + var newName, + definitions, + defLen, + defIdx, + refrences, + refLen, + refIdx, + attrs, + attrLen, + attrIdx, + allLinks, + allLinksLen, + allLinksIdx, + links, + linkLen, + linkIdx + ; + + forEach.call(defs, function(elem) { + + definitions = svg.querySelectorAll(elem.def + '[id]'); + for (defIdx = 0, defLen = definitions.length; defIdx < defLen; defIdx++) { + newName = definitions[defIdx].id + '-' + suffix; + + attrs = elem.attrs; + for (attrIdx = 0, attrLen = attrs.length; attrIdx < attrLen; attrIdx++) { + + // console.log('suffixxed ' + attribute + ': ' + newName); + // :NOTE: using a substring match attr selector here to deal with IE "adding extra quotes in url() attrs" + refrences = svg.querySelectorAll('[' + attrs[attrIdx] + '="url(#' + definitions[defIdx].id + ')"]'); + for (refIdx = 0, refLen = refrences.length; refIdx < refLen; refIdx++) { + // console.log('set url', newName); + refrences[refIdx].setAttribute(attrs[attrIdx], 'url(#' + newName + ')'); + } + } + + // handle xlink:refrences + // :NOTE: IE does not like the easy way: links = svg.querySelectorAll('[*|href="#' + definitions[defIdx].id + '"]'); + allLinks = svg.querySelectorAll('[*|href]'); + links = []; + for (allLinksIdx = 0, allLinksLen = allLinks.length; allLinksIdx < allLinksLen; allLinksIdx++) { + if (allLinks[allLinksIdx].getAttributeNS(XLINK_NS, 'href').toString() === '#' + definitions[defIdx].id ) { + links.push(allLinks[allLinksIdx]); + } + } + + for (linkIdx = 0, linkLen = links.length; linkIdx < linkLen; linkIdx++) { + links[linkIdx].setAttributeNS(XLINK_NS, 'href', '#' + newName); + // console.log('set link', newName, links[linkIdx]); + } + definitions[defIdx].id = newName; + } + }); + }; + + copyAttributes = function (svgElemSource, svgElemTarget, attributesToIgnore) { + var curAttr; + if (typeof attributesToIgnore === 'undefined') { attributesToIgnore = ['id', 'viewBox']; } + + for(var i=0; i 1) { + origPrefixClassName = srcArr[1]; + newPrefixClassName = origPrefixClassName + '-' + injectCount; + regex = new RegExp('\\.' + origPrefixClassName + ' ', 'g'); + styleTag.textContent = styleTagContent.replace(regex, '.' + newPrefixClassName + ' '); + } + else { //inject a single element.. this has most probaly not gone through preprocessing + srcFileNameArr = srcArr[0].split('/'); + newPrefixClassName = srcFileNameArr[srcFileNameArr.length-1].replace('.svg', '') + '-' + injectCount; + // console.info('inject complete file: ' + srcArr[0]); + //https://medium.com/jotform-form-builder/writing-a-css-parser-in-javascript-3ecaa1719a43 + regex = new RegExp('([\\s\\S]*?){([\\s\\S]*?)}', 'g'); + + while ((regexSearchResult = regex.exec(styleTagContent)) !== null) { + selectorArr = regexSearchResult[1].trim().split(', '); + selectorArr.forEach(prefixSelector); + + var tmp = selectorArr.join(', ') + '{' + regexSearchResult[2] + '}\n'; + newContent += tmp; + } + styleTag.textContent = newContent; + } + + svg.setAttribute('class', (svg.getAttribute('class') + ' ' + newPrefixClassName)); + }; + + getClassList = function (svgToCheck) { + var curClassAttr = svgToCheck.getAttribute('class'); + return (curClassAttr) ? curClassAttr.trim().split(' ') : []; + }; + + getSpriteIdFromClass = function (element) { + var classes = getClassList(element); + var id = ''; + forEach.call(classes, function (curClass) { + if (curClass.indexOf(config.spriteClassIdName) >= 0) { + id = curClass.replace(config.spriteClassIdName, ''); + // console.log('class with prefix ' + config.spriteClassIdName + ' found. id: ' + id); + } + }); + return id; + }; + + cloneSvg = function (config, sourceSvg, fragId) { + + var svgElem, + newSVG = null, + viewBox, + viewBoxAttr, + symbolAttributesToFind, + curClassList, + setViewboxOnNewSVG = false, + setDimensionsOnNewSVG = false, + symbolElem = null, + symobolList; + + if (fragId === undefined){ + svgElem = newSVG = sourceSvg.cloneNode(true); + if (!newSVG.getAttribute('width') && !sourceSvg.getAttribute('width')) { + setDimensionsOnNewSVG = true; + } + + } + else { + svgElem = sourceSvg.getElementById(fragId); + if (!svgElem) { + console.warn(fragId + ' not found in svg'); + return; + } + } + viewBoxAttr = svgElem.getAttribute('viewBox'); + viewBox = viewBoxAttr.split(' '); + if (!newSVG) { + if (svgElem instanceof SVGSymbolElement) { + + newSVG = cloneSymbolAsSVG(svgElem); + setDimensionsOnNewSVG = setViewboxOnNewSVG = true; + + } + else if (svgElem instanceof SVGViewElement) { + symbolElem = null; + if (config.onlyInjectVisiblePart) { + var selector = '*[width="' + viewBox[2] + '"][height="' + viewBox[3] + '"]'; + + symbolAttributesToFind = {}; + if (Math.abs(parseInt(viewBox[0])) === 0) { + selector += ':not([x])'; + } + else { + symbolAttributesToFind.x = viewBox[0]; + selector += '[x="' + viewBox[0] + '"]'; + } + + if (Math.abs(parseInt(viewBox[1])) === 0) { + selector += ':not([y])'; + } + else { + symbolAttributesToFind.y = viewBox[1]; + selector += '[y="' + viewBox[1] + '"]'; + } + symobolList = sourceSvg.querySelectorAll(selector); + if (symobolList.length > 1) { + console.warn('more than one item, with the matching viewbox found!', symobolList); + } + symbolElem = symobolList[0]; + } + if (symbolElem && (symbolElem instanceof SVGSVGElement)) { + newSVG = symbolElem.cloneNode(true); + + for (var prop in symbolAttributesToFind) { + if (prop !== 'width' && prop !== 'height') { + newSVG.removeAttribute(prop); + } + } + } + else if (symbolElem && (symbolElem instanceof SVGUseElement)) { + // console.log('referenced view shows a SVGUseElement'); + var referencedSymbol = sourceSvg.getElementById( + symbolElem.getAttributeNS(XLINK_NS, 'href').substr(1) + ); + newSVG = cloneSymbolAsSVG(referencedSymbol); + viewBoxAttr = referencedSymbol.getAttribute('viewBox'); + viewBox = viewBoxAttr.split(' '); + setDimensionsOnNewSVG = setViewboxOnNewSVG = true; + } + else { + console.info( + ((config.onlyInjectVisiblePart) ? 'symbol referenced via view' + fragId + ' not found' : 'option.onlyInjectVisiblePart: false') + ' -> clone complete svg!' + ); + setDimensionsOnNewSVG = setViewboxOnNewSVG = true; + newSVG = sourceSvg.cloneNode(true); + + } + } + + curClassList = getClassList(newSVG); + var fragIdClassName = config.prefixFragIdClass + fragId; + if (curClassList.indexOf(fragIdClassName)<0) { + curClassList.push(fragIdClassName); + newSVG.setAttribute('class', curClassList.join(' ')); + } + } + + if (setViewboxOnNewSVG) { + newSVG.setAttribute('viewBox', viewBox.join(' ')); + } + if (setDimensionsOnNewSVG) { + newSVG.setAttribute('width', viewBox[2]+'px'); + newSVG.setAttribute('height', viewBox[3]+'px'); + } + newSVG.setAttribute('xmlns', SVG_NS); + newSVG.setAttribute('xmlns:xlink', XLINK_NS); + return newSVG; + }; + + //queueRequest(requestQueue, fileName, fragId, onElementInjectedCallback, el); + queueRequest = function (fileName, fragId, callback, el) { + requestQueue[fileName] = requestQueue[fileName] || []; + requestQueue[fileName].push({callback:callback, fragmentId:fragId, element:el, name: name}); + }; + + processRequestQueue = function (url) { + var requestQueueElem; + for (var i = 0, len = requestQueue[url].length; i < len; i++) { + // Make these calls async so we avoid blocking the page/renderer + /* jshint loopfunc: true */ + (function (index) { + setTimeout(function () { + requestQueueElem = requestQueue[url][index]; + onLoadSVG(url, requestQueueElem.fragmentId, requestQueueElem.callback, requestQueueElem.element, requestQueueElem.name); + }, 0); + })(i); + /* jshint loopfunc: false */ + } + }; + + loadSvg = function (onElementInjectedCallback, url, el) { + var urlArr, fileUrl, fragId, name, pathArr; + //var state = {onElementInjectedCallback:onElementInjectedCallback, injections:injections, config:config, url:url, el:el, ranScripts:ranScripts}; + // console.log('loadSvg', url); + urlArr = url.split('#'); + fileUrl = urlArr[0]; + fragId = (urlArr.length === 2) ? urlArr[1] : undefined; + //name = fragId ? undefined : ; + if (typeof fragId !== 'undefined') { + pathArr = fileUrl.split('/'); + name = pathArr[pathArr.length-1].replace('.svg', ''); + } + + if (svgCache[fileUrl] !== undefined) { + if (svgCache[fileUrl] instanceof SVGSVGElement) { + // We already have it in cache, so use it + // console.log('We already have it in cache, so use it', fileName, fragId); + onLoadSVG(fileUrl, fragId, onElementInjectedCallback, el, name); + } + else { + // console.log('We don\'t have it in cache yet, but we are loading it, so queue this request', fileName, fragId); + // We don't have it in cache yet, but we are loading it, so queue this request + queueRequest(fileUrl, fragId, onElementInjectedCallback, el, name); + } + } + else { + + if (!window.XMLHttpRequest) { + onElementInjectedCallback('Browser does not support XMLHttpRequest'); + return false; + } + + // Seed the cache to indicate we are loading this URL already + svgCache[fileUrl] = {}; + queueRequest(fileUrl, fragId, onElementInjectedCallback, el, name); + + var httpRequest = new XMLHttpRequest(); + + httpRequest.onreadystatechange = function () { + // readyState 4 = complete + if (httpRequest.readyState === 4) { + + // Handle status + if (httpRequest.status === 404 || httpRequest.responseXML === null) { + onElementInjectedCallback('Unable to load SVG file: ' + fileUrl); + + // @check this! + //if (env.isLocal) { + // onLoadCompleteCb('Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver.'); + //} + // + //onLoadCompleteCb(); + return false; + } + + // 200 success from server, or 0 when using file:// protocol locally + if (httpRequest.status === 200 || (env.isLocal && httpRequest.status === 0)) { + + if (httpRequest.responseXML instanceof Document) { + // Cache it + svgCache[fileUrl] = httpRequest.responseXML.documentElement; + } + + // IE9 doesn't create a responseXML Document object from loaded SVG, + // and throws a "DOM Exception: HIERARCHY_REQUEST_ERR (3)" error when injected. + // + // So, we'll just create our own manually via the DOMParser using + // the the raw XML responseText. + // + // :NOTE: IE8 and older doesn't have DOMParser, but they can't do SVG either, so... + else if (DOMParser && (DOMParser instanceof Function)) { + var xmlDoc; + try { + var parser = new DOMParser(); + xmlDoc = parser.parseFromString(httpRequest.responseText, 'text/xml'); + } + catch (e) { + xmlDoc = undefined; + } + + if (!xmlDoc || xmlDoc.getElementsByTagName('parsererror').length) { + onElementInjectedCallback('Unable to parse SVG file: ' + url); + return false; + } + else { + // Cache it + svgCache[fileUrl] = xmlDoc.documentElement; + } + } + + // We've loaded a new asset, so process any requests waiting for it + processRequestQueue(fileUrl); + } + else { + onElementInjectedCallback('There was a problem injecting the SVG: ' + httpRequest.status + ' ' + httpRequest.statusText); + return false; + } + } + }; + + httpRequest.open('GET', fileUrl); + + // Treat and parse the response as XML, even if the + // server sends us a different mimetype> + if (httpRequest.overrideMimeType) httpRequest.overrideMimeType('text/xml'); + + httpRequest.send(); + } + }; + + writeDefaultClass = function(removeStylesClass) { + var css = 'svg.' + removeStylesClass + ' {fill: currentColor;}', + head = document.head || document.getElementsByTagName('head')[0], + style = document.createElement('style'); + + style.type = 'text/css'; + if (style.styleSheet){ + style.styleSheet.cssText = css; + } + else { + style.appendChild(document.createTextNode(css)); + } + head.appendChild(style); + // console.info( 'default class written: ', css ); + }; + + replaceNoSVGClass = function(element, noSVGClassName, hasSvgSupport) { + if (hasSvgSupport) { + element.className.replace(noSVGClassName, ''); + } + else{ + element.className += ' ' + noSVGClassName; + } + }; + + + onLoadSVG = function(url, fragmentId, onElementInjectedCallback, el, name){ + // console.log('onLoadSVG', url, fragmentId, onElementInjectedCallback, el, name); + var svg, + imgId, + titleId, + descId, + ariaHidden, + fallbackSvg, + labeledBy, + titleTagExisting, + descTagExisting + ; + + svg = cloneSvg(config, svgCache[url], fragmentId); + if (typeof svg === 'undefined' || typeof svg === 'string') { + fallbackSvg = el.getAttribute('data-fallback-svg'); + fallbackSvg = fallbackSvg || config.svgFallbackDir ? config.svgFallbackDir + '/' + fragmentId + '.svg' : false; + if (fallbackSvg) { + // console.log('use fallback-svg', fallbackSvg); + el.setAttribute('data-src', fallbackSvg); + injections.elements.splice(injections.elements.indexOf(el), 1); + injectElement(el, onElementInjectedCallback); + } else { + onElementInjectedCallback(svg); + } + return false; + } + + // take care of accessibility + svg.setAttribute('role', 'img'); + forEach.call(svg.children || [], function (curChildElem) { // IE does not support Children on SVGElement! + if ( + !(curChildElem instanceof SVGDefsElement) && + !(curChildElem instanceof SVGTitleElement) && + !(curChildElem instanceof SVGDescElement) + ) { + curChildElem.setAttribute('role', 'presentation'); + } + }); + + + // set aria-hidden attribute + ariaHidden = el.getAttribute('aria-hidden') || svg.getAttribute('aria-hidden'); + + if (ariaHidden) { + svg.setAttribute('aria-hidden', 'true'); + titleTagExisting = svg.querySelector('title'); + descTagExisting = svg.querySelector('desc'); + if (titleTagExisting) { + svg.removeChild(titleTagExisting); + } + if (descTagExisting) { + svg.removeChild(descTagExisting); + } + + } else { + // set desc + title + descId = setRootLevelElem('desc', svg, el, fragmentId, false); + titleId = setRootLevelElem('title', svg, el, fragmentId, false); + if (descId.length > 0 || titleId.length > 0) { + labeledBy = titleId + ' ' + descId; + svg.setAttribute('aria-labelledby', labeledBy.trim()); + } + + } + + // copy attributes of original element to new svg excluding class + copyAttributes(el, svg, ['class']); + + + // Concat the SVG classes + 'injected-svg' + the img classes + var classMerge = [].concat(svg.getAttribute('class') || [], 'injected-svg', el.getAttribute('class') || []).join(' '); + svg.setAttribute('class', uniqueClasses(classMerge)); + + // Make sure any internally referenced ids and their + // references are unique. + // + // This addresses the issue of having multiple instances of the + // same SVG on a page and only the first clipPath, gradient, mask or filter id is referenced. + suffixIdReferences(svg, injections.count, name); + + + // Remove any unwanted/invalid namespaces that might have been added by SVG editing tools + svg.removeAttribute('xmlns:a'); + + // Post page load injected SVGs don't automatically have their script + // elements run, so we'll need to make that happen, if requested + + // Find then prune the scripts + var scripts = svg.querySelectorAll('script'); + var scriptsToEval = []; + var script, scriptType; + + for (var k = 0, scriptsLen = scripts.length; k < scriptsLen; k++) { + scriptType = scripts[k].getAttribute('type'); + + // Only process javascript types. + // SVG defaults to 'application/ecmascript' for unset types + if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript') { + + // innerText for IE, textContent for other browsers + script = scripts[k].innerText || scripts[k].textContent; + + // Stash + scriptsToEval.push(script); + + // Tidy up and remove the script element since we don't need it anymore + svg.removeChild(scripts[k]); + } + } + + // Run/Eval the scripts if needed + if (scriptsToEval.length > 0 && (config.evalScripts === 'always' || (config.evalScripts === 'once' && ! ranScripts[url]))) { + for (var l = 0, scriptsToEvalLen = scriptsToEval.length; l < scriptsToEvalLen; l++) { + + // :NOTE: Yup, this is a form of eval, but it is being used to eval code + // the caller has explictely asked to be loaded, and the code is in a caller + // defined SVG file... not raw user input. + // + // Also, the code is evaluated in a closure and not in the global scope. + // If you need to put something in global scope, use 'window' + new Function(scriptsToEval[l])(window); // jshint ignore:line + } + + // Remember we already ran scripts for this svg + ranScripts[url] = true; + } + + // :NOTE: handle styles in style-tags + var styleTags = svg.querySelectorAll('style'); + + forEach.call(styleTags, function (styleTag) { + var svgClassList = getClassList(svg), + stylesUntouched = true; + if ((svgClassList.indexOf(config.removeStylesClass)>=0 || config.removeAllStyles) && (svgClassList.indexOf(config.keepStylesClass)<0) ) { + + // remove the styletag if the removeStylesClass is applied to the SVG + // console.log('remove styleTag', styleTag); + styleTag.parentNode.removeChild(styleTag); + } + else { + + if (suffixIdReferencesInStyles(styleTag, injections.count, svg, name) > 0) { + stylesUntouched = false; + } + + if (config.prefixStyleTags){ + doPrefixStyleTags(styleTag, injections.count, svg, name); + stylesUntouched = false; + } + + if (stylesUntouched) { + // :WORKAROUND: + // IE doesn't evaluate - - - - - thumb up - - - thumb up - - - - - - - - diff --git a/tests/cors/js/svg-injector.js b/tests/cors/js/svg-injector.js deleted file mode 100755 index 495d54c..0000000 --- a/tests/cors/js/svg-injector.js +++ /dev/null @@ -1,440 +0,0 @@ -/** - * SVGInjector v1.1.2 - Fast, caching, dynamic inline SVG DOM injection library - * https://github.com/iconic/SVGInjector - * - * Copyright (c) 2014 Waybury - * @license MIT - */ - -(function (window, document) { - - 'use strict'; - - // Environment - var isLocal = window.location.protocol === 'file:'; - var hasSvgSupport = document.implementation.hasFeature('http://www.w3.org/TR/SVG11/feature#BasicStructure', '1.1'); - - function uniqueClasses(list) { - list = list.split(' '); - - var hash = {}; - var i = list.length; - var out = []; - - while (i--) { - if (!hash.hasOwnProperty(list[i])) { - hash[list[i]] = 1; - out.unshift(list[i]); - } - } - - return out.join(' '); - } - - /** - * cache (or polyfill for <= IE8) Array.forEach() - * source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach - */ - var forEach = Array.prototype.forEach || function (fn, scope) { - if (this === void 0 || this === null || typeof fn !== 'function') { - throw new TypeError(); - } - - /* jshint bitwise: false */ - var i, len = this.length >>> 0; - /* jshint bitwise: true */ - - for (i = 0; i < len; ++i) { - if (i in this) { - fn.call(scope, this[i], i, this); - } - } - }; - - // SVG Cache - var svgCache = {}; - - var injectCount = 0; - var injectedElements = []; - - // Request Queue - var requestQueue = []; - - // Script running status - var ranScripts = {}; - - var cloneSvg = function (sourceSvg) { - return sourceSvg.cloneNode(true); - }; - - var queueRequest = function (url, callback) { - requestQueue[url] = requestQueue[url] || []; - requestQueue[url].push(callback); - }; - - var processRequestQueue = function (url) { - for (var i = 0, len = requestQueue[url].length; i < len; i++) { - // Make these calls async so we avoid blocking the page/renderer - /* jshint loopfunc: true */ - (function (index) { - setTimeout(function () { - requestQueue[url][index](cloneSvg(svgCache[url])); - }, 0); - })(i); - /* jshint loopfunc: false */ - } - }; - - var loadSvg = function (url, callback) { - if (svgCache[url] !== undefined) { - if (svgCache[url] instanceof SVGSVGElement) { - // We already have it in cache, so use it - callback(cloneSvg(svgCache[url])); - } - else { - // We don't have it in cache yet, but we are loading it, so queue this request - queueRequest(url, callback); - } - } - else { - - if (!window.XMLHttpRequest) { - callback('Browser does not support XMLHttpRequest'); - return false; - } - - // Seed the cache to indicate we are loading this URL already - svgCache[url] = {}; - queueRequest(url, callback); - - var httpRequest = new XMLHttpRequest(); - - httpRequest.onreadystatechange = function () { - // readyState 4 = complete - if (httpRequest.readyState === 4) { - - // Handle status - if (httpRequest.status === 404 || httpRequest.responseXML === null) { - callback('Unable to load SVG file: ' + url); - - if (isLocal) callback('Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver.'); - - callback(); - return false; - } - - // 200 success from server, or 0 when using file:// protocol locally - if (httpRequest.status === 200 || (isLocal && httpRequest.status === 0)) { - - /* globals Document */ - if (httpRequest.responseXML instanceof Document) { - // Cache it - svgCache[url] = httpRequest.responseXML.documentElement; - } - /* globals -Document */ - - // IE9 doesn't create a responseXML Document object from loaded SVG, - // and throws a "DOM Exception: HIERARCHY_REQUEST_ERR (3)" error when injected. - // - // So, we'll just create our own manually via the DOMParser using - // the the raw XML responseText. - // - // :NOTE: IE8 and older doesn't have DOMParser, but they can't do SVG either, so... - else if (DOMParser && (DOMParser instanceof Function)) { - var xmlDoc; - try { - var parser = new DOMParser(); - xmlDoc = parser.parseFromString(httpRequest.responseText, 'text/xml'); - } - catch (e) { - xmlDoc = undefined; - } - - if (!xmlDoc || xmlDoc.getElementsByTagName('parsererror').length) { - callback('Unable to parse SVG file: ' + url); - return false; - } - else { - // Cache it - svgCache[url] = xmlDoc.documentElement; - } - } - - // We've loaded a new asset, so process any requests waiting for it - processRequestQueue(url); - } - else { - callback('There was a problem injecting the SVG: ' + httpRequest.status + ' ' + httpRequest.statusText); - return false; - } - } - }; - - httpRequest.open('GET', url); - - // Treat and parse the response as XML, even if the - // server sends us a different mimetype - if (httpRequest.overrideMimeType) httpRequest.overrideMimeType('text/xml'); - - httpRequest.send(); - } - }; - - // Inject a single element - var injectElement = function (el, evalScripts, pngFallback, callback) { - - // Grab the src or data-src attribute - var imgUrl = el.getAttribute('data-src') || el.getAttribute('src'); - - // We can only inject SVG - if (!(/\.svg/i).test(imgUrl)) { - callback('Attempted to inject a file with a non-svg extension: ' + imgUrl); - return; - } - - // If we don't have SVG support try to fall back to a png, - // either defined per-element via data-fallback or data-png, - // or globally via the pngFallback directory setting - if (!hasSvgSupport) { - var perElementFallback = el.getAttribute('data-fallback') || el.getAttribute('data-png'); - - // Per-element specific PNG fallback defined, so use that - if (perElementFallback) { - el.setAttribute('src', perElementFallback); - callback(null); - } - // Global PNG fallback directoriy defined, use the same-named PNG - else if (pngFallback) { - el.setAttribute('src', pngFallback + '/' + imgUrl.split('/').pop().replace('.svg', '.png')); - callback(null); - } - // um... - else { - callback('This browser does not support SVG and no PNG fallback was defined.'); - } - - return; - } - - // Make sure we aren't already in the process of injecting this element to - // avoid a race condition if multiple injections for the same element are run. - // :NOTE: Using indexOf() only _after_ we check for SVG support and bail, - // so no need for IE8 indexOf() polyfill - if (injectedElements.indexOf(el) !== -1) { - return; - } - - // Remember the request to inject this element, in case other injection - // calls are also trying to replace this element before we finish - injectedElements.push(el); - - // Try to avoid loading the orginal image src if possible. - el.setAttribute('src', ''); - - // Load it up - loadSvg(imgUrl, function (svg) { - - if (typeof svg === 'undefined' || typeof svg === 'string') { - callback(svg); - return false; - } - - var imgId = el.getAttribute('id'); - if (imgId) { - svg.setAttribute('id', imgId); - } - - var imgTitle = el.getAttribute('title'); - if (imgTitle) { - svg.setAttribute('title', imgTitle); - } - - // Concat the SVG classes + 'injected-svg' + the img classes - var classMerge = [].concat(svg.getAttribute('class') || [], 'injected-svg', el.getAttribute('class') || []).join(' '); - svg.setAttribute('class', uniqueClasses(classMerge)); - - var imgStyle = el.getAttribute('style'); - if (imgStyle) { - svg.setAttribute('style', imgStyle); - } - - // Copy all the data elements to the svg - var imgData = [].filter.call(el.attributes, function (at) { - return (/^data-\w[\w\-]*$/).test(at.name); - }); - forEach.call(imgData, function (dataAttr) { - if (dataAttr.name && dataAttr.value) { - svg.setAttribute(dataAttr.name, dataAttr.value); - } - }); - - // Make sure any internally referenced clipPath ids and their - // clip-path references are unique. - // - // This addresses the issue of having multiple instances of the - // same SVG on a page and only the first clipPath id is referenced. - // - // Browsers often shortcut the SVG Spec and don't use clipPaths - // contained in parent elements that are hidden, so if you hide the first - // SVG instance on the page, then all other instances lose their clipping. - // Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=376027 - var clipPaths = svg.querySelectorAll('defs clipPath[id]'); - var newClipPathName; - for (var g = 0, clipPathsLen = clipPaths.length; g < clipPathsLen; g++) { - newClipPathName = clipPaths[g].id + '-' + injectCount; - // :NOTE: using a substring match attr selector here to deal with IE "adding extra quotes in url() attrs" - var usingClipPath = svg.querySelectorAll('[clip-path*="' + clipPaths[g].id + '"]'); - for (var h = 0, usingClipPathLen = usingClipPath.length; h < usingClipPathLen; h++) { - usingClipPath[h].setAttribute('clip-path', 'url(#' + newClipPathName + ')'); - } - clipPaths[g].id = newClipPathName; - } - - // Do the same for masks - var masks = svg.querySelectorAll('defs mask[id]'); - var newMaskName; - for (var i = 0, masksLen = masks.length; i < masksLen; i++) { - newMaskName = masks[i].id + '-' + injectCount; - // :NOTE: using a substring match attr selector here to deal with IE "adding extra quotes in url() attrs" - var usingMask = svg.querySelectorAll('[mask*="' + masks[i].id + '"]'); - for (var j = 0, usingMaskLen = usingMask.length; j < usingMaskLen; j++) { - usingMask[j].setAttribute('mask', 'url(#' + newMaskName + ')'); - } - masks[i].id = newMaskName; - } - - // Remove any unwanted/invalid namespaces that might have been added by SVG editing tools - svg.removeAttribute('xmlns:a'); - - // Post page load injected SVGs don't automatically have their script - // elements run, so we'll need to make that happen, if requested - - // Find then prune the scripts - var scripts = svg.querySelectorAll('script'); - var scriptsToEval = []; - var script, scriptType; - - for (var k = 0, scriptsLen = scripts.length; k < scriptsLen; k++) { - scriptType = scripts[k].getAttribute('type'); - - // Only process javascript types. - // SVG defaults to 'application/ecmascript' for unset types - if (!scriptType || scriptType === 'application/ecmascript' || scriptType === 'application/javascript') { - - // innerText for IE, textContent for other browsers - script = scripts[k].innerText || scripts[k].textContent; - - // Stash - scriptsToEval.push(script); - - // Tidy up and remove the script element since we don't need it anymore - svg.removeChild(scripts[k]); - } - } - - // Run/Eval the scripts if needed - if (scriptsToEval.length > 0 && (evalScripts === 'always' || (evalScripts === 'once' && !ranScripts[imgUrl]))) { - for (var l = 0, scriptsToEvalLen = scriptsToEval.length; l < scriptsToEvalLen; l++) { - - // :NOTE: Yup, this is a form of eval, but it is being used to eval code - // the caller has explictely asked to be loaded, and the code is in a caller - // defined SVG file... not raw user input. - // - // Also, the code is evaluated in a closure and not in the global scope. - // If you need to put something in global scope, use 'window' - new Function(scriptsToEval[l])(window); // jshint ignore:line - } - - // Remember we already ran scripts for this svg - ranScripts[imgUrl] = true; - } - - // Replace the image with the svg - el.parentNode.replaceChild(svg, el); - - // Now that we no longer need it, drop references - // to the original element so it can be GC'd - delete injectedElements[injectedElements.indexOf(el)]; - el = null; - - // Increment the injected count - injectCount++; - - callback(svg); - }); - }; - - /** - * SVGInjector - * - * Replace the given elements with their full inline SVG DOM elements. - * - * :NOTE: We are using get/setAttribute with SVG because the SVG DOM spec differs from HTML DOM and - * can return other unexpected object types when trying to directly access svg properties. - * ex: "className" returns a SVGAnimatedString with the class value found in the "baseVal" property, - * instead of simple string like with HTML Elements. - * - * @param {mixes} Array of or single DOM element - * @param {object} options - * @param {function} callback - * @return {object} Instance of SVGInjector - */ - var SVGInjector = function (elements, options, done) { - - // Options & defaults - options = options || {}; - - // Should we run the scripts blocks found in the SVG - // 'always' - Run them every time - // 'once' - Only run scripts once for each SVG - // [false|'never'] - Ignore scripts - var evalScripts = options.evalScripts || 'always'; - - // Location of fallback pngs, if desired - var pngFallback = options.pngFallback || false; - - // Callback to run during each SVG injection, returning the SVG injected - var eachCallback = options.each; - - // Do the injection... - if (elements.length !== undefined) { - var elementsLoaded = 0; - forEach.call(elements, function (element) { - injectElement(element, evalScripts, pngFallback, function (svg) { - if (eachCallback && typeof eachCallback === 'function') eachCallback(svg); - if (done && elements.length === ++elementsLoaded) done(elementsLoaded); - }); - }); - } - else { - if (elements) { - injectElement(elements, evalScripts, pngFallback, function (svg) { - if (eachCallback && typeof eachCallback === 'function') eachCallback(svg); - if (done) done(1); - elements = null; - }); - } - else { - if (done) done(0); - } - } - }; - - /* global module, exports: true, define */ - // Node.js or CommonJS - if (typeof module === 'object' && typeof module.exports === 'object') { - module.exports = exports = SVGInjector; - } - // AMD support - else if (typeof define === 'function' && define.amd) { - define(function () { - return SVGInjector; - }); - } - // Otherwise, attach to window as global - else if (typeof window === 'object') { - window.SVGInjector = SVGInjector; - } - /* global -module, -exports, -define */ - -}(window, document)); diff --git a/tests/cors/js/svg-injector.min.js b/tests/cors/js/svg-injector.min.js deleted file mode 100755 index dcdb71e..0000000 --- a/tests/cors/js/svg-injector.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * SVGInjector v1.1.2 - Fast, caching, dynamic inline SVG DOM injection library - * https://github.com/iconic/SVGInjector - * - * Copyright (c) 2014 Waybury - * @license MIT - */ -!function(t,e){"use strict";function r(t){t=t.split(" ");for(var e={},r=t.length,n=[];r--;)e.hasOwnProperty(t[r])||(e[t[r]]=1,n.unshift(t[r]));return n.join(" ")}var n="file:"===t.location.protocol,i=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),o=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var r,n=this.length>>>0;for(r=0;n>r;++r)r in this&&t.call(e,this[r],r,this)},a={},s=0,l=[],u=[],c={},f=function(t){return t.cloneNode(!0)},p=function(t,e){u[t]=u[t]||[],u[t].push(e)},d=function(t){for(var e=0,r=u[t].length;r>e;e++)!function(e){setTimeout(function(){u[t][e](f(a[t]))},0)}(e)},h=function(e,r){if(void 0!==a[e])a[e]instanceof SVGSVGElement?r(f(a[e])):p(e,r);else{if(!t.XMLHttpRequest)return r("Browser does not support XMLHttpRequest"),!1;a[e]={},p(e,r);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return r("Unable to load SVG file: "+e),n&&r("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),r(),!1;if(!(200===i.status||n&&0===i.status))return r("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)a[e]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var t;try{var o=new DOMParser;t=o.parseFromString(i.responseText,"text/xml")}catch(s){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)return r("Unable to parse SVG file: "+e),!1;a[e]=t.documentElement}d(e)}},i.open("GET",e),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},v=function(e,n,a,u){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!/\.svg/i.test(f))return void u("Attempted to inject a file with a non-svg extension: "+f);if(!i){var p=e.getAttribute("data-fallback")||e.getAttribute("data-png");return void(p?(e.setAttribute("src",p),u(null)):a?(e.setAttribute("src",a+"/"+f.split("/").pop().replace(".svg",".png")),u(null)):u("This browser does not support SVG and no PNG fallback was defined."))}-1===l.indexOf(e)&&(l.push(e),e.setAttribute("src",""),h(f,function(i){if("undefined"==typeof i||"string"==typeof i)return u(i),!1;var a=e.getAttribute("id");a&&i.setAttribute("id",a);var p=e.getAttribute("title");p&&i.setAttribute("title",p);var d=[].concat(i.getAttribute("class")||[],"injected-svg",e.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(d));var h=e.getAttribute("style");h&&i.setAttribute("style",h);var v=[].filter.call(e.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});o.call(v,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});for(var g,b=i.querySelectorAll("defs clipPath[id]"),m=0,y=b.length;y>m;m++){g=b[m].id+"-"+s;for(var A=i.querySelectorAll('[clip-path*="'+b[m].id+'"]'),w=0,S=A.length;S>w;w++)A[w].setAttribute("clip-path","url(#"+g+")");b[m].id=g}for(var x,j=i.querySelectorAll("defs mask[id]"),T=0,G=j.length;G>T;T++){x=j[T].id+"-"+s;for(var M=i.querySelectorAll('[mask*="'+j[T].id+'"]'),V=0,q=M.length;q>V;V++)M[V].setAttribute("mask","url(#"+x+")");j[T].id=x}i.removeAttribute("xmlns:a");for(var k,E,O=i.querySelectorAll("script"),L=[],P=0,X=O.length;X>P;P++)E=O[P].getAttribute("type"),E&&"application/ecmascript"!==E&&"application/javascript"!==E||(k=O[P].innerText||O[P].textContent,L.push(k),i.removeChild(O[P]));if(L.length>0&&("always"===n||"once"===n&&!c[f])){for(var F=0,N=L.length;N>F;F++)new Function(L[F])(t);c[f]=!0}e.parentNode.replaceChild(i,e),delete l[l.indexOf(e)],e=null,s++,u(i)}))},g=function(t,e,r){e=e||{};var n=e.evalScripts||"always",i=e.pngFallback||!1,a=e.each;if(void 0!==t.length){var s=0;o.call(t,function(e){v(e,n,i,function(e){a&&"function"==typeof a&&a(e),r&&t.length===++s&&r(s)})})}else t?v(t,n,i,function(e){a&&"function"==typeof a&&a(e),r&&r(1),t=null}):r&&r(0)};"object"==typeof module&&"object"==typeof module.exports?module.exports=exports=g:"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof t&&(t.SVGInjector=g)}(window,document); -//# sourceMappingURL=svg-injector.map.js \ No newline at end of file diff --git a/tests/ie-style-tag-eval/index.html b/tests/ie-style-tag-eval/index.html deleted file mode 100755 index 87a01f2..0000000 --- a/tests/ie-style-tag-eval/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - SVGInjector Test: IE Style Tag Use - - - - -

IE doesn't evaluate and use style tags on injected SVGs.

-

This page tests if the SVGInjector workaround for this issue is effective.

-

Reference

- - - - - - - diff --git a/tests/ie-style-tag-eval/js/svg-injector.min.js b/tests/ie-style-tag-eval/js/svg-injector.min.js deleted file mode 100755 index ad97290..0000000 --- a/tests/ie-style-tag-eval/js/svg-injector.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * SVGInjector v1.1.2 - Fast, caching, dynamic inline SVG DOM injection library - * https://github.com/iconic/SVGInjector - * - * Copyright (c) 2014 Waybury - * @license MIT - */ -!function(t,e){"use strict";function r(t){t=t.split(" ");for(var e={},r=t.length,n=[];r--;)e.hasOwnProperty(t[r])||(e[t[r]]=1,n.unshift(t[r]));return n.join(" ")}var n="file:"===t.location.protocol,i=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),o=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var r,n=this.length>>>0;for(r=0;n>r;++r)r in this&&t.call(e,this[r],r,this)},a={},l=0,s=[],u=[],c={},f=function(t){return t.cloneNode(!0)},p=function(t,e){u[t]=u[t]||[],u[t].push(e)},d=function(t){for(var e=0,r=u[t].length;r>e;e++)!function(e){setTimeout(function(){u[t][e](f(a[t]))},0)}(e)},v=function(e,r){if(void 0!==a[e])a[e]instanceof SVGSVGElement?r(f(a[e])):p(e,r);else{if(!t.XMLHttpRequest)return r("Browser does not support XMLHttpRequest"),!1;a[e]={},p(e,r);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return r("Unable to load SVG file: "+e),n&&r("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),r(),!1;if(!(200===i.status||n&&0===i.status))return r("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)a[e]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var t;try{var o=new DOMParser;t=o.parseFromString(i.responseText,"text/xml")}catch(l){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)return r("Unable to parse SVG file: "+e),!1;a[e]=t.documentElement}d(e)}},i.open("GET",e),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},h=function(e,n,a,u){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!/\.svg/i.test(f))return void u("Attempted to inject a file with a non-svg extension: "+f);if(!i){var p=e.getAttribute("data-fallback")||e.getAttribute("data-png");return void(p?(e.setAttribute("src",p),u(null)):a?(e.setAttribute("src",a+"/"+f.split("/").pop().replace(".svg",".png")),u(null)):u("This browser does not support SVG and no PNG fallback was defined."))}-1===s.indexOf(e)&&(s.push(e),e.setAttribute("src",""),v(f,function(i){if("undefined"==typeof i||"string"==typeof i)return u(i),!1;var a=e.getAttribute("id");a&&i.setAttribute("id",a);var p=e.getAttribute("title");p&&i.setAttribute("title",p);var d=[].concat(i.getAttribute("class")||[],"injected-svg",e.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(d));var v=e.getAttribute("style");v&&i.setAttribute("style",v);var h=[].filter.call(e.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});o.call(h,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});for(var g,b=i.querySelectorAll("defs clipPath[id]"),y=0,m=b.length;m>y;y++){g=b[y].id+"-"+l;for(var A=i.querySelectorAll('[clip-path*="'+b[y].id+'"]'),w=0,S=A.length;S>w;w++)A[w].setAttribute("clip-path","url(#"+g+")");b[y].id=g}for(var x,j=i.querySelectorAll("defs mask[id]"),T=0,G=j.length;G>T;T++){x=j[T].id+"-"+l;for(var M=i.querySelectorAll('[mask*="'+j[T].id+'"]'),q=0,V=M.length;V>q;q++)M[q].setAttribute("mask","url(#"+x+")");j[T].id=x}i.removeAttribute("xmlns:a");for(var k,E,O=i.querySelectorAll("script"),L=[],P=0,X=O.length;X>P;P++)E=O[P].getAttribute("type"),E&&"application/ecmascript"!==E&&"application/javascript"!==E||(k=O[P].innerText||O[P].textContent,L.push(k),i.removeChild(O[P]));if(L.length>0&&("always"===n||"once"===n&&!c[f])){for(var F=0,N=L.length;N>F;F++)new Function(L[F])(t);c[f]=!0}var C=i.querySelectorAll("style");o.call(C,function(t){t.textContent+=""}),e.parentNode.replaceChild(i,e),delete s[s.indexOf(e)],e=null,l++,u(i)}))},g=function(t,e,r){e=e||{};var n=e.evalScripts||"always",i=e.pngFallback||!1,a=e.each;if(void 0!==t.length){var l=0;o.call(t,function(e){h(e,n,i,function(e){a&&"function"==typeof a&&a(e),r&&t.length===++l&&r(l)})})}else t?h(t,n,i,function(e){a&&"function"==typeof a&&a(e),r&&r(1),t=null}):r&&r(0)};"object"==typeof module&&"object"==typeof module.exports?module.exports=exports=g:"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof t&&(t.SVGInjector=g)}(window,document); -//# sourceMappingURL=svg-injector.map.js \ No newline at end of file diff --git a/tests/race-condition/assets/svg/thumb-up.svg b/tests/race-condition/assets/svg/thumb-up.svg deleted file mode 100755 index 2c936b6..0000000 --- a/tests/race-condition/assets/svg/thumb-up.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - \ No newline at end of file diff --git a/tests/race-condition/js/svg-injector.min.js b/tests/race-condition/js/svg-injector.min.js deleted file mode 100755 index dcdb71e..0000000 --- a/tests/race-condition/js/svg-injector.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * SVGInjector v1.1.2 - Fast, caching, dynamic inline SVG DOM injection library - * https://github.com/iconic/SVGInjector - * - * Copyright (c) 2014 Waybury - * @license MIT - */ -!function(t,e){"use strict";function r(t){t=t.split(" ");for(var e={},r=t.length,n=[];r--;)e.hasOwnProperty(t[r])||(e[t[r]]=1,n.unshift(t[r]));return n.join(" ")}var n="file:"===t.location.protocol,i=e.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"),o=Array.prototype.forEach||function(t,e){if(void 0===this||null===this||"function"!=typeof t)throw new TypeError;var r,n=this.length>>>0;for(r=0;n>r;++r)r in this&&t.call(e,this[r],r,this)},a={},s=0,l=[],u=[],c={},f=function(t){return t.cloneNode(!0)},p=function(t,e){u[t]=u[t]||[],u[t].push(e)},d=function(t){for(var e=0,r=u[t].length;r>e;e++)!function(e){setTimeout(function(){u[t][e](f(a[t]))},0)}(e)},h=function(e,r){if(void 0!==a[e])a[e]instanceof SVGSVGElement?r(f(a[e])):p(e,r);else{if(!t.XMLHttpRequest)return r("Browser does not support XMLHttpRequest"),!1;a[e]={},p(e,r);var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(404===i.status||null===i.responseXML)return r("Unable to load SVG file: "+e),n&&r("Note: SVG injection ajax calls do not work locally without adjusting security setting in your browser. Or consider using a local webserver."),r(),!1;if(!(200===i.status||n&&0===i.status))return r("There was a problem injecting the SVG: "+i.status+" "+i.statusText),!1;if(i.responseXML instanceof Document)a[e]=i.responseXML.documentElement;else if(DOMParser&&DOMParser instanceof Function){var t;try{var o=new DOMParser;t=o.parseFromString(i.responseText,"text/xml")}catch(s){t=void 0}if(!t||t.getElementsByTagName("parsererror").length)return r("Unable to parse SVG file: "+e),!1;a[e]=t.documentElement}d(e)}},i.open("GET",e),i.overrideMimeType&&i.overrideMimeType("text/xml"),i.send()}},v=function(e,n,a,u){var f=e.getAttribute("data-src")||e.getAttribute("src");if(!/\.svg/i.test(f))return void u("Attempted to inject a file with a non-svg extension: "+f);if(!i){var p=e.getAttribute("data-fallback")||e.getAttribute("data-png");return void(p?(e.setAttribute("src",p),u(null)):a?(e.setAttribute("src",a+"/"+f.split("/").pop().replace(".svg",".png")),u(null)):u("This browser does not support SVG and no PNG fallback was defined."))}-1===l.indexOf(e)&&(l.push(e),e.setAttribute("src",""),h(f,function(i){if("undefined"==typeof i||"string"==typeof i)return u(i),!1;var a=e.getAttribute("id");a&&i.setAttribute("id",a);var p=e.getAttribute("title");p&&i.setAttribute("title",p);var d=[].concat(i.getAttribute("class")||[],"injected-svg",e.getAttribute("class")||[]).join(" ");i.setAttribute("class",r(d));var h=e.getAttribute("style");h&&i.setAttribute("style",h);var v=[].filter.call(e.attributes,function(t){return/^data-\w[\w\-]*$/.test(t.name)});o.call(v,function(t){t.name&&t.value&&i.setAttribute(t.name,t.value)});for(var g,b=i.querySelectorAll("defs clipPath[id]"),m=0,y=b.length;y>m;m++){g=b[m].id+"-"+s;for(var A=i.querySelectorAll('[clip-path*="'+b[m].id+'"]'),w=0,S=A.length;S>w;w++)A[w].setAttribute("clip-path","url(#"+g+")");b[m].id=g}for(var x,j=i.querySelectorAll("defs mask[id]"),T=0,G=j.length;G>T;T++){x=j[T].id+"-"+s;for(var M=i.querySelectorAll('[mask*="'+j[T].id+'"]'),V=0,q=M.length;q>V;V++)M[V].setAttribute("mask","url(#"+x+")");j[T].id=x}i.removeAttribute("xmlns:a");for(var k,E,O=i.querySelectorAll("script"),L=[],P=0,X=O.length;X>P;P++)E=O[P].getAttribute("type"),E&&"application/ecmascript"!==E&&"application/javascript"!==E||(k=O[P].innerText||O[P].textContent,L.push(k),i.removeChild(O[P]));if(L.length>0&&("always"===n||"once"===n&&!c[f])){for(var F=0,N=L.length;N>F;F++)new Function(L[F])(t);c[f]=!0}e.parentNode.replaceChild(i,e),delete l[l.indexOf(e)],e=null,s++,u(i)}))},g=function(t,e,r){e=e||{};var n=e.evalScripts||"always",i=e.pngFallback||!1,a=e.each;if(void 0!==t.length){var s=0;o.call(t,function(e){v(e,n,i,function(e){a&&"function"==typeof a&&a(e),r&&t.length===++s&&r(s)})})}else t?v(t,n,i,function(e){a&&"function"==typeof a&&a(e),r&&r(1),t=null}):r&&r(0)};"object"==typeof module&&"object"==typeof module.exports?module.exports=exports=g:"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof t&&(t.SVGInjector=g)}(window,document); -//# sourceMappingURL=svg-injector.map.js \ No newline at end of file