M7350v1_en_gpl

This commit is contained in:
T
2024-09-09 08:52:07 +00:00
commit f9cc65cfda
65988 changed files with 26357421 additions and 0 deletions

View File

@@ -0,0 +1,119 @@
// Copyright 2009 Google Inc. All Rights Reserved.
/**
* @fileoverview Utility functions for formating date.
*/
/**
* Formats start date and end date in JSON format to string of format:
"09/09/2010 20:00 PM to 22:00 PM PST"
* @param {object} start date in JSON format.
* @param {object} end date in JSON format.
* @param {string} formatted date string.
*/
function formatDate(start,end) {
var s_ampm = null;
var e_ampm = null;
var toStr = function (num) {
if (num <= 12) {
return "" + num;
} else {
return "" + (num - 12);
}
};
var getMonthName = function (num) {
switch(num) {
case 1:
return 'January';
case 2:
return 'February';
case 3:
return 'March';
case 4:
return 'April';
case 5:
return 'May';
case 6:
return 'June';
case 7:
return 'July';
case 8:
return 'August';
case 9:
return 'September';
case 10:
return 'October';
case 11:
return 'November';
case 12:
return 'December';
}
}
var regex = /(^\d{4})-(\d{2})-(\d{2})\s{1}(\d{2}):(\d{2}):(\d{2}$)/;
var s_match = regex.exec(start.toString());
if( s_match == null) {
return '';
}
var yy = s_match[1];
var mm = parseInt(s_match[2], 10 /** base 10 **/);
var dd = s_match[3];
var s_hh = parseInt(s_match[4], 10 /** base 10 **/);
if (s_hh > 12) {
s_ampm = "PM";
} else {
s_ampm = "AM";
}
s_hh = toStr(s_hh);
var s_mi = s_match[5];
var str = getMonthName(mm) + " " + dd + ", " + yy ;
str += " " + s_hh + ":" + s_mi;
str += " " + s_ampm;
regex = /(^\d{4})-(\d{2})-(\d{2})\s{1}(\d{2}):(\d{2}):(\d{2}$)/;
var e_match = regex.exec(end.toString());
if( e_match == null) {
return str + ' PST';
}
var e_hh = parseInt(e_match[4], 10 /** base 10 **/);
if (e_hh > 12) {
e_ampm = "PM";
} else {
e_ampm = "AM";
}
e_hh = toStr(e_hh);
var e_mi = e_match[5];
str += " to " + e_hh + ":" + e_mi;
str += " " + e_ampm;
str += " PST";
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

@@ -0,0 +1,64 @@
page.title=Upcoming Schedule
@jd:body
<script type="text/javascript">
/**
/* Draw all webinars from feed into a 'webinars' div
* @param data The feed data returned from the webinars request
*/
function renderWebinar(data) {
var entries = data.webinars || [];
var resultsDiv = $('#resource-browser-results');
var code = [];
// Loop through each entry (each webinar) and add it to the 'webinars' list
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
var title = entry.title;
var description = entry.description;
var url = entry.url;
var start = entry.start;
var end = entry.end;
code.push('<div>');
code.push('<h3>' + title + '</h3>');
code.push('<p><i>' + formatDate(start, end) + '</i>');
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>');
}
var html = code.join('\n');
resultsDiv.html(html);
}
/* Request the webinar feeds from webinarhosting server */
function showWebinars() {
var script = "<script type='text/javascript' src='/resources/webinars/date.js'><\/script>";
$("body").append(script);
$.getJSON(
'http://android-webinars.appspot.com/feeds/api/upcomingwebinars?callback=?',
function(json){renderWebinar(json);});
}
// Initialization actions
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>

View File

@@ -0,0 +1,111 @@
page.title=Watch a Webinar
@jd:body
<script type="text/javascript">
/**
* Draw all webinars from feed into a 'live_webinar' div
* @param data The feed data returned from the live webinars request
*/
function renderLiveWebinar(data) {
var entries = data.webinars || [];
var resultsDiv = $('#live_webinar');
var code = [];
// Loop through each entry (each webinar) and add it to the 'webinars' list
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
var title = entry.title;
var description = entry.description;
var url = entry.url;
var start = entry.start;
var end = entry.end;
code.push('<div >');
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 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');
resultsDiv.html(html);
}
/* Request the webinar feeds from webinarhosting server */
function showLiveWebinars() {
var script = "<script type='text/javascript' src='/resources/webinars/date.js'><\/script>";
$("body").append(script);
$.getJSON(
'http://android-webinars.appspot.com/feeds/api/livewebinar?callback=?',
function(json){renderLiveWebinar(json);});
}
// Initialization actions
showLiveWebinars(); // load webinars
/**
* Draw all past webinars from feed into a 'webinars' div
* @param data The feed data returned from the webinars request
*/
function renderPastWebinar(data) {
var entries = data.webinars || [];
var resultsDiv = $('#past_webinars');
var code = [];
code.push('<h2> Past Webinars </h2>');
// Loop through each entry (each webinar) and add it to the 'webinars' list
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
var title = entry.title;
var description = entry.description;
var url = entry.url;
var start = entry.start;
var end = entry.end;
code.push('<div >');
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>' + description);
code.push('</div>');
}
if (entries.length == 0) {
code.push('<div >');
code.push('<p>There are no past webinars.');
code.push('</div>');
}
var html = code.join('\n');
resultsDiv.html(html);
}
/* Request the past webinar feeds from webinarhosting server */
function showPastWebinars() {
var script = "<script type='text/javascript' src='/resources/webinars/date.js'><\/script>";
$("body").append(script);
$.getJSON(
'http://android-webinars.appspot.com/feeds/api/pastwebinars?callback=?',
function(json){renderPastWebinar(json);});
}
// Initialization actions
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>
<div id="past_webinars">
</div>