-
Notifications
You must be signed in to change notification settings - Fork 2
/
appgen.html
executable file
·252 lines (196 loc) · 8.49 KB
/
appgen.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Project Wing</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Sumukh Sridhara">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le styles -->
<link href="/static/assets/css/bootstrap.min.css" rel="stylesheet">
<link href="/static/assets/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="/static/assets/css/jigowatt.min.css" rel="stylesheet">
<link href="/static/assets/css/goalhawkcustom.css" rel="stylesheet">
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://staging.tokbox.com/v0.91/js/TB.min.js"></script>
<script type="text/javascript">
var apiKey = '14255491';
var sessionId = '{{sessionId}}'
var token = 'devtoken';
TB.setLogLevel(TB.DEBUG);
var session = TB.initSession(sessionId);
session.addEventListener('sessionConnected', sessionConnectedHandler);
session.addEventListener('streamCreated', streamCreatedHandler);
session.connect(apiKey, token);
var publisher;
var publisher2;
function sessionConnectedHandler(event) {
publisher = session.publish('myPublisherDiv');
// Subscribe to streams that were in the session when we connected
subscribeToStreams(event.streams);
}
function streamCreatedHandler(event) {
// Subscribe to any new streams that are created
subscribeToStreams(event.streams);
}
function publisherResizeHandler(event) {
newWidth = event.widthTo;
newHeight = event.heightTo;
// Modify the UI based on the new dimensions of the publisher
}
function subscribeToStreams(streams) {
for (var i = 0; i < streams.length; i++) {
// Make sure we don't subscribe to ourself
if (streams[i].connection.connectionId == session.connection.connectionId) {
return;
}
// Create the div to put the subscriber element in to
var div = document.createElement('div');
div.setAttribute('id', 'stream' + streams[i].streamId);
console.log( document.getElementById('test2') );
// document.getElementById("test2")[0].appendChild('div'); //append new div to another
// $('#test2').append('div');
var pele = document.getElementById("test2");
pele.appendChild(div);
// Subscribe to the stream
session.subscribe(streams[i], div.id);
}
var div = document.createElement('div');
div.setAttribute('id', 'publisher');
var publisherContainer = document.getElementById('publisherContainer');
publisherContainer.appendChild(div);
publisher = session.publish('publisher');
publisher.addEventListener("resize", publisherResizeHandler);
function publisherResizeHandler(event) {
newWidth = event.widthTo;
newHeight = event.heightTo;
// Modify the UI based on the new dimensions of the publisher
}
}
</script>
<script type="text/javascript">
function changeText(txt){
document.getElementById('freetitle').innerHTML = txt;
}
</script>
<!-- <link rel="shortcut icon" href="favicon.ico"> -->
</head>
<body>
<!-- Navigation
================================================== -->
<div class="navbar navbar-fixed-top">
<div class="navbar">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="home.php">
<logo >Project Wing</logo> <!-- <img src="/static/assets/i/ghlogo.png" width="90"> -->
</a>
<div class="nav-collapse">
<ul class="nav" id="findme">
<li><a href="home.php">Home</a></li>
<li><a href="#">Classes</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Blog</a></li>
</ul>
<ul class="nav pull-right">
<li><a href="#" class="signup-link"><strong>You are studying! </strong> » </a></li> <li><a data-toggle="modal" class="signup-link" href="#myModal" ><strong> Invite</strong> your friends</a>
</li>
</ul>
</div>
</div>
</div><!-- /navbar-inner -->
</div><!-- /navbar -->
</div><!-- /navbar-wrapper -->
<!-- Main content================================================== -->
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal" >×</a>
<h3>Modal Heading</h3>
</div>
<div class="modal-body">
<h4>Text in a modal</h4>
<p>Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem.</p>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal" >Close</a>
<a href="#" class="btn btn-primary" data-dismiss="modal" >Share</a>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header">People here</li>
<li class="active"><a target="freeform" onclick='changeText("Your Space")' href="http://willyou.typewith.me/p/{{mytext}}">Class Name</a></li>
<li><a target="freeform" onclick='changeText("Richie")' href="http://willyou.typewith.me/p/richielusdalasda">Richie</a></li>
<li><a target="freeform" onclick='changeText("Sumukh")' href="http://willyou.typewith.me/p/sumukhlusdalasda">Sumukh</a></li>
<li><a target="freeform" onclick='changeText("Whiteboard")' href="http://api.dabbleboard.com/api/iframe?dev_id=sumukh1&user_id=cs61&user_key=cs61&drawing_user_id=cs61&drawing_id=0&drawing_key=cs61&width=640&height=480
">Whiteboard</a></li>
<li class="nav-header">Files</li>
<li><a target="freeform" onclick='changeText("CS61A P/S 1")' href="http://www-inst.eecs.berkeley.edu/~cs61a/sp12/hw/hw1.html">Problem Set 1</a></li>
<li><a target="freeform" onclick='changeText("SICP Ch. 1")' href="http://www-inst.eecs.berkeley.edu/~cs61a/sp12/book/functions.html
">Textbook</a></li>
<div id="myPublisherDiv"></div>
<div id="test2"></div>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span9">
<div class="row-fluid">
<div class="span6">
<h2><div id="freetitle">Your Space</div></h2>
<iframe name="freeform" src="http://willyou.typewith.me/p/{{mytext}}" width="100%" height="600px" frameborder="0"></iframe>
</div><!--/span-->
<div class="span6">
<h2>The Classes Space</h2>
<iframe src="http://willyou.typewith.me/p/{{grouptext}}" width="100%" height="600px" frameborder="0"></iframe>
</div><!--/span-->
</div><!--/span-->
</div><!--/row-->
</div><!--/span-->
</div><!--/row-->
</div>
<!-- Footer
================================================== -->
</div> <!-- /.span9 -->
</div> <!-- /.row-fluid -->
</body>
<footer>
<div class="footer">
<hr class="soften">
<div id="logo">
<a href="#">© <logo>Project Wing</logo> - The Big Hack - Cal</a>
</div>
<div id="Group2"><br> <a href="#privacy">Privacy </a> | <a href="#">Blog</a> </div>
</div>
</footer>
</div> <!-- /.container-fluid -->
</div> <!-- the wrapper layer -->
<!-- The javascript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="/static/assets/js/bootstrap.collapse.js"></script>
<script src="/static/assets/js/bootstrap-modal.js"></script>
<script src="/static/assets/js/bootstrap-dropdown.js"></script>
<script src="/static/assets/js/bootstrap-button.js"></script>
<script src="/static/assets/js/bootstrap-tab.js"></script>
<script src="/static/assets/js/bootstrap-alert.js"></script>
<script src="/static/assets/js/bootstrap-scrollspy.js"></script>
<script src="/static/assets/js/bootstrap-popover.js"></script>
<script src="/static/assets/js/jquery.jigowatt.js"></script>
</body>
</html>