Skip to content

Commit

Permalink
2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathantneal committed Feb 2, 2016
1 parent 103134f commit 7d747cc
Show file tree
Hide file tree
Showing 19 changed files with 487 additions and 93 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{json,yml}]
indent_size = 2
indent_style = space
153 changes: 153 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
{
"env": {
"browser": true,
"node": true
},
"rules": {
"accessor-pairs": [2],
"block-scoped-var": [2],
"callback-return": [2],
"complexity": [2, 15],
"consistent-return": [2],
"consistent-this": [2, "self"],
"constructor-super": [2],
"default-case": [2],
"eqeqeq": [2],
"func-style": [0],
"global-require": [2],
"guard-for-in": [0],
"handle-callback-err": [2, "^err(or)?$"],
"id-length": [0],
"id-match": [0],
"init-declarations": [0],
"max-depth": [2, 6],
"max-nested-callbacks": [2, 3],
"max-params": [2, 3],
"max-statements": [0],
"new-parens": [0],
"no-alert": [2],
"no-array-constructor": [0],
"no-bitwise": [0],
"no-caller": [2],
"no-case-declarations": [2],
"no-catch-shadow": [2],
"no-class-assign": [2],
"no-cond-assign": [2],
"no-console": [0],
"no-const-assign": [2],
"no-constant-condition": [0],
"no-continue": [0],
"no-control-regex": [2],
"no-debugger": [2],
"no-delete-var": [2],
"no-div-regex": [0],
"no-dupe-args": [2],
"no-dupe-class-members": [2],
"no-dupe-keys": [2],
"no-duplicate-case": [2],
"no-else-return": [0],
"no-empty-character-class": [2],
"no-empty-label": [2],
"no-empty-pattern": [2],
"no-empty": [2],
"no-eq-null": [2],
"no-eval": [2],
"no-ex-assign": [2],
"no-extend-native": [0],
"no-extra-bind": [2],
"no-extra-boolean-cast": [2],
"no-extra-parens": [2],
"no-extra-semi": [2],
"no-fallthrough": [2],
"no-floating-decimal": [2],
"no-func-assign": [2],
"no-implicit-coercion": [2],
"no-implicit-globals": [0],
"no-implied-eval": [2],
"no-inline-comments": [0],
"no-inner-declarations": [2],
"no-invalid-regexp": [2],
"no-invalid-this": [0],
"no-irregular-whitespace": [2],
"no-iterator": [2],
"no-label-var": [2],
"no-labels": [0],
"no-lone-blocks": [2],
"no-lonely-if": [2],
"no-loop-func": [2],
"no-magic-numbers": [2],
"no-mixed-requires": [0],
"no-multi-str": [2],
"no-native-reassign": [2],
"no-negated-condition": [0],
"no-negated-in-lhs": [2],
"no-nested-ternary": [0],
"no-new-func": [0],
"no-new-object": [2],
"no-new-require": [0],
"no-new-wrappers": [2],
"no-new": [2],
"no-obj-calls": [2],
"no-octal-escape": [2],
"no-octal": [2],
"no-param-reassign": [2],
"no-path-concat": [2],
"no-plusplus": [0],
"no-process-env": [2],
"no-process-exit": [0],
"no-proto": [2],
"no-redeclare": [2],
"no-regex-spaces": [0],
"no-restricted-imports": [0],
"no-restricted-syntax": [0],
"no-return-assign": [2],
"no-script-url": [0],
"no-self-compare": [2],
"no-sequences": [2],
"no-shadow-restricted-names": [2],
"no-shadow": [2],
"no-sparse-arrays": [2],
"no-sync": [0],
"no-ternary": [0],
"no-this-before-super": [2],
"no-throw-literal": [2],
"no-undef-init": [0],
"no-undef": [2],
"no-undefined": [0],
"no-unneeded-ternary": [2],
"no-unreachable": [2],
"no-unused-expressions": [2],
"no-unused-vars": [2],
"no-use-before-define": [0],
"no-useless-call": [2],
"no-useless-concat": [2],
"no-var": [0],
"no-void": [0],
"no-with": [2],
"object-shorthand": [0],
"one-var": [0],
"operator-assignment": [2, "always"],
"prefer-arrow-callback": [0],
"prefer-const": [0],
"prefer-reflect": [0],
"prefer-rest-params": [0],
"prefer-spread": [0],
"prefer-template": [0],
"quotes": [0],
"radix": [2, "as-needed"],
"require-yield": [0],
"sort-imports": [0],
"sort-vars": [0],
"strict": [0],
"use-isnan": [2],
"valid-typeof": [2],
"vars-on-top": [0],
"wrap-iife": [2, "inside"],
"wrap-regex": [0],
"yoda": [0],

"camelcase": [0],
"key-spacing": [0],
"spaced-comment": [0]
}
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
node_modules/
node_modules
npm-debug.log
102 changes: 102 additions & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"disallowKeywords": [
"with"
],
"disallowKeywordsOnNewLine": [
"else"
],
"disallowMultipleSpaces": false,
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineBreaks": true,
"disallowMultipleLineStrings": true,
"disallowMultipleVarDecl": true,
"disallowNewlineBeforeBlockStatements": true,
"disallowSpaceAfterObjectKeys": true,
"disallowSpaceAfterPrefixUnaryOperators": true,
"disallowSpacesInCallExpression": true,
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInsideArrayBrackets": "all",
"disallowSpacesInsideObjectBrackets": "all",
"disallowSpacesInsideParentheses": true,
"disallowTrailingWhitespace": true,
"maximumLineLength": null,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
"requireDotNotation": true,
"requireLineFeedAtFileEnd": true,
"requireOperatorBeforeLineBreak": true,
"requireSemicolons": true,
"requireSpaceAfterBinaryOperators": true,
"requireSpaceAfterKeywords": [
"if",
"else",
"for",
"while",
"do",
"switch",
"return",
"try",
"catch"
],
"requireSpaceBeforeBinaryOperators": [
"=",
"+=",
"-=",
"*=",
"/=",
"%=",
"<<=",
">>=",
">>>=",
"&=",
"|=",
"^=",
"+=",
"+",
"-",
"*",
"/",
"%",
"<<",
">>",
">>>",
"&",
"|",
"^",
"&&",
"||",
"===",
"==",
">=",
"<=",
"<",
">",
"!=",
"!=="
],
"requireSpaceBeforeBlockStatements": true,
"requireSpaceBeforeObjectValues": true,
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": true,
"beforeOpeningRoundBrace": true
},
"requireSpacesInConditionalExpression": true,
"requireSpacesInForStatement": true,
"requireSpacesInFunctionDeclaration": {
"beforeOpeningCurlyBrace": true
},
"validateIndentation": "\t",
"validateParameterSeparator": ", ",
"validateQuoteMarks": "'"
}
4 changes: 0 additions & 4 deletions .jshintrc

This file was deleted.

1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sudo: false
language: node_js
node_js:
- "0.12"
before_script:
- npm install grunt-cli -g
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## 2.0.2 (2016-02-02)

- Use non-minified non-legacy version as main file
- Adding caching for elements
- Update project configuration and stricter linting
- Add a test page
- Updated documentation

## 2.0.1 (2015-11-24)

- Fix infinite loop issue with invalid <use> tags
Expand Down
47 changes: 39 additions & 8 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,45 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: true
eslint: {
gruntfile: {
options: {
rules: {
camelcase: [0],
'global-require': [0]
}
},
files: {
src: ['Gruntfile.js']
}
},
buildfile: {
options: {
globals: ['LEGACY_SUPPORT', 'svg4everybody'],
rules: {
'no-magic-numbers': [0],
'no-unused-vars': [0]
}
},
files: {
src: ['lib/svg4everybody.js']
}
}
},
jscs: {
gruntfile: {
options: {
requireCamelCaseOrUpperCaseIdentifiers: null
},
files: {
src: ['Gruntfile.js']
}
},
build: [
'Gruntfile.js',
'lib/svg4everybody.js'
]
buildfile: {
files: {
src: ['lib/svg4everybody.js']
}
}
},
uglify: {
build: {
Expand Down Expand Up @@ -93,7 +124,7 @@ module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);

// npm run test
grunt.registerTask('test', ['jshint']);
grunt.registerTask('test', ['eslint', 'jscs']);

// npm run build, grunt build
grunt.registerTask('build', ['test', 'umd', 'uglify']);
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# SVG for Everybody

[![NPM Version][npm-img]][npm] [![Build Status][ci-img]][ci]

[SVG for Everybody] adds [SVG External Content] support to [all browsers].

To use it now, include the script in your document.
Expand Down Expand Up @@ -210,6 +212,11 @@ $ [sudo] npm install -g svgo
$ svgo spritemap.svg
```

[ci]: https://travis-ci.org/jonathantneal/svg4everybody
[ci-img]: https://img.shields.io/travis/jonathantneal/svg4everybody.svg
[npm]: https://www.npmjs.com/package/svg4everybody
[npm-img]: https://img.shields.io/npm/v/svg4everybody.svg

[all browsers]: http://caniuse.com/svg
[David Storey]: https://twitter.com/dstorey/status/626514631884804096
[dreams came true]: https://dev.windows.com/en-us/microsoft-edge/platform/changelog/desktop/10586/?compareWith=10240
Expand Down
Loading

0 comments on commit 7d747cc

Please sign in to comment.