Skip to content

Commit e6688d4

Browse files
authored
Merge branch 'master' into 227-headless-chrome-example
2 parents 53dc94f + 9a4c7fb commit e6688d4

8 files changed

Lines changed: 135 additions & 110 deletions

File tree

.eslintrc.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"node": true
5+
},
6+
"extends": "eslint:recommended",
7+
"rules": {
8+
"indent": [
9+
"error",
10+
4
11+
],
12+
"linebreak-style": [
13+
"error",
14+
"unix"
15+
],
16+
"semi": [
17+
"error",
18+
"always"
19+
],
20+
"no-undef": 0,
21+
"no-redeclare": 0
22+
}
23+
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package-lock.json
55
build/
66
node_modules/
77
Auditor/Auditor_with_beacon.js
8+
*.tgz
89

910
# OS generated files #
1011
######################
@@ -15,4 +16,4 @@ Auditor/Auditor_with_beacon.js
1516
.Trashes
1617
Icon?
1718
ehthumbs.db
18-
Thumbs.db
19+
Thumbs.db

.jshintrc

Lines changed: 0 additions & 4 deletions
This file was deleted.

Auditor/HTMLCSAuditor.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ _global.HTMLCSAuditor = new function()
197197
};
198198

199199
_doc.onmouseup = function(e) {
200+
var maxHeight = window.innerHeight - wrapper.offsetHeight;
201+
202+
if (mouseY > maxHeight) {
203+
wrapper.style.top = maxHeight + 'px';
204+
} else if (mouseY < 0) {
205+
wrapper.style.top = 0 + 'px';
206+
}
207+
200208
dragging = false;
201209
};
202210

Gruntfile.js

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
2+
module.exports = function (grunt) {
3+
grunt.initConfig({
4+
pkg: grunt.file.readJSON('./package.json'),
5+
eslint: {
6+
target: ['Standards/**/*.js', 'Contrib/PhantomJS/*.js']
7+
},
8+
uglify: {
9+
debug: {
10+
options: {
11+
compress: false,
12+
mangle: false,
13+
beautify: true,
14+
preserveComments: true,
15+
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js'),
16+
footer: grunt.file.read('Contrib/Build/umd-footer.js')
17+
},
18+
files: {
19+
'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/HTMLCSAuditor.js']
20+
}
21+
},
22+
dist: {
23+
options: {
24+
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/umd-header.js'),
25+
footer: grunt.file.read('Contrib/Build/umd-footer.js')
26+
},
27+
files: {
28+
'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/HTMLCSAuditor.js']
29+
}
30+
},
31+
bookmarklet: {
32+
options: {
33+
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %> */\n' + grunt.file.read('Contrib/Build/header-bookmarklet.js'),
34+
footer: grunt.file.read('Contrib/Build/umd-footer.js')
35+
},
36+
files: {
37+
'build/HTMLCS.js': ['Translations/*.js', 'Standards/**/*.js', 'HTMLCS.js', 'HTMLCS.Util.js', 'Contrib/PhantomJS/runner.js', 'Auditor/Auditor_with_beacon.js']
38+
}
39+
}
40+
},
41+
copy: {
42+
dist: {
43+
files: [
44+
{
45+
expand: true,
46+
flatten: true,
47+
src: 'Auditor/HTMLCSAuditor.css',
48+
rename: function (dest, src) {
49+
return dest + '/HTMLCS.css';
50+
},
51+
dest: 'build',
52+
filter: 'isFile'
53+
}, {
54+
expand: true,
55+
flatten: true,
56+
src: 'Auditor/Images/*',
57+
dest: 'build/Images',
58+
filter: 'isFile'
59+
}, {
60+
expand: true,
61+
flatten: true,
62+
src: 'licence.txt',
63+
dest: 'build',
64+
filter: 'isFile'
65+
}
66+
]
67+
}
68+
}
69+
});
70+
71+
grunt.file.setBase('./');
72+
require('load-grunt-tasks')(grunt);
73+
74+
grunt.registerTask('default', ['eslint']);
75+
grunt.registerTask('build', ['uglify:dist', 'copy:dist']);
76+
grunt.registerTask('build-bookmarklet', ['uglify:bookmarklet', 'copy:dist']);
77+
78+
return grunt.registerTask('build-debug', ['uglify:debug', 'copy:dist']);
79+
};

README.markdown

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,7 @@ Special thanks to:
188188

189189
* [nsulzycki](https://github.com/nsulzycki) (Polish Translation)
190190
* [dmassiani](https://github.com/dmassiani) (French Translation)
191+
192+
## License
193+
194+
Licensed under [the BSD 3-Clause "New" or "Revised" License](https://opensource.org/licenses/BSD-3-Clause).

gruntfile.coffee

Lines changed: 0 additions & 96 deletions
This file was deleted.

package.json

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,25 @@
22
"name": "html_codesniffer",
33
"version": "2.2.0",
44
"description": "HTML_CodeSniffer is a client-side JavaScript that checks a HTML document or source code, and detects violations of a defined coding standard.",
5+
"license": "BSD-3-Clause",
56
"main": "index.js",
67
"keywords": [
78
"htmlcs"
89
],
910
"scripts": {
11+
"prepack": "grunt build",
1012
"test": "echo \"Error: no test specified\" && exit 1"
1113
},
14+
"files": [
15+
"Auditor",
16+
"build",
17+
"Contrib",
18+
"Standards",
19+
"Translations",
20+
"HTMLCS.js",
21+
"HTMLCS.Util.js",
22+
"index.js"
23+
],
1224
"repository": {
1325
"type": "git",
1426
"url": "https://github.com/squizlabs/HTML_CodeSniffer.git"
@@ -18,14 +30,12 @@
1830
"url": "https://github.com/squizlabs/HTML_CodeSniffer/issues"
1931
},
2032
"homepage": "http://squizlabs.github.io/HTML_CodeSniffer/",
21-
"dependencies": {
22-
"grunt": "^1.0.0",
23-
"grunt-contrib-copy": "^1.0.0",
24-
"grunt-contrib-jshint": "^1.0.0",
25-
"grunt-contrib-watch": "^1.0.0",
26-
"load-grunt-tasks": "^3.5.2"
27-
},
2833
"devDependencies": {
29-
"grunt-contrib-uglify": "^2.3.0"
34+
"grunt": "^1.0.3",
35+
"grunt-contrib-copy": "^1.0.0",
36+
"grunt-eslint": "^21.0.0",
37+
"grunt-contrib-watch": "^1.1.0",
38+
"load-grunt-tasks": "^4.0.0",
39+
"grunt-contrib-uglify": "^4.0.0"
3040
}
31-
}
41+
}

0 commit comments

Comments
 (0)