* commit '1f0850ee04dcb54e0969f40f692ae00f1da5843b': docs: add script for 32/64-bit bundle downloads
This commit is contained in:
commit
9ade5e7987
2 changed files with 85 additions and 58 deletions
|
@ -1995,7 +1995,7 @@ div#sdk-terms-form {
|
||||||
padding:0 0 0 10px;
|
padding:0 0 0 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#sdk-terms-form input#agree {
|
div#sdk-terms-form input {
|
||||||
display:inline;
|
display:inline;
|
||||||
margin:4px 4px 4px 0;
|
margin:4px 4px 4px 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,7 @@
|
||||||
<td><?cs var:ndk.win_bytes ?> bytes</td>
|
<td><?cs var:ndk.win_bytes ?> bytes</td>
|
||||||
<td><?cs var:ndk.win_checksum ?></td>
|
<td><?cs var:ndk.win_checksum ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="alt-color">
|
<tr>
|
||||||
<td>Mac OS X (intel)</td>
|
<td>Mac OS X (intel)</td>
|
||||||
<td>
|
<td>
|
||||||
<a onClick="return onDownload(this)"
|
<a onClick="return onDownload(this)"
|
||||||
|
@ -207,31 +207,49 @@
|
||||||
<th>MD5 Checksum</th>
|
<th>MD5 Checksum</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Windows</td>
|
<td>Windows 32-bit</td>
|
||||||
<td>
|
<td>
|
||||||
<a onClick="return onDownload(this)" id="win-bundle"
|
<a onClick="return onDownload(this)" id="win-bundle32"
|
||||||
href="http://dl.google.com/android/<?cs var:sdk.win_bundle_download ?>"><?cs var:sdk.win_bundle_download ?></a>
|
href="http://dl.google.com/android/adt/<?cs var:sdk.win32_bundle_download ?>"><?cs var:sdk.win32_bundle_download ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td><?cs var:sdk.win_bundle_bytes ?> bytes</td>
|
<td><?cs var:sdk.win32_bundle_bytes ?> bytes</td>
|
||||||
<td><?cs var:sdk.win_bundle_checksum ?></td>
|
<td><?cs var:sdk.win32_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/<?cs var:sdk.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>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Linux 32/64-bit (x86)</td>
|
<td>Windows 64-bit</td>
|
||||||
<td>
|
<td>
|
||||||
<a onClick="return onDownload(this)" id="linux-bundle"
|
<a onClick="return onDownload(this)" id="win-bundle64"
|
||||||
href="http://dl.google.com/android/<?cs var:sdk.linux_bundle_download ?>"><?cs var:sdk.linux_bundle_download ?></a>
|
href="http://dl.google.com/android/adt/<?cs var:sdk.win64_bundle_download ?>"><?cs var:sdk.win64_bundle_download ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td><?cs var:sdk.linux_bundle_bytes ?> bytes</td>
|
<td><?cs var:sdk.win64_bundle_bytes ?> bytes</td>
|
||||||
<td><?cs var:sdk.linux_bundle_checksum ?></td>
|
<td><?cs var:sdk.win64_bundle_checksum ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><nobr>Mac OS X 64-bit</nobr></td>
|
||||||
|
<td>
|
||||||
|
<a onClick="return onDownload(this)" id="mac-bundle64"
|
||||||
|
href="http://dl.google.com/android/adt/<?cs var:sdk.mac64_bundle_download ?>"><?cs var:sdk.mac64_bundle_download ?></a>
|
||||||
|
</td>
|
||||||
|
<td><?cs var:sdk.mac64_bundle_bytes ?> bytes</td>
|
||||||
|
<td><?cs var:sdk.mac64_bundle_checksum ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Linux 32-bit</td>
|
||||||
|
<td>
|
||||||
|
<a onClick="return onDownload(this)" id="linux-bundle32"
|
||||||
|
href="http://dl.google.com/android/adt/<?cs var:sdk.linux32_bundle_download ?>"><?cs var:sdk.linux32_bundle_download ?></a>
|
||||||
|
</td>
|
||||||
|
<td><?cs var:sdk.linux32_bundle_bytes ?> bytes</td>
|
||||||
|
<td><?cs var:sdk.linux32_bundle_checksum ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>Linux 64-bit</td>
|
||||||
|
<td>
|
||||||
|
<a onClick="return onDownload(this)" id="linux-bundle64"
|
||||||
|
href="http://dl.google.com/android/adt/<?cs var:sdk.linux64_bundle_download ?>"><?cs var:sdk.linux64_bundle_download ?></a>
|
||||||
|
</td>
|
||||||
|
<td><?cs var:sdk.linux64_bundle_bytes ?> bytes</td>
|
||||||
|
<td><?cs var:sdk.linux64_bundle_checksum ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
@ -263,8 +281,8 @@ var:sdk.win_installer
|
||||||
<td><?cs var:sdk.win_installer_bytes ?> bytes</td>
|
<td><?cs var:sdk.win_installer_bytes ?> bytes</td>
|
||||||
<td><?cs var:sdk.win_installer_checksum ?></td>
|
<td><?cs var:sdk.win_installer_checksum ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="alt-color">
|
<tr>
|
||||||
<td>Mac OS X (intel)</td>
|
<td>Mac OS X</td>
|
||||||
<td>
|
<td>
|
||||||
<a onclick="return onDownload(this)" id="mac-tools" 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
|
var:sdk.mac_download
|
||||||
|
@ -274,7 +292,7 @@ var:sdk.mac_download
|
||||||
<td><?cs var:sdk.mac_checksum ?></td>
|
<td><?cs var:sdk.mac_checksum ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Linux (i386)</td>
|
<td>Linux</td>
|
||||||
<td>
|
<td>
|
||||||
<a onclick="return onDownload(this)" id="linux-tools" 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
|
var:sdk.linux_download
|
||||||
|
@ -302,20 +320,20 @@ var:sdk.linux_download
|
||||||
}
|
}
|
||||||
|
|
||||||
var os;
|
var os;
|
||||||
var $bundlelink;
|
var bundlename;
|
||||||
var $toolslink;
|
var $toolslink;
|
||||||
|
|
||||||
if (navigator.appVersion.indexOf("Win")!=-1) {
|
if (navigator.appVersion.indexOf("Win")!=-1) {
|
||||||
os = "Windows";
|
os = "Windows";
|
||||||
$bundlelink = $('#win-bundle');
|
bundlename = '#win-bundle';
|
||||||
$toolslink = $('#win-tools');
|
$toolslink = $('#win-tools');
|
||||||
} else if (navigator.appVersion.indexOf("Mac")!=-1) {
|
} else if (navigator.appVersion.indexOf("Mac")!=-1) {
|
||||||
os = "Mac";
|
os = "Mac";
|
||||||
$bundlelink = $('#mac-bundle');
|
bundlename = '#mac-bundle';
|
||||||
$toolslink = $('#mac-tools');
|
$toolslink = $('#mac-tools');
|
||||||
} else if (navigator.appVersion.indexOf("Linux")!=-1) {
|
} else if (navigator.appVersion.indexOf("Linux")!=-1) {
|
||||||
os = "Linux";
|
os = "Linux";
|
||||||
$bundlelink = $('#linux-bundle');
|
bundlename = '#linux-bundle';
|
||||||
$toolslink = $('#linux-tools');
|
$toolslink = $('#linux-tools');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -325,47 +343,45 @@ var:sdk.linux_download
|
||||||
/* set up primary adt download button */
|
/* set up primary adt download button */
|
||||||
$('#download-bundle-button').show();
|
$('#download-bundle-button').show();
|
||||||
$('#download-bundle-button').append("Download the SDK <br/><span class='small'>ADT Bundle for " + os + "</span>");
|
$('#download-bundle-button').append("Download the SDK <br/><span class='small'>ADT Bundle for " + os + "</span>");
|
||||||
$('#download-bundle-button').click(function() {return onDownloadBouncer(this,true);}).attr('href', $bundlelink.attr('href'));
|
$('#download-bundle-button').click(function() {return onDownload(this,true,true);}).attr('href', bundlename);
|
||||||
|
|
||||||
/* set up sdk tools only button */
|
/* set up sdk tools only button */
|
||||||
$('#download-tools-button').show();
|
$('#download-tools-button').show();
|
||||||
$('#download-tools-button').append("Download the SDK Tools for " + os);
|
$('#download-tools-button').append("Download the SDK Tools for " + os);
|
||||||
$('#download-tools-button').click(function() {return onDownload(this,false);}).attr('href', $toolslink.attr('href'));
|
$('#download-tools-button').click(function() {return onDownload(this,true);}).attr('href', $toolslink.attr('href'));
|
||||||
} else {
|
} else {
|
||||||
$('.pax').show();
|
$('.pax').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function onDownloadBouncer(link, button) {
|
function onDownload(link, button, bundle) {
|
||||||
|
|
||||||
if (navigator.userAgent.indexOf("WOW64") != -1 ||
|
|
||||||
navigator.userAgent.indexOf("Win64") != -1 ) {
|
|
||||||
|
|
||||||
$("#naMessage").show();
|
|
||||||
$("#warningCancel").click(function() {
|
|
||||||
$('#naMessage').hide();
|
|
||||||
onDownload(link,button);
|
|
||||||
});
|
|
||||||
$("#warningOk").click(function() {
|
|
||||||
$('#naMessage').hide();
|
|
||||||
onDownload($("#download-tools-button").get(),false);
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
return onDownload(link,button);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function onDownload(link, button) {
|
|
||||||
|
|
||||||
|
/* set text for download button */
|
||||||
if (button) {
|
if (button) {
|
||||||
$("#downloadForRealz").html($(link).text());
|
$("#downloadForRealz").html($(link).text());
|
||||||
} else {
|
} else {
|
||||||
$("#downloadForRealz").html("Download " + $(link).text());
|
$("#downloadForRealz").html("Download " + $(link).text());
|
||||||
|
}
|
||||||
|
|
||||||
|
/* if it's a bundle, show the 32/64-bit picker */
|
||||||
|
if (bundle) {
|
||||||
|
$("#downloadForRealz").attr('bundle','true');
|
||||||
|
if ($("#downloadForRealz").text().indexOf("Mac") == -1) {
|
||||||
|
$("p#bitpicker").show();
|
||||||
|
} else {
|
||||||
|
/* mac is always 64 bit, so set it checked */
|
||||||
|
$("p#bitpicker input[value=64]").attr('checked', true);
|
||||||
|
}
|
||||||
|
/* save link name until the bit version is chosen */
|
||||||
|
$("#downloadForRealz").attr('name',$(link).attr('href'));
|
||||||
|
} else {
|
||||||
|
/* if not using bundle, set download button to ignore bitpicker and set url */
|
||||||
|
$("#downloadForRealz").attr('bundle','false');
|
||||||
|
$("#downloadForRealz").attr('href',$(link).attr('href'));
|
||||||
|
/* set picker checked as a fake default */
|
||||||
|
$("p#bitpicker input[value=64]").attr('checked', true);
|
||||||
$("a#next-link").html("Setting Up an Existing IDE").attr('href',toRoot + 'sdk/installing/index.html');
|
$("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');
|
$("#tos").fadeIn('fast');
|
||||||
$("#landing").fadeOut('fast');
|
$("#landing").fadeOut('fast');
|
||||||
|
@ -376,7 +392,18 @@ var:sdk.linux_download
|
||||||
|
|
||||||
|
|
||||||
function onAgreeChecked() {
|
function onAgreeChecked() {
|
||||||
if ($("input#agree").is(":checked")) {
|
/* verify that the TOS is agreed and a bit version is chosen */
|
||||||
|
if ($("input#agree").is(":checked") && $("#bitpicker input:checked").length) {
|
||||||
|
|
||||||
|
/* if downloading the bundle */
|
||||||
|
if ($("#downloadForRealz").attr('bundle')) {
|
||||||
|
/* construct the name of the link we want based on the bit version */
|
||||||
|
linkId = $("a#downloadForRealz").attr("name") + $("#bitpicker input:checked").val();
|
||||||
|
/* set the real url for download */
|
||||||
|
$("a#downloadForRealz").attr("href", $(linkId).attr("href"));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* reveal the download button */
|
||||||
$("a#downloadForRealz").removeClass('disabled');
|
$("a#downloadForRealz").removeClass('disabled');
|
||||||
} else {
|
} else {
|
||||||
$("a#downloadForRealz").addClass('disabled');
|
$("a#downloadForRealz").addClass('disabled');
|
||||||
|
@ -384,15 +411,15 @@ var:sdk.linux_download
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDownloadForRealz(link) {
|
function onDownloadForRealz(link) {
|
||||||
if ($("input#agree").is(':checked')) {
|
if ($("input#agree").is(':checked') && $("#bitpicker input:checked").length) {
|
||||||
$("div.sdk-terms").slideUp();
|
$("div.sdk-terms").slideUp();
|
||||||
$("#sdk-terms-form,.sdk-terms-intro").fadeOut('slow');
|
$("#sdk-terms-form,.sdk-terms-intro").fadeOut('slow');
|
||||||
$("#next-steps").fadeIn('slow');
|
$("#next-steps").fadeIn('slow');
|
||||||
$("h1#tos-header").text('Get Ready to Code!');
|
$("h1#tos-header").text('Get Ready to Code!');
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
$("label#agreeLabel").parent().stop().animate({color: "#258AAF"}, 200,
|
$("label#agreeLabel,#bitpicker input").parent().stop().animate({color: "#258AAF"}, 200,
|
||||||
function() {$("label#agreeLabel").parent().stop().animate({color: "#222"}, 200)}
|
function() {$("label#agreeLabel,#bitpicker input").parent().stop().animate({color: "#222"}, 200)}
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue