am 502c498f: sdk doc change for esr: add "Resources" tab and modify templates to build content for it.

Merge commit '502c498fec23cb28d16f5e86e981400f76da36ea' into eclair-plus-aosp

* commit '502c498fec23cb28d16f5e86e981400f76da36ea':
  sdk doc change for esr: add "Resources" tab and modify templates to build content for it.
This commit is contained in:
Dirk Dougherty 2009-12-15 07:38:57 -08:00 committed by Android Git Automerger
commit 7b0e85e181
11 changed files with 110 additions and 48 deletions

View file

@ -137,6 +137,9 @@ public class DocFile
} else if (outfile.indexOf("guide/") != -1) {
hdf.setValue("guide", "true");
ClearPage.write(hdf, "docpage.cs", outfile);
} else if (outfile.indexOf("resources/") != -1) {
hdf.setValue("resources", "true");
ClearPage.write(hdf, "resourcespage.cs", outfile);
} else {
ClearPage.write(hdf, "nosidenavpage.cs", outfile);
}

View file

@ -44,7 +44,7 @@ public class SampleCode {
System.out.println("-samplecode not a directory: " + mSource);
return;
}
if (offlineMode) writeIndexOnly(f, mDest);
if (offlineMode) writeIndexOnly(f, mDest, offlineMode);
else writeDirectory(f, mDest);
}
@ -118,9 +118,10 @@ public class SampleCode {
ClearPage.write(hdf, "sampleindex.cs", relative + "/index" + DroidDoc.htmlExtension);
}
public void writeIndexOnly(File dir, String relative) {
public void writeIndexOnly(File dir, String relative, Boolean offline) {
HDF hdf = writeIndex(dir);
ClearPage.write(hdf, "sampleindex.cs", relative + "/index" +
if (!offline) relative = "/" + relative;
ClearPage.write(hdf, "sampleindex.cs", relative + "index" +
DroidDoc.htmlExtension);
}

View file

@ -108,6 +108,21 @@ def:sdk_nav() ?>
</div> <!-- end side-nav -->
<?cs /def ?>
<?cs
def:resources_tab_nav() ?>
<div class="g-section g-tpl-240" id="body-content">
<div class="g-unit g-first side-nav-resizable" id="side-nav">
<div id="devdoc-nav"><?cs
include:"../../../../frameworks/base/docs/html/resources/resources_toc.cs" ?>
</div>
</div> <!-- end side-nav -->
<script>
addLoadEvent(function() {
scrollIntoView("devdoc-nav");
});
</script>
<?cs /def ?>
<?cs
def:guide_nav() ?>
<div class="g-section g-tpl-240" id="body-content">
@ -196,6 +211,8 @@ def:default_left_nav() ?>
def:custom_left_nav() ?><?cs
if:guide ?><?cs
call:guide_nav() ?><?cs
elif:resources ?><?cs
call:resources_tab_nav() ?><?cs
elif:sdk ?><?cs
call:sdk_nav() ?><?cs
else ?><?cs

View file

@ -3,7 +3,7 @@
elif:guide ?>guide<?cs
elif:sdk ?>sdk<?cs
elif:home ?>home<?cs
elif:community ?>community<?cs
elif:resources ?>resources<?cs
elif:videos ?>videos<?cs /if ?>">
<li id="home-link"><a href="<?cs var:toroot ?><?cs
@ -15,7 +15,7 @@
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<?cs /if ?>
@ -30,7 +30,7 @@
<span style="display:none" class="es">Guía</span>
<span style="display:none" class="fr">Guide</span>
<span style="display:none" class="it">Guida</span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<?cs /if ?>
@ -42,21 +42,21 @@
<span style="display:none" class="es">Referencia</span>
<span style="display:none" class="fr">Référence</span>
<span style="display:none" class="it">Riferimento</span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<?cs /if ?>
</a></li>
<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
<li id="resources-link"><a href="<?cs var:toroot ?>resources/index.html" onClick="return loadLast('resources')">
<?cs if:!sdk.redirect ?>
<span class="en">Blog</span>
<span class="en">Resources</span>
<span style="display:none" class="de"></span>
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<?cs /if ?>
</a></li>
<li id="videos-link"><a href="<?cs var:toroot ?>videos/index.html" onClick="return loadLast('videos')">
@ -66,22 +66,24 @@
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<?cs /if ?>
</a></li>
<li id="community-link"><a href="<?cs var:toroot ?>community/index.html">
<li><a href="http://android-developers.blogspot.com" onClick="return requestAppendHL(this.href)">
<?cs if:!sdk.redirect ?>
<span class="en">Community</span>
<span class="en">Blog</span>
<span style="display:none" class="de"></span>
<span style="display:none" class="es">Comunidad</span>
<span style="display:none" class="fr">Communauté</span>
<span style="display:none" class="es"></span>
<span style="display:none" class="fr"></span>
<span style="display:none" class="it"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<span style="display:none" class="ja"></span>
<span style="display:none" class="zh-CN"></span>
<span style="display:none" class="zh-TW"></span>
<?cs /if ?>
</a></li>
</ul>

View file

@ -0,0 +1,31 @@
<?cs include:"doctype.cs" ?>
<?cs include:"macros.cs" ?>
<html>
<?cs include:"head_tag.cs" ?>
<body class="gc-documentation">
<?cs call:custom_masthead() ?>
<?cs call:resources_tab_nav() ?>
<a name="top"></a>
<div class="g-unit" id="doc-content" >
<div id="jd-header" class="guide-header">
<span class="crumb">&nbsp;</span>
<h1><?cs var:page.title ?></h1>
</div>
<div id="jd-content">
<?cs call:tag_list(root.descr) ?>
<?cs include:"footer.cs" ?>
</div><!-- end doc-content -->
<?cs include:"trailer.cs" ?>
</body>
</html>

View file

@ -268,7 +268,7 @@ hr.blue {
.guide #guide-link a,
.reference #reference-link a,
.sdk #sdk-link a,
.community #community-link a,
.resources #resources-link a,
.videos #videos-link a {
background-image: url(images/bg_images_sprite.png);
background-position: 0 0;
@ -282,7 +282,7 @@ hr.blue {
.guide #guide-link a:hover,
.reference #reference-link a:hover,
.sdk #sdk-link a:hover,
.community #community-link a:hover,
.resources #resources-link a:hover,
.videos #videos-link a:hover {
background-image: url(images/bg_images_sprite.png);
background-position: 0 0;

View file

@ -140,6 +140,8 @@ function init() {
var cookiePath = "reference_";
} else if (location.href.indexOf("/guide/") != -1) {
var cookiePath = "guide_";
} else if (location.href.indexOf("/resources/") != -1) {
var cookiePath = "resources_";
}
if (!isMobile) {
@ -166,9 +168,14 @@ function init() {
function highlightNav(fullPageName) {
var lastSlashPos = fullPageName.lastIndexOf("/");
var firstSlashPos = (fullPageName.indexOf("/guide/") != -1) ?
fullPageName.indexOf("/guide/") :
fullPageName.indexOf("/sdk/"); // first slash after /guide or /sdk
var firstSlashPos;
if (fullPageName.indexOf("/guide/") != -1) {
firstSlashPos = fullPageName.indexOf("/guide/");
} else if (fullPageName.indexOf("/sdk/") != -1) {
firstSlashPos = fullPageName.indexOf("/sdk/");
} else {
firstSlashPos = fullPageName.indexOf("/resources/");
}
if (lastSlashPos == (fullPageName.length - 1)) { // if the url ends in slash (add 'index.html')
fullPageName = fullPageName + "index.html";
}
@ -228,6 +235,8 @@ function resizeHeight() {
// If in the dev guide docs, also resize the "devdoc-nav" div
} else if (href.indexOf("/guide/") != -1) {
$("#devdoc-nav").css({height:sidenav.css("height")});
} else if (href.indexOf("/resources/") != -1) {
$("#devdoc-nav").css({height:sidenav.css("height")});
}
}
@ -308,6 +317,8 @@ $(window).unload(function(){
writeCookie("lastpage", path, "reference", null);
} else if (path.indexOf("/guide/") != -1) {
writeCookie("lastpage", path, "guide", null);
} else if (path.indexOf("/resources/") != -1) {
writeCookie("lastpage", path, "resources", null);
}
});

View file

@ -19,7 +19,6 @@
<div id="jd-content">
<div class="jd-descr">
<?cs call:tag_list(root.descr) ?>
</div>

View file

@ -5,7 +5,7 @@
if:page.title ?><?cs
var:page.title ?> | <?cs
/if ?>Android Developers</title><?cs
if:guide||sdk ?>
if:guide||sdk||resources ?>
<link href="<?cs var:toroot ?>assets/android-developer-docs-devguide.css" rel="stylesheet" type="text/css" /><?cs
else ?>
<link href="<?cs var:toroot ?>assets/android-developer-docs.css" rel="stylesheet" type="text/css" /><?cs

View file

@ -1,20 +1,18 @@
<?cs include:"doctype.cs" ?>
<?cs include:"macros.cs" ?>
<?cs set:guide="true" ?>
<?cs set:resources="true" ?>
<html>
<?cs include:"head_tag.cs" ?>
<?cs include:"header.cs" ?>
<body class="gc-documentation">
<div class="g-unit" id="doc-content"><a name="top"></a>
<div id="jd-header" class="guide-header">
<span class="crumb">
<a href="<?cs var:toroot ?>guide/samples/index.html">Sample Code &gt;</a>
</span>
<h1><?cs var:page.title ?></h1>
</div>
<a name="top"></a>
<div class="g-unit" id="doc-content">
<div id="jd-header" class="guide-header">
<span class="crumb">&nbsp;</span>
<h1><?cs var:page.title ?></h1>
</div>
<div id="jd-content">

View file

@ -1,20 +1,18 @@
<?cs include:"doctype.cs" ?>
<?cs include:"macros.cs" ?>
<?cs set:guide="true" ?>
<?cs set:resources="true" ?>
<html>
<?cs include:"head_tag.cs" ?>
<?cs include:"header.cs" ?>
<body class="gc-documentation">
<div class="g-unit" id="doc-content"><a name="top"></a>
<div id="jd-header" class="guide-header">
<span class="crumb">
<a href="<?cs var:toroot ?>guide/samples/index.html">Sample Code &gt;</a>
</span>
<h1><?cs var:page.title ?></h1>
</div>
<a name="top"></a>
<div class="g-unit" id="doc-content">
<div id="jd-header" class="guide-header">
<span class="crumb">&nbsp;</span>
<h1><?cs var:page.title ?></h1>
</div>
<div id="jd-content">
@ -54,8 +52,10 @@
<?cs /if ?><?cs # end if/else online docs ?>
<?cs include:"footer.cs" ?>
</div><!-- end jd-content -->
<?cs include:"footer.cs" ?>
</div><!-- end doc-content -->
<?cs include:"trailer.cs" ?>