summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-12-01 16:21:30 +0000
committermichelou <michelou@epfl.ch>2006-12-01 16:21:30 +0000
commit8a9719c222b39a35b70fef7b5eb56c842fa2cea0 (patch)
tree64a0e2b5047be73a0ea091a359402e042c27c0fe /src/compiler
parent9924a48040753103f6f88ef120c322ce1ae1a4fe (diff)
downloadscala-8a9719c222b39a35b70fef7b5eb56c842fa2cea0.tar.gz
scala-8a9719c222b39a35b70fef7b5eb56c842fa2cea0.tar.bz2
scala-8a9719c222b39a35b70fef7b5eb56c842fa2cea0.zip
added navigation frame in generated API documen...
added navigation frame in generated API documentation
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/doc/DocGenerator.scala28
-rw-r--r--src/compiler/scala/tools/nsc/doc/script.js16
-rw-r--r--src/compiler/scala/tools/nsc/doc/style.css5
3 files changed, 42 insertions, 7 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/DocGenerator.scala b/src/compiler/scala/tools/nsc/doc/DocGenerator.scala
index c749c922da..87e700d7b3 100644
--- a/src/compiler/scala/tools/nsc/doc/DocGenerator.scala
+++ b/src/compiler/scala/tools/nsc/doc/DocGenerator.scala
@@ -203,13 +203,13 @@ abstract class DocGenerator extends Models {
def modules: TreeMap[String, ModuleClassSymbol]
def body: NodeSeq = {
val x = doctitle concat
- aref("all-classes.html", classesFrame, "All objects and classes")
+ <a href="all-classes.html" target={classesFrame} onclick="resetKinds();">{"All objects and classes"}</a>
val y = <p/><b>Packages</b>
<table class="list" summary="">
<tr><td style="white-space:nowrap;">
{ {
for (val top <- modules.elements.toList) yield
- {br(aref(urlFor(top._2), classesFrame, top._2.fullNameString('.')))};
+ br(<a href={urlFor(top._2)} target={classesFrame} onclick="resetKinds();">{top._2.fullNameString('.')}</a>)
} }
</td></tr>
</table>;
@@ -264,11 +264,11 @@ abstract class DocGenerator extends Models {
</table>;
val body = <div>{ { for (val kind <- KINDS; classes contains kind) yield {
- <p>
- <b>{Text(pluralFor(kind))}</b>
- </p>
+ <div id={pluralFor(kind)} class="kinds">
+ {Text(pluralFor(kind))}
+ </div>
<table class="list" summary="">
- <tr><td style="white-space;nowrap;">
+ <tr><td style="white-space:nowrap;">
{ {
for (val mmbr <- classes(kind).toList) yield
br(urlFor(mmbr.tree, contentFrame));
@@ -825,6 +825,19 @@ abstract class DocGenerator extends Models {
def modules = modules0
}
+ new Frame {
+ def title="navigation"
+ def path="nav-classes"
+ override def body0(hasBody: Boolean, nodes: NodeSeq): NodeSeq =
+ if (!hasBody) nodes else <body onload="init()" style="margin:1px;">{nodes}</body>;
+ def body =
+ <select id="kinds" onchange="goto()">
+ <option value="#Classes" selected="selected">Classes</option>
+ <option value="#Objects">Objects</option>
+ <option value="#Traits">Traits</option>
+ </select>
+ }
+
new ListClassFrame {
def classes = {
var allClasses = emptyMap
@@ -1223,8 +1236,9 @@ abstract class DocGenerator extends Models {
val index =
<frameset cols="25%, 75%">
- <frameset rows="50%, 50%">
+ <frameset rows="50%, 26, 50%">
<frame src="modules.html" name={modulesFrame}></frame>
+ <frame src="nav-classes.html" name="navigationFrame"></frame>
<frame src="all-classes.html" name={classesFrame}></frame>
</frameset>
<frame src="root-content.html" name={contentFrame}></frame>
diff --git a/src/compiler/scala/tools/nsc/doc/script.js b/src/compiler/scala/tools/nsc/doc/script.js
index 58cf9689de..a71d154ef5 100644
--- a/src/compiler/scala/tools/nsc/doc/script.js
+++ b/src/compiler/scala/tools/nsc/doc/script.js
@@ -269,4 +269,20 @@ function init() {
}
}
}
+
+function goto() {
+ kinds = parent.frames["navigationFrame"].document.getElementById("kinds")
+ oldLocation = parent.frames["classesFrame"].window.location.href
+ //alert("oldLocation="+oldLocation);
+ pos = oldLocation.lastIndexOf("#")
+ classesURL = (pos > 0) ? oldLocation.substring(0, pos) : oldLocation;
+ newLocation = classesURL + kinds.options[kinds.selectedIndex].value;
+ //alert("newLocation="+newLocation);
+ parent.frames["classesFrame"].window.location = newLocation;
+}
+
+function resetKinds() {
+ kinds = parent.frames["navigationFrame"].document.getElementById("kinds")
+ kinds.selectedIndex = 0;
+}
-->
diff --git a/src/compiler/scala/tools/nsc/doc/style.css b/src/compiler/scala/tools/nsc/doc/style.css
index 92c94ffedb..2e07756e41 100644
--- a/src/compiler/scala/tools/nsc/doc/style.css
+++ b/src/compiler/scala/tools/nsc/doc/style.css
@@ -33,6 +33,11 @@ div.doctitle-larger {
font-weight: bold;
}
+div.kinds {
+ margin: 0.6em 0 0 0; /* top right bottom left */
+ font-weight: bold;
+}
+
div.page-title {
margin: 15px 0px 15px 0px;
font-size: x-large;