am b094b0c4: modifications to webinars: add the ability to add an upcoming webinar event to Google Calendar; add some introduction text; adjust some markup

* commit 'b094b0c4a4309f48d9da7253de78ebda20a8a81c':
  modifications to webinars: add the ability to add an upcoming webinar event to Google Calendar; add some introduction text; adjust some markup
This commit is contained in:
Scott Main
2010-12-15 14:11:08 -08:00
committed by Android Git Automerger
3 changed files with 42 additions and 7 deletions

View File

@@ -98,3 +98,22 @@ function formatDate(start,end) {
return str; return str;
} }
function formatDateUtf(date) {
var regex = /(^\d{4})-(\d{2})-(\d{2})\s{1}(\d{2}):(\d{2}):(\d{2}$)/;
var match = regex.exec(date.toString());
var yy = match[1];
var mm = match[2];
var dd = match[3];
var hh = parseInt(match[4], 10) + 8; // +8 to convert from PST to GMT
var mi = match[5] + "00"; // add seconds
if (hh >= 24) { // If the GMT adjustment put us into the next day,
dd++; // increment the day and
hh -= 24; // set the hour back to real hours
}
hh = hh < 10 ? "0" + hh : hh; // form a double digit number for single digit hours
return yy + mm + dd + 'T' + hh + mi + 'Z';
}

View File

@@ -26,8 +26,15 @@ function renderWebinar(data) {
code.push('<div>'); code.push('<div>');
code.push('<h3>' + title + '</h3>'); code.push('<h3>' + title + '</h3>');
code.push('<p ><i>' + formatDate(start, end) + '</i>'); code.push('<p><i>' + formatDate(start, end) + '</i>');
code.push('<p>' + description); code.push('<br/><a href="https://www.google.com/calendar/event?action=TEMPLATE&hl=en&text=' + title +
'&dates=' + formatDateUtf(start) + '/' + formatDateUtf(end) +
'&details=' + description + ' Go to: http://developer.android.com/resources/webinars/webinar-watch.html' +
'&location=developer.android.com' +
'&sprop=name:Android Developers' +
'&sprop=website:developer.android.com' +
'" target="_blank">Add this to my calendar</a></p>');
code.push('<p>' + description + '</p>');
code.push('</div>'); code.push('</div>');
} }
@@ -48,6 +55,10 @@ showWebinars(); // load webinars
</script> </script>
<p>This page provides a schedule of upcoming webinars.
When a webinar occurs, you can watch it live and participate in an ICQ session that's coupled
with the presentation, by following the live link at
<a href="{@docRoot}resources/webinars/webinar-watch.html">Watch a Webinar</a>.</p>
<div id="resource-browser-results"> <div id="resource-browser-results">
</div> </div>

View File

@@ -1,4 +1,4 @@
page.title=Watch A Webinar page.title=Watch a Webinar
@jd:body @jd:body
<script type="text/javascript"> <script type="text/javascript">
@@ -24,14 +24,14 @@ function renderLiveWebinar(data) {
var start = entry.start; var start = entry.start;
var end = entry.end; var end = entry.end;
code.push('<div >'); code.push('<div >');
code.push('<h3><b>Live!</b><a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Live Webinar", "' + title + '"]);>' + title + '</a></h3>'); code.push('<h3><b>Live!</b>&nbsp;<a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Live Webinar", "' + title + '"]);>' + title + '</a></h3>');
code.push('<p ><i>' + formatDate(start, end) + '</i>'); code.push('<p ><i>' + formatDate(start, end) + '</i>');
code.push('<p>' + description); code.push('<p>' + description);
code.push('</div>'); code.push('</div>');
} }
if (entries.length == 0) { if (entries.length == 0) {
code.push('<div >'); code.push('<div >');
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>.'); 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>.');
code.push('</div>'); code.push('</div>');
} }
var html = code.join('\n'); var html = code.join('\n');
@@ -72,7 +72,7 @@ function renderPastWebinar(data) {
var end = entry.end; var end = entry.end;
code.push('<div >'); code.push('<div >');
code.push('<h3><a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Past Webinars", "' + title + '"]);>' + title + '</a></h3>'); code.push('<h3><a href="' + url + '" target="_blank" onClick=_gaq.push(["_trackEvent", "Past Webinars", "' + title + '"]);>' + title + '</a></h3>');
code.push('<p ><i>' + formatDate(start, end) + '</i>'); code.push('<p><i>' + formatDate(start, end) + '</i>');
code.push('<p>' + description); code.push('<p>' + description);
code.push('</div>'); code.push('</div>');
} }
@@ -98,7 +98,12 @@ showPastWebinars(); // load webinars
</script> </script>
<p>Webinars are web-based seminars that provide online training for a wide range of Android
developer topics. When a new webinar takes place, you can watch live and chat with the presenter
and other participants in an IRC session that's coupled with the presentation. The IRC session
is held on the <em>#android-dev</em> channel at <em>irc.freenode.net</em>.</p>
<p style="margin-bottom:2em">When available, live webinars appear at the top of this page. If there's no live webinar, you
can watch one of the previous webinars from the list below.</p>
<div id="live_webinar"> <div id="live_webinar">
</div> </div>