diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index 0f3c431e9..4c4cdee5a 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -1995,7 +1995,7 @@ div#sdk-terms-form { padding:0 0 0 10px; } -div#sdk-terms-form input#agree { +div#sdk-terms-form input { display:inline; margin:4px 4px 4px 0; } diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs index 1e3a7283c..170231fa3 100644 --- a/tools/droiddoc/templates-sdk/sdkpage.cs +++ b/tools/droiddoc/templates-sdk/sdkpage.cs @@ -92,7 +92,7 @@ bytes - + Mac OS X (intel) MD5 Checksum - Windows + Windows 32-bit - + - bytes - - - - Mac OS X (intel) - - - - bytes - + bytes + - Linux 32/64-bit (x86) + Windows 64-bit - + - bytes - + bytes + + + + Mac OS X 64-bit + + + + bytes + + + + Linux 32-bit + + + + bytes + + + + Linux 64-bit + + + + bytes + @@ -263,8 +281,8 @@ var:sdk.win_installer bytes - - Mac OS X (intel) + + Mac OS X ADT Bundle for " + os + ""); - $('#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 */ $('#download-tools-button').show(); $('#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 { $('.pax').show(); } - - - function onDownloadBouncer(link, button) { - - 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) { - + function onDownload(link, button, bundle) { + + /* set text for download button */ if (button) { $("#downloadForRealz").html($(link).text()); } else { $("#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'); } - $("#downloadForRealz").attr('href',$(link).attr('href')); $("#tos").fadeIn('fast'); $("#landing").fadeOut('fast'); @@ -376,7 +392,18 @@ var:sdk.linux_download 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'); } else { $("a#downloadForRealz").addClass('disabled'); @@ -384,15 +411,15 @@ var:sdk.linux_download } function onDownloadForRealz(link) { - if ($("input#agree").is(':checked')) { + if ($("input#agree").is(':checked') && $("#bitpicker input:checked").length) { $("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)} + $("label#agreeLabel,#bitpicker input").parent().stop().animate({color: "#258AAF"}, 200, + function() {$("label#agreeLabel,#bitpicker input").parent().stop().animate({color: "#222"}, 200)} ); return false; }