forked from zachleat/ALARMd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
336 lines (327 loc) · 17.3 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
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
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>ALARMd.com Internet Alarm Clock</title>
<meta name="author" content="Zach Leatherman, zachleat.com"/>
<meta name="description" content="User customizable, browser embedded online internet alarm clock. Plays your YouTube videos, MP3's, and Last.fm streams."/>
<meta name="keywords" content="alarm clock, internet alarm clock, online alarm clock, alarm, youtube, last.fm"/>
<meta name="robots" content="index, follow"/>
<link rel="stylesheet" type="text/css" href="include/alarmd.css"/>
</head>
<body>
<div id="doc3" class="yui-t7">
<noscript>JavaScript is required to use ALARMd, the Internet Alarm Clock. Instead of actually using it without JavaScript, you can go ahead and <a href="http://www.zachleat.com/web/2007/06/18/wake-up-to-youtube-on-my-internet-alarm-clock/" title="Read about ALARMd">read about what fun</a> you could be having if you had JavaScript turned on.</noscript>
<div id="hd">
<label id="title" class="hide-naked"><a href="http://www.alarmd.com">ALARMd<span>.com</span></a> by <a href="http://www.zachleat.com/">zachleat</a><span id="calendarTitle"></span></label>
<label id="about" class="hide-naked"><a href="http://www.zachleat.com/web/2008/04/06/alarmd-2-beta-with-google-calendar-integration/" title="Read about ALARMd">Readme</a></label>
<label for="naked-mode"><input id="naked-mode" type="checkbox" class="checkbox" value="on" /> <span class="hide-naked">Naked</span></label>
</div>
<div id="bd">
<div id="clock">
<div id="standardTimeFormatDisplay" class="timeFormat"><span id="hours"></span><span class="minor">:</span><span id="minutes"></span><span id="seconds" class="minor">:</span></div>
<div id="readableTimeFormatDisplay" class="timeFormat"></div>
<div id="unixTimeFormat" class="timeFormat"></div>
<div id="metricTimeFormatDisplay" class="timeFormat"><span id="metric-centidays"></span><span class="minor">.</span><span id="metric-centidays-fraction" class="minor"></span><span class="minor">LMT</span></div>
<div id="unitcircleTimeFormatDisplay" class="timeFormat"><span id="unitcircle-numerator"></span><span id="unitcircle-pi" class="minor" style="display: none">π</span><span id="unitcircle-denominator" class="minor">/180</span></div>
</div>
<div id="error-message" class="hide-naked"></div>
<div id="calendar-help-content" class="hide-naked">
<ol>
<li>Go to Calendar Settings for the Calendar you want to use.</li>
<li>Make sure your Calendar is Public under the "Share this calendar" tab.</li>
<li>
Find your Calendar ID (The red dotted box shown below)
<img src="media/calendar-id.gif"/>
</li>
</ol>
</div>
<div id="alarm">
<div id="alarm-youtube">
<div id="ytapiplayer"></div>
</div>
<div id="alarm-other"></div>
</div>
</div>
<div id="alarm-list" class="hide-naked"><ul></ul></div>
<div id="ft">
<div id="menu">
<label id="youtube-cache-indicator" class="hide-naked"></label>
<label><a id="test-alarm" class="link hide-naked">Test</a></label>
</div>
<button id="toggle-options" class="hide-naked">Options</button>
</div>
</div>
<div id="options" class="hide-naked">
<form id="options-form">
<dl>
<dt>Alarm Dates and Times</dt>
<dd>
<div>
<label for="alarmFormat">Alarm Types</label>
<select id="alarmFormat">
<option value="singleAlarmFormat" selected="selected">Single Easy Alarm</option>
<option value="gcalAlarmFormat">Google Calendar</option>
</select>
</div>
<div id="singleAlarmFormat" class="alarmFormat">
<label for="alarm-value" title="Accepts formats like 20s, 20m, 20h, 2055, 12:00 AM, etc.">Single Easy Alarm</label>
<input type="text" id="alarm-value" value="" class="text"/>
</div>
<div id="gcalAlarmFormat" class="alarmFormat">
<label for="gcal-address"><a id="calendar-help" class="link">Help</a> Google Calendar ID</label>
<input type="text" id="gcal-address" value="" class="text"/>
<div>
<label for="gcal-one-event-day" class="clickable"><input id="gcal-one-event-day" type="checkbox" class="checkbox" value="on" /> First Event of the Day Only</label>
</div>
<div>
<label for="gcal-events-within" class="clickable">Within <input id="gcal-events-within" type="text" class="text" value="3" /> Days</label>
</div>
<div>
<label for="gcal-events-prior" class="clickable">Adjust <input id="gcal-events-prior" type="text" class="text" value="0" /> Minutes Before Event</label>
</div>
</div>
</dd>
<dt>Sources</dt>
<dd>
<div id="alarm-options">
<label for="default-alarm">Default Alarm</label>
<select id="default-alarm">
<option value="http://www.youtube.com/v/42peBWLbYto" selected="selected">Rage Against the Machine: Wake Up</option>
<option value="http://www.youtube.com/v/-50fhqD3HtA">Technotronic: Get Up</option>
<option value="http://www.youtube.com/v/T4Igb5Yors4">Andy McKee: For My Father</option>
<option value="last.fm/tag/indie">Last.fm Tag: Indie</option>
<option value="last.fm/tag/rock">Last.fm Tag: Rock</option>
<option value="http://www.pandora.com/?cmd=mini">Pandora Radio</option>
<option value="media/train_crossing.mp3">Generic Train Crossing</option>
<option value="http://www.voco.uk.com/gmm/d01.mp3">Voco Clock Butler (voco.uk.com)</option>
</select>
<!-- <input type="text" id="default-alarm" value="http://www.youtube.com/v/42peBWLbYto" class="text"/> -->
</div>
<div>
<button id="delete-alarm-from-list" type="button">Delete</button>
<a id="toggle-add-new-alarm" class="toggle link">Add New Alarm</a>
</div>
<div id="add-new-alarm">
<div>
<select id="new-alarm-type">
<option value="url" selected="selected">URL</option>
<option value="youtube-id">Youtube ID</option>
<option value="last-fm-tag">Last.fm Tag</option>
<option value="last-fm-user">Last.fm User</option>
</select>
<input type="text" id="add-alarm-value" value="" class="text"/>
</div>
<div>
<label for="add-alarm-label">Label (Optional)</label>
<input type="text" id="add-alarm-label" value="" class="text"/>
</div>
<div>
<button id="ok-add-new-alarm" type="button">Add</button>
<button id="cancel-add-new-alarm" class="toggle" type="button">Cancel</button>
</div>
</div>
<div>
<label for="loopVideos" class="clickable"><input id="loopVideos" type="checkbox" class="checkbox" value="on" /> Repeat (YouTube and MP3 Only, Requires Restart)</label>
</div>
</dd>
<dt>Clock Format</dt>
<dd>
<div>
<label for="isCountdown" class="clickable"><input id="isCountdown" type="checkbox" class="checkbox" value="on" /> Count Down (Alarm Required)</label>
</div>
<div>
<label for="timeFormat">Main Clock Format</label>
<select id="timeFormat">
<option value="standardTimeFormat" selected="selected">Standard</option>
<option value="readableTimeFormat">Readable</option>
<option value="unixTimeFormat">Unix</option>
<option value="metricTimeFormat">Metric</option>
<option value="unitcircleTimeFormat">Unit Circle</option>
</select>
</div>
<div id="standardTimeFormat" class="timeFormat">
<label for="24hourFormat" class="clickable"><input id="24hourFormat" type="checkbox" class="checkbox" value="on" /> 24 Hour</label>
<label for="secondsFormat" class="clickable"><input id="secondsFormat" type="checkbox" class="checkbox" value="on" /> Seconds</label>
</div>
</dd>
<dt>Appearance</dt>
<dd>
<div>
<label for="css-skin">
Skin
<select id="css-skin">
<option value="" selected="selected">(None)</option>
<option value="skins/red.css">Red Clock</option>
<option value="skins/green.css">Green Clock</option>
<option value="skins/blue.css">Blue Clock</option>
<option value="skins/24-yellow.css">24 Yellow (7-Segment)</option>
</select>
</label>
</div>
<div id="css-options">
<label for="external-css">Your Own Skin Url (CSS)</label>
<input type="text" id="external-css" value="http://" class="text"/>
</div>
</dd>
</dl>
<div id="buttons">
<button id="save" type="submit">Options</button>
<!-- <button id="reset-alarms">Reset Alarms</button> -->
</div>
</form>
</div>
<!-- Notes: Opera doesn't fire the onunload, so settings are not saved when the page is left. -->
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="lib/date.js"></script>
<script type="text/javascript" src="include/alarmd-plugins.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<script type="text/javascript" src="//www.google.com/jsapi?key=ABQIAAAAy3SKAip7V5MBJX7isXGS8BQgwVrr9c3g1Jd6a7klqh2Z9A4w6hREc4-Ho46UwZAA2MJWs9r0u1vaFg"></script>
<script type="text/javascript" src="include/api.js"></script>
<script type="text/javascript" src="include/alarmd.js"></script>
<script type="text/javascript">
jQuery(function()
{
// change wasn't firing in IE on a checkbox, click fires even when label is clicked
jQuery('#naked-mode').click(function(event)
{
jQuery('body').toggleClass('naked-mode');
});
jQuery('#24hourFormat').change(alarmd.reformatAlarmDates);
jQuery('#options-form').submit(function()
{
alarmd.save();
return false;
});
$('#cancel').click(function()
{
$('#toggle-options').trigger('click');
return false;
});
$('#toggle-options').click(function()
{
var $t = $(this),
cls = 'expanded',
on = $t.hasClass(cls),
$options = $('#options');
if(on) {
$t.html('Options');
$t.add($options).removeClass(cls);
alarmd.save();
} else {
$t.html('Save Options');
$t.add($options).addClass(cls);
}
$options.animate({
right: on ? '-302px' : '0px',
}, 600);
});
jQuery('.toggle').click(function()
{
var id = jQuery(this).attr('id');
var target = id.substr(id.split('-')[0].length + 1); // toggle- or cancel-
jQuery('#'+target).slideToggle('slow', function()
{
// causes an error in IE.
//jQuery('select:visible, input:visible', this).focus();
});
});
jQuery('#test-alarm').click(function()
{
var str;
if(jQuery(this).html() == 'Hide Test') {
str = 'Test';
alarmd.kill(true);
} else {
str = 'Hide Test';
alarmd.trigger(0, true);
}
util.dom.update(this, str);
return false;
});
jQuery('#calendar-help').click(function()
{
jQuery('#calendar-help-content').slideToggle();
});
jQuery('#calendar-help-content').click(function()
{
jQuery(this).slideToggle();
});
jQuery(document).keyup(function(event) // otherwise it will trigger by just holding it down.
{
if(!jQuery(event.target).is('input, select, button')) {
// Unspecified IE error
alarmd.keymash.execute();
}
});
function optionChange()
{
var $t = jQuery(this);
var format = $t.val();
jQuery('.'+$t.attr('id')).hide();
jQuery('#'+format+'Display').show();
jQuery('#'+format).show();
}
jQuery('#timeFormat').change(function()
{
var val = jQuery(this).val();
jQuery('#'+val+'Display').show();
if(val == 'metricTimeFormat') {
alarmd.setInterval(864);
} else {
alarmd.setInterval(1000);
}
optionChange.call(this);
}).change();
jQuery('#alarmFormat').change(optionChange).change();
jQuery('#ok-add-new-alarm').click(function()
{
var val,
label,
source = jQuery('#add-alarm-value').val();
switch(jQuery('#new-alarm-type').val()) {
case 'youtube-id':
val = 'http://www.youtube.com/v/'+source;
break;
case 'last-fm-tag':
val = 'last.fm/tag/'+source;
break;
case 'last-fm-user':
val = 'last.fm/user/'+source;
break;
default:
val = source;
break;
}
var label = jQuery('#add-alarm-label').val() || val;
if(val) {
jQuery('#default-alarm').append('<option value="'+val+'">'+label+'</option>');
}
jQuery('#add-new-alarm').slideToggle();
return false;
});
jQuery('#delete-alarm-from-list').click(function()
{
var selected = jQuery('#default-alarm option:selected');
if(confirm('Are you sure you want to delete '+selected.text()+'?')) {
selected.remove();
}
return false;
});
youtube.onload();
alarmd.load();
});
// Google Analytics
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-588046-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
document.body.appendChild(ga);
})();
</script>
</body>
</html>