From a9d796a4f9e198f17de6f1a27264b1b4fc9a778a Mon Sep 17 00:00:00 2001 From: Joe Fernandez Date: Tue, 5 May 2015 22:07:42 -0700 Subject: [PATCH] docs: Add navigation heading for Develop > Preview Change-Id: I133672c6ecb5e778f49c31d091812ed7b6dc6b24 --- .../droiddoc/templates-sdk/assets/js/docs.js | 37 ++++- .../templates-sdk/components/masthead.cs | 46 +------ .../droiddoc/templates-sdk/customizations.cs | 128 +++++++++--------- tools/droiddoc/templates-sdk/docpage.cs | 36 ++--- 4 files changed, 123 insertions(+), 124 deletions(-) diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index ca642171f..8baf3f4d5 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -192,6 +192,8 @@ $(document).ready(function() { subNavEl.find("li.google > a").addClass("selected"); } else if ($("body").hasClass("samples")) { subNavEl.find("li.samples > a").addClass("selected"); + } else if ($("body").hasClass("preview")) { + subNavEl.find("li.preview > a").addClass("selected"); } else { parentNavEl.removeClass('has-subnav').addClass("selected"); } @@ -2357,6 +2359,37 @@ function search_changed(e, kd, toroot) } } + // Search for Preview Guides + for (var i=0; i= 0; j--) { + // it matches a tag + if (s.keywords[j].toLowerCase().match(textRegex)) { + matched = true; + s.matched_tag = j + 1; // add 1 to index position + } + } + // Check if query matches the doc title, but only for current language + if (s.lang == currentLang) { + // if query matches the doc title + if (s.title.toLowerCase().match(textRegex)) { + matched = true; + s.matched_title = 1; + } + } + if (matched) { + gDocsMatches[matchedCountDocs] = s; + matchedCountDocs++; + } + } + // Rank/sort all the matched pages rank_autocomplete_doc_results(text, gDocsMatches); } @@ -3707,7 +3740,7 @@ function showSamples() { return $el; } - + function createResponsiveFlowColumn(cardSize) { var cardWidth = parseInt(cardSize.match(/(\d+)/)[1], 10); var column = $('
').addClass('col-' + (cardWidth / 3) + 'of6'); @@ -3732,7 +3765,7 @@ function showSamples() { while (i < resources.length) { var cardSize = cardSizes[j++ % cardSizes.length]; cardSize = cardSize.replace(/^\s+|\s+$/,''); - + var column = createResponsiveFlowColumn(cardSize).appendTo($widget); // A stack has a third dimension which is the number of stacked items diff --git a/tools/droiddoc/templates-sdk/components/masthead.cs b/tools/droiddoc/templates-sdk/components/masthead.cs index a02774944..9e6a64531 100644 --- a/tools/droiddoc/templates-sdk/components/masthead.cs +++ b/tools/droiddoc/templates-sdk/components/masthead.cs @@ -1,10 +1,7 @@ - - - - - - - - - - -
- - - - -
- - + @@ -268,6 +236,6 @@ color:#666;font-weight:100;font-size:27px;">L Developer Preview
-?> +?> diff --git a/tools/droiddoc/templates-sdk/customizations.cs b/tools/droiddoc/templates-sdk/customizations.cs index 15dc3af72..7c92adb15 100644 --- a/tools/droiddoc/templates-sdk/customizations.cs +++ b/tools/droiddoc/templates-sdk/customizations.cs @@ -1,15 +1,15 @@ -
-
- @@ -26,10 +26,10 @@ def:tools_nav() ?>
- - - + +
+
+
+
+ +
+
+ +
@@ -175,9 +189,9 @@ def:guide_nav() ?>
- - +
@@ -196,7 +210,7 @@ def:design_nav() ?> - +
@@ -214,7 +228,7 @@ def:distribute_nav() ?> - +
@@ -252,12 +266,12 @@ def:google_nav() ?> - +
- -
-
-
- -
-
- - - - @@ -343,15 +341,15 @@ def:default_left_nav() ?>
Android APIs
- +