diff --git a/.htaccess b/.htaccess index b5b463d..778cbf6 100755 --- a/.htaccess +++ b/.htaccess @@ -1,7 +1,5 @@ RewriteEngine On -RewriteRule ^spotify-authorization?$ /app/services/spotify/authenticate.php$1 [L,QSA] - # If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d diff --git a/app/app.js b/app/app.js index 3d6c90c..cbc58a6 100755 --- a/app/app.js +++ b/app/app.js @@ -9,7 +9,6 @@ angular.module('spotmop', [ 'ngResource', 'ngStorage', 'ngTouch', - 'ngAnimate', 'ui.router', 'angular-loading-bar', @@ -43,9 +42,10 @@ angular.module('spotmop', [ 'spotmop.browse.new' ]) -.config(function($stateProvider, $locationProvider, $urlRouterProvider){ +.config(function($stateProvider, $locationProvider, $urlRouterProvider, $httpProvider){ $locationProvider.html5Mode(true); $urlRouterProvider.otherwise("/queue"); + $httpProvider.interceptors.push('SpotifyServiceIntercepter'); }) @@ -172,6 +172,11 @@ angular.module('spotmop', [ BackgroundCheck.refresh(); }); + $(document).on('click', '#body', function(event){ + if( $(event.target).closest('.menu-reveal-trigger').length <= 0 ) + $scope.hideMenu(); + }); + // show menu (this is triggered by swipe event) $scope.showMenu = function(){ $(document).find('body').addClass('menu-revealed'); @@ -258,23 +263,11 @@ angular.module('spotmop', [ },0 ); - - // watch for re-authorizations of spotify - $scope.$watch( - function(){ - return $localStorage.spotify; - }, - function(newVal,oldVal){ - getSpotifyAccount(); - } - ); - - // figure out who we are on Spotify - // TODO: Hold back on this to make sure we're authorized - - getSpotifyAccount(); + /** + * Spotify account is authorized + **/ + $scope.$on('mopidy:state:online', function(){ - function getSpotifyAccount(){ SpotifyService.getMe() .then( function(response){ $scope.spotifyUser = response; @@ -291,7 +284,7 @@ angular.module('spotmop', [ $scope.updatePlaylists(); } }); - } + }); /** diff --git a/app/browse/album/template.html b/app/browse/album/template.html index 3d97c6c..df74e67 100755 --- a/app/browse/album/template.html +++ b/app/browse/album/template.html @@ -1,4 +1,6 @@
+ +
diff --git a/app/browse/artist/template.html b/app/browse/artist/template.html index eac51ed..fe7cf52 100755 --- a/app/browse/artist/template.html +++ b/app/browse/artist/template.html @@ -1,5 +1,7 @@
+ +
diff --git a/app/browse/featured/template.html b/app/browse/featured/template.html index 048036a..2426f41 100755 --- a/app/browse/featured/template.html +++ b/app/browse/featured/template.html @@ -1,5 +1,7 @@