summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2010-09-01 15:41:56 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2010-09-01 15:41:56 +0000
commit8f1a52438a2954c935f59c2e10220beac0e42d03 (patch)
tree372f062b7ca82937fd526bea53f82ec43634b6ce /src
parentd367ae7b26d1d757189ff9a7bea842da81c9df78 (diff)
downloadscala-8f1a52438a2954c935f59c2e10220beac0e42d03.tar.gz
scala-8f1a52438a2954c935f59c2e10220beac0e42d03.tar.bz2
scala-8f1a52438a2954c935f59c2e10220beac0e42d03.zip
[scaladoc] Merges Petr's changes from the colla...
[scaladoc] Merges Petr's changes from the colladoc branch to only display less-important information in class comments on demand. Also fixes a bug with index filter. No review.
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/page/Template.scala8
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js4
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.css11
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js12
4 files changed, 24 insertions, 11 deletions
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 3001a1dc5a..622d2cdc22 100644
--- a/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
+++ b/src/compiler/scala/tools/nsc/doc/html/page/Template.scala
@@ -180,7 +180,13 @@ class Template(tpl: DocTemplateEntity) extends HtmlPage {
mbr match {
case dte: DocTemplateEntity if isSelf =>
// comment of class itself
- <div id="comment" class="fullcomment">{ memberToCommentBodyHtml(mbr, isSelf = true) }</div>
+ <xml:group>
+ { if (mbr.comment.isEmpty) NodeSeq.Empty
+ else
+ <div class="shortcomment cmt">{ commentToHtml(mbr.comment) }</div>
+ }
+ <div id="comment" class="fullcomment">{ memberToCommentBodyHtml(mbr, isSelf = true) }</div>
+ </xml:group>
case dte: DocTemplateEntity if mbr.comment.isDefined =>
// comment of inner, documented class (only short comment, full comment is on the class' own page)
memberToInlineCommentHtml(mbr, isSelf)
diff --git a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
index db4dac9ece..21c09bf5e1 100644
--- a/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
+++ b/src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js
@@ -103,7 +103,7 @@ function prepareEntityList() {
function configureTextFilter() {
scheduler.add("init", function() {
$("#filter").append("<div id='textfilter'><span class='pre'/><span class='input'><input type='text' accesskey='/'/></span><span class='post'/></div>");
- var input = $("#textfilter > input");
+ var input = $("#textfilter input");
resizeFilterBlock();
input.bind("keyup", function(event) {
if (event.keyCode == 27) { // escape
@@ -115,7 +115,7 @@ function configureTextFilter() {
});
scheduler.add("init", function() {
$("#textfilter > .post").click(function(){
- $("#textfilter > input").attr("value", "");
+ $("#textfilter input").attr("value", "");
textFilter();
});
});
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 de78793fe6..e7b4d672da 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
@@ -104,6 +104,7 @@ a:hover {
}
#comment {
+ display:none;
padding-right: 8px;
padding-left: 8px;
}
@@ -332,10 +333,11 @@ p.comment {
margin-left: 8.7em;
}
-p.shortcomment {
+.shortcomment {
display: block;
- margin-left: 8.7em;
cursor: pointer;
+ margin: 4px 0px;
+ padding: 0 8px;
}
div.fullcomment {
@@ -347,6 +349,11 @@ div.fullcomment {
margin: 6px 0 6px 8.7em;
}
+#template .shortcomment {
+ margin: 0 0 0 8.7em;
+ padding: 0;
+}
+
div.fullcomment .block {
padding: 2px 0 2px 0;
border-top: 1px solid gray;
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 e32c7f135e..efa4288a67 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
@@ -10,7 +10,7 @@ $(document).ready(function(){
prefilters.addClass("out");
filter();
- var input = $("#textfilter > input");
+ var input = $("#textfilter input");
input.bind("keyup", function(event) {
if (event.keyCode == 27) { // escape
input.attr("value", "");
@@ -19,7 +19,7 @@ $(document).ready(function(){
});
input.focus(function(event) { input.select(); });
$("#textfilter > .post").click(function(){
- $("#textfilter > input").attr("value", "");
+ $("#textfilter input").attr("value", "");
filter();
});
@@ -109,7 +109,7 @@ $(document).ready(function(){
$(this.getTip()).html(this.getTrigger().attr("name"))
}
});
- var docAllSigs = $("#template .signature");
+ var docAllSigs = $(".signature");
function commentShowFct(fullComment){
var vis = $(":visible", fullComment);
if (vis.length > 0) {
@@ -139,13 +139,13 @@ $(document).ready(function(){
}
};
var docToggleSigs = docAllSigs.filter(function(){
- return $("+ p.shortcomment", $(this)).length > 0;
+ return $("+ .shortcomment", $(this)).length > 0;
});
docToggleSigs.css("cursor", "pointer");
docToggleSigs.click(function(){
- commentToggleFct($("+ p.shortcomment", $(this)));
+ commentToggleFct($("+ .shortcomment", $(this)));
});
- $("p.shortcomment").click(function(){
+ $(".shortcomment").click(function(){
commentToggleFct($(this));
});
});