From db3678bcaadf74b1a940a3dafb9fda4e238250be Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 23 Oct 2012 14:13:41 -0700 Subject: add ADT Bundle to the download page Change-Id: Ife533a32e29f2d5f1c58a42ad0b91c5053b44da4 --- .../droiddoc/templates-sdk/assets/css/default.css | 109 ++++++++++++--- tools/droiddoc/templates-sdk/assets/js/docs.js | 21 ++- tools/droiddoc/templates-sdk/sdkpage.cs | 152 +++++++++++++++++---- 3 files changed, 236 insertions(+), 46 deletions(-) (limited to 'tools/droiddoc') 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('
'); + $('h2').not('#qv h2').not('#tb h2').not('.sidebox h2').not('#devdoc-nav h2').not('h2.norule').css({marginBottom:0}).after('
'); // 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 = $('
') .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 @@ # ?> - @@ -140,6 +139,49 @@
Platform
+ + + + + + + + + + + + + + + + + + + + + + + + +
PlatformPackageSizeMD5 Checksum
Windows + + bytes
Mac OS X (intel) + + bytes
Linux 32/64-bit (x86) + + bytes
+ + +

SDK Tools Only

@@ -150,7 +192,7 @@ @@ -159,7 +201,7 @@ @@ -169,7 +211,7 @@ var:sdk.win_installer @@ -179,7 +221,7 @@ var:sdk.mac_download @@ -187,51 +229,109 @@ var:sdk.linux_download
Platform
Windows - bytes
- (Recommended)
Mac OS X (intel) -
Linux (i386) -
+ + + -
+ + + + + + + -- cgit v1.1 From 55d99832fd2631bc9453141ae3a23e2eb074ede0 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Mon, 12 Nov 2012 23:03:59 -0800 Subject: docs: changes to sdk page and script for toggles Change-Id: Idef0c6099885cada3a4866ed7b5ec5b6f5078e39 --- tools/droiddoc/templates-sdk/assets/js/docs.js | 1 + tools/droiddoc/templates-sdk/sdkpage.cs | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index 54e1fd4..3cdfe1e 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -1065,6 +1065,7 @@ function toggleExpandable(link,id) { function hideExpandable(ids) { $(ids).slideUp(); + $(ids).prev('h4').find('a.expandable').removeClass('expanded'); } diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs index bbb94c0..305c085 100644 --- a/tools/droiddoc/templates-sdk/sdkpage.cs +++ b/tools/droiddoc/templates-sdk/sdkpage.cs @@ -137,12 +137,17 @@ -
- -
- -- cgit v1.1 From 705e8a4f6100486dbcf1530490e9761c1afa1a6e Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 13 Nov 2012 05:36:12 -0800 Subject: docs: something whatever Change-Id: I08120f1e27a488dfec03868758ab6de2e75fdc09 --- tools/droiddoc/templates-sdk/sdkpage.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs index 305c085..2cf5c61 100644 --- a/tools/droiddoc/templates-sdk/sdkpage.cs +++ b/tools/droiddoc/templates-sdk/sdkpage.cs @@ -327,7 +327,6 @@ var:sdk.linux_download } $(window).hashchange( function(){ - console.log('hash: '+location.hash); if (location.hash == "") { location.reload(); } -- cgit v1.1 From bbffb4bfb48eb0adb7dc827594f41428f8ffcc19 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 13 Nov 2012 07:40:16 -0800 Subject: docs: add support for templated tabs with the doc title Change-Id: I820a2704d21c94a9a452854a46ea88749d8274d0 --- .../droiddoc/templates-sdk/assets/css/default.css | 44 ++++++++++++++++++++++ tools/droiddoc/templates-sdk/docpage.cs | 12 +++++- 2 files changed, 55 insertions(+), 1 deletion(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index db5bd01..65040f8 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -486,6 +486,50 @@ video.with-shadow { float:right; text-transform:uppercase; } + + + + /* inner-doc tabs w/ title */ + +div#title-tabs-wrapper { + border-bottom:1px solid #ccc; + margin:20px 0 30px; +} +h1.with-title-tabs { + display:inline-block; + margin:0 0 -1px 0; + padding:0 60px 0 0; + border-bottom:1px solid #F9F9F9; +} +ul#title-tabs { + list-style:none; + padding:0; + height:29px; + margin:0; + font-size:16px; + line-height:26px; + display:inline-block; + vertical-align:bottom; +} +ul#title-tabs li { + display:block; + float:left; + margin-right:40px; + border-bottom: 3px solid transparent; +} +ul#title-tabs li.selected { + border-bottom: 3px solid #93C; +} +ul#title-tabs li a { + color:#333; +} +ul#title-tabs li a:hover, +ul#title-tabs li a:visited, +ul#title-tabs li a:active { + color:#93C !important; +} + + /* content body */ @-webkit-keyframes glowheader { diff --git a/tools/droiddoc/templates-sdk/docpage.cs b/tools/droiddoc/templates-sdk/docpage.cs index 63abceb..3ea55fa 100644 --- a/tools/droiddoc/templates-sdk/docpage.cs +++ b/tools/droiddoc/templates-sdk/docpage.cs @@ -101,7 +101,17 @@ -

+
+

class="with-title-tabs">

    +
  • + +
  • + +
  • +
+
+ -- cgit v1.1 From e0c11a6f9ae9345da7109c4b08d26778e8265520 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 13 Nov 2012 07:47:50 -0800 Subject: docs: fix broken template Change-Id: Ibb804bcf8851cdb15cf6c98dff25a3a391eb8301 --- tools/droiddoc/templates-sdk/docpage.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/docpage.cs b/tools/droiddoc/templates-sdk/docpage.cs index 3ea55fa..3f1cfcf 100644 --- a/tools/droiddoc/templates-sdk/docpage.cs +++ b/tools/droiddoc/templates-sdk/docpage.cs @@ -101,7 +101,7 @@ -
+

class="with-title-tabs">

  • @@ -110,8 +110,8 @@
-
- + +
-- cgit v1.1 From df0e161703de693dd6a837c56be810a9e29e7d3c Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 13 Nov 2012 07:52:20 -0800 Subject: docs: css fix Change-Id: Ie03e7708866fd2e97347ee10f3a40b2f77b0a803 --- tools/droiddoc/templates-sdk/assets/css/default.css | 1 - 1 file changed, 1 deletion(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index 65040f8..89b6c88 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -524,7 +524,6 @@ ul#title-tabs li a { color:#333; } ul#title-tabs li a:hover, -ul#title-tabs li a:visited, ul#title-tabs li a:active { color:#93C !important; } -- cgit v1.1 From 098d8deaefaf6f834db86c15999d2aedd038d272 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Tue, 13 Nov 2012 11:25:06 -0800 Subject: docs: add support for ndk tos wall Change-Id: Ife49429b8241f4e9ce5aaa9f6494d52014a3f238 --- tools/droiddoc/templates-sdk/sdkpage.cs | 62 +++++++++++++++++++++++++++++---- 1 file changed, 56 insertions(+), 6 deletions(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs index 2cf5c61..41c9446 100644 --- a/tools/droiddoc/templates-sdk/sdkpage.cs +++ b/tools/droiddoc/templates-sdk/sdkpage.cs @@ -86,7 +86,7 @@ Windows - bytes @@ -95,7 +95,7 @@ Mac OS X (intel) - bytes @@ -104,7 +104,7 @@ Linux 32/64-bit (x86) - bytes @@ -115,6 +115,56 @@ + + + + Windows + href="http://dl.google.com/android/"> bytes @@ -169,7 +219,7 @@ Mac OS X (intel) + href="http://dl.google.com/android/"> bytes @@ -178,7 +228,7 @@ Linux 32/64-bit (x86) + href="http://dl.google.com/android/"> bytes -- cgit v1.1 From 7c05b69c0c985bd2f57caec9143710a2204317b8 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Wed, 14 Nov 2012 14:12:29 -0800 Subject: docs: add warning message for adt when on 32-bit os Change-Id: I457a219bb1f9e07d6b94084c69c56309568a4881 --- tools/droiddoc/templates-sdk/sdkpage.cs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/sdkpage.cs b/tools/droiddoc/templates-sdk/sdkpage.cs index 41c9446..1e3a728 100644 --- a/tools/droiddoc/templates-sdk/sdkpage.cs +++ b/tools/droiddoc/templates-sdk/sdkpage.cs @@ -325,16 +325,38 @@ var:sdk.linux_download /* set up primary adt download button */ $('#download-bundle-button').show(); $('#download-bundle-button').append("Download the SDK
ADT Bundle for " + os + ""); - $('#download-bundle-button').click(function() {return onDownload(this,true);}).attr('href', $bundlelink.attr('href')); + $('#download-bundle-button').click(function() {return onDownloadBouncer(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')); + $('#download-tools-button').click(function() {return onDownload(this,false);}).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) { if (button) { -- cgit v1.1 From 5a1123ef7a43c007ff4cfb6c04d3f9dc5436f1c6 Mon Sep 17 00:00:00 2001 From: Scott Main Date: Wed, 26 Sep 2012 12:51:28 -0700 Subject: add script to generate list of classes for each training course landing page Change-Id: Ieac8a97a8d6fda41a3682241901150cfe16afc4d --- .../droiddoc/templates-sdk/assets/css/default.css | 80 +++++++++++- tools/droiddoc/templates-sdk/assets/js/docs.js | 135 +++++++++++++-------- tools/droiddoc/templates-sdk/docpage.cs | 17 +-- 3 files changed, 169 insertions(+), 63 deletions(-) (limited to 'tools/droiddoc') diff --git a/tools/droiddoc/templates-sdk/assets/css/default.css b/tools/droiddoc/templates-sdk/assets/css/default.css index db5bd01..4f8c424 100644 --- a/tools/droiddoc/templates-sdk/assets/css/default.css +++ b/tools/droiddoc/templates-sdk/assets/css/default.css @@ -448,21 +448,23 @@ video.with-shadow { border:1px solid #DADADA; border-bottom:0; } - + .training-nav-top a.next-page-link { border-left:0; width:123px; } + .paging-links a.disabled, .training-nav-top a.disabled, .content-footer a.disabled { - color:#999; + color:#bbb; } + .paging-links a.disabled:hover, .training-nav-top a.disabled:hover, .content-footer a.disabled:hover { cursor:default; - color:#999 !important; + color:#bbb !important; } .training-nav-top a.start-class-link, @@ -470,6 +472,78 @@ video.with-shadow { width:262px; } + /* list of classes on course landing page */ + ol.class-list { + list-style:none; + margin-left:0; + } + ol.class-list>li { + margin:0 0 15px; + padding:5px 0 0; + overflow:hidden; + border-top:1px solid #ccc; + } + ol.class-list li a.title { + font-size:16px; + margin:0; + clear:left; + display:block; + height:32px; + padding:0 4px; + } + ol.class-list li a.title h2 { + color:inherit; + margin:0 0 10px; + display:block; + float:left; + width:675px; + } + ol.class-list li a.title span { + display:none; + float:left; + font-size:18px; + font-weight:bold; + background: transparent url(../images/styles/disclosure_right.png) no-repeat scroll 50% 50%; + width: 10px; + height: 32px; + } + ol.class-list li a.title:hover { + background:#ddd; + color:#258AAF !important; + } + ol.class-list li a.title:hover span { + display:block; + } + + #jd-content + ol.class-list li img { + float:left; + clear:left; + width:64px; + margin:0 20px 0 0; + } + ol.class-list li p.description { + float:left; + display:block; + width:250px; + margin:0; + } + ol.class-list li p.description.article { + width: 550px; + } + ol.class-list ol { + float:left; + width:320px; + margin:0 0 0 30px; + list-style:none; + margin:0 0 0 20px; + } + ol.class-list div.lessons li { + margin:0 0 6px; + line-height:16px; + } + + .hide { display:none !important; } diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index 54e1fd4..0a5a4af 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -135,6 +135,7 @@ $(document).ready(function() { // select current page in sidenav and set up prev/next links if they exist var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]'); + var $selListItem; if ($selNavLink.length) { $selListItem = $selNavLink.closest('li'); @@ -156,11 +157,9 @@ $(document).ready(function() { false; // navigate across topic boundaries only in design docs if ($prevListItem.length) { if ($prevListItem.hasClass('nav-section')) { - if (crossBoundaries) { - // jump to last topic of previous section - $prevLink = $prevListItem.find('a:last'); - } - } else { + // jump to last topic of previous section + $prevLink = $prevListItem.find('a:last'); + } else if (!$selListItem.hasClass('nav-section')) { // jump to previous topic in this section $prevLink = $prevListItem.find('a:eq(0)'); } @@ -177,18 +176,8 @@ false; // navigate across topic boundaries only in design docs } } - if ($prevLink.length) { - var prevHref = $prevLink.attr('href'); - if (prevHref == SITE_ROOT + 'index.html') { - // Don't show Previous when it leads to the homepage - } else { - $('.prev-page-link').attr('href', $prevLink.attr('href')).removeClass("hide"); - } - } - // set up next links var $nextLink = []; - var startCourse = false; var startClass = false; var training = $(".next-class-link").length; // decides whether to provide "next class" link var isCrossingBoundary = false; @@ -206,53 +195,103 @@ false; // navigate across topic boundaries only in design docs $('.topic-start-link').text($nextLink.text().toUpperCase()); } - // Handle some Training specialties - if ($selListItem.parent().is("#nav") && $(".start-course-link").length) { - // this means we're at the very top of the TOC hierarchy - startCourse = true; - } else if ($(".start-class-link").length) { - // this means this page has children but is not at the top (it's a class, not a course) + // If the selected page has a description, then it's a class or article homepage + if ($selListItem.find('a[description]').length) { + // this means we're on a class landing page startClass = true; } } else { // jump to the next topic in this section (if it exists) $nextLink = $selListItem.next('li').find('a:eq(0)'); if (!$nextLink.length) { - if (crossBoundaries || training) { - // no more topics in this section, jump to the first topic in the next section - $nextLink = $selListItem.parents('li:eq(0)').next('li.nav-section').find('a:eq(0)'); - isCrossingBoundary = true; + isCrossingBoundary = true; + // no more topics in this section, jump to the first topic in the next section + $nextLink = $selListItem.parents('li:eq(0)').next('li.nav-section').find('a:eq(0)'); + if (!$nextLink.length) { // Go up another layer to look for next page (lesson > class > course) + $nextLink = $selListItem.parents('li:eq(1)').next('li.nav-section').find('a:eq(0)'); } } } - if ($nextLink.length) { - if (startCourse || startClass) { - if (startCourse) { - $('.start-course-link').attr('href', $nextLink.attr('href')).removeClass("hide"); - } else { - $('.start-class-link').attr('href', $nextLink.attr('href')).removeClass("hide"); - } - // if there's no training bar (below the start button), - // then we need to add a bottom border to button - if (!$("#tb").length) { - $('.start-course-link').css({'border-bottom':'1px solid #DADADA'}); - $('.start-class-link').css({'border-bottom':'1px solid #DADADA'}); - } - } else if (training && isCrossingBoundary) { - $('.content-footer.next-class').show(); - $('.next-page-link').attr('href','') - .removeClass("hide").addClass("disabled") - .click(function() { return false; }); - - $('.next-class-link').attr('href',$nextLink.attr('href')) - .removeClass("hide").append($nextLink.html()); - $('.next-class-link').find('.new').empty(); + + if (startClass) { + $('.start-class-link').attr('href', $nextLink.attr('href')).removeClass("hide"); + + // if there's no training bar (below the start button), + // then we need to add a bottom border to button + if (!$("#tb").length) { + $('.start-class-link').css({'border-bottom':'1px solid #DADADA'}); + } + } else if (isCrossingBoundary && !$('body.design').length) { // Design always crosses boundaries + $('.content-footer.next-class').show(); + $('.next-page-link').attr('href','') + .removeClass("hide").addClass("disabled") + .click(function() { return false; }); + + $('.next-class-link').attr('href',$nextLink.attr('href')) + .removeClass("hide").append($nextLink.html()); + $('.next-class-link').find('.new').empty(); + } else { + $('.next-page-link').attr('href', $nextLink.attr('href')).removeClass("hide"); + } + + if (!startClass && $prevLink.length) { + var prevHref = $prevLink.attr('href'); + if (prevHref == SITE_ROOT + 'index.html') { + // Don't show Previous when it leads to the homepage } else { - $('.next-page-link').attr('href', $nextLink.attr('href')).removeClass("hide"); + $('.prev-page-link').attr('href', $prevLink.attr('href')).removeClass("hide"); } + } + + // If this is a training 'article', there should be no prev/next nav + // ... if the grandparent is the "nav" ... and it has no child list items... + if (training && $selListItem.parents('ul').eq(1).is('[id="nav"]') && + !$selListItem.find('li').length) { + $('.next-page-link,.prev-page-link').attr('href','').addClass("disabled") + .click(function() { return false; }); } } + + + + // Set up the course landing pages for Training with class names and descriptions + if ($('body.trainingcourse').length) { + var $classLinks = $selListItem.find('ul li a').not('#nav .nav-section .nav-section ul a'); + var $classDescriptions = $classLinks.attr('description'); + + var $olClasses = $('
    '); + var $liClass; + var $imgIcon; + var $h2Title; + var $pSummary; + var $olLessons; + var $liLesson; + $classLinks.each(function(index) { + $liClass = $('
  1. '); + $h2Title = $('

    ' + $(this).html()+'

    '); + $pSummary = $('

    ' + $(this).attr('description') + '

    '); + + $olLessons = $('
      '); + + $lessons = $(this).closest('li').find('ul li a'); + + if ($lessons.length) { + $imgIcon = $(''); + $lessons.each(function(index) { + $olLessons.append('
    1. ' + $(this).html()+'
    2. '); + }); + } else { + $imgIcon = $(''); + $pSummary.addClass('article'); + } + + $liClass.append($h2Title).append($imgIcon).append($pSummary).append($olLessons); + $olClasses.append($liClass); + }); + $('.jd-descr').append($olClasses); + } + diff --git a/tools/droiddoc/templates-sdk/docpage.cs b/tools/droiddoc/templates-sdk/docpage.cs index 63abceb..00ca5e0 100644 --- a/tools/droiddoc/templates-sdk/docpage.cs +++ b/tools/droiddoc/templates-sdk/docpage.cs @@ -7,7 +7,8 @@ elif:about ?>aboutdesigndistribute" itemscope itemtype="http://schema.org/Article"> + /if ?> trainingcourse" itemscope itemtype="http://schema.org/Article"> @@ -16,7 +17,7 @@ ?>class="col-13" id="doc-col"class="col-12" id="doc-col" > - + - +