summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDonna Malayeri <lindydonna@gmail.com>2011-05-05 12:45:21 +0000
committerDonna Malayeri <lindydonna@gmail.com>2011-05-05 12:45:21 +0000
commit93b421779764614b81764325e4cc0d33328f7e3a (patch)
treee203c76db293c86589fedb400ac603ed01106451 /src
parentb38cddd20e5f5c7025f645413e8e5b309c8b893c (diff)
downloadscala-93b421779764614b81764325e4cc0d33328f7e3a.tar.gz
scala-93b421779764614b81764325e4cc0d33328f7e3a.tar.bz2
scala-93b421779764614b81764325e4cc0d33328f7e3a.zip
[scaladoc] Unify template and package header.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala5
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala6
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/page/Template.scala46
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/class_big.pngbin7495 -> 7516 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/class_to_object_big.pngbin0 -> 9006 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/object_big.pngbin7619 -> 7653 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_class_big.pngbin0 -> 9158 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_trait_big.pngbin0 -> 9200 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css102
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js16
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_big.pngbin7378 -> 7410 bytes
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_to_object_big.pngbin0 -> 8967 bytes
12 files changed, 90 insertions, 85 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
index 7e1be90d3d..8fc044c195 100644
--- a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala
@@ -59,6 +59,11 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) {
copyResource("lib/package.png")
copyResource("lib/package_big.png")
+ copyResource("lib/class_to_object_big.png")
+ copyResource("lib/object_to_class_big.png")
+ copyResource("lib/object_to_trait_big.png")
+ copyResource("lib/trait_to_object_big.png")
+
copyResource("lib/arrow-down.png")
copyResource("lib/arrow-right.png")
copyResource("lib/filter_box_left.png")
diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
index 21d6ba91a9..d99403e5ba 100644
--- a/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/HtmlPage.scala
@@ -239,8 +239,12 @@ abstract class HtmlPage { thisPage =>
/** Returns the _big image name corresponding to the DocTemplate Entity (upper left icon) */
def docEntityKindToBigImage(ety: DocTemplateEntity) =
- if (ety.isTrait) "trait_big.png"
+ if (ety.isTrait && !ety.companion.isEmpty && ety.companion.get.visibility.isPublic && ety.companion.get.inSource != None) "trait_to_object_big.png"
+ else if (ety.isTrait) "trait_big.png"
+ else if (ety.isClass && !ety.companion.isEmpty && ety.companion.get.visibility.isPublic && ety.companion.get.inSource != None) "class_to_object_big.png"
else if (ety.isClass) "class_big.png"
+ else if (ety.isObject && !ety.companion.isEmpty && ety.companion.get.visibility.isPublic && ety.companion.get.inSource != None && ety.companion.get.isClass) "object_to_class_big.png"
+ else if (ety.isObject && !ety.companion.isEmpty && ety.companion.get.visibility.isPublic && ety.companion.get.inSource != None && ety.companion.get.isTrait) "object_to_trait_big.png"
else if (ety.isObject) "object_big.png"
else if (ety.isPackage) "package_big.png"
else "class_big.png" // FIXME: an entity *should* fall into one of the above categories, but AnyRef is somehow not
diff --git a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
index e87f297094..fe14a1997a 100644
--- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -46,28 +46,32 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
* this problem should be fixed, this implementation is just a patch
*/
val body = {
- <body class={ if (tpl.isTrait || tpl.isClass || tpl.qualifiedName == "scala.AnyRef") "type" else "value" } onload="windowTitle();">
-
- { if (tpl.isRootPackage || tpl.inTemplate.isRootPackage)
- NodeSeq.Empty
- else
- <p id="owner">{ templatesToHtml(tpl.inTemplate.toRoot.reverse.tail, xml.Text(".")) }</p>
- }
+ val templateName = if (tpl.isRootPackage) "root package" else tpl.name
+ val displayName = tpl.companion match {
+ case Some(companion) if (companion.visibility.isPublic && companion.inSource != None) =>
+ <a href={relativeLinkTo(companion)} title="Go to companion">{ templateName }</a>
+ case _ =>
+ templateName
+ }
+ val owner = {
+ if (tpl.isRootPackage || tpl.inTemplate.isRootPackage)
+ NodeSeq.Empty
+ else
+ <p id="owner">{ templatesToHtml(tpl.inTemplate.toRoot.reverse.tail, xml.Text(".")) }</p>
+ }
- { val templateName = if (tpl.isRootPackage) "root package" else tpl.name
- val displayName = tpl.companion match {
- case Some(companion) =>
- if (companion.visibility.isPublic && companion.inSource != None)
- <a href={relativeLinkTo(companion)} title="go to companion">{ templateName }</a>
- else templateName
- case _ =>
- templateName
- }
- <div id="definition">
- <img src={ relativeLinkTo(List(docEntityKindToBigImage(tpl), "lib")) }/>
- <h1>{ displayName }</h1>
- </div>
- }
+ <body class={ if (tpl.isTrait || tpl.isClass || tpl.qualifiedName == "scala.AnyRef") "type" else "value" }>
+ <div id="definition">
+ {
+ tpl.companion match {
+ case Some(companion) if (companion.visibility.isPublic && companion.inSource != None) =>
+ <a href={relativeLinkTo(companion)} title="Go to companion"><img src={ relativeLinkTo(List(docEntityKindToBigImage(tpl), "lib")) }/></a>
+ case _ =>
+ <img src={ relativeLinkTo(List(docEntityKindToBigImage(tpl), "lib")) }/>
+ }}
+ { owner }
+ <h1>{ displayName }</h1>
+ </div>
{ signature(tpl, true) }
{ memberToCommentHtml(tpl, true) }
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_big.png
index 1a00abb401..cb1f638a58 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_big.png
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_big.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_to_object_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_to_object_big.png
new file mode 100644
index 0000000000..5dd6e38d2e
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/class_to_object_big.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_big.png
index d51c797047..67ffca79de 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_big.png
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_big.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_class_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_class_big.png
new file mode 100644
index 0000000000..7502942eb6
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_class_big.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_trait_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_trait_big.png
new file mode 100644
index 0000000000..c777bfce8d
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/object_to_trait_big.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css
index 0b2bc7f7b1..09c96eecbc 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css
@@ -43,37 +43,6 @@ a[href]:hover {
text-decoration: none;
}
-#owner {
- padding: 2px 10px 5px;
- height: 17px;
- font-size: 12pt;
- display: block;
-}
-
-#owner a {
- color: black;
-/* text-decoration: none;*/
-/* font-weight: bold;*/
-/* text-shadow: white 0px 1px 0px;*/
-}
-
-#owner a:hover {
- color: black;
- text-decoration: none;
-/* font-weight: bold;*/
-/* text-shadow: white 0px 1px 0px;*/
-}
-
-.value #owner {
- background-color: #7996AC; /* light steel gray */
-}
-
-.type #owner {
- background-color: #95b8a1; /* lighter green */
-/* background-image:url('ownerbg2.gif');
- background-repeat:repeat-x;*/
-}
-
#types ol li > p {
margin-top: 5px;
}
@@ -82,41 +51,69 @@ a[href]:hover {
margin-bottom: 5px;
}
+/*
#definition {
- display: block;
- padding: 5px 6px;
- height: 61px;
+ padding: 6px 0 6px 6px;
+ min-height: 59px;
+ color: white;
+}
+*/
+
+#definition {
+ display: block-inline;
+ padding: 5px 0px;
+ min-height: 61px;
}
#definition > img {
float: left;
+ padding-right: 6px;
+ padding-left: 5px;
+}
+
+#definition > a > img {
+ float: left;
+ padding-right: 6px;
+ padding-left: 5px;
+}
+
+#definition p + h1 {
+ margin-top: 3px;
}
#definition > h1 {
- padding: 12px 0 12px 6px;
+/* padding: 12px 0 12px 6px;*/
color: white;
-/* text-shadow: 3px black;
+ text-shadow: 3px black;
text-shadow: black 0px 2px 0px;
- */
font-size: 24pt;
display: inline-block;
+ overflow: hidden;
+ margin-top: 10px;
}
#definition h1 > a {
color: #ffffff;
-/* text-decoration: none; */
-/* font-size: 24pt;
- text-shadow: black 0px 0px 0px;
- */
- }
+ font-size: 24pt;
+ text-shadow: black 0px 2px 0px;
+/* text-shadow: black 0px 0px 0px;*/
+text-decoration: none;
+}
+
+#definition #owner {
+ color: #ffffff;
+ margin-top: 4px;
+ font-size: 10pt;
+ overflow: hidden;
+}
-#definition h1 > a:hover {
+#definition #owner > a {
color: #ffffff;
+}
+
+#definition #owner > a:hover {
text-decoration: none;
- font-size: 24pt;
-/* text-shadow: black 0px 2px 0px;
- */
- }
+}
#signature {
background-image:url('signaturebg2.gif');
@@ -134,17 +131,16 @@ a[href]:hover {
text-align: left;
width: auto;
position: static;
-/* text-shadow: 2px white;
+ text-shadow: 2px white;
text-shadow: white 0px 1px 0px;
- */
}
#signature > span.symbol {
text-align: left;
display: inline;
padding-left: 0.7em;
-/* text-shadow: 2px white;
- text-shadow: white 0px 1px 0px; */
+ text-shadow: 2px white;
+ text-shadow: white 0px 1px 0px;
}
/* Linear super types and known subclasses */
@@ -288,8 +284,8 @@ div.members > ol > li:last-child {
line-height: 18px;
clear: both;
display: block;
-/* text-shadow: 2px white;
- text-shadow: white 0px 1px 0px; */
+ text-shadow: 2px white;
+ text-shadow: white 0px 1px 0px;
}
.signature .kind {
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
index 2479945299..0d2e373811 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
@@ -84,8 +84,9 @@ $(document).ready(function(){
};
});
initInherit();
- //http://flowplayer.org/tools/tooltip.html
- $(".extype").tooltip({
+
+ // Create tooltips
+ $(".extype").add(".defval").tooltip({
tip: "#tooltip",
position:"top center",
predelay: 500,
@@ -93,14 +94,6 @@ $(document).ready(function(){
$(this.getTip()).text(this.getTrigger().attr("name"));
}
});
- $(".defval").tooltip({
- tip: "#tooltip",
- position:"top center",
- predelay: 500,
- onBeforeShow: function(ev) {
- $(this.getTip()).html(this.getTrigger().attr("name"))
- }
- });
/* Add toggle arrows */
var docAllSigs = $("#template li").has(".fullcomment").find(".signature");
@@ -143,6 +136,9 @@ $(document).ready(function(){
$(".toggleContainer").click(function() {
toggleShowContentFct($(this));
});
+
+ // Set parent window title
+ windowTitle();
});
function orderAlpha() {
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_big.png
index 0159946d46..625d9251cb 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_big.png
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_big.png
Binary files differ
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_to_object_big.png b/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_to_object_big.png
new file mode 100644
index 0000000000..d0cd7fd512
--- /dev/null
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/trait_to_object_big.png
Binary files differ