am cf7a3b9e: Highlight "Preview" subtab on preview pages. Support templating for ndk files within templates-sdk.

* commit 'cf7a3b9eb3e17f19ec598e1d77f5bc74751295ac':
  Highlight "Preview" subtab on preview pages. Support templating for ndk files within templates-sdk.
This commit is contained in:
Dirk Dougherty 2015-05-22 17:28:34 +00:00 committed by Android Git Automerger
commit 4620dbd590
8 changed files with 197 additions and 71 deletions

View File

@ -7438,6 +7438,10 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
font-weight: 400;
}
.dac-header-crumbs-link.current.ndk {
color: #00BCD4;
}
@media (max-width: 719px) {
.dac-header-crumbs {
display: none;
@ -7630,6 +7634,10 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
padding-bottom: 11px;
}
.dac-nav-link.has-subnav.ndk, .dac-nav-link.selected.ndk {
border-bottom: 3px solid #00BCD4;
}
.dac-nav-secondary {
border-bottom: 1px solid #e5e5e5;
display: none;
@ -7660,11 +7668,12 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
}
}
.dac-nav-secondary .dac-nav-item:first-child .dac-nav-link {
padding-left: 20px;
.dac-nav-secondary .dac-nav-link.selected {
border: none;
font-weight: 700;
}
.dac-nav-secondary .dac-nav-link.selected {
.dac-nav-secondary .dac-nav-link.selected.ndk {
border: none;
font-weight: 700;
}
@ -7750,6 +7759,11 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
padding: 0 20px;
}
.dac-nav-link.has-subnav.ndk, .dac-nav-link.selected.ndk {
border: none;
padding: 0 20px;
}
.dac-logo-image {
margin-right: 5px;
vertical-align: top;

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -163,6 +163,21 @@ $(document).ready(function() {
} else {
navEl.find("> li.home > a").addClass('selected');
}
// highlight NDK tabs
} else if ($("body").hasClass("ndk")) {
parentNavEl = navEl.find("> li.ndk > a");
parentNavEl.addClass('has-subnav');
if ($("body").hasClass("guide")) {
navEl.find("> li.guides > a").addClass("selected ndk");
} else if ($("body").hasClass("reference")) {
navEl.find("> li.reference > a").addClass("selected ndk");
} else if ($("body").hasClass("samples")) {
navEl.find("> li.samples > a").addClass("selected ndk");
} else if ($("body").hasClass("downloads")) {
navEl.find("> li.downloads > a").addClass("selected ndk");
}
// highlight Develop tab
} else if ($("body").hasClass("develop") || $("body").hasClass("google")) {
parentNavEl = navEl.find("> li.develop > a");
@ -1056,7 +1071,7 @@ function checkSticky() {
var top = $(window).scrollTop();
// we set the navbar fixed when the scroll position is beyond the height of the site header...
var shouldBeSticky = top >= stickyTop;
var shouldBeSticky = top > stickyTop;
// ... except if the document content is shorter than the sidenav height.
// (this is necessary to avoid crazy behavior on OSX Lion due to overscroll bouncing)
if ($("#doc-col").height() < $("#side-nav").height()) {

View File

@ -58,26 +58,36 @@
<span class="dac-nav-hamburger-bot"></span>
</span>
</a>
<a class="dac-header-logo" href="<?cs var:toroot ?>index.html">
<?cs if:ndk ?><a class="dac-header-logo" href="<?cs var:toroot ?>ndk/index.html">
<img class="dac-header-logo-image" src="<?cs var:toroot ?>assets/images/android_logo_ndk.png"
srcset="<?cs var:toroot ?>assets/images/android_logo_ndk@2x.png 2x"
width="32" height="36" alt="Android" /> NDK
</a><?cs else ?><a class="dac-header-logo" href="<?cs var:toroot ?>index.html">
<img class="dac-header-logo-image" src="<?cs var:toroot ?>assets/images/android_logo.png"
srcset="<?cs var:toroot ?>assets/images/android_logo@2x.png 2x"
width="32" height="36" alt="Android" /> Developers
</a>
</a><?cs /if ?>
<ul class="dac-header-crumbs">
<?cs # More <li> elements added here with javascript ?>
<?cs if:!section.landing ?><li class="dac-header-crumbs-item"><span class="dac-header-crumbs-link current"><?cs var:page.title ?></a></li><?cs
<?cs if:!section.landing ?><li class="dac-header-crumbs-item"><span class="dac-header-crumbs-link current <?cs
if:ndk ?>ndk<?cs /if ?>"><?cs var:page.title ?></a></li><?cs
/if ?>
</ul>
<?cs # ADD SEARCH AND MENU ?>
<?cs if:!ndk ?>
<?cs call:header_search_widget() ?>
<?cs /if ?>
<a class="dac-header-consoleBtn" href="https://play.google.com/apps/publish/">
<?cs if:ndk ?><a class="dac-header-consoleBtn" href="http://developer.android.com">
<span class="dac-visible-desktop-inline">Back to Android Developers</span>
</a><?cs else ?><a class="dac-header-consoleBtn" href="https://play.google.com/apps/publish/">
<span class="dac-sprite dac-google-play"></span>
<span class="dac-visible-desktop-inline">Developer</span>
Console
</a>
</a><?cs /if ?>
</div><!-- end header-wrap.wrap -->
</div><!-- end header -->
@ -87,6 +97,49 @@
</div>
</div> <!--end header-wrapper -->
<?cs if:ndk ?>
<!-- NDK Navigation-->
<nav class="dac-nav">
<div class="dac-nav-dimmer" data-dac-toggle-nav></div>
<ul class="dac-nav-list" data-dac-nav>
<li class="dac-nav-item dac-nav-head">
<a class="dac-nav-link dac-nav-logo" data-dac-toggle-nav href="javascript:;" title="Close navigation">
<img class="dac-logo-image" src="<?cs var:toroot ?>assets/images/android_logo_ndk.png"
srcset="<?cs var:toroot ?>assets/images/android_logo_ndk@2x.png 2x"
width="32" height="36" alt="Android" /> NDK
</a>
</li>
<li class="dac-nav-item guides">
<a class="dac-nav-link" href="<?cs var:toroot ?>ndk/guides/index.html"
zh-tw-lang="API 指南"
zh-cn-lang="API 指南"
ru-lang="Руководства по API"
ko-lang="API 가이드"
ja-lang="API ガイド"
es-lang="Guías de la API">Guides</a>
</li>
<li class="dac-nav-item reference">
<a class="dac-nav-link" href="<?cs var:toroot ?>ndk/reference/index.html"
zh-tw-lang="參考資源"
zh-cn-lang="参考"
ru-lang="Справочник"
ko-lang="참조문서"
ja-lang="リファレンス"
es-lang="Referencia">Reference</a>
</li>
<li class="dac-nav-item samples">
<a class="dac-nav-link" href="<?cs var:toroot ?>ndk/samples/index.html"
>Samples</a>
</li>
<li class="dac-nav-item downloads">
<a class="dac-nav-link" href="<?cs var:toroot ?>ndk/downloads/index.html"
>Downloads</a>
</li>
</ul>
</nav>
<!-- end NDK navigation-->
<?cs else ?>
<!-- Navigation-->
<nav class="dac-nav">
<div class="dac-nav-dimmer" data-dac-toggle-nav></div>
@ -213,6 +266,7 @@
</ul>
</nav>
<!-- end navigation-->
<?cs /if ?>
<?cs /if ?><?cs # end if/else !devsite ?>
<?cs

View File

@ -455,6 +455,28 @@ def:default_left_nav() ?>
<?cs
/def ?>
<?cs
def:ndk_nav() ?>
<div class="wrap clearfix" id="body-content"><div class="cols">
<div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
<?cs call:mobile_nav_toggle() ?>
<div class="dac-toggle-content" id="devdoc-nav">
<div class="scroll-pane">
<?cs
if:guide ?><?cs include:"../../../../frameworks/base/docs/html-ndk/ndk/guides/guides_toc.cs" ?><?cs
elif:reference ?><?cs include:"../../../../frameworks/base/docs/html-ndk/ndk/reference/reference_toc.cs" ?><?cs
elif:downloads ?><?cs include:"../../../../frameworks/base/docs/html-ndk/ndk/downloads/downloads_toc.cs" ?><?cs
elif:samples ?><?cs include:"../../../../frameworks/base/docs/html-ndk/ndk/samples/samples_toc.cs" ?><?cs
/if ?>
</div>
</div>
</div> <!-- end side-nav -->
<script>
$(document).ready(function() {
scrollIntoView("devdoc-nav");
});
</script>
<?cs /def ?>
<?cs
def:header_search_widget() ?>
@ -499,53 +521,64 @@ def:header_search_widget() ?>
<?cs /def ?>
<?cs
def:custom_left_nav() ?><?cs
if:fullpage ?><?cs
call:fullpage() ?><?cs
elif:nonavpage ?><?cs
call:no_nav() ?><?cs
elif:guide ?><?cs
call:guide_nav() ?><?cs
elif:design ?><?cs
call:design_nav() ?><?cs
elif:training ?><?cs
call:training_nav() ?><?cs
elif:tools ?><?cs
call:tools_nav() ?><?cs
elif:google ?><?cs
call:google_nav() ?><?cs
elif:samples ?><?cs
call:samples_nav() ?><?cs
elif:preview ?><?cs
call:preview_nav() ?><?cs
elif:distribute ?><?cs
if:googleplay ?><?cs
call:googleplay_nav() ?><?cs
elif:essentials ?><?cs
call:essentials_nav() ?><?cs
elif:users ?><?cs
call:users_nav() ?><?cs
elif:engage ?><?cs
call:engage_nav() ?><?cs
elif:monetize ?><?cs
call:monetize_nav() ?><?cs
elif:analyze ?><?cs
call:analyze_nav() ?><?cs
elif:disttools ?><?cs
call:disttools_nav() ?><?cs
elif:stories ?><?cs
call:stories_nav() ?><?cs
if:ndk ?><?cs
if:fullpage ?><?cs
call:fullpage() ?><?cs
elif:nonavpage ?><?cs
call:no_nav() ?><?cs
elif:guide || reference || samples || downloads ?><?cs
call:ndk_nav() ?><?cs
else ?><?cs
call:default_left_nav() ?> <?cs
/if ?><?cs
elif:about ?><?cs
call:about_nav() ?><?cs
elif:distribute ?><?cs
call:distribute_nav() ?><?cs
elif:wear ?><?cs
call:wear_nav() ?><?cs
else ?><?cs
call:default_left_nav() ?> <?cs
if:fullpage ?><?cs
call:fullpage() ?><?cs
elif:nonavpage ?><?cs
call:no_nav() ?><?cs
elif:guide ?><?cs
call:guide_nav() ?><?cs
elif:design ?><?cs
call:design_nav() ?><?cs
elif:training ?><?cs
call:training_nav() ?><?cs
elif:tools ?><?cs
call:tools_nav() ?><?cs
elif:google ?><?cs
call:google_nav() ?><?cs
elif:samples ?><?cs
call:samples_nav() ?><?cs
elif:preview ?><?cs
call:preview_nav() ?><?cs
elif:distribute ?><?cs
if:googleplay ?><?cs
call:googleplay_nav() ?><?cs
elif:essentials ?><?cs
call:essentials_nav() ?><?cs
elif:users ?><?cs
call:users_nav() ?><?cs
elif:engage ?><?cs
call:engage_nav() ?><?cs
elif:monetize ?><?cs
call:monetize_nav() ?><?cs
elif:analyze ?><?cs
call:analyze_nav() ?><?cs
elif:disttools ?><?cs
call:disttools_nav() ?><?cs
elif:stories ?><?cs
call:stories_nav() ?><?cs
/if ?><?cs
elif:about ?><?cs
call:about_nav() ?><?cs
elif:distribute ?><?cs
call:distribute_nav() ?><?cs
elif:wear ?><?cs
call:wear_nav() ?><?cs
else ?><?cs
call:default_left_nav() ?> <?cs
/if ?><?cs
/if ?><?cs
/def ?>

View File

@ -6,25 +6,30 @@
<?cs # add document classes for navigation header selection (and other stuff) ?>
<?cs
if:(google || reference.gms || reference.gcm) ?>google <?cs
/if ?><?cs
if:(guide||develop||training||reference||tools||sdk||google||samples||preview) ?>develop<?cs
if:guide ?> guide<?cs /if ?><?cs
if:samples ?> samples<?cs /if ?><?cs
if:preview ?> preview<?cs /if ?><?cs
elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories)
?>distribute<?cs
if:googleplay ?> googleplay<?cs /if ?><?cs
if:essentials ?> essentials<?cs /if ?><?cs
if:users ?> users<?cs /if ?><?cs
if:engage ?> engage<?cs /if ?><?cs
if:monetize ?> monetize<?cs /if ?><?cs
if:disttools ?> disttools<?cs /if ?><?cs
if:stories ?> stories<?cs /if ?><?cs
elif:(about||wear||tv||auto) ?>about<?cs
elif:design ?>design<?cs
/if ?><?cs
if:page.trainingcourse ?> trainingcourse<?cs
if:(google || reference.gms || reference.gcm) ?>google <?cs /if ?><?cs
if:ndk ?>ndk<?cs
if:guide ?> guide<?cs /if ?><?cs
if:samples ?> samples<?cs /if ?><?cs
if:reference ?> reference<?cs /if ?><?cs
if:downloads ?> downloads<?cs /if ?><?cs
else ?><?cs
if:(guide||develop||training||reference||tools||sdk||google||samples||preview) ?>develop<?cs
if:guide ?> guide<?cs /if ?><?cs
if:samples ?> samples<?cs /if ?><?cs
if:preview ?> preview<?cs /if ?><?cs
elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?>distribute<?cs
if:googleplay ?> googleplay<?cs /if ?><?cs
if:essentials ?> essentials<?cs /if ?><?cs
if:users ?> users<?cs /if ?><?cs
if:engage ?> engage<?cs /if ?><?cs
if:monetize ?> monetize<?cs /if ?><?cs
if:disttools ?> disttools<?cs /if ?><?cs
if:stories ?> stories<?cs /if ?><?cs
if:analyze ?> analyze<?cs /if ?><?cs
elif:(about||wear||tv||auto) ?>about<?cs
elif:design ?>design<?cs
/if ?><?cs
if:page.trainingcourse ?> trainingcourse<?cs /if ?><?cs
/if ?>" itemscope itemtype="http://schema.org/Article"><?cs
include:"header.cs" ?>

View File

@ -36,6 +36,11 @@ if:android.whichdoc != 'online' ?>http:<?cs
if:android.whichdoc != 'online' ?>http:<?cs
/if ?>//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
title="roboto">
<?cs
if:ndk ?><link rel="stylesheet" href="<?cs
if:android.whichdoc != 'online' ?>http:<?cs
/if ?>//fonts.googleapis.com/css?family=Roboto+Mono:400,500,700" title="roboto-mono" type="text/css"><?cs
/if ?>
<link href="<?cs var:toroot ?>assets/css/default.css?v=5" rel="stylesheet" type="text/css">
<?cs if:reference && !(reference.gms || reference.gcm || preview) ?>