Reorganizes the entire app to follow Google's best practice recommendations for Angular App Structure.
see: https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub The files are now grouped by view / component. Tests are located beside tested js files. The Grunt build will be responsible for only distributing actual files without the tests. Each partial is at the same level as the js files related to it. Ideally css files should be at the same level, maybe I'll refactor this later. Moves all non-bower plugins to app/vendor. Moves all images to app/images and styles to app/styles. Merges the test and non-test jshintrc files. Adds all the Jamstash contributors to the package.json file while I was refactoring. Conflicts: app/app.js app/images/vgrabber.gif app/images/vgrabber2-active.gif app/images/vgrabber2-normal.gif app/index.html
15
.jshintrc
|
@ -17,9 +17,20 @@
|
||||||
"trailing": true,
|
"trailing": true,
|
||||||
"smarttabs": true,
|
"smarttabs": true,
|
||||||
"globals": {
|
"globals": {
|
||||||
|
"_": false,
|
||||||
|
"after": false,
|
||||||
|
"afterEach": false,
|
||||||
"angular": false,
|
"angular": false,
|
||||||
"_": false
|
"before": false,
|
||||||
},
|
"beforeEach": false,
|
||||||
|
"browser": false,
|
||||||
|
"describe": false,
|
||||||
|
"expect": false,
|
||||||
|
"inject": false,
|
||||||
|
"it": false,
|
||||||
|
"jasmine": false,
|
||||||
|
"spyOn": false
|
||||||
|
}
|
||||||
"browser": true,
|
"browser": true,
|
||||||
"node": true,
|
"node": true,
|
||||||
"jquery": true
|
"jquery": true
|
||||||
|
|
18
Gruntfile.js
|
@ -34,14 +34,14 @@ module.exports = function (grunt) {
|
||||||
tasks: ['wiredep']
|
tasks: ['wiredep']
|
||||||
},
|
},
|
||||||
js: {
|
js: {
|
||||||
files: ['<%= yeoman.app %>/js/{,*/}*.js'],
|
files: ['<%= yeoman.app %>/**/*.js', '!<%= yeoman.app %>/**/*_test.js'],
|
||||||
tasks: ['karma:continuous:run'], //'newer:jshint:all'],
|
tasks: ['karma:continuous:run'], //'newer:jshint:all'],
|
||||||
options: {
|
options: {
|
||||||
livereload: '<%= connect.options.livereload %>'
|
livereload: '<%= connect.options.livereload %>'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
jsTest: {
|
jsTest: {
|
||||||
files: ['test/**/*_test.js'],
|
files: ['<%= yeoman.app %>/**/*_test.js'],
|
||||||
tasks: ['karma:continuous:run'], //'newer:jshint:test']
|
tasks: ['karma:continuous:run'], //'newer:jshint:test']
|
||||||
},
|
},
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -53,7 +53,7 @@ module.exports = function (grunt) {
|
||||||
},
|
},
|
||||||
livereload: {
|
livereload: {
|
||||||
files: [
|
files: [
|
||||||
'<%= yeoman.app %>/{,*/}*.html',
|
'<%= yeoman.app %>/**/*.html',
|
||||||
'.tmp/styles/{,*/}*.css',
|
'.tmp/styles/{,*/}*.css',
|
||||||
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
|
'<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
|
||||||
]
|
]
|
||||||
|
@ -92,7 +92,7 @@ module.exports = function (grunt) {
|
||||||
middleware: function (connect) {
|
middleware: function (connect) {
|
||||||
return [
|
return [
|
||||||
connect.static('.tmp'),
|
connect.static('.tmp'),
|
||||||
connect.static('test'),
|
//connect.static('test'),
|
||||||
connect().use(
|
connect().use(
|
||||||
'/bower_components',
|
'/bower_components',
|
||||||
connect.static('./bower_components')
|
connect.static('./bower_components')
|
||||||
|
@ -119,14 +119,8 @@ module.exports = function (grunt) {
|
||||||
all: {
|
all: {
|
||||||
src: [
|
src: [
|
||||||
'Gruntfile.js',
|
'Gruntfile.js',
|
||||||
'<%= yeoman.app %>/js/{,*/}*.js'
|
'<%= yeoman.app %>/**/*.js'
|
||||||
]
|
]
|
||||||
},
|
|
||||||
test: {
|
|
||||||
options: {
|
|
||||||
jshintrc: 'test/.jshintrc'
|
|
||||||
},
|
|
||||||
src: ['test/{,*/}*.js']
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -258,7 +252,7 @@ module.exports = function (grunt) {
|
||||||
// Test settings
|
// Test settings
|
||||||
karma: {
|
karma: {
|
||||||
options: {
|
options: {
|
||||||
configFile: 'test/karma.conf.js',
|
configFile: './karma.conf.js',
|
||||||
},
|
},
|
||||||
unit: {
|
unit: {
|
||||||
singleRun: true
|
singleRun: true
|
||||||
|
|
|
@ -7,16 +7,15 @@ var jamstash = angular.module('JamStash', ['ngCookies', 'ngRoute', 'ngSanitize',
|
||||||
jamstash.config(function ($routeProvider) {
|
jamstash.config(function ($routeProvider) {
|
||||||
$routeProvider
|
$routeProvider
|
||||||
.when('/index', { redirectTo: '/library' })
|
.when('/index', { redirectTo: '/library' })
|
||||||
.when('/settings', { templateUrl: 'js/partials/settings.html', controller: 'SettingsCtrl' })
|
.when('/settings', { templateUrl: 'settings/settings.html', controller: 'SettingsCtrl' })
|
||||||
.when('/queue', { templateUrl: 'js/partials/queue.html', controller: 'QueueCtrl' })
|
.when('/queue', { templateUrl: 'queue/queue.html', controller: 'QueueCtrl' })
|
||||||
.when('/library', { templateUrl: 'js/partials/library.html', controller: 'SubsonicCtrl' })
|
.when('/library', { templateUrl: 'subsonic/subsonic.html', controller: 'SubsonicCtrl' })
|
||||||
.when('/library/:artistId', { templateUrl: 'js/partials/library.html', controller: 'SubsonicCtrl', reloadOnSearch: false })
|
.when('/library/:artistId', { templateUrl: 'subsonic/subsonic.html', controller: 'SubsonicCtrl', reloadOnSearch: false })
|
||||||
.when('/library/:artistId/:albumId', { templateUrl: 'js/partials/library.html', controller: 'SubsonicCtrl', reloadOnSearch: false })
|
.when('/library/:artistId/:albumId', { templateUrl: 'subsonic/subsonic.html', controller: 'SubsonicCtrl', reloadOnSearch: false })
|
||||||
.when('/playlists', { templateUrl: 'js/partials/playlists.html', controller: 'PlaylistCtrl' })
|
.when('/podcasts', { templateUrl: 'podcasts/podcasts.html', controller: 'PodcastCtrl' })
|
||||||
.when('/podcasts', { templateUrl: 'js/partials/podcasts.html', controller: 'PodcastCtrl' })
|
.when('/archive', { templateUrl: 'archive/archive.html', controller: 'ArchiveCtrl' })
|
||||||
.when('/archive', { templateUrl: 'js/partials/archive.html', controller: 'ArchiveCtrl' })
|
.when('/archive/:artist', { templateUrl: 'archive/archive.html', controller: 'ArchiveCtrl' })
|
||||||
.when('/archive/:artist', { templateUrl: 'js/partials/archive.html', controller: 'ArchiveCtrl' })
|
.when('/archive/:artist/:album', { templateUrl: 'archive/archive.html', controller: 'ArchiveCtrl' })
|
||||||
.when('/archive/:artist/:album', { templateUrl: 'js/partials/archive.html', controller: 'ArchiveCtrl' })
|
|
||||||
.otherwise({ redirectTo: '/index' });
|
.otherwise({ redirectTo: '/index' });
|
||||||
});
|
});
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</li>
|
</li>
|
||||||
<ul class="simplelist songlist noselect" ng-if="song.length > 0">
|
<ul class="simplelist songlist noselect" ng-if="song.length > 0">
|
||||||
<div class="songs" ng-include src="'js/partials/songs.html'"></div>
|
<div class="songs" ng-include src="'common/songs.html'"></div>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
|
@ -45,7 +45,7 @@ jamstash.directive('fancybox', function ($compile) {
|
||||||
jamstash.directive('songpreview', function ($compile, subsonic) {
|
jamstash.directive('songpreview', function ($compile, subsonic) {
|
||||||
return {
|
return {
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
templateUrl: 'js/partials/songs.html',
|
templateUrl: 'common/songs.html',
|
||||||
replace: false,
|
replace: false,
|
||||||
// pass these two names from attrs into the template scope
|
// pass these two names from attrs into the template scope
|
||||||
scope: {
|
scope: {
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Provides generally useful functions, like sorts, date-related functions, localStorage access, etc.
|
* Provides generally useful functions, like sorts, date-related functions, localStorage access, etc.
|
||||||
*/
|
*/
|
||||||
angular.module('jamstash.utils', ['jamstash.globals'])
|
angular.module('jamstash.utils', ['jamstash.settings'])
|
||||||
|
|
||||||
.service('utils', function ($rootScope, globals) {
|
.service('utils', function ($rootScope, globals) {
|
||||||
'use strict';
|
'use strict';
|
Before Width: | Height: | Size: 723 B After Width: | Height: | Size: 723 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 776 B After Width: | Height: | Size: 776 B |
Before Width: | Height: | Size: 973 B After Width: | Height: | Size: 973 B |
Before Width: | Height: | Size: 993 B After Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 182 B After Width: | Height: | Size: 182 B |
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
Before Width: | Height: | Size: 213 B After Width: | Height: | Size: 213 B |
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 175 B |
Before Width: | Height: | Size: 199 B After Width: | Height: | Size: 199 B |
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 181 B |
Before Width: | Height: | Size: 54 B After Width: | Height: | Size: 54 B |
Before Width: | Height: | Size: 64 B After Width: | Height: | Size: 64 B |
Before Width: | Height: | Size: 299 B After Width: | Height: | Size: 299 B |
Before Width: | Height: | Size: 170 B After Width: | Height: | Size: 170 B |
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 257 B After Width: | Height: | Size: 257 B |
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
Before Width: | Height: | Size: 54 B After Width: | Height: | Size: 54 B |
Before Width: | Height: | Size: 210 B After Width: | Height: | Size: 210 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 870 B After Width: | Height: | Size: 870 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 88 KiB After Width: | Height: | Size: 88 KiB |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 265 B |
Before Width: | Height: | Size: 224 B After Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
Before Width: | Height: | Size: 228 B After Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 208 B After Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 159 B After Width: | Height: | Size: 159 B |
Before Width: | Height: | Size: 139 B After Width: | Height: | Size: 139 B |
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 137 B |
Before Width: | Height: | Size: 268 B After Width: | Height: | Size: 268 B |
Before Width: | Height: | Size: 255 B After Width: | Height: | Size: 255 B |
Before Width: | Height: | Size: 241 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 277 B |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 115 B After Width: | Height: | Size: 115 B |
Before Width: | Height: | Size: 156 B After Width: | Height: | Size: 156 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 151 B After Width: | Height: | Size: 151 B |
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
Before Width: | Height: | Size: 165 B After Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 164 B |
Before Width: | Height: | Size: 152 B After Width: | Height: | Size: 152 B |
Before Width: | Height: | Size: 141 B After Width: | Height: | Size: 141 B |
Before Width: | Height: | Size: 142 B After Width: | Height: | Size: 142 B |
Before Width: | Height: | Size: 239 B After Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 301 B After Width: | Height: | Size: 301 B |
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
Before Width: | Height: | Size: 393 B After Width: | Height: | Size: 393 B |
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 394 B After Width: | Height: | Size: 394 B |
Before Width: | Height: | Size: 240 B After Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 399 B After Width: | Height: | Size: 399 B |
Before Width: | Height: | Size: 307 B After Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 341 B After Width: | Height: | Size: 341 B |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |