Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize .min files #123

Merged
merged 2 commits into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ module.exports = function (grunt) {
LEGACY_SUPPORT: false
}
},
preserveComments: 'some'
mangle: true,
preserveComments: false
}
},
legacy: {
Expand Down Expand Up @@ -101,7 +102,8 @@ module.exports = function (grunt) {
LEGACY_SUPPORT: true
}
},
preserveComments: 'some'
mangle: true,
preserveComments: false
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To support Internet Explorer 6-8, include the legacy script instead.
<script>svg4everybody(); // run it now or whenever you are ready</script>
```

_As of v2.0.0, you must the manually call `svg4everybody()`. If you are using an AMD/CommonJS dependency loader then you may call it within the callback closure._
_As of v2.0.0, you must manually call `svg4everybody()`. If you are using an AMD/CommonJS dependency loader then you may call it within the callback closure._

IE 6-8 require you to put the script in the `<head>` in order to shiv `<svg>` and `<use>` elements. For best results in IE, set [X-UA-Compatible] to `ie=edge`. This can be done with a response header from the server or the following HTML in the `<head>`.

Expand Down
5 changes: 4 additions & 1 deletion dist/svg4everybody.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
define([], function() {
return root.svg4everybody = factory();
}) : "object" == typeof exports ? module.exports = factory() : root.svg4everybody = factory();
}) : "object" == typeof exports ? // Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory() : root.svg4everybody = factory();
}(this, function() {
/*! svg4everybody v2.1.0 | github.com/jonathantneal/svg4everybody */
function embed(svg, target) {
Expand Down
10 changes: 8 additions & 2 deletions dist/svg4everybody.legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"function" == typeof define && define.amd ? // AMD. Register as an anonymous module unless amdModuleId is set
define([], function() {
return root.svg4everybody = factory();
}) : "object" == typeof exports ? module.exports = factory() : root.svg4everybody = factory();
}) : "object" == typeof exports ? // Node. Does not work with strict CommonJS, but
// only CommonJS-like environments that support module.exports,
// like Node.
module.exports = factory() : root.svg4everybody = factory();
}(this, function() {
/*! svg4everybody v2.1.0 | github.com/jonathantneal/svg4everybody */
function embed(svg, target) {
Expand Down Expand Up @@ -95,9 +98,12 @@
requestAnimationFrame(oninterval, 67);
}
var nosvg, fallback, opts = Object(rawopts);
// configure the fallback method
fallback = opts.fallback || function(src) {
return src.replace(/\?[^#]+/, "").replace("#", ".").replace(/^\./, "") + ".png" + (/\?[^#]+/.exec(src) || [ "" ])[0];
}, nosvg = "nosvg" in opts ? opts.nosvg : /\bMSIE [1-8]\b/.test(navigator.userAgent),
}, // set whether to shiv <svg> and <use> elements and use image fallbacks
nosvg = "nosvg" in opts ? opts.nosvg : /\bMSIE [1-8]\b/.test(navigator.userAgent),
// conditionally shiv <svg> and <use>
nosvg && (document.createElement("svg"), document.createElement("use"));
// set whether the polyfill will be activated or not
var polyfill, olderIEUA = /\bMSIE [1-8]\.0\b/, newerIEUA = /\bTrident\/[567]\b|\bMSIE (?:9|10)\.0\b/, webkitUA = /\bAppleWebKit\/(\d+)\b/, olderEdgeUA = /\bEdge\/12\.(\d+)\b/;
Expand Down
70 changes: 1 addition & 69 deletions dist/svg4everybody.legacy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 1 addition & 64 deletions dist/svg4everybody.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.