Fixing Doclava template styles for non-dac javadocs on devsite.
Test: make tradefed-ds-docs
Change-Id: Iedd4521b236e5c2c7826e8d20d1a9b9a7b4d3ac2
diff --git a/res/assets/templates-sdk/class.cs b/res/assets/templates-sdk/class.cs
index dee7a4c..9ce6a6d 100644
--- a/res/assets/templates-sdk/class.cs
+++ b/res/assets/templates-sdk/class.cs
@@ -210,7 +210,8 @@
<?cs include:"head_tag.cs" ?>
<?cs include:"body_tag.cs" ?>
<?cs include:"header.cs" ?>
-<?cs include:"page_info.cs" ?>
+<?cs # Includes api-info-block DIV at top of page. Standard Devsite uses right nav. ?>
+<?cs if:dac ?><?cs include:"page_info.cs" ?><?cs /if ?>
<?cs # This DIV spans the entire document to provide scope for some scripts ?>
<div class="api apilevel-<?cs var:class.since ?>" id="jd-content">
<?cs # this next line must be exactly like this to be parsed by eclipse ?>
@@ -279,17 +280,33 @@
?><?cs
if:subcount(class.subclasses.direct) && !class.subclasses.hidden ?>
<table class="jd-sumtable jd-sumtable-subclasses">
- <tr><td style="border:none;margin:0;padding:0;">
- <?cs call:expando_trigger("subclasses-direct", "closed") ?>Known Direct Subclasses
- <?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "list") ?>
- </td></tr>
+ <tr>
+ <td style="border:none;margin:0;padding:0;"><?cs
+ if:enable_javascript ?>
+ <?cs call:expando_trigger("subclasses-direct", "closed") ?><span>Known Direct Subclasses</span>
+ <?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "list") ?><?cs
+ else ?>
+ <span>Known Direct Subclasses</span>
+ <?cs call:expandable_class_list("subclasses-direct", class.subclasses.direct, "summary") ?><?cs
+ /if ?>
+ </td>
+ </tr>
</table>
<?cs /if ?>
<?cs if:subcount(class.subclasses.indirect) && !class.subclasses.hidden ?>
- <table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="2" style="border:none;margin:0;padding:0;">
- <?cs call:expando_trigger("subclasses-indirect", "closed") ?>Known Indirect Subclasses
- <?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "list") ?>
- </td></tr></table><?cs
+ <table class="jd-sumtable jd-sumtable-subclasses">
+ <tr>
+ <td colspan="2" style="border:none;margin:0;padding:0;"><?cs
+ if:enable_javascript ?>
+ <?cs call:expando_trigger("subclasses-indirect", "closed") ?><span>Known Indirect Subclasses</span>
+ <?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "list") ?><?cs
+ else ?>
+ <span>Known Indirect Subclasses</span>
+ <?cs call:expandable_class_list("subclasses-indirect", class.subclasses.indirect, "summary") ?><?cs
+ /if ?>
+ </td>
+ </tr>
+ </table><?cs
/if ?>
<?cs call:show_annotations_list(class) ?>
<br><hr><?cs
@@ -349,8 +366,10 @@
<?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.attrs) ?>
<tr class="api apilevel-<?cs var:cl.since ?>" >
-<td colspan="2">
-<?cs call:expando_trigger("inherited-attrs-"+cl.qualified, "closed") ?>From
+<td colspan="2"><?cs
+ if:enable_javascript ?><?cs
+ call:expando_trigger("inherited-attrs-"+cl.qualified, "closed") ?><?cs
+ /if ?>From
<?cs var:cl.kind ?>
<code>
<?cs call:cond_link(cl.qualified, toroot, cl.link, cl.included) ?>
@@ -407,8 +426,10 @@
<?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.constants) ?>
<tr class="api apilevel-<?cs var:cl.since ?>" >
- <td>
- <?cs call:expando_trigger("inherited-constants-"+cl.qualified, "closed") ?>From
+ <td><?cs
+ if:enable_javascript ?><?cs
+ call:expando_trigger("inherited-constants-"+cl.qualified, "closed") ?><?cs
+ /if ?>From
<?cs var:cl.kind ?>
<code>
<?cs call:cond_link(cl.qualified, toroot, cl.link, cl.included) ?>
@@ -446,8 +467,10 @@
<?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.fields) ?>
<tr class="api apilevel-<?cs var:cl.since ?>" >
- <td>
- <?cs call:expando_trigger("inherited-fields-"+cl.qualified, "closed") ?>From
+ <td><?cs
+ if:enable_javascript ?><?cs
+ call:expando_trigger("inherited-fields-"+cl.qualified, "closed") ?><?cs
+ /if ?>From
<?cs var:cl.kind ?>
<code>
<?cs call:cond_link(cl.qualified, toroot, cl.link, cl.included) ?>
@@ -512,8 +535,10 @@
<?cs each:cl=class.inherited ?>
<?cs if:subcount(cl.methods) ?>
<tr class="api apilevel-<?cs var:cl.since ?>" >
-<td colspan="2">
-<?cs call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?>From
+<td colspan="2"><?cs
+ if:enable_javascript ?><?cs
+ call:expando_trigger("inherited-methods-"+cl.qualified, "closed") ?><?cs
+ /if ?>From
<?cs var:cl.kind ?>
<code>
<?cs if:cl.included ?>
diff --git a/res/assets/templates-sdk/head_tag.cs b/res/assets/templates-sdk/head_tag.cs
index 6dbe393..995dd72 100644
--- a/res/assets/templates-sdk/head_tag.cs
+++ b/res/assets/templates-sdk/head_tag.cs
@@ -242,4 +242,9 @@
ga('universal.send', 'pageview'); // Send page view for new tracker.
</script><?cs /if ?><?cs
# END if/else !devsite ?>
+
+<?cs if:css.path ?><?cs
+#include custom stylesheet ?>
+<link rel="stylesheet" href="<?cs var:css.path ?>"><?cs
+/if ?>
</head>
diff --git a/res/assets/templates-sdk/package.cs b/res/assets/templates-sdk/package.cs
index d3efdda..6a16bc0 100644
--- a/res/assets/templates-sdk/package.cs
+++ b/res/assets/templates-sdk/package.cs
@@ -7,7 +7,8 @@
<?cs include:"head_tag.cs" ?>
<?cs include:"body_tag.cs" ?>
<?cs include:"header.cs" ?>
-<?cs include:"page_info.cs" ?>
+<?cs # Includes api-info-block DIV at top of page. Standard Devsite uses right nav. ?>
+<?cs if:dac ?><?cs include:"page_info.cs" ?><?cs /if ?>
<div class="api apilevel-<?cs var:package.since ?>" id="jd-content">
<h1><?cs var:package.name ?></h1>
diff --git a/res/assets/templates/macros.cs b/res/assets/templates/macros.cs
index dd46a55..9bf7e63 100644
--- a/res/assets/templates/macros.cs
+++ b/res/assets/templates/macros.cs
@@ -1,5 +1,12 @@
-<?cs # A link to a package ?><?cs
+<?cs
+# Set global vars for template features based on site and target.
+?><?cs
+if:dac ?><?cs
+ # standard devsite warns on inline js and script tags ?><?cs
+ set:enable_javascript = 1 ?><?cs
+/if ?>
+<?cs # A link to a package ?><?cs
def:package_link(pkg) ?>
<a href="<?cs var:toroot ?><?cs var:pkg.link ?>"><?cs var:pkg.name ?></a><?cs
/def ?><?cs
@@ -410,46 +417,62 @@
each:pkg=packages ?>
<li class="<?cs if:(class.package.name == pkg.name) || (package.name == pkg.name)?>selected <?cs /if ?>api apilevel-<?cs var:pkg.since ?>"><?cs call:package_link(pkg) ?></li><?cs
/each ?><?cs
-/def ?><?cs
+/def ?>
-# An expando trigger ?><?cs
+<?cs
+# An expando trigger
+?><?cs
def:expando_trigger(id, default) ?>
- <a href="#" onclick="return toggleInherited(this, null)" id="<?cs var:id ?>" class="jd-expando-trigger closed"
- ><img height="34" id="<?cs var:id ?>-trigger"
- src="<?cs var:toroot ?>assets/images/styles/disclosure_<?cs
- if:default == 'closed' ?>down<?cs else ?>up<?cs /if ?>.png"
- class="jd-expando-trigger-img" /></a><?cs
-/def ?><?cs
+ <a href="#" id="<?cs var:id ?>" class="jd-expando-trigger closed"<?cs
+ if:enable_javascript ?>
+ onclick="return toggleInherited(this, null)"<?cs
+ /if ?> >
+ <img id="<?cs var:id ?>-trigger" class="jd-expando-trigger-img"
+ height="34"
+ src="<?cs var:toroot ?>assets/images/styles/disclosure_<?cs
+ if:default == 'closed' ?>down<?cs else ?>up<?cs /if ?>.png" />
+ </a><?cs
+/def ?>
-# An expandable list of classes ?><?cs
+<?cs
+# An expandable list of classes
+?><?cs
def:expandable_class_list(id, classes, default) ?>
<div id="<?cs var:id ?>">
- <div id="<?cs var:id ?>-list"
- class="jd-inheritedlinks"
- <?cs if:default != "list" ?>style="display: none;"<?cs /if ?>
- >
- <?cs if:subcount(classes) <= #20 ?>
- <?cs each:cl=classes ?>
- <?cs call:type_link(cl.type) ?><?cs if:!last(cl) ?>,<?cs /if ?>
- <?cs /each ?>
- <?cs else ?>
- <?cs set:leftovers = subcount(classes) - #15 ?>
- <?cs loop:i = #0, #14, #1 ?>
- <?cs with:cl=classes[i] ?>
- <?cs call:type_link(cl.type) ?>,
- <?cs /with ?>
- <?cs if:(#i == #14) ?>and
- <a href="#" onclick="return toggleInherited(document.getElementById('<?cs
- var:id ?>', null))"><?cs var:leftovers ?> others.</a>
- <?cs /if ?>
- <?cs /loop ?>
- <?cs /if ?>
- </div>
- <div id="<?cs var:id ?>-summary"
- <?cs if:default != "summary" ?>style="display: none;"<?cs /if ?>
- ><?cs
- call:class_link_table(classes) ?>
- </div>
+ <div id="<?cs var:id ?>-list" class="jd-inheritedlinks"<?cs
+ if:default != "list" ?>
+ style="display: none;"<?cs
+ /if ?> > <?cs
+ if:subcount(classes) <= #20 ?><?cs
+ each:cl=classes ?><?cs
+ call:type_link(cl.type) ?><?cs
+ if:!last(cl)
+ ?>,<?cs
+ /if ?><?cs
+ /each ?><?cs
+ else ?><?cs
+ set:leftovers = subcount(classes) - #15 ?><?cs
+ loop:i = #0, #14, #1 ?><?cs
+ with:cl=classes[i] ?><?cs
+ call:type_link(cl.type) ?>,<?cs
+ /with ?><?cs
+ if:(#i == #14) ?>and
+ <a href="#"<?cs
+ if:enable_javascript ?>
+ onclick="return toggleInherited(document.getElementById('<?cs var:id ?>', null))"<?cs
+ /if ?> >
+ <?cs var:leftovers ?> others.</a><?cs
+ /if ?><?cs
+ /loop ?><?cs
+ /if ?>
+ </div>
+ <div id="<?cs var:id ?>-summary"<?cs
+ if:default != "summary" ?>
+ style="display: none;"<?cs
+ /if ?> >
+ <?cs call:class_link_table(classes) ?>
+ </div>
</div><?cs
-/def ?><?cs
-include:"components.cs" ?>
\ No newline at end of file
+/def ?>
+
+<?cs include:"components.cs" ?>