Commit graph

7 commits

Author SHA1 Message Date
Hyzual
a1d48bbd30 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
2014-11-09 16:10:34 +01:00
Hyzual
b190d2f99f Moves the subsonic controller into its own module.
Removes many injected params that weren't used at all in it.
Removes the old commented getStarred function from the subsonic service.
2014-11-09 16:05:12 +01:00
Hyzual
1a830d6cef Splits all the services into different jamstash.* modules.
That way dependencies are actually visible and can be managed
e.g. Jamstash doesn't depend upon underscore directly anymore, it's just the subsonic service that needs it.
2014-11-09 16:05:11 +01:00
Hyzual
00837e946e Completes getRandomStarredSongs() with further error handling and using underscore's sample function. 2014-11-09 16:01:55 +01:00
Hyzual
c5cbad003f Refactors the getStarred function, refactors its tests.
getStarred queries the Subsonic server and caches the request. It handles both GET and JSONP. It returns meaningful messages when there is a problem and distinguishes between HTTP errors and Subsonic errors.
Those messages are meant to be displayed by the controller using the notifications.

The tests are refactored too : most of what is common is at the top describe to keep the tests lean. Tests for error conditions have been added.
2014-11-09 16:01:54 +01:00
Hyzual
2c6276cced Renames all tests according to angularseed's style convention.
Refactors subsonic service's getStarred method to use angular $http and to limit results on the client side since we can't do it with Subsonic's API.

Adds a working unit test for this new method.
2014-11-09 16:00:15 +01:00
Hyzual
3164f01407 Further separates services, directives and filters into individual files for a better organization.
Conflicts:
	js/app.js
	js/service.js
	js/services/utils-service.js
	test/services/model-service_test.js
2014-11-09 15:57:48 +01:00