Commit 3837ecba5e1b268c30f68183fa802f24012a7ad9
Exists in
master
and in
1 other branch
Merge branch 'master' of git.ucsd.edu:110swag/flashy-frontend
Showing 4 changed files Side-by-side Diff
login_test.js
View file @
3837ecb
scripts/StudyController.js
View file @
3837ecb
... | ... | @@ -3,8 +3,6 @@ |
3 | 3 | controller('StudyController', ['$scope', '$stateParams', '$state', '$http', 'UserService', |
4 | 4 | function($scope, $stateParams, $state, $http, UserService) { |
5 | 5 | console.log('Flashy study controller content in this file. also hell0'); |
6 | - sectionId = $stateParams.sectionId; | |
7 | - $scope.isParamOpen = true; | |
8 | 6 | |
9 | 7 | $(document).ready(function() { |
10 | 8 | $('.datepicker').pickadate({ |
11 | 9 | |
12 | 10 | |
13 | 11 | |
14 | 12 | |
... | ... | @@ -13,22 +11,25 @@ |
13 | 11 | }); |
14 | 12 | |
15 | 13 | $('select').material_select(); |
14 | + | |
15 | + // Open by default | |
16 | + $('#content-x').slideDown(250).addClass('open'); | |
16 | 17 | }); |
17 | 18 | |
19 | + sectionId = $stateParams.sectionId; | |
20 | + $scope.isParamOpen = true; | |
18 | 21 | $scope.UserService = UserService; |
19 | 22 | $scope.isParamOpen = true; |
20 | 23 | |
21 | - console.log($scope.UserService.getUserData().sections); | |
24 | + console.log('user sections', $scope.UserService.getUserData().sections); | |
22 | 25 | |
26 | + /* Sets current study class to the one passed in (y) */ | |
23 | 27 | $scope.toggleSectionToStudy = function(id) { |
24 | 28 | console.log('toggle sect', id); |
25 | 29 | $scope.sectionToStudy = id; |
26 | 30 | }; |
27 | 31 | |
28 | - $scope.openParams = function() { | |
29 | - $scope.isParamOpen = !$scope.isParamOpen; | |
30 | - }; | |
31 | - | |
32 | + /* Opens or closes content collapsible */ | |
32 | 33 | $scope.toggleContent = function(event, index) { |
33 | 34 | if ($('#content-x').hasClass('open')) { // let's close it |
34 | 35 | // Note: 250 is duration (ms) of animation |
35 | 36 | |
36 | 37 | |
37 | 38 | |
38 | 39 | |
39 | 40 | |
... | ... | @@ -39,27 +40,21 @@ |
39 | 40 | }; |
40 | 41 | |
41 | 42 | |
42 | - /* | |
43 | - $scope.fetchQuiz = function(a, b) { | |
44 | - //console.log($scope.startDate, $scope.endDate); | |
45 | - console.log(a, b); | |
46 | - console.log($('#start-date').val()); | |
47 | - }; | |
48 | - */ | |
49 | - | |
50 | 43 | $scope.fetchQuiz = function() { |
51 | 44 | console.log('fetching quiz...'); |
45 | + console.log('study sect', $scope.sectionToStudy, parseInt($scope.sectionToStudy)); | |
52 | 46 | var studyRequest = { |
53 | - 'sections': ($scope.sectionToStudy == null) ? [] : [$scope.sectionToStudy] | |
47 | + 'sections': ($scope.sectionToStudy == null) ? [] : [parseInt($scope.sectionToStudy)] | |
54 | 48 | }; |
49 | + console.log('startdate:', new Date($('#start-date').val())); | |
55 | 50 | console.log('enddate:', $('#end-date').val() + 'T00:00:00Z'); |
56 | - console.log('study sect', $scope.sectionToStudy); | |
57 | 51 | |
58 | 52 | |
59 | 53 | $http.post('/api/study/', studyRequest). |
60 | 54 | success(function(data) { |
61 | 55 | console.log('Fetched card:', data); |
62 | 56 | }).error(function(err) { |
57 | + console.log('Fetch Error'); | |
63 | 58 | }); |
64 | 59 | }; |
65 | 60 |
ss_test.js
View file @
3837ecb
1 | -//http://docs.casperjs.org/en/latest/modules/casper.html#captureselector | |
2 | -//Run with: casperjs --ssl-protocol=tlsv1 ss_test.js | |
3 | - | |
4 | -var casper = require('casper').create({ | |
5 | - viewportSize: {width: 800, height: 600} | |
6 | -}); | |
7 | - | |
8 | -casper.start().zoom(.9).thenOpen('https://flashy.cards/app/login', function() { | |
9 | - this.captureSelector('test2.png','.ng-scope' ); | |
10 | -}); | |
11 | - | |
12 | -casper.run(); |