diff --git a/config.js b/config.js index 7cda9e7..445200c 100644 --- a/config.js +++ b/config.js @@ -15,7 +15,7 @@ angular.module('flashy', [ 'flashy.HelpController', 'flashy.SettingsController', 'ngCookies']). - config(function ($stateProvider, $urlRouterProvider, $resourceProvider, $httpProvider, $locationProvider) { + config(function($stateProvider, $urlRouterProvider, $resourceProvider, $httpProvider, $locationProvider) { 'use strict'; $httpProvider.defaults.withCredentials = true; $httpProvider.defaults.xsrfCookieName = 'csrftoken'; @@ -29,9 +29,9 @@ angular.module('flashy', [ } } - $httpProvider.interceptors.push(function ($q, $rootScope) { + $httpProvider.interceptors.push(function($q, $rootScope) { return { - 'responseError': function (rejection) { // need a better redirect + 'responseError': function(rejection) { // need a better redirect if (rejection.status >= 500) { console.log('got error'); console.log(rejection); @@ -39,7 +39,7 @@ angular.module('flashy', [ } if (rejection.status == 403) { console.log(rejection); - if (rejection.data && rejection.data.detail == "Please verify your email before continuing") { + if (rejection.data && rejection.data.detail == 'Please verify your email before continuing') { $rootScope.$broadcast('account_locked'); } } @@ -50,9 +50,9 @@ angular.module('flashy', [ $locationProvider.html5Mode(true); $urlRouterProvider.otherwise('/404'); var auth_resolve = { - authorize: function ($q, $state, $stateParams, UserService) { + authorize: function($q, $state, $stateParams, UserService) { console.log('resolving user before continuing'); - var redirectAsNeeded = function () { + var redirectAsNeeded = function() { if (!UserService.isLoggedIn()) { console.log(UserService.getUserData()); console.log('making the user log in'); @@ -80,7 +80,7 @@ angular.module('flashy', [ }). state('root', { resolve: auth_resolve, - url: '/', + url: '', controller: 'RootController' }). state('feed', { @@ -152,12 +152,12 @@ angular.module('flashy', [ controller: 'HelpController' }); }). - run(function ($rootScope, $state, $stateParams, $location, UserService) { - $rootScope.$on('$stateChangeError', function (event, toState, toParams, fromState, fromParams, error) { + run(function($rootScope, $state, $stateParams, $location, UserService) { + $rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) { console.log('failed to change state: ' + error); $state.go('login'); }); - $rootScope.$on('$stateChangeStart', function (event, toState, toParams, fromState, fromParams) { + $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) { if (['feed', 'deck', 'cardlist'].indexOf(toState.name) >= 0) { localStorage.setItem('last_state', toState.name); localStorage.setItem('last_state_params', JSON.stringify(toParams)); diff --git a/home.html b/home.html index 3e678ee..bb020bd 100644 --- a/home.html +++ b/home.html @@ -28,7 +28,9 @@
  • Add Class