add ADT Bundle to the download page

Change-Id: Ife533a32e29f2d5f1c58a42ad0b91c5053b44da4
This commit is contained in:
Scott Main
2012-10-23 14:13:41 -07:00
parent e896e34471
commit db3678bcaa
3 changed files with 237 additions and 47 deletions

View File

@@ -76,7 +76,6 @@
#
?>
<table class="download" id="download-table">
<tr>
<th>Platform</th>
@@ -140,6 +139,49 @@
<div class="wrap">
<div class="pax col-13 online" style="display:none">
<p class="table-caption"><strong>ADT Bundle</strong></p>
<table class="download">
<tr>
<th>Platform</th>
<th>Package</th>
<th>Size</th>
<th>MD5 Checksum</th>
</tr>
<tr>
<td>Windows</td>
<td>
<a onClick="return onDownload(this)" id="win-bundle"
href="http://dl.google.com/android/sdk/<?cs var:sdk.win_bundle_download ?>"><?cs var:sdk.win_bundle_download ?></a>
</td>
<td><?cs var:sdk.win_bundle_bytes ?> bytes</td>
<td><?cs var:sdk.win_bundle_checksum ?></td>
</tr>
<tr class="alt-color">
<td>Mac OS X (intel)</td>
<td>
<a onClick="return onDownload(this)" id="mac-bundle"
href="http://dl.google.com/android/sdk/<?cs var:ndk.mac_bundle_download ?>"><?cs var:sdk.mac_bundle_download ?></a>
</td>
<td><?cs var:sdk.mac_bundle_bytes ?> bytes</td>
<td><?cs var:sdk.mac_bundle_checksum ?></td>
</tr>
<tr>
<td>Linux 32/64-bit (x86)</td>
<td>
<a onClick="return onDownload(this)" id="linux-bundle"
href="http://dl.google.com/android/sdk/<?cs var:sdk.linux_bundle_download ?>"><?cs var:sdk.linux_bundle_download ?></a>
</td>
<td><?cs var:sdk.linux_bundle_bytes ?> bytes</td>
<td><?cs var:sdk.linux_bundle_checksum ?></td>
</tr>
</table>
<p class="table-caption"><strong>SDK Tools Only</strong></p>
<table class="download">
<tr>
<th>Platform</th>
@@ -150,7 +192,7 @@
<tr>
<td rowspan="2">Windows</td>
<td>
<a onclick="onDownload(this,false)" href="http://dl.google.com/android/<?cs var:sdk.win_download
<a onclick="return onDownload(this)" href="http://dl.google.com/android/<?cs var:sdk.win_download
?>"><?cs var:sdk.win_download ?></a>
</td>
<td><?cs var:sdk.win_bytes ?> bytes</td>
@@ -159,7 +201,7 @@
<tr>
<!-- blank TD from Windows rowspan -->
<td>
<a onclick="onDownload(this,false)" id="win-sdk" href="http://dl.google.com/android/<?cs
<a onclick="return onDownload(this)" id="win-tools" href="http://dl.google.com/android/<?cs
var:sdk.win_installer
?>"><?cs var:sdk.win_installer ?></a> (Recommended)
</td>
@@ -169,7 +211,7 @@ var:sdk.win_installer
<tr class="alt-color">
<td>Mac OS X (intel)</td>
<td>
<a onclick="onDownload(this,false)" id="mac-sdk" href="http://dl.google.com/android/<?cs
<a onclick="return onDownload(this)" id="mac-tools" href="http://dl.google.com/android/<?cs
var:sdk.mac_download
?>"><?cs var:sdk.mac_download ?></a>
</td>
@@ -179,7 +221,7 @@ var:sdk.mac_download
<tr>
<td>Linux (i386)</td>
<td>
<a onclick="onDownload(this,false)" id="linux-sdk" href="http://dl.google.com/android/<?cs
<a onclick="return onDownload(this)" id="linux-tools" href="http://dl.google.com/android/<?cs
var:sdk.linux_download
?>"><?cs var:sdk.linux_download ?></a>
</td>
@@ -187,51 +229,109 @@ var:sdk.linux_download
<td><?cs var:sdk.linux_checksum ?></td>
</tr>
</table>
<script>
function onDownload(link,fromButton) {
$("#filename").text($(link).html());
$("#next-steps").fadeIn('slow');
$("#intro").fadeOut('slow');
$('.pax').slideUp();
$('.reqs').slideUp();
// Deliver Analytics event
if (fromButton) {
_gaq.push(['_trackEvent', 'Tools', 'Download SDK', 'Button <' + text($(link).html()) + '>']);
} else {
_gaq.push(['_trackEvent', 'Tools', 'Download SDK', 'Link <' + text($(link).html()) + '>']);
}
}
var os;
var $link;
var $bundlelink;
var $toolslink;
if (navigator.appVersion.indexOf("Win")!=-1) {
os = "Windows";
$link = $('#win-sdk');
$bundlelink = $('#win-bundle');
$toolslink = $('#win-tools');
} else if (navigator.appVersion.indexOf("Mac")!=-1) {
os = "Mac";
$link = $('#mac-sdk');
$bundlelink = $('#mac-bundle');
$toolslink = $('#mac-tools');
} else if (navigator.appVersion.indexOf("Linux")!=-1) {
os = "Linux";
$link = $('#linux-sdk');
$bundlelink = $('#linux-bundle');
$toolslink = $('#linux-tools');
}
if (os) {
$('#not-supported').hide();
$('#download-button').show();
$('#download-button').text("Download the SDK for " + os);
$('#download-button').click(function() {onDownload($link.get());}).attr('href', $link.attr('href'),true);
/* set up primary adt download button */
$('#download-bundle-button').show();
$('#download-bundle-button').append("Download the SDK <br/><span class='small'>ADT Bundle for " + os + "</span>");
$('#download-bundle-button').click(function() {return onDownload(this,true);}).attr('href', $bundlelink.attr('href'));
/* set up sdk tools only button */
$('#download-tools-button').show();
$('#download-tools-button').append("Download the SDK Tools for " + os);
$('#download-tools-button').click(function() {return onDownload(this,true);}).attr('href', $toolslink.attr('href'));
} else {
$('.pax').show();
}
function onDownload(link, button) {
if (button) {
$("#downloadForRealz").html($(link).text());
} else {
$("#downloadForRealz").html("Download " + $(link).text());
$("a#next-link").html("Setting Up an Existing IDE").attr('href',toRoot + 'sdk/installing/index.html');
}
$("#downloadForRealz").attr('href',$(link).attr('href'));
$("#tos").fadeIn('fast');
$("#landing").fadeOut('fast');
location.hash = "download";
return false;
}
function onAgreeChecked() {
if ($("input#agree").is(":checked")) {
$("a#downloadForRealz").removeClass('disabled');
} else {
$("a#downloadForRealz").addClass('disabled');
}
}
function onDownloadForRealz(link) {
if ($("input#agree").is(':checked')) {
$("div.sdk-terms").slideUp();
$("#sdk-terms-form,.sdk-terms-intro").fadeOut('slow');
$("#next-steps").fadeIn('slow');
$("h1#tos-header").text('Get Ready to Code!');
return true;
} else {
$("label#agreeLabel").parent().stop().animate({color: "#258AAF"}, 200,
function() {$("label#agreeLabel").parent().stop().animate({color: "#222"}, 200)}
);
return false;
}
}
$(window).hashchange( function(){
console.log('hash: '+location.hash);
if (location.hash == "") {
location.reload();
}
});
</script>
</div><!-- end pax -->
</div><!-- end wrap -->
</div><!-- end the wrapper used for relative/absolute positions -->
<?cs # THIS DIV WAS OPENED IN INDEX.JD ?>
<?cs else ?> <?cs # end if online ?>
<?cs if:sdk.preview ?><?cs # it's preview offline docs ?>