Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b094b0c4 authored by Scott Main's avatar Scott Main
Browse files

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
parent 7daaa98c
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -98,3 +98,22 @@ function formatDate(start,end) {
  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';
}
+13 −2
Original line number Diff line number Diff line
@@ -27,7 +27,14 @@ function renderWebinar(data) {
    code.push('<div>');
    code.push('<h3>' + title + '</h3>');
    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>');
  }

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

</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>
+10 −5
Original line number Diff line number Diff line
page.title=Watch A Webinar
page.title=Watch a Webinar
@jd:body

<script type="text/javascript">
@@ -24,14 +24,14 @@ function renderLiveWebinar(data) {
    var start = entry.start;
    var end = entry.end;
    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>' + description);
    code.push('</div>');
  }
  if (entries.length == 0) {
    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>');
  }
  var html = code.join('\n');
@@ -98,7 +98,12 @@ showPastWebinars(); // load webinars

</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>