This repository has been archived by the owner on Feb 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
114 lines (110 loc) · 3.53 KB
/
index.html
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
109
110
111
112
113
114
<!DOCTYPE html>
<html>
<head>
<title>must.js test</title>
<link rel="stylesheet" href="components/sassquatch/css/sassquatch.css"/>
<style>
body {
background:#eee;
padding:1em;
}
</style>
<script src="components/jquery/jquery.min.js"></script>
<script src="must.js"></script>
</head>
<body>
<div class="doc-box rounded-all">
<div class="doc-content">
<h1>Must.js test</h1>
</div>
<div class="doc-content clearfix">
<div class="unit size1of4">
<div>
<h2>RSVPs</h2>
<a data-stream="rsvps" class="button primary" href="#">start</a>
</div>
<div>
<ul class="paddedList" id="rsvps"></ul>
</div>
</div>
<div class="unit size1of4">
<div>
<h2>Comments</h2>
<a data-stream="comments" class="button primary" href="#">start</a>
</div>
<div>
<ul class="paddedList" id="comments"></ul>
</div>
</div>
<div class="unit size1of4">
<div>
<h2>Photos</h2>
<a data-stream="photos" class="button primary" href="#">start</a>
</div>
<div>
<ul class="paddedList" id="comments"></ul>
</div>
</div>
<div class="lastUnit">
<div>
<h2>Checkins</h2>
<a data-stream="checkins" class="button primary" href="#">start</a>
</div>
<div>
<ul class="paddedList" id="checkins"></ul>
</div>
</div>
</div>
</div>
<script type="text/javascript">
(function($, must){
$(function() {
var currentStream
, currentStreamName
, streams = {
"rsvps": function() {
return must.Rsvps(function(r){
$("#rsvps").append("<li>"+r.member.member_name+" RSVP'd " +r.response+ " <div class='muted small'> " + r.event.event_name + "</span></li>");
});
},
"comments": function() {
return must.Comments(function(c) {
console.log(c);
$("#comments").append("<li>"+c.comment+" <div class='muted small'>"+c.member.member_name+"</div></li>");
});
},
"photos": function() {
return must.Photos(function(p) {
$("#photos").append("<li><img src='"+p.thumb_link+"/></li>");
});
},
"checkins": function() {
return must.Checkins(function(c) {
$("#checkins").append("<li>"+c.member.member_name + " checked in </li>");
});
}
};
$(".button").on('click', function(e){
e.preventDefault();
var $btn = $(this),
streamName = $btn.data().stream;
if (streamName == currentStreamName && $btn.attr('disabled')) {
$btn.removeAttr('disabled');
} else {
$(".button").removeAttr('disabled');
$btn.attr('disabled','disabled');
}
if (currentStream) {
currentStream.stop();
}
if ($btn.attr('disabled')) {
currentStreamName = streamName;
currentStream = streams[streamName]();
}
return false;
});
});
})(jQuery, must);
</script>
</body>
</html>