-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpartify-mobile.js
49 lines (42 loc) · 1.2 KB
/
partify-mobile.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
if (Meteor.is_client) {
Template.events.eventlist = function () {
return Events.find({}, {sort: {name: 1}});
};
Template.user.user = function () {
return user = Session.get('user');
};
// events
Template.events.events = {
'click .events': function (event) {
console.log("foo");
// update user object: facebook id and event id
// go to user 'home' with current playing, list and form
}
};
Template.hello.events = {
'click .fblogin': function (event) {
event.preventDefault();
FB.login(function(response) { }, {scope:'user_events'});
}
};
Template.playlist.songs = function() {
return Songs.find({});
};
Template.songSubmission.events = {
'submit form': function (event) {
event.preventDefault();
var songTrack = document.getElementById("song-track").value;
// Songs.insert({name: songTrack});
Meteor.call('searchSong', songTrack, function(error, result) {
console.log(result)
if(!result)
alert("oops that song is way to indie for us, please try again...")
});
}
};
}
if (Meteor.is_server) {
Meteor.startup(function () {
// code to run on server at startup
});
}