diff options
author | Scott Main <smain@google.com> | 2012-10-23 14:13:41 -0700 |
---|---|---|
committer | Scott Main <smain@google.com> | 2012-11-12 18:00:23 -0800 |
commit | db3678bcaadf74b1a940a3dafb9fda4e238250be (patch) | |
tree | 4a329bfbc579591d2987825257c5db9404e15e24 /tools | |
parent | e896e3447145859371d2b7172122faabe44d10e2 (diff) | |
download | build-db3678bcaadf74b1a940a3dafb9fda4e238250be.zip build-db3678bcaadf74b1a940a3dafb9fda4e238250be.tar.gz build-db3678bcaadf74b1a940a3dafb9fda4e238250be.tar.bz2 |
add ADT Bundle to the download page
Change-Id: Ife533a32e29f2d5f1c58a42ad0b91c5053b44da4
Diffstat (limited to 'tools')
-rw-r--r-- | tools/droiddoc/templates-sdk/assets/css/default.css | 109 | ||||
-rw-r--r-- | tools/droiddoc/templates-sdk/assets/js/docs.js | 21 | ||||
-rw-r--r-- | tools/droiddoc/templates-sdk/sdkpage.cs | 152 |
3 files changed, 236 insertions, 46 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index f56fc98..db5bd01 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -129,11 +129,14 @@ strong { em { font-style: italic; } -acronym { +acronym, +.tooltip-link { border-bottom: 1px dotted #555555; cursor: help; } -acronym:hover { +acronym:hover, +.tooltip-link:hover { + color: #7aa1b0; border-bottom-color: #7aa1b0; } img.with-shadow, @@ -938,9 +941,12 @@ dd { dd p { margin:10px 0 0; } -ul p, -ol p { - margin:5px 0 0; +li p, +li pre, +li ul, +li ol { + margin-top:5px; + margin-bottom:5px; } pre strong, pre b, a strong, a b, a code { color: inherit; @@ -1418,18 +1424,14 @@ Buttons color: #444; } a.button, a.button:visited, a.button-secondary, a.button-secondary:visited { - height: 28px; - line-height: 28px; margin-right: 16px; - font-weight: 400; + font-weight: 400; min-width: 54px; outline: 0; padding: 8px 15px; text-align: center; } .button, .button-secondary { - height: 34px; - line-height: 34px; margin-right: 16px; font-weight: 400; min-width: 54px; @@ -1455,6 +1457,9 @@ EndColorStr='#4cadcb',GradientType=0); background-image: none; border-color: #30b7e6; } +a.button.big.subtitle { + line-height:18px; +} .button-secondary:hover, a.button-secondary:hover { border-color: #dbdbdb; background-color: #f3f3f3; @@ -1469,7 +1474,7 @@ EndColorStr='#ececec'); color: #33B5E5 !important; } .button-secondary:active, a.button-secondary:active { - border-color: #dadada; + border-color: #dadada; background: #ebebeb; /* Old browsers */ /* IE9 SVG, needs conditional override of 'filter' to 'none' */ background: @@ -1510,12 +1515,20 @@ endColorstr='#ffffff',GradientType=0 ); /* IE6-8 */ font-size:20px; display:inline-block; } +.button.big span.small { + font-size:14px; +} +.button-caption { + margin-top:10px; + font-size:12px; + font-style:italic; +} .button.disabled, .button.disabled:hover, .button.disabled:active { background:#ebebeb; - color:#999; + color:#999 !important; border-color:#999; cursor:default; } @@ -1832,15 +1845,54 @@ form .form-error input[type='text'], form .form-error textarea { border-color: #eff2f9; } */ + +/* SDK TOS styles */ + +div.sdk-terms { + white-space: pre-wrap; + word-wrap: break-word; + font-family: inherit; + font-size: inherit; + padding: 10px; + height: 370px; + width: 738px; + border: 1px solid #444; + background: transparent; + overflow:auto; + margin:0 0 10px; +} + +div.sdk-terms.fullsize { + padding: 0; + height: auto; + width: auto; + border:none; +} + +div.sdk-terms h3, +div.sdk-terms h2 { + margin:0; +} + +div#sdk-terms-form { + padding:0 0 0 10px; +} + +div#sdk-terms-form input#agree { + display:inline; + margin:4px 4px 4px 0; +} + + /* -------------------------------------------------------------------------- Code Style */ pre { - margin:0 0 1em 0; - padding: 1em; - overflow: auto; - border: solid 1px #ddd; - background: #f7f7f7; + margin:0 0 1em 0; + padding: 1em; + overflow: auto; + border: solid 1px #ddd; + background: #f7f7f7; } .str { color: #080; } .kwd { color: #008; } @@ -2332,6 +2384,29 @@ div.design-announce p { line-height:30px; } +.expandable { + height:34px; + padding-left:20px; + position:relative; +} +.expandable:before { + content: ''; + background-image: url(../images/styles/disclosure_down.png); + background-repeat:no-repeat; + background-position: -12px -9px; + width: 20px; + height: 20px; + display: inline-block; + position: absolute; + top: 0; + left: 0; } +} +.expandable.expanded:before { + background-image: url(../images/styles/disclosure_up.png); +} + + + /* ----------------------------------------------- Dialog box for popup messages */ diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index d18c490..54e1fd4 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -28,7 +28,7 @@ $(document).ready(function() { $('.scroll-pane').jScrollPane( {verticalGutter:0} ); // add HRs below all H2s (except for a few other h2 variants) - $('h2').not('#qv h2').not('#tb h2').not('.sidebox h2').not('#devdoc-nav h2').css({marginBottom:0}).after('<hr/>'); + $('h2').not('#qv h2').not('#tb h2').not('.sidebox h2').not('#devdoc-nav h2').not('h2.norule').css({marginBottom:0}).after('<hr/>'); // set search's onkeyup handler here so we can show suggestions // even while search results are visible @@ -384,11 +384,11 @@ false; // navigate across topic boundaries only in design docs // Set up tooltips var TOOLTIP_MARGIN = 10; - $('acronym').each(function() { + $('acronym,.tooltip-link').each(function() { var $target = $(this); var $tooltip = $('<div>') .addClass('tooltip-box') - .text($target.attr('title')) + .append($target.attr('title')) .hide() .appendTo('body'); $target.removeAttr('title'); @@ -1052,6 +1052,21 @@ function toggleContent(obj) { } +/* New version of expandable content */ +function toggleExpandable(link,id) { + if($(id).is(':visible')) { + $(id).slideUp(); + $(link).removeClass('expanded'); + } else { + $(id).slideDown(); + $(link).addClass('expanded'); + } +} + +function hideExpandable(ids) { + $(ids).slideUp(); +} + diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs index 8de6668..bbb94c0 100644 --- a/tools/droiddoc/templates-sdk/sdkpage.cs +++ b/tools/droiddoc/templates-sdk/sdkpage.cs @@ -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()) + '>']); - } - } +<script> + 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 ?> |