-
Notifications
You must be signed in to change notification settings - Fork 0
/
scrpt.js
108 lines (85 loc) · 3.05 KB
/
scrpt.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
var easyListeningApp = angular.module('easyListeningApp', ['ngAnimate']);
easyListeningApp.controller("MainCtrl", ["$scope", "$location", function($scope, $location) {
$scope.templates = [
{ name: "Home", url: "templates/home.htm"},
{ name: "About", url: "templates/about.htm"},
];
$scope.changeActive = function(name) {
$scope.activePage = _.find($scope.templates, function(t) {
return t.name == name;
});
};
$scope.parseUrl = function() {
switch ($location.path()) {
case "/about":
$scope.changeActive("About");
break;
case "/home":
$scope.changeActive("Home");
break;
default:
$scope.changeActive("Home");
}
}
$scope.parseUrl();
}]);
easyListeningApp.controller("HomeCtrl", ["$scope", function($scope) {
//Set playing status
var d = new Date();
if (d.getDay() == 3 && d.getUTCHours() == 18) {
$scope.showStatus = "maybe live right now";
}
else {
$scope.showStatus = "not live right now";
}
$scope.lastShow = {
name: "Davis and Daniel present: An Easy Listening Christmas",
src: "https://dl.dropboxusercontent.com/u/6447183/last.wav"
};
}]);
easyListeningApp.controller("AboutCtrl", ["$scope", "$timeout", function($scope, $timeout) {
$scope.personSelected = false;
$scope.daniel = {
name: "Daniel",
information: "Daniel is a sometimes bored person whose hobbies include having dysfunctional conversations with one to two people, walking until he's lost, and not knowing what's going on.",
image: "img/IMG_0300.JPG",
social: [
{
name: "Twitter",
url: "https://twitter.com/helloimdanielhi"
},
{
name: "last.fm",
url: "http://www.last.fm/user/myusernamegone"
}
]
};
$scope.davis = {
name: "Davis",
information: "Davis is a guy named Davis. He has a zine that has cool things in it.",
image: "img/1.png",
social: [
{
name: "davisland.info",
url: "http://davisland.info/"
},
{
name: "in the end pretty much everything is mostly water",
url: "http://intheendprettymucheverythingismostlywater.com/"
}
]
};
$scope.changePerson = function(name) {
$scope.personSelected = false;
$timeout(function() {
if (name == "Daniel") {
$scope.activePerson = $scope.daniel;
}
else if (name == "Davis") {
$scope.activePerson = $scope.davis;
}
$scope.personSelected = true;
},500);
};
$scope.activePerson = $scope.daniel;
}]);