Skip to content

Commit b094b0c

Browse files
committed
modifications to webinars:
add the ability to add an upcoming webinar event to Google Calendar; add some introduction text; adjust some markup Change-Id: I4d18a183b1520e79a45e114dc49e725fe27a43c9
1 parent 7daaa98 commit b094b0c

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

docs/html/resources/webinars/date.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,22 @@ function formatDate(start,end) {
9898
return str;
9999

100100
}
101+
102+
103+
function formatDateUtf(date) {
104+
var regex = /(^\d{4})-(\d{2})-(\d{2})\s{1}(\d{2}):(\d{2}):(\d{2}$)/;
105+
var match = regex.exec(date.toString());
106+
var yy = match[1];
107+
var mm = match[2];
108+
var dd = match[3];
109+
var hh = parseInt(match[4], 10) + 8; // +8 to convert from PST to GMT
110+
var mi = match[5] + "00"; // add seconds
111+
112+
if (hh >= 24) { // If the GMT adjustment put us into the next day,
113+
dd++; // increment the day and
114+
hh -= 24; // set the hour back to real hours
115+
}
116+
hh = hh < 10 ? "0" + hh : hh; // form a double digit number for single digit hours
117+
118+
return yy + mm + dd + 'T' + hh + mi + 'Z';
119+
}

docs/html/resources/webinars/webinar-upcoming.jd

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,15 @@ function renderWebinar(data) {
2626

2727
code.push('<div>');
2828
code.push('<h3>' + title + '</h3>');
29-
code.push('<p ><i>' + formatDate(start, end) + '</i>');
30-
code.push('<p>' + description);
29+
code.push('<p><i>' + formatDate(start, end) + '</i>');
30+
code.push('<br/><a href="https://www.google.com/calendar/event?action=TEMPLATE&hl=en&text=' + title +
31+
'&dates=' + formatDateUtf(start) + '/' + formatDateUtf(end) +
32+
'&details=' + description + ' Go to: http://developer.android.com/resources/webinars/webinar-watch.html' +
33+
'&location=developer.android.com' +
34+
'&sprop=name:Android Developers' +
35+
'&sprop=website:developer.android.com' +
36+
'" target="_blank">Add this to my calendar</a></p>');
37+
code.push('<p>' + description + '</p>');
3138
code.push('</div>');
3239
}
3340

@@ -48,6 +55,10 @@ showWebinars(); // load webinars
4855

4956
</script>
5057

58+
<p>This page provides a schedule of upcoming webinars.
59+
When a webinar occurs, you can watch it live and participate in an ICQ session that's coupled
60+
with the presentation, by following the live link at
61+
<a href="{@docRoot}resources/webinars/webinar-watch.html">Watch a Webinar</a>.</p>
5162

5263
<div id="resource-browser-results">
5364
</div>

docs/html/resources/webinars/webinar-watch.jd

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
page.title=Watch A Webinar
1+
page.title=Watch a Webinar
22
@jd:body
33

44
<script type="text/javascript">
@@ -24,14 +24,14 @@ function renderLiveWebinar(data) {
2424
var start = entry.start;
2525
var end = entry.end;
2626
code.push('<div >');
27-
code.push('<h3><b>Live!</b><a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Live Webinar", "' + title + '"]);>' + title + '</a></h3>');
27+
code.push('<h3><b>Live!</b>&nbsp;<a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Live Webinar", "' + title + '"]);>' + title + '</a></h3>');
2828
code.push('<p ><i>' + formatDate(start, end) + '</i>');
2929
code.push('<p>' + description);
3030
code.push('</div>');
3131
}
3232
if (entries.length == 0) {
3333
code.push('<div >');
34-
code.push('<p>There is currently no live webinar. Watch one of the previous webinars from the list below and check the schedule for <a href="/resources/webinars/webinar-upcoming.html">Upcoming Webinars</a>.');
34+
code.push('<p class="note">There is currently no live webinar. Check the schedule for <a href="/resources/webinars/webinar-upcoming.html">Upcoming Webinars</a>.');
3535
code.push('</div>');
3636
}
3737
var html = code.join('\n');
@@ -72,7 +72,7 @@ function renderPastWebinar(data) {
7272
var end = entry.end;
7373
code.push('<div >');
7474
code.push('<h3><a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Past Webinars", "' + title + '"]);>' + title + '</a></h3>');
75-
code.push('<p ><i>' + formatDate(start, end) + '</i>');
75+
code.push('<p><i>' + formatDate(start, end) + '</i>');
7676
code.push('<p>' + description);
7777
code.push('</div>');
7878
}
@@ -98,7 +98,12 @@ showPastWebinars(); // load webinars
9898

9999
</script>
100100

101-
101+
<p>Webinars are web-based seminars that provide online training for a wide range of Android
102+
developer topics. When a new webinar takes place, you can watch live and chat with the presenter
103+
and other participants in an IRC session that's coupled with the presentation. The IRC session
104+
is held on the <em>#android-dev</em> channel at <em>irc.freenode.net</em>.</p>
105+
<p style="margin-bottom:2em">When available, live webinars appear at the top of this page. If there's no live webinar, you
106+
can watch one of the previous webinars from the list below.</p>
102107

103108
<div id="live_webinar">
104109
</div>

0 commit comments

Comments
 (0)