forked from allevaton/starterupper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
546 lines (527 loc) · 23 KB
/
index2.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Git and Hosting Setup</title>
<link href="font-awesome-4.2.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Suppress favicon -->
<link rel="shortcut icon" href="#" />
<link rel="stylesheet" href="http://lawrancej.github.io/starterupper/reset.css" />
<link rel="stylesheet" href="http://lawrancej.github.io/starterupper/text.css" />
<link rel="stylesheet" href="http://lawrancej.github.io/starterupper/960.css" />
<style>
ul {
margin-bottom: 0px;
}
.subheading {
text-align: right;
}
.error {
color:red;
}
.success {
color:green;
}
.fail {
color:black;
}
h1 {
margin:0px;
padding:0px;
}
header {
display: block;
border-bottom: 1px solid lightgray;
margin-top: 10px;
margin-bottom: 10px;
padding-bottom: 5px;
}
section {
margin-bottom:5px;
}
input[type="text"] { width:200px; }
input[type="email"] { width:200px; }
input[type="password"] { width:120px; }
.js #javascript-warning {display: none;}
.js #manual-github-login {display: none;}
.js #manual-github-login-label {display: none;}
.js #manual-github-login-password {display: none;}
.github-two-factor {display: none; }
.webcam { display: none; }
.manual { display: none; }
.js .no-github-upgraded { display: none; }
.github-email-verified {display: none;}
.github-upgraded { display: none; }
.github-profile { display:none; }
.github-collaborator {display: none;}
.github-repository {display: none;}
.github-key {display: none;}
</style>
<noscript>
<link rel="stylesheet" href="http://localhost:8080/browser.css" />
<style>
.github-authenticated {display: none;}
.gravatar-authenticated {display: none;}
/* .login-control {display: none;} */
/* #github-retry {display: none;} */
</style>
</noscript>
<script src="http://lawrancej.github.io/starterupper/modernizr-latest.js"></script>
<!-- <script>
// Borrowed from Modernizr, switch no-js to js if javascript is available
document.documentElement.className=document.documentElement.className.replace(/\bno-js\b/,'') + ' js';
</script> -->
</head>
<body>
<article>
<form method="post" action="/" >
<!-- The server should replace these values -->
<input type="hidden" id="repository" value="REPOSITORY" />
<input type="hidden" id="instructor" value="INSTRUCTOR_GITHUB" />
<input type="hidden" id="host" value="USER_NAME@HOSTNAME" />
<input type="hidden" id="public-key" value="PUBLIC_KEY" />
<!-- Nag the user if JavaScript is disabled -->
<section class="container_12" id="javascript-warning">
<header>
<div class="grid_12"><i class="fa fa-warning fa-fw fa-lg error"></i>
<b>JavaScript disabled or unsupported</b>:
Enable to automate setup</div>
<div class="clear"></div>
</header>
<!-- IE users -->
<div class="grid_2 subheading msie">
<img src="http://lawrancej.github.io/starterupper/ie.svg" width="140" height="140"
title="Internet Explorer" />
</div>
<div class="grid_10 msie">
<!-- IE5 through IE9 -->
<!--[if lte IE 9]>
<b>Your browser is obsolete</b>:
Please <a target="actionRequired"
href="http://windows.microsoft.com/en-us/internet-explorer/download-ie">upgrade</a>
first, or install
<a href="http://www.google.com/chrome/"
target="actionRequired">Chrome</a> or
<a href="https://www.mozilla.org/en-US/firefox/new/"
target="actionRequired">Firefox</a> instead<br/><br/>
<![endif]-->
If <b>Internet Explorer restricted this webpage from running scripts
or ActiveX controls</b>, click <b>Allow blocked content</b>
<ol>
<li>Otherwise, click <b>Tools</b> and select
<b>Internet options</b></li>
<li>Select the <b>Security</b> tab within Internet Options</li>
<li>Click <b>Custom level...</b></li>
<li>Scroll until you find the "Scripting" section</li>
<li>Under "Active Scripting", click <b>Enable</b></li>
<li>Click <b>OK</b></li>
<li>Reload this page</li>
</ol>
</div>
<div class="clear msie"></div>
<!-- Firefox users -->
<div class="grid_2 firefox">
<a href="http://kb.mozillazine.org/About:config"
target="actionRequired">
<img src="http://lawrancej.github.io/starterupper/firefox.svg" width="140"
height="140" title="Firefox" />
</a>
</div>
<div class="grid_10 firefox">
<b>Firefox users</b>: if you installed NoScript,
enable (allow or trust) JavaScript
<ol>
<li>Otherwise, open a new tab and type <code>about:config</code>
in the location (address) bar</li>
<li>Type <code>javascript.enabled</code> in the <b>Search</b> box</li>
<li>Double-click to set <code>javascript.enabled</code> to <b>true</b></li>
<li>Reload this page</li>
</ol>
</div>
<div class="clear firefox"></div>
<!-- Chrome users -->
<div class="grid_2 chrome">
<img src="http://lawrancej.github.io/starterupper/chrome.svg" width="140" height="140" title="Chrome" />
</div>
<div class="grid_10 chrome">
<b>Chrome users</b>: if you installed ScriptSafe or NotScripts,
enable (allow or trust) JavaScript
<ol style="margin-bottom: 0px;">
<li>Otherwise, open a new tab</li>
<li>Type <code>chrome://settings/content</code> in the location (address) bar</li>
<li>In the "Javascript" section, select
<b>Allow all sites to run JavaScript (recommended)</b></li>
<li>Click <b>Done</b></li>
<li>Reload this page</li>
</ol>
</div>
<div class="clear chrome"></div>
</section>
<!-- What to do if the script is offline -->
<section class="container_12 manual">
<header>
<div class="grid_12"><i class="fa fa-warning fa-fw fa-lg error"></i>
<b>Server off-line</b>: Troubleshoot or complete steps manually
</div>
<div class="clear"></div>
</header>
<div class="grid_2">
<b>Possible cause</b><br/>
Firewall blocked <code>netcat</code>
</div>
<div class="grid_7">
<b>Solution</b><br/>
<ol>
<li>Open the firewall</li>
<li>Allow programs to communicate through the firewall</li>
<li>Change settings</li>
<li>Select <code>nc.exe</code> and ensure <b>Domain</b> is checked</li>
<li>Click <b>OK</b></li>
<li>Close this window and restart the script in the command line</li>
</ol>
</div>
<div class="clear"></div>
<div class="grid_2">
<b>Possible cause</b><br/>
Port 8080 is in use
</div>
<div class="grid_7">
<b>Solution</b><br/>
<ol>
<li>Close any web servers on your machine</li>
<li>Close this window and restart the script in the command line</li>
</ol>
</div>
</section>
<!-- Profile -->
<section class="container_12">
<header>
<div class="grid_12">
<i class="fa fa-user fa-fw fa-lg"></i>
<b>Profile</b>:
Confirm your full name and school email address
</div>
<div class="clear"></div>
</header>
<!-- Full name -->
<div class="grid_2 subheading">
<label for="name">Full name</label>
</div>
<div class="grid_3">
<input id="name" type="text" name="name" value="FULL_NAME"
placeholder="Full name" pattern="[^ ]+( [^ ]+)+" required
title="Full name (first and last name)" autocomplete="on" /><br/>
</div>
<div class="grid_7">
Your first and last name
</div>
<div class="clear"></div>
<!-- Email -->
<div class="grid_2 subheading">
<label for="email">School email</label>
</div>
<div class="grid_3">
<input id="email" type="email" name="email" value="USER_EMAIL"
placeholder="School email address" required
autofocus autocomplete="on" title="School email address (ends with .edu)" />
</div>
<div class="grid_7">
Your <code>.edu</code> email address
</div>
<div class="clear"></div>
</section>
<!-- Gravatar -->
<section class="container_12">
<iframe id="SGravatar" width=960 height=900 src="https://myweb.wit.edu/kieuq/New_folder/webcam.html?hash="><p>No internet connection or server is down</p></iframe>
</section>
<!--<header>
<div class="grid_12">
<i class="fa fa-camera fa-fw fa-lg"></i>
<b>Gravatar</b>:
Create or update your profile picture
to help the instructor learn names
</div>
<div class="clear"></div>
</header>
<div class="grid_2">
<img id="visible-gravatar"
src="http://www.gravatar.com/avatar/EMAIL_HASH?d=retro&s=140"
title="Your Gravatar" width="140" height="140" />
</div>
<div class="grid_3">
<div class="no-gravatar-authenticated onboard no-gravatar-account">
<i class="fa fa-fw fa-lg fa-user"></i>
<a href="https://en.gravatar.com/connect/?source=_signup"
target="actionRequired"
title="New to Gravatar? Join with your school email">
<b>Join</b></a>
or
<i class="fa fa-fw fa-lg fa-envelope"></i>
<a href="https://en.gravatar.com/emails/new"
target="actionRequired"
title="Already use Gravatar? Add and verify your school email">
<b>Add & verify email</b></a>
<br/>
<i class="fa fa-fw fa-lg fa-hand-o-right"></i> Either way, use school email<br/>
</div>
<div class="gravatar-authenticated login-control">
<i class="fa fa-fw fa-lg fa-lock"></i> You are signed in
<input type="button" id="gravatar-signout" value="Sign out" />
</div>
<div class="no-gravatar-authenticated login-control">
<i class="fa fa-fw fa-lg fa-unlock"></i> You are not signed in<br/>
<input type="password" id="gravatarPassword"
placeholder="Gravatar password" pattern=".{7,}" />
<input type="button" value="Sign in" id="gravatar-signin" />
<a href="https://en.wordpress.com/wp-login.php?action=lostpassword&wpcom_connect=1"
target="actionRequired">Forgot password?</a>
</div>
<div class="no-js">
<i class="fa fa-fw fa-lg fa-camera"></i>
<a href="https://en.gravatar.com/gravatars/new"
target="actionRequired"
title="Update Gravatar profile picture">Update picture</a>
</div>
<div class="webcam">
How about webcam.js here? http://pixlcore.com/read/WebcamJS
</div>
</div>
</section>
<!-- Github -->
<section class="container_12">
<header>
<div class="grid_10">
<i class="fa fa-github fa-fw fa-lg"></i>
<b>Github</b>:
Create & upgrade your account for educational use to
get free private repositories
</div>
<div class="clear"></div>
</header>
<div class="clear"></div>
<div class="grid_2 no-github-authenticated onboard subheading">
Setup account
</div>
<div class="grid_3 no-github-authenticated onboard">
<i class="fa fa-fw fa-lg fa-user"></i>
<a href="https://github.com/join" target="actionRequired"
title="New to Github? Join with your school email">
<b>Join</b></a> or
<i class="fa fa-fw fa-lg fa-envelope"></i>
<a href="https://github.com/settings/emails"
target="actionRequired"
title="Already use Github? Add and verify your school email">
<b>Add & verify email</b></a>
</div>
<div class="grid_7 no-github-authenticated onboard">
<!-- <i class="fa fa-fw fa-lg fa-info-circle"></i> -->
Use your school email for account setup
</div>
<div class="clear"></div>
<div class="grid_2 subheading automated">
<div class="github-authenticated login-control">
You're signed in <i class="fa fa-lg fa-lock"></i>
</div>
<div class="no-github-authenticated login-control">
You're not signed in <i class="fa fa-lg fa-unlock"></i>
</div>
</div>
<div class="grid_3 automated">
<div class="github-authenticated login-control">
<input type="hidden" name="github.login" id="github-login" />
<input type="button" id="github-signout" value="Sign out" />
<input type="button" id="github-retry" value="Finish setup" />
</div>
<div class="no-github-authenticated login-control">
<input type="password" id="github-password"
placeholder="Github password" pattern=".{7,}"
title="Github password (must be 7+ characters)" required />
<input type="button" id="github-signin" value="Sign in" />
<div class="github-two-factor">
<input type="text" id="otp" placeholder="Authentication code"
pattern="[0-9]{6}" />
</div>
</div>
</div>
<div class="grid_7 no-github-authenticated login-control automated">
<a href="https://github.com/password_reset"
target="actionRequired">Forgot password?</a>
</div>
<div class="clear"></div>
<div class="grid_2 github-authenticated subheading">
Setup checklist
</div>
<div class="grid_7 github-authenticated manual">
<ul class="fa-ul" style="margin-left: 0px;">
<li class="no-github-email-verified">
<i class="fa-li fa fa-lg fa-envelope fail"></i>
<a href="https://github.com/settings/emails"
target="actionRequired">Verify
your school email</a>
</li>
<li class="github-email-verified">
<i class="fa-li fa fa-lg fa-check success"></i>
<a href="https://github.com/settings/emails"
target="actionRequired">Verified school email</a>
</li>
<li class="no-github-upgraded">
<i class="fa-li fa fa-lg fa-graduation-cap fail"></i>
<a href="https://education.github.com/discount_requests/new"
target="actionRequired">Request an educational discount</a>
</li>
<li class="github-upgraded">
<i class="fa-li fa fa-lg fa-check success"></i>
<a href="https://education.github.com/discount_requests/new"
target="actionRequired">Educational discount approved</a>
</li>
<li class="no-github-profile">
<i class="fa-li fa fa-lg fa-user fail"></i>
<a target="actionRequired"
href="https://github.com/settings/profile">
Share your full name</a>
</li>
<li class="github-profile">
<i class="fa-li fa fa-lg fa-check success"></i>
<a target="actionRequired"
href="https://github.com/settings/profile">Updated profile</a>
</li>
<li class="no-github-key">
<i class="fa-li fa fa-lg fa-key fail"></i>
<a href="https://github.com/settings/ssh"
target="actionRequired">Share public key</a>:
<input type="text" value="PUBLIC_KEY" style="width:100px;" />
</li>
<li class="github-key">
<i class="fa-li fa fa-lg fa-check success"></i>
Shared public key
(<a href="https://github.com/settings/ssh"
target="actionRequired">Update</a>)
</li>
<li class="no-github-repository">
<i class="fa-li fa fa-lg fa-database fail"></i>
<a target="actionRequired" href="https://github.com/new">
Create private repository REPOSITORY</a>
</li>
<li class="github-repository">
<i class="fa-li fa fa-lg fa-check success"></i>
<a href="https://github.com/USER_NAME/REPOSITORY"
target="actionRequired"
class="origin-href">Created repository REPOSITORY</a>
class="origin-href">REPOSITORY</a>
</li>
<li class="no-github-collaborator">
<i class="fa-li fa fa-lg fa-users fail"></i>
Allow INSTRUCTOR_GITHUB to collaborate on REPOSITORY
</li>
<li class="github-collaborator">
<i class="fa-li fa fa-lg fa-check success"></i>
<a href="https://github.com/USER_NAME/REPOSITORY/settings/collaboration"
id="collaborator-href" target="actionRequired">
INSTRUCTOR_GITHUB may collaborate on REPOSITORY</a>
</li>
</ul>
</div>
</section>
<section class="container_12">
<header>
<div class="grid_10">
<i class="fa fa-git-square fa-fw fa-lg error"></i>
<b>Git</b>: Configure your <b>local</b> repository (<a href="REPOSITORY" target="_blank"><code>~/REPOSITORY</code></a>),
<b>origin</b> (<a class="origin-href"
href="https://github.com/USER_NAME/REPOSITORY"
target="_blank">your private repository</a>) and
<b>upstream</b> (<a href="https://github.com/INSTRUCTOR_GITHUB/REPOSITORY"
target="_blank">course repository</a>)</div>
<div class="clear"></div>
</header>
<div class="clear"></div>
<div class="grid_2 subheading">
Configure git<br/><br/>
Clone upstream<br/><br/>
Configure remotes
</div>
<div class="grid_10">
<ul class="fa-ul" style="margin-left: 0px; font-size: 10pt;">
<li><i class="fa fa-li fa-lg fa-user success"></i>
<code id="git-config-name">git config --global user.name "FULL_NAME"</code>
</li>
<li>
<i class="fa fa-envelope fa-li fa-lg success"></i><code
id="git-config-email">git config --global user.email USER_EMAIL</code>
</li>
<li>
<i class="fa-li fa fa-lg fa-code-fork success"></i>
<code>cd && git clone https://github.com/INSTRUCTOR_GITHUB/REPOSITORY.git</code>
</li>
<li>
<i class="fa-li fa fa-lg fa-folder-open success"></i>
<code>cd REPOSITORY</code></li>
<li>
<i class="fa-li fa fa-lg fa-chain-broken success"></i>
<code>git remote rm origin</code>
</li>
<li>
<i class="fa-li fa fa-lg fa-chain success"></i>
<code>git remote add upstream https://github.com/INSTRUCTOR_GITHUB/REPOSITORY.git</code>
</li>
<li>
<i class="fa-li fa fa-lg fa-chain fail origin"></i>
<code id="origin-code">git remote add origin git@github.com:USER_NAME/REPOSITORY.git</code>
</li>
<li>
<i class="fa-li fa fa-lg fa-cloud-upload fail origin"></i>
<code>git push -u origin master</code>
</li>
</ul>
</div>
</section>
<section class="container_12">
<hr style="margin-bottom: 10px;"/>
<div class="grid_12">
<center><i class="fa fa-fw fa-lg fa-warning" style="color:red;"></i>
<b>DO NOT</b> move your local git repository to any folder synchronized
with Google Drive or Dropbox
<p>Instead create hard link to the folder of the project. You could look that up online for your Operation System</p></center>
</div>
</section>
</form>
</article>
<script src="http://lawrancej.github.io/starterupper/sparkMD5.js"></script>
<script src="http://lawrancej.github.io/starterupper/jquery-2.1.1.min.js"></script>
<script src="http://lawrancej.github.io/starterupper/github.js"></script>
<script src="ui.js"></script>
<!--// Server-initialized variables
// User's full name (DO NOT set directly, use model.setEmail())
fullName: localStorage.hasOwnProperty("Model.fullName") ?
localStorage.getItem("Model.fullName") : 'FULL_NAME',
getName: function() {
return localStorage.getItem("Model.fullName");
},
setName: function(name) {
model.fullName = name.trim();
if (model.validName()) {
localStorage.setItem("Model.fullName", model.fullName);
}
},
validName: function() {
var regex = /[^ ]+( [^ ]+)+/;
return regex.test(model.fullName);
},
// Sanitize and validate email address before setting it
if (model.validEmail()) {
localStorage.setItem("Model.email", model.email);
}
},
getEmail: function() {
return localStorage.getItem("Model.email");
$( "#git-config-name" ).html('git config --global user.name "' + model.getName() + '"');
// TODO: FIXME: use local storage and validate
// Another bug: check if email and full name are valid before sharing them
// Perhaps just use local storage?
$(".origin-href").attr("href", "https://github.com/" + Github.getUsername() + "/REPOSITORY");
$("#collaborator-href").attr("href", "https://github.com/" + Github.getUsername() + "/REPOSITORY/settings/collaboration");
$("#origin-code").html("git remote add origin git@github.com:" + Github.getUsername() + "/REPOSITORY.git");
$("#name").val(model.getName());
$("#email").val(model.getEmail());-->
</body>
</html>