am 285f0772: Merge "clean up the sample template files to remove unused stuff and fix the collapsible project list and highlight the Samples nav" into jb-mr2-docs

* commit '285f07722d86f422166811ffc810535a97c1eb1e':
  clean up the sample template files to remove unused stuff and fix the collapsible project list and highlight the Samples nav
This commit is contained in:
Scott Main 2013-08-22 16:23:48 -07:00 committed by Android Git Automerger
commit 1ef0d36382
4 changed files with 42 additions and 271 deletions

View File

@ -1122,18 +1122,20 @@ function getLangPref() {
/* Used to hide and reveal supplemental content, such as long code samples.
See the companion CSS in android-developer-docs.css */
function toggleContent(obj) {
var div = $(obj.parentNode.parentNode);
var toggleMe = $(".toggle-content-toggleme",div);
var div = $(obj).closest(".toggle-content");
var toggleMe = $(".toggle-content-toggleme:eq(0)",div);
if (div.hasClass("closed")) { // if it's closed, open it
toggleMe.slideDown();
$(".toggle-content-text", obj).toggle();
$(".toggle-content-text:eq(0)", obj).toggle();
div.removeClass("closed").addClass("open");
$(".toggle-content-img", div).attr("title", "hide").attr("src", toRoot
$(".toggle-content-img:eq(0)", div).attr("title", "hide").attr("src", toRoot
+ "assets/images/triangle-opened.png");
} else { // if it's open, close it
toggleMe.slideUp('fast', function() { // Wait until the animation is done before closing arrow
$(".toggle-content-text", obj).toggle();
$(".toggle-content-text:eq(0)", obj).toggle();
div.removeClass("open").addClass("closed");
div.find(".toggle-content").removeClass("open").addClass("closed")
.find(".toggle-content-toggleme").hide();
$(".toggle-content-img", div).attr("title", "show").attr("src", toRoot
+ "assets/images/triangle-closed.png");
});
@ -2922,4 +2924,4 @@ function selectText(element) {
selection.removeAllRanges();
selection.addRange(range);
}
}
}

View File

@ -259,7 +259,8 @@ onkeyup="return search_changed(event, false, '<?cs var:toroot ?>')" />
>Google Services</a>
</li>
<?cs if:android.hasSamples ?>
<li><a href="<?cs var:toroot ?>samples/index.html">Samples</a>
<li class="samples"><a href="<?cs var:toroot ?>samples/index.html"
>Samples</a>
</li>
<?cs /if ?>
</ul>

View File

@ -2,13 +2,7 @@
<?cs include:"macros.cs" ?>
<html<?cs if:devsite ?> devsite<?cs /if ?>>
<?cs include:"head_tag.cs" ?>
<body class="gc-documentation <?cs if:(google || reference.gms || reference.gcm) ?>google<?cs /if ?>
<?cs if:(guide||develop||training||reference||tools||sdk||samples) ?>develop<?cs if:guide ?> guide<?cs /if ?><?cs if:samples ?> samples<?cs /if ?><?cs
elif:about ?>about<?cs
elif:design ?>design<?cs
elif:distribute ?>distribute<?cs
/if ?><?cs
if:page.trainingcourse ?> trainingcourse<?cs /if ?>" itemscope itemtype="http://schema.org/Article">
<body class="gc-documentation develop samples" itemscope itemtype="http://schema.org/Article">
<?cs include:"header.cs" ?>
<div <?cs if:fullpage
@ -16,100 +10,10 @@
?>class="col-13" id="doc-col"<?cs else
?>class="col-12" id="doc-col"<?cs /if ?> >
<?cs if:(design||training||walkthru) && !page.trainingcourse && !page.article ?><?cs # header logic for docs that provide previous/next buttons ?>
<?cs if:header.hide ?>
<?cs else ?>
<div class="layout-content-row content-header <?cs if:header.justLinks ?>just-links<?cs /if ?>">
<div class="layout-content-col <?cs if:training ?>span-7<?cs else ?>span-9<?cs /if ?>">
<?cs if:header.justLinks ?>&nbsp;
<?cs else ?><h1 itemprop="name">item <?cs var:page.title ?></h1>
<?cs /if ?>
</div>
<?cs if:training ?>
<div class="training-nav-top layout-content-col span-5" itemscope itemtype="http://schema.org/SiteNavigationElement">
<a href="#" class="prev-page-link hide"
zh-tw-lang="上一堂課"
zh-cn-lang="上一课"
ru-lang="Предыдущий"
ko-lang="이전"
ja-lang="前へ"
es-lang="Anterior"
>Previous</a>
<a href="#" class="next-page-link hide"
zh-tw-lang="下一堂課"
zh-cn-lang="下一课"
ru-lang="Следующий"
ko-lang="다음"
ja-lang="次へ"
es-lang="Siguiente"
>Next</a>
<a href="#" class="start-class-link hide"
zh-tw-lang="開始上課"
zh-cn-lang="开始"
ru-lang="Начало работы"
ko-lang="시작하기"
ja-lang="開始する"
es-lang="Empezar"
>Get started</a>
</div>
<?cs elif:!page.trainingcourse ?>
<div class="paging-links layout-content-col span-4" itemscope itemtype="http://schema.org/SiteNavigationElement">
<a href="#" class="prev-page-link hide"
zh-tw-lang="上一堂課"
zh-cn-lang="上一课"
ru-lang="Предыдущий"
ko-lang="이전"
ja-lang="前へ"
es-lang="Anterior"
>Previous</a>
<a href="#" class="next-page-link hide"
zh-tw-lang="下一堂課"
zh-cn-lang="下一课"
ru-lang="Следующий"
ko-lang="다음"
ja-lang="次へ"
es-lang="Siguiente"
>Next</a>
</div>
<?cs /if ?><?cs # end if training ?>
</div>
<?cs /if ?>
<?cs else ?>
<?cs if:(!fullpage && !header.hide) ?>
<?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
<div class="landing-banner">
<?cs if:page.landing.image ?><?cs # use two-column layout only if theres an image ?>
<div class="col-6">
<img src="<?cs var:toroot ?><?cs var:page.landing.image ?>" alt="" />
</div>
<div class="col-6">
<?cs /if ?>
<h1 itemprop="name" style="margin-bottom:0;"> item2 <?cs var:page.title ?></h1>
<p itemprop="description"><?cs var:page.landing.intro ?></p>
<p><a class="next-page-link topic-start-link"></a></p>
<?cs if:page.landing.image ?>
</div>
<?cs /if ?>
</div>
<?cs else ?>
<?cs if:tab1 ?><div id="title-tabs-wrapper"><?cs /if ?>
<h1 itemprop="name" <?cs if:tab1 ?>class="with-title-tabs"<?cs /if ?>><?cs var:page.title ?></h1><?cs
if:tab1 ?><ul id="title-tabs">
<li class="selected"><a href="<?cs var:tab1.link ?>"><?cs var:tab1 ?></a></li>
<?cs if:tab2 ?>
<li><a href="<?cs var:tab2.link ?>"><?cs var:tab2 ?></a></li><?cs /if ?>
<?cs if:tab3 ?>
<li><a href="<?cs var:tab3.link ?>"><?cs var:tab3 ?></a></li><?cs /if ?>
</ul>
<?cs /if ?>
<?cs if:tab1 ?></div><!-- end tab-wrapper --><?cs /if ?>
<?cs /if ?>
<?cs /if ?>
<?cs /if ?><?cs # end if design ?>
<h1 itemprop="name"><?cs var:page.title ?></h1>
<?cs # THIS IS THE MAIN DOC CONTENT ?>
<div id="jd-content">
<?cs # THIS IS THE MAIN DOC CONTENT ?>
<div id="jd-content">
<?cs if:android.whichdoc == "online" ?>

View File

@ -2,13 +2,7 @@
<?cs include:"macros.cs" ?>
<html<?cs if:devsite ?> devsite<?cs /if ?>>
<?cs include:"head_tag.cs" ?>
<body class="gc-documentation <?cs if:(google || reference.gms || reference.gcm) ?>google<?cs /if ?>
<?cs if:(guide||develop||training||reference||tools||sdk||samples) ?>develop<?cs if:guide ?> guide<?cs /if ?><?cs if:samples ?> samples<?cs /if ?><?cs
elif:about ?>about<?cs
elif:design ?>design<?cs
elif:distribute ?>distribute<?cs
/if ?><?cs
if:page.trainingcourse ?> trainingcourse<?cs /if ?>" itemscope itemtype="http://schema.org/Article">
<body class="gc-documentation develop samples" itemscope itemtype="http://schema.org/Article">
<?cs include:"header.cs" ?>
<div <?cs if:fullpage
@ -16,100 +10,34 @@
?>class="col-13" id="doc-col"<?cs else
?>class="col-12" id="doc-col"<?cs /if ?> >
<?cs if:(design||training||walkthru) && !page.trainingcourse && !page.article ?><?cs # header logic for docs that provide previous/next buttons ?>
<?cs if:header.hide ?>
<?cs else ?>
<div class="layout-content-row content-header <?cs if:header.justLinks ?>just-links<?cs /if ?>">
<div class="layout-content-col <?cs if:training ?>span-7<?cs else ?>span-9<?cs /if ?>">
<?cs if:header.justLinks ?>&nbsp;
<?cs else ?><h1 itemprop="name">item <?cs var:page.title ?></h1>
<?cs /if ?>
</div>
<?cs if:training ?>
<div class="training-nav-top layout-content-col span-5" itemscope itemtype="http://schema.org/SiteNavigationElement">
<a href="#" class="prev-page-link hide"
zh-tw-lang="上一堂課"
zh-cn-lang="上一课"
ru-lang="Предыдущий"
ko-lang="이전"
ja-lang="前へ"
es-lang="Anterior"
>Previous</a>
<a href="#" class="next-page-link hide"
zh-tw-lang="下一堂課"
zh-cn-lang="下一课"
ru-lang="Следующий"
ko-lang="다음"
ja-lang="次へ"
es-lang="Siguiente"
>Next</a>
<a href="#" class="start-class-link hide"
zh-tw-lang="開始上課"
zh-cn-lang="开始"
ru-lang="Начало работы"
ko-lang="시작하기"
ja-lang="開始する"
es-lang="Empezar"
>Get started</a>
</div>
<?cs elif:!page.trainingcourse ?>
<div class="paging-links layout-content-col span-4" itemscope itemtype="http://schema.org/SiteNavigationElement">
<a href="#" class="prev-page-link hide"
zh-tw-lang="上一堂課"
zh-cn-lang="上一课"
ru-lang="Предыдущий"
ko-lang="이전"
ja-lang="前へ"
es-lang="Anterior"
>Previous</a>
<a href="#" class="next-page-link hide"
zh-tw-lang="下一堂課"
zh-cn-lang="下一课"
ru-lang="Следующий"
ko-lang="다음"
ja-lang="次へ"
es-lang="Siguiente"
>Next</a>
</div>
<?cs /if ?><?cs # end if training ?>
</div>
<?cs /if ?>
<?cs else ?>
<?cs if:(!fullpage && !header.hide) ?>
<?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
<div class="landing-banner">
<?cs if:page.landing.image ?><?cs # use two-column layout only if theres an image ?>
<div class="col-6">
<img src="<?cs var:toroot ?><?cs var:page.landing.image ?>" alt="" />
</div>
<div class="col-6">
<?cs /if ?>
<h1 itemprop="name" style="margin-bottom:0;"> item2 <?cs var:page.title ?></h1>
<p itemprop="description"><?cs var:page.landing.intro ?></p>
<p><a class="next-page-link topic-start-link"></a></p>
<?cs if:page.landing.image ?>
</div>
<?cs /if ?>
</div>
<?cs else ?>
<?cs if:tab1 ?><div id="title-tabs-wrapper"><?cs /if ?>
<h1 itemprop="name" <?cs if:tab1 ?>class="with-title-tabs"<?cs /if ?>><?cs var:projectTitle ?></h1><?cs
if:tab1 ?><ul id="title-tabs">
<li class="selected"><a href="<?cs var:tab1.link ?>"><?cs var:tab1 ?></a></li>
<?cs if:tab2 ?>
<li><a href="<?cs var:tab2.link ?>"><?cs var:tab2 ?></a></li><?cs /if ?>
<?cs if:tab3 ?>
<li><a href="<?cs var:tab3.link ?>"><?cs var:tab3 ?></a></li><?cs /if ?>
</ul>
<?cs /if ?>
<?cs if:tab1 ?></div><!-- end tab-wrapper --><?cs /if ?>
<?cs /if ?>
<?cs /if ?>
<?cs /if ?><?cs # end if design ?>
<h1 itemprop="name"><?cs var:projectTitle ?></h1>
<div id="jd-content">
<?cs def:display_files(files) ?>
<?cs # THIS IS THE MAIN DOC CONTENT ?>
<div id="jd-content">
<?cs each:file = files ?>
<?cs if:file.Type != "dir" ?>
<div class="structure-<?cs var:file.Type ?>">
<a href="<?cs var:toroot ?><?cs var:file.Href ?>"><?cs var:file.Name ?></a>
</div>
<?cs else ?>
<div class="toggle-content opened structure-dir">
<a href="#" onclick="return toggleContent(this)">
<img src="<?cs var:toroot ?>assets/images/triangle-opened.png"
class="toggle-content-img structure-toggle-img" height="9px" width="9px" />
<?cs var:file.Name ?></a><?cs
if:file.SummaryFlag == "true" ?><span class="dirInfo"
>[&nbsp;<a href="file.SummaryHref">Info</a>&nbsp;]</a></span><?cs
/if ?>
<div class="toggle-content-toggleme structure-toggleme">
<?cs if:file.Sub.0.Name ?>
<?cs call:display_files(file.Sub) ?>
<?cs /if ?>
</div> <?cs # /toggleme ?>
</div> <?cs # /toggle-content ?>
<?cs /if ?>
<?cs /each ?>
<?cs /def ?>
<?cs if:android.whichdoc == "online" ?>
@ -117,47 +45,6 @@
<?cs if:page.title == "Project Structure" ?>
<script type="text/javascript">
function toggleDiv(link) {
var toggleable = $(link).parent();
if (toggleable.hasClass("closed")) {
$(".toggleme", toggleable).slideDown("fast");
toggleable.removeClass("closed");
toggleable.addClass("open");
$(".toggle-img", toggleable).attr("title", "hide").attr("src", (toRoot + "assets/images/triangle-opened.png"));
} else {
$(".toggleme", toggleable).slideUp("fast");
toggleable.removeClass("open");
toggleable.addClass("closed");
$(".toggle-img", toggleable).attr("title", "show").attr("src", (toRoot + "assets/images/triangle-closed.png"));
}
return false;
}
</script>
<?cs def:display_files(files) ?>
<?cs each:file = files ?>
<?cs if:file.Type != "dir" ?>
<div class="structure-<?cs var:file.Type ?>"><a href="<?cs var:toroot ?><?cs var:file.Href ?>"><?cs var:file.Name ?></a></div>
<?cs else ?>
<div class="toggleable opened structure-dir">
<a href="#" onclick="return toggleDiv(this)">
<img src="<?cs var:toroot ?>assets/images/triangle-opened.png" class="toggle-img structure-toggle-img" height="9px" width="9px" />
<?cs var:file.Name ?></a><?cs if:file.SummaryFlag == "true" ?><span class="dirInfo">[&nbsp;<a href="file.SummaryHref">Info</a>&nbsp;]</a></span><?cs /if ?>
<div class="toggleme structure-toggleme">
<?cs if:file.Sub.0.Name ?>
<?cs call:display_files(file.Sub) ?>
<?cs /if ?>
</div> <?cs # /toggleme ?>
</div> <?cs # /toggleable ?>
<?cs /if ?>
<?cs /each ?>
<?cs /def ?>
<?cs call:display_files(Files) ?>
<?cs else ?> <?cs # else not project structure doc ?>
@ -168,29 +55,6 @@ function toggleDiv(link) {
<p>Decide what to do with this ...</p>
<?cs def:display_files(files) ?>
<?cs each:file = files ?>
<?cs if:file.Type != "dir" ?>
<div class="structure-<?cs var:file.Type ?>"><a href="<?cs var:toroot ?><?cs var:file.Href ?>"><?cs var:file.Name ?></a></div>
<?cs else ?>
<div class="toggleable opened structure-dir">
<a href="#" onclick="return toggleDiv(this)">
<img src="<?cs var:toroot ?>assets/images/triangle-opened.png" class="toggle-img structure-toggle-img" height="9px" width="9px" />
<?cs var:file.Name ?></a><?cs if:file.SummaryFlag == "true" ?><span class="dirInfo">[&nbsp;<a href="file.SummaryHref">Info</a>&nbsp;]</a></span><?cs /if ?>
<div class="toggleme structure-toggleme">
<?cs if:file.Sub.0.Name ?>
<?cs call:display_files(file.Sub) ?>
<?cs /if ?>
</div> <?cs # /toggleme ?>
</div> <?cs # /toggleable ?>
<?cs /if ?>
<?cs /each ?>
<?cs /def ?>
<?cs call:display_files(Files) ?>
<?cs /if ?> <?cs # end if project structure ?>