Blame view

scripts/HelpController.js 3.65 KB
b12a56132   Andrew Buss   try to fix (hah) ...
1
  angular.module('flashy.HelpController', ['ui.router']).
b12a56132   Andrew Buss   try to fix (hah) ...
2

8e3988f5e   Andrew Buss   fix bugs about bo...
3
4
5
      controller('HelpController', function($scope, $state, $http, $timeout) {
          $scope.toggleContent = function(event, index) {
              console.log(event, index);
18a7fb3d7   Andrew Buss   merge; cleanup
6

8e3988f5e   Andrew Buss   fix bugs about bo...
7
8
9
10
11
12
              if ($('#content-' + index).hasClass('open')) { // let's close it
                  // Note: 250 is duration (ms) of animation
                  $('#content-' + index).slideUp(250).removeClass('open');
              } else { // let'd open it
                  $('#content-' + index).slideDown(250).addClass('open');
              }
a77847e15   Rachel Lee   FAQ and CSS things
13

6a6b8b8d2   Rachel Lee   Nice looking FAQ
14
  //            event.currentTarget
8e3988f5e   Andrew Buss   fix bugs about bo...
15
          };
18a7fb3d7   Andrew Buss   merge; cleanup
16

8e3988f5e   Andrew Buss   fix bugs about bo...
17
          $scope.closeContent = function(event) {
18a7fb3d7   Andrew Buss   merge; cleanup
18

8e3988f5e   Andrew Buss   fix bugs about bo...
19
          };
18a7fb3d7   Andrew Buss   merge; cleanup
20

8e3988f5e   Andrew Buss   fix bugs about bo...
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
          // JSON OF FAQ ENTRIES
          $scope.entries = [
              {
                  // icon: 'mdi-editor-insert-emoticon small',
                  question: 'What is Flashy?',
                  answer: '<p>Flashy is a service for creating, sharing, and reviewing flashcards for your courses.' +
                  '</p><p>Flashy is optimized for contributing cards in real time during lecture to a shared live' +
                  " feed. Don't want to contribute cards? That's fine! By adding others' cards to your deck, you" +
                  ' help identify high-quality cards which should remain at the top of the feed for others to choose.' +
                  '</p><p>Based on the principles of spaced repetition, Flashy also intelligently determines which' +
                  ' cards you are most at risk of forgetting, based on your review history. Receive push ' +
                  "notifications on your Android device's Chrome browser without installing any other app," +
                  " and we'll notify you when you have a few cards which need to be reviewed.</p>"
              },
              {
                  // icon: 'mdi-file-cloud-queue small',
                  question: 'Does Flashy work outside of UCSD?',
                  answer: "To simplify development, Flashy was configured only for courses at UCSD. If you'd like Flashy for your school, please send us an email to let us know!"
              },
              {
                  // icon: 'mdi-hardware-security small',
                  question: 'How do registration and verification work?',
                  answer: "An account is required to use Flashy. We store the cards you save to your deck with your account. When you register, you'll be able to use the site immediately, but you must verify ownership of your email address within 24 hours. After 24 hours have passed, you'll need to verify your address before continuing to use the site. Don't worry, your cards and deck won't be deleted."
              },
              {
                  question: "My question isn't answered above",
fbe96ab3a   Andrew Buss   remove white-text...
47
                  answer: '<a href="mailto:or.so.help.me@flashy.cards">Send us an email</a> or join us on Freenode in <a href="irc://irc.freenode.net/flashy">#flashy</a>!'
8e3988f5e   Andrew Buss   fix bugs about bo...
48
              }];
18a7fb3d7   Andrew Buss   merge; cleanup
49

8e3988f5e   Andrew Buss   fix bugs about bo...
50
51
52
53
54
55
56
57
58
          // Functions
          $scope.toggleContent = function(event, index) {
              if ($('#content-' + index).hasClass('open')) { // let's close it
                  // Note: 250 is duration (ms) of animation
                  $('#content-' + index).slideUp(250).removeClass('open');
              } else { // let's open it
                  $('#content-' + index).slideDown(250).addClass('open');
              }
          };
18a7fb3d7   Andrew Buss   merge; cleanup
59

8e3988f5e   Andrew Buss   fix bugs about bo...
60
61
62
63
64
          $scope.expandAllContent = function() {
              for (var i = 0; i < $scope.entries.length; i++) {
                  $('#content-' + i).slideDown(0).addClass('open');
              }
          };
18a7fb3d7   Andrew Buss   merge; cleanup
65

8e3988f5e   Andrew Buss   fix bugs about bo...
66
67
68
69
70
71
          $scope.collapseAllContent = function() {
              for (var i = 0; i < $scope.entries.length; i++) {
                  $('#content-' + i).slideUp(0).removeClass('open');
              }
          };
      });