Skip to content

Commit f59961e

Browse files
committed
Added custom jshint & jscs and validated all JS - Before theme restructuring
1 parent 274d0e0 commit f59961e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+618
-196
lines changed

.jscsrc

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"requireCurlyBraces": [
3+
"if",
4+
"else",
5+
"for",
6+
"while",
7+
"do",
8+
"try",
9+
"catch"
10+
],
11+
"esnext": true,
12+
"requireCamelCaseOrUpperCaseIdentifiers": true,
13+
"maximumLineLength": {
14+
"value": 120,
15+
"allowComments": true,
16+
"allowRegex": true
17+
},
18+
"validateIndentation": 2,
19+
"validateQuoteMarks": "'",
20+
"validateParameterSeparator": ", ",
21+
22+
"disallowMultipleLineStrings": true,
23+
"disallowMixedSpacesAndTabs": true,
24+
"disallowTrailingWhitespace": true,
25+
"disallowTrailingComma": true,
26+
"disallowSpaceAfterPrefixUnaryOperators": true,
27+
"disallowSpacesInCallExpression": true,
28+
"disallowPaddingNewlinesInBlocks": true,
29+
"requireCommaBeforeLineBreak": true,
30+
"requireCapitalizedConstructors": true,
31+
32+
"disallowKeywordsOnNewLine": ["else", "catch", "finally"],
33+
34+
"requireSpaceAfterKeywords": [
35+
"if",
36+
"else",
37+
"for",
38+
"switch",
39+
"return",
40+
"try"
41+
],
42+
"requireSpaceBeforeBinaryOperators": [
43+
"=", "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=",
44+
"&=", "|=", "^=", "+=",
45+
"+", "-", "*", "/", "%", "<<", ">>", ">>>", "&",
46+
"|", "^", "&&", "||", "===", "==", ">=",
47+
"<=", "<", ">", "!=", "!=="
48+
],
49+
"requireSpaceAfterBinaryOperators": true,
50+
"requireSpacesInConditionalExpression": true,
51+
"requireSpaceBeforeBlockStatements": true,
52+
"requireLineFeedAtFileEnd": true,
53+
"requireSpacesInFunctionExpression": {
54+
"beforeOpeningCurlyBrace": true
55+
},
56+
"disallowSpacesInAnonymousFunctionExpression": {
57+
"beforeOpeningRoundBrace": true
58+
},
59+
"disallowSpacesInsideObjectBrackets": "nested",
60+
"disallowSpacesInsideArrayBrackets": "nested",
61+
"disallowSpacesInsideParentheses": true,
62+
"disallowSpaceAfterObjectKeys": true,
63+
"requireSpaceBeforeObjectValues": true,
64+
65+
"disallowNewlineBeforeBlockStatements": true,
66+
67+
"fileExtensions": [ ".js", "jscs", ".es6" ],
68+
69+
"requireSpaceBetweenArguments": true,
70+
"requireParenthesesAroundIIFE": true,
71+
72+
"disallowKeywords": ["with"],
73+
"disallowImplicitTypeConversion": ["string"],
74+
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
75+
76+
"safeContextKeyword": "_this",
77+
"requireBlocksOnNewline": 1,
78+
"requireLineBreakAfterVariableAssignment": true,
79+
"requireMultipleVarDecl": "onevar",
80+
81+
"excludeFiles": [
82+
]
83+
}

.jshintrc

+82-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,90 @@
11
{
2+
"passfail": false,
3+
"maxerr": 100,
4+
"browser": true,
5+
"node": true,
6+
"rhino": false,
7+
"couch": false,
8+
"wsh": true,
9+
"jquery": true,
10+
"prototypejs": false,
11+
"mootools": false,
12+
"dojo": false,
13+
"debug": true,
14+
"devel": true,
15+
"strict": false,
16+
"globalstrict": false,
217
"esnext": true,
3-
"bitwise": true,
18+
"asi": false,
19+
"laxbreak": false,
20+
"bitwise": false,
21+
"boss": false,
422
"curly": true,
523
"eqeqeq": true,
24+
"eqnull": false,
25+
"evil": false,
26+
"expr": true,
27+
"forin": false,
28+
"immed": true,
629
"latedef": false,
30+
"loopfunc": false,
731
"noarg": true,
32+
"regexp": true,
33+
"regexdash": false,
34+
"scripturl": true,
35+
"shadow": true,
36+
"supernew": false,
837
"undef": true,
9-
"unused": true,
10-
"validthis": true,
11-
"jasmine": true,
12-
"globals": {
13-
"angular": false,
14-
"inject": false,
15-
"module": false,
16-
"io": true,
17-
"socket": true,
18-
"toastr": true
19-
},
20-
"devel": {
21-
"console": true
22-
}
38+
"funcscope": false,
39+
"iterator": false,
40+
"lastsemic": false,
41+
"laxcomma": false,
42+
"nonstandard": true,
43+
"onecase": false,
44+
"proto": false,
45+
"smarttabs": false,
46+
"validthis": false,
47+
"unused": false,
48+
"newcap": true,
49+
"noempty": false,
50+
"nonew": true,
51+
"nomen": false,
52+
"onevar": false,
53+
"plusplus": false,
54+
"sub": true,
55+
"trailing": true,
56+
"white": true,
57+
"indent": 2,
58+
"predef": [
59+
"define",
60+
"describe",
61+
"beforeEach",
62+
"afterEach",
63+
"beforeAll",
64+
"afterAll",
65+
"expect",
66+
"it",
67+
"xit",
68+
"IScroll",
69+
"moment",
70+
"inject",
71+
"jasmine",
72+
"xdescribe",
73+
"Snap",
74+
"mina",
75+
"TestElement",
76+
"TestUtils",
77+
"sprintf",
78+
"angular",
79+
"_",
80+
"wrapGenerator",
81+
"bouncefix",
82+
"spyOn",
83+
"google",
84+
"d3",
85+
"_satellite",
86+
"picturefill",
87+
"io",
88+
"socket"
89+
]
2390
}

.jshintrc_

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"esnext": true,
3+
"bitwise": true,
4+
"curly": true,
5+
"eqeqeq": true,
6+
"latedef": false,
7+
"noarg": true,
8+
"undef": true,
9+
"unused": true,
10+
"validthis": true,
11+
"jasmine": true,
12+
"globals": {
13+
"angular": false,
14+
"inject": false,
15+
"module": false,
16+
"io": true,
17+
"socket": true,
18+
"toastr": true
19+
},
20+
"devel": {
21+
"console": true
22+
}
23+
}

dist/favicon.ico

-4.19 KB
Binary file not shown.

dist/favicon.png

2.18 KB
Loading

dist/index.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<!doctype html><html ng-app="volumio"><head><meta charset="utf-8"><title>Volumio</title><meta name="description" content=""><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><link rel="stylesheet" href="styles/vendor-cd4f69ac82.css"><link rel="stylesheet" href="styles/app-2fc5dea85d.css"></head><body><!--[if lt IE 10]>
1+
<!doctype html><html ng-app="volumio"><head><meta charset="utf-8"><title>Axiom air</title><meta name="description" content=""><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><link rel="shortcut icon" type="image/png" href="favicon.png"><link rel="stylesheet" href="styles/vendor-cd4f69ac82.css"><link rel="stylesheet" href="styles/app-83f16077a4.css"></head><body><!--[if lt IE 10]>
22
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
3-
<![endif]--><div ui-view="layout"></div><script src="scripts/vendor-f1865dec62.js"></script><script src="scripts/app-47a349f7e2.js"></script></body></html>
3+
<![endif]--><div ui-view="layout"></div><script src="scripts/vendor-f1865dec62.js"></script><script src="scripts/app-5feaddcfe9.js"></script></body></html>

dist/scripts/app-47a349f7e2.js

-5
This file was deleted.

dist/scripts/app-5feaddcfe9.js

+5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/styles/app-2fc5dea85d.css

-1
This file was deleted.

dist/styles/app-83f16077a4.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulp/build.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// jshint ignore: start
2+
// jscs:disable
13
'use strict';
24

35
var path = require('path');

gulp/scripts.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// jshint ignore: start
2+
// jscs:disable
13
'use strict';
24

35
var path = require('path');

gulp/server.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// jshint ignore: start
2+
// jscs:disable
13
'use strict';
24

35
var path = require('path');

gulp/styles.js

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// jshint ignore: start
2+
// jscs:disable
13
'use strict';
24

35
var path = require('path');

src/app/browse/browse.controller.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class BrowseController {
2-
constructor (browseService, playQueueService, playlistService, socketService, $modal) {
2+
constructor(browseService, playQueueService, playlistService, socketService, $modal) {
33
'ngInject';
44
this.browseService = browseService;
55
this.playQueueService = playQueueService;
@@ -62,12 +62,12 @@ class BrowseController {
6262
modalInstance.result.then(() => {}, () => {});
6363
}
6464

65-
deletePlaylist(item){
65+
deletePlaylist(item) {
6666
console.log('browse - deletePlaylist', item);
6767
this.playlistService.deletePlaylist(item.title);
6868
}
6969

70-
addToFavourites(item){
70+
addToFavourites(item) {
7171
console.log('browse - addToFavourites', item);
7272
this.playlistService.addToFavourites(item);
7373
}

src/app/browse/browse.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<img ng-if="item.image" ng-src="{{item.albumart}}" alt="" style="height:80px;"/>
4848
<i ng-if="item.icon" class="{{item.icon}}"></i>
4949
</td>
50-
<td>{{item.title}} - {{item.type}}</td>
50+
<td>{{item.title}}</td>
5151
<td>{{item.album}}</td>
5252
<td>{{item.artist}}</td>
5353
<td>
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
1-
<div class="modal-header">
2-
<h3 class="modal-title">{{modalPlaylist.params.title}}</h3>
3-
</div>
4-
<div class="modal-body">
5-
<ul class="list-group">
6-
<li class="list-group-item">
7-
<input type="text" ng-model="modalPlaylist.customPlaylist">
8-
<button type="button" ng-click="modalPlaylist.addToCustomPlaylist()">New</button>
9-
</li>
10-
<li class="list-group-item"
11-
ng-click="modalPlaylist.addToFavourite()"
12-
>
13-
Favourites
14-
</li>
15-
<li ng-repeat="playlist in modalPlaylist.params.playlists track by $index"
16-
class="list-group-item"
17-
ng-click="modalPlaylist.addToPlaylist(playlist)"
18-
>
19-
{{playlist}}
20-
</li>
21-
</ul>
22-
</div>
23-
<div class="modal-footer">
24-
<!-- <button class="btn btn-primary" ng-click="modalPlaylist.ok()">Add</button> -->
25-
<button class="btn btn-warning" ng-click="modalPlaylist.cancel()">Cancel</button>
1+
<div id="modalPlaylist">
2+
<div class="modal-header">
3+
<h3 class="modal-title">{{modalPlaylist.params.title}}</h3>
4+
</div>
5+
<div class="modal-body">
6+
<input type="text" ng-model="modalPlaylist.customPlaylist">
7+
<button type="button" ng-click="modalPlaylist.addToCustomPlaylist()">
8+
New
9+
</button>
10+
<ul class="list-group">
11+
<li class="list-group-item"
12+
ng-click="modalPlaylist.addToFavourite()">
13+
Favourites
14+
</li>
15+
<li ng-repeat="playlist in modalPlaylist.params.playlists track by $index"
16+
class="list-group-item"
17+
ng-click="modalPlaylist.addToPlaylist(playlist)">
18+
{{playlist}}
19+
</li>
20+
</ul>
21+
</div>
22+
<div class="modal-footer">
23+
<!-- <button class="btn btn-primary" ng-click="modalPlaylist.ok()">Add</button> -->
24+
<button class="btn btn-warning" ng-click="modalPlaylist.cancel()">
25+
Cancel
26+
</button>
27+
</div>
2628
</div>

src/app/components/player-buttons/player-buttons.directive.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class PlayerButtonsDirective {
2-
constructor () {
2+
constructor() {
33
'ngInject';
44

55
let directive = {
@@ -10,13 +10,12 @@ class PlayerButtonsDirective {
1010
controllerAs: 'playerButtons',
1111
bindToController: true
1212
};
13-
1413
return directive;
1514
}
1615
}
1716

1817
class PlayerButtonsController {
19-
constructor (playerService) {
18+
constructor(playerService) {
2019
'ngInject';
2120
this.playerService = playerService;
2221
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
class ModalAlarmClockController {
2+
constructor ($modalInstance, socketService, params) {
3+
'ngInject';
4+
this.$modalInstance = $modalInstance;
5+
this.socketService = socketService;
6+
this.params = params;
7+
console.log(params);
8+
this.init();
9+
}
10+
11+
cancel() {
12+
this.$modalInstance.dismiss('cancel');
13+
}
14+
15+
init() {
16+
this.registerListner();
17+
this.initService();
18+
}
19+
20+
registerListner() {
21+
// this.socketService.on('pushSleep', (data) => {
22+
// console.warn('pushSleep', data);
23+
// //this.menuItems = data;
24+
// });
25+
}
26+
27+
initService() {
28+
//this.socketService.emit('getSleep');
29+
}
30+
}
31+
32+
export default ModalAlarmClockController;

0 commit comments

Comments
 (0)