-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
77 lines (77 loc) · 4.2 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
<html>
<head>
<title>AutoScheduler</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<link rel="stylesheet" href="css/style.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="script/bookmarklet.js"></script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>AutoScheduler (Beta)</h1>
<p>This tool creates a custom JS bookmarklet button based on a web scheduler link. <a href="#" data-toggle="modal" data-target="#instructionsModal">Click here for instructions.</a></p>
</div>
<div id="instructionsModal" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Instructions</h4>
</div>
<div class="modal-body">
<p>A JavaScript Bookmarklet is a piece of JavaScript stored in a web browser bookmark. This allows you to make a button in your bookmark bar that can run code when you click it. This website will create a bookmarklet script containing your schedule's call numbers, so you can run it on the Drop/Add Classes page and schedule much faster.</p>
<h6>Instructions:</h6>
<ol>
<li>Paste the link to your schedule made on the Stevens Web Scheduler</li>
<li>Check/uncheck "Auto submit". With Auto Submit on, the bookmarklet will submit your schedule as soon as the call numbers are copied into the scheduler form. You can turn it off if you want to double check the call numbers before submitting.</li>
<li>Click "Generate bookmarklet!" If there aren't any errors, your bookmarklet will appear under the submit button as a hyperlink.</li>
<li>Click and drag the bookmarklet hyperlink into your bookmark bar.</li>
<li>Go to the Drop/Add Classes page and schedule your classes!</li>
</ol>
<p><strong>TL;DR:</strong> Paste the link press the blue button and drag the link to your bookmarks</p>
<p>Code by Andrew Afflitto. <a href="https://github.com/LegoMaster616/AutoScheduler">Fork me on GitHub</a></p>
</div>
</div>
</div>
</div>
<form class="needs-validation">
<div class="form-group" id="scheduleLinkDiv">
<label for="scheduleLink">Stevens scheduler link:</label>
<input type="url" class="form-control" id="scheduleLink" required>
<span class="help-block hidden" id="scheduleLinkError">
Invalid URL!
</span>
</div>
<div class="form-group">
<label><input type="checkbox" id="autosubmit"> Auto submit</label>
</div>
<div class="form-group">
<button type="button" class="btn btn-primary" id='generateButton'>Generate bookmarklet!</button>
</div>
</form>
<div class="row hidden" id="bookmarkletResult">
<div class="col-md-12">
<h2>Finished Bookmarklet</h2>
<p>Drag the link to your bookmark bar:</p>
<a href="#" id="bookmarklet">AutoScheduler</a>
</div>
</div>
</div>
<script>
$('#generateButton').click(function(){
if($('#scheduleLink').val().length>0 && validateURL($('#scheduleLink').val()))
{
setUrlError(false);
generate();
}
else {
setUrlError(true);
}
});
</script>
</body>
</html>