aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunasSudo <runassudo@yingtongli.me>2017-03-09 21:10:48 +1100
committerRunasSudo <runassudo@yingtongli.me>2017-03-09 21:10:48 +1100
commit41016faaef661fea1c90d34bedf3fef8bd60c2a3 (patch)
tree4db9e1533e0f41fb6fc6328391d754fade72ff0f
parent2e0860985bbee8bc97957c30dc2832c49f6acb3c (diff)
Use a bootstrap script
-rw-r--r--bootstrap.js26
-rw-r--r--index.html2
2 files changed, 27 insertions, 1 deletions
diff --git a/bootstrap.js b/bootstrap.js
new file mode 100644
index 0000000..102984d
--- /dev/null
+++ b/bootstrap.js
@@ -0,0 +1,26 @@
+/*
+ allocics.js - One-click export of Allocate+ timetables to ICS format
+ Copyright © 2017 RunasSudo (Yingtong Li)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+if (window.location.hostname.indexOf('github.io') >= 0) {
+ window.alert('Drag the link to your bookmarks bar; don\'t click it.');
+} else {
+ // Load the main implementation
+ var impl = document.createElement('script');
+ impl.src = 'https://runassudo.github.io/allocics.js/allocics.js';
+ document.body.appendChild(impl);
+}
diff --git a/index.html b/index.html
index 05a96cc..16e901d 100644
--- a/index.html
+++ b/index.html
@@ -27,7 +27,7 @@
<h2>Let's do it!</h2>
<ol>
- <li>Click <i>and drag</i> this link – <a href="javascript:var q=document.createElement('script');q.src='https://runassudo.github.io/allocics.js/allocics.js';document.body.appendChild(q);void 0;">Export Timetable</a> – to your bookmarks bar.</li>
+ <li>Click <i>and drag</i> this link – <a href="javascript:var q=document.createElement('script');q.src='https://runassudo.github.io/allocics.js/bootstrap.js';document.body.appendChild(q);void 0;">Export Timetable</a> – to your bookmarks bar.</li>
<li>Log in to <a href="https://monash.edu/timetables/login.html">Allocate+</a>, and go to the ‘Timetable’ tab.</li>
<li>Click the bookmark!</li>
<li>That's it! Just download the ICS file and import it into your calendar.</li>
Contact (issues, pull requests, etc.) at git@yingtongli.me. Generated by cgit.