am 01a2545b: docs: update templates to remove global content for devsite builds

* commit '01a2545bbab916e45eedbd3708f526ed8bd62935':
  docs: update templates to remove global content for devsite builds
This commit is contained in:
Scott Main 2013-03-21 18:27:16 -07:00 committed by Android Git Automerger
commit 8d92d9ef82
4 changed files with 29 additions and 16 deletions

View file

@ -142,6 +142,9 @@ $(document).ready(function() {
}
}
// Need a copy of the pagePath before it gets changed in the next block;
// it's needed to perform proper tab highlighting in offline docs (see rootDir below)
var pagePathOriginal = pagePath;
if (SITE_ROOT.match(/\.\.\//) || SITE_ROOT == '') {
// If running locally, SITE_ROOT will be a relative path, so account for that by
// finding the relative URL to this page. This will allow us to find links on the page
@ -169,9 +172,8 @@ $(document).ready(function() {
// highlight Develop tab
} else if ($("body").hasClass("develop") || $("body").hasClass("google")) {
$("#header li.develop a").addClass("selected");
// In Develop docs, also highlight appropriate sub-tab
var rootDir = pagePath.substring(1,pagePath.indexOf('/', 1));
var rootDir = pagePathOriginal.substring(1,pagePathOriginal.indexOf('/', 1));
if (rootDir == "training") {
$("#nav-x li.training a").addClass("selected");
} else if (rootDir == "guide") {

View file

@ -1,4 +1,6 @@
<?cs def:custom_masthead() ?>
<a name="top"></a>
<?cs if:!devsite ?><?cs # leave out the global header for devsite; it's in devsite template ?>
<!-- Header -->
<div id="header">
<div class="wrap" id="header-wrap">
@ -60,11 +62,8 @@
<li><a href="http://source.android.com">Android Open Source Project</a></li>
</ul>
<?cs ############ TODO: Remove when we're happy with Devsite ############# ?>
<?cs # Use differenc lang switcher for devsite and gae server ?>
<?cs if:devsite ?>
<div class="header">Language</div>
<?cs elif:android.whichdoc == "online" ?>
<?cs # Include language switcher only in online docs ?>
<?cs if:android.whichdoc == "online" ?>
<div class="header">Language</div>
<div id="language" class="locales">
<select name="language" onChange="changeLangPref(this.value, true)">
@ -83,7 +82,7 @@
//-->
</script>
<?cs /if ?>
<?cs # End of devsite vs. gae version of lang switcher ?>
<?cs # End of lang switcher ?>
<br class="clearfix" />
@ -194,8 +193,7 @@ onkeyup="return search_changed(event, false, '<?cs var:toroot ?>')" />
</div>
<?cs if:training || guide || reference || tools || develop || google ?>
<?cs if:training || guide || reference || tools || develop || google ?>
<!-- Secondary x-nav -->
<div id="nav-x">
<div class="wrap">
@ -240,6 +238,10 @@ onkeyup="return search_changed(event, false, '<?cs var:toroot ?>')" />
</div>
<!-- /Sendondary x-nav -->
<?cs /if ?>
<?cs /if ?>
<?cs # end if/else !devsite ?>
<?cs
/def ?>

View file

@ -9,7 +9,6 @@
elif:distribute ?>distribute<?cs
/if ?><?cs
if:page.trainingcourse ?> trainingcourse<?cs /if ?>" itemscope itemtype="http://schema.org/Article">
<a name="top"></a>
<?cs include:"header.cs" ?>
<div <?cs if:fullpage

View file

@ -1,4 +1,18 @@
<head>
<?cs ####### If building devsite, add some meta data needed for when generating the top nav ######### ?>
<?cs
if:devsite ?><?cs
if:guide||develop||training||reference||tools||sdk||google
?><meta name="top_category" value="develop" /><?cs
elif:google
?><meta name="top_category" value="google" /><?cs
elif:reference && !(reference.gms || reference.gcm)
?><meta name="top_category" value="css-fullscreen" /><?cs
/if ?>
<?cs
/if
?><?cs # END if/else devsite ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?cs if:page.metaDescription ?>
<meta name="Description" content="<?cs var:page.metaDescription ?>">
@ -30,11 +44,7 @@ else
/if ?>
<script type="text/javascript">
var toRoot = "<?cs var:toroot ?>";
<?cs if:devsite ?>
var devsite = true;
<?cs else ?>
var devsite = false;
<?cs /if ?>
var devsite = <?cs if:devsite ?>true<?cs else ?>false<?cs /if ?>;
</script>
<script src="<?cs var:toroot ?>assets/js/docs.js" type="text/javascript"></script>
<?cs if:reference.gms || reference.gcm || google?>