Commit a0d3b9b1dd63c425e0ec5e7deb7bde610e757674
1 parent
aac0218e83
Exists in
master
and in
1 other branch
tiny style tweaks
Showing 4 changed files with 22 additions and 21 deletions Side-by-side Diff
home.html
View file @
a0d3b9b
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | |
8 | 8 | <link rel="stylesheet" href="styles/flashier.css"/> |
9 | 9 | <link rel="stylesheet" href="styles/flashy.css"/> |
10 | - <link href='https://fonts.googleapis.com/css?family=Changa+One:400,400italic|Titillium+Web:200,200italic,300,600,400,900,700,400italic,700italic,300italic,600italic' | |
10 | + <link href='https://fonts.googleapis.com/css?family=Titillium+Web:200,200italic,300,600,400,900,700,400italic,700italic,300italic,600italic' | |
11 | 11 | rel='stylesheet' type='text/css'> |
12 | 12 | <title>Flashy</title> |
13 | 13 | </head> |
scripts/FeedController.js
View file @
a0d3b9b
scripts/FlashcardDirective.js
View file @
a0d3b9b
1 | 1 | angular.module('flashy.FlashcardDirective', []). |
2 | 2 | |
3 | 3 | directive('flashcard', ['$http', '$state', '$window', |
4 | - function ($http, $state, $window) { | |
4 | + function($http, $state, $window) { | |
5 | 5 | return { |
6 | 6 | templateUrl: '/app/templates/flashcard.html', |
7 | 7 | restrict: 'E', |
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | flashcard: '=flashcardObj', // flashcard-obj in parent html |
10 | 10 | refresh: '&' // eval refresh in parent html |
11 | 11 | }, |
12 | - link: function (scope, element) { | |
12 | + link: function(scope, element) { | |
13 | 13 | /* Handles width of the card */ |
14 | 14 | function refresh_width() { |
15 | 15 | avail = $window.innerWidth - 17; |
16 | 16 | |
17 | 17 | |
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | 21 | |
22 | 22 | |
23 | 23 | |
... | ... | @@ -25,49 +25,49 @@ |
25 | 25 | refresh_width(); |
26 | 26 | |
27 | 27 | /* Pulls card from feed into deck */ |
28 | - scope.pullCard = function (flashcard) { | |
28 | + scope.pullCard = function(flashcard) { | |
29 | 29 | if ($state.current.name == 'feed') { |
30 | 30 | $http.post('/api/flashcards/' + flashcard.id + '/pull/', flashcard). |
31 | - success(function (data) { | |
31 | + success(function(data) { | |
32 | 32 | console.log('pulled flashcard #' + flashcard.id); |
33 | 33 | scope.startShrink = true; |
34 | 34 | scope.refresh(); |
35 | 35 | }). |
36 | - error(function (data) { | |
36 | + error(function(data) { | |
37 | 37 | console.log('failed to pull flashcard #' + flashcard.id); |
38 | 38 | }); |
39 | 39 | } |
40 | 40 | }; |
41 | 41 | |
42 | 42 | /* Unpulls card from deck */ |
43 | - scope.unpullCard = function (flashcard) { | |
43 | + scope.unpullCard = function(flashcard) { | |
44 | 44 | if ($state.current.name == 'deck') { |
45 | 45 | console.log('unpulling card...'); |
46 | 46 | |
47 | 47 | $http.post('/api/flashcards/' + flashcard.id + '/unpull/', |
48 | 48 | flashcard). |
49 | - success(function (data) { | |
49 | + success(function(data) { | |
50 | 50 | console.log('card unpull success'); |
51 | 51 | scope.startShrink = true; |
52 | 52 | scope.refresh(); |
53 | 53 | }). |
54 | - error(function (data) { | |
54 | + error(function(data) { | |
55 | 55 | console.log('card unpull FAILURE'); |
56 | 56 | }); |
57 | 57 | } |
58 | 58 | }; |
59 | 59 | |
60 | 60 | /* Hides card from feed */ |
61 | - scope.hideCard = function (flashcard) { | |
61 | + scope.hideCard = function(flashcard) { | |
62 | 62 | if ($state.current.name == 'feed') { |
63 | 63 | $http.post('/api/flashcards/' + flashcard.id + '/hide/', |
64 | 64 | flashcard). |
65 | - success(function (data) { | |
65 | + success(function(data) { | |
66 | 66 | console.log('card hide success'); |
67 | 67 | scope.startShrink = true; |
68 | 68 | scope.refresh(); |
69 | 69 | }). |
70 | - error(function (data) { | |
70 | + error(function(data) { | |
71 | 71 | console.log('card hide FAILURE'); |
72 | 72 | }); |
73 | 73 | } |
scripts/LoginController.js
View file @
a0d3b9b
1 | 1 | angular.module('flashy.LoginController', ['ui.router']). |
2 | 2 | |
3 | 3 | controller('LoginController', ['$rootScope', '$scope', '$state', '$http', 'UserService', |
4 | - function ($rootScope, $scope, $state, $http, UserService) { | |
4 | + function($rootScope, $scope, $state, $http, UserService) { | |
5 | 5 | 'use strict'; |
6 | 6 | // If we're logged in, there's nothing to do here |
7 | 7 | if (UserService.isLoggedIn()) $state.go('addclass'); |
8 | 8 | $scope.uniqueError = false; |
9 | 9 | $scope.loginError = false; |
10 | - $scope.login = function (email, password) { | |
10 | + $scope.login = function(email, password) { | |
11 | 11 | $http.post('/api/login/', JSON.stringify({ |
12 | 12 | 'email': email, |
13 | 13 | 'password': password |
14 | 14 | })). |
15 | - success(function (data) { | |
15 | + success(function(data) { | |
16 | 16 | UserService.setUserData(data); |
17 | 17 | if (angular.isDefined($scope.returnToState)) |
18 | 18 | $state.go($scope.returnToState.name, $scope.returnToStateParams); |
19 | 19 | else $state.go('addclass'); |
20 | 20 | console.log(data); |
21 | 21 | }). |
22 | - error(function (data, status, header, config) { | |
22 | + error(function(data, status, header, config) { | |
23 | 23 | if (data.detail) { // assume 'invalid email or pass' |
24 | 24 | $scope.loginError = true; |
25 | 25 | } |
26 | 26 | console.log(data); |
27 | 27 | }); |
28 | 28 | }; |
29 | - $scope.signUp = function (email, password) { | |
29 | + $scope.signUp = function(email, password) { | |
30 | 30 | $http.post('/api/register/', JSON.stringify({ |
31 | 31 | 'email': email, |
32 | 32 | 'password': password |
33 | 33 | })). |
34 | - success(function (data) { | |
34 | + success(function(data) { | |
35 | 35 | if (angular.isDefined($scope.returnToState)) |
36 | 36 | $state.go($scope.returnToState.name, $scope.returnToStateParams); |
37 | 37 | else $state.go('addclass'); |
38 | 38 | console.log(data); |
39 | 39 | }). |
40 | - error(function (data, status, headers, config) { | |
40 | + error(function(data, status, headers, config) { | |
41 | 41 | console.log(data.email); |
42 | 42 | if (data.email == 'This field is required.') { |
43 | 43 | $scope.invalid = true; |
44 | 44 | |
... | ... | @@ -51,10 +51,10 @@ |
51 | 51 | }); |
52 | 52 | |
53 | 53 | }; |
54 | - $scope.triggerPasswordReset = function () { | |
54 | + $scope.triggerPasswordReset = function() { | |
55 | 55 | $state.go('requestpasswordreset'); |
56 | 56 | }; |
57 | - $(document).ready(function () { | |
57 | + $(document).ready(function() { | |
58 | 58 | $('ul.tabs').tabs(); |
59 | 59 | }); |
60 | 60 | } |