diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2010-04-08 13:20:58 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2010-04-08 13:20:58 +0000 |
commit | 67959c59138e01a141a4eb9813b0063a2a1693f7 (patch) | |
tree | 83d3e3cd95bc0502bf85c38fc61d69dcf68a0b9e | |
parent | a2f3507a56597002f26bbd8d417e6cd7c15481c7 (diff) | |
download | scala-67959c59138e01a141a4eb9813b0063a2a1693f7.tar.gz scala-67959c59138e01a141a4eb9813b0063a2a1693f7.tar.bz2 scala-67959c59138e01a141a4eb9813b0063a2a1693f7.zip |
[scaladoc] Fixed filter method in template page...
[scaladoc] Fixed filter method in template page (inherited filtering
works again). No review. Fixed whitespace in sources.
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/resource/lib/index.js | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js | 207 |
2 files changed, 108 insertions, 107 deletions
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 815a176390..e7cf484fa2 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 @@ -97,7 +97,7 @@ function configureTextFilter() { scheduler.add("init", function() { $("#filter").append("<div id='textfilter'><input type='text' accesskey='/'/></div>"); var input = $("#textfilter > input"); - resizeFilterBlock(); + resizeFilterBlock(); input.bind("keyup", function(event) { if (event.keyCode == 27) { // escape input.attr("value", ""); @@ -105,7 +105,7 @@ function configureTextFilter() { textFilter(); }); input.focus(function(event) { input.select(); }); - }); + }); } // Filters all focused templates and packages. This function should be made less-blocking. @@ -227,9 +227,9 @@ function focusFilter(package) { domCache.update(); $("#focusfilter").show(); $("#kindfilter").hide(); - resizeFilterBlock(); + resizeFilterBlock(); focusFilterState = package; - kindFilterSync(); + kindFilterSync(); }); } 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 47de01f6e2..a13c502ba5 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 @@ -2,115 +2,116 @@ // code by Gilles Dubochet with contributions by Pedro Furlanetto $(document).ready(function(){ - var prefilters = $("#ancestors > ol > li").filter(function(){ - var name = $(this).attr("name"); - return name == "scala.Any" || name == "scala.AnyRef"; - }); - prefilters.removeClass("in"); - prefilters.addClass("out"); - filter(); - $("#ancestors > ol > li").click(function(){ - if ($(this).hasClass("in")) { - $(this).removeClass("in"); - $(this).addClass("out"); - } - else if ($(this).hasClass("out")) { - $(this).removeClass("out"); - $(this).addClass("in"); - }; - filter(); - }); - $("#ancestors > ol > li.hideall").click(function() { - $("#ancestors > ol > li.in").removeClass("in").addClass("out"); - filter(); - }) - $("#ancestors > ol > li.showall").click(function() { - var filtered = - $("#ancestors > ol > li.out").filter(function() { - var name = $(this).attr("name"); - return !(name == "scala.Any" || name == "scala.AnyRef"); - }); - filtered.removeClass("out").addClass("in"); - filter(); - }); - $("#visbl > ol > li.public").click(function() { - if ($(this).hasClass("out")) { + var prefilters = $("#ancestors > ol > li").filter(function(){ + var name = $(this).attr("name"); + return name == "scala.Any" || name == "scala.AnyRef"; + }); + prefilters.removeClass("in"); + prefilters.addClass("out"); + filter(); + $("#ancestors > ol > li").click(function(){ + if ($(this).hasClass("in")) { + $(this).removeClass("in"); + $(this).addClass("out"); + } + else if ($(this).hasClass("out")) { + $(this).removeClass("out"); + $(this).addClass("in"); + }; + filter(); + }); + $("#ancestors > ol > li.hideall").click(function() { + $("#ancestors > ol > li.in").removeClass("in").addClass("out"); + filter(); + }) + $("#ancestors > ol > li.showall").click(function() { + var filtered = + $("#ancestors > ol > li.out").filter(function() { + var name = $(this).attr("name"); + return !(name == "scala.Any" || name == "scala.AnyRef"); + }); + filtered.removeClass("out").addClass("in"); + filter(); + }); + $("#visbl > ol > li.public").click(function() { + if ($(this).hasClass("out")) { $(this).removeClass("out").addClass("in"); $("#visbl > ol > li.all").removeClass("in").addClass("out"); - filter(); + filter(); }; - }) - $("#visbl > ol > li.all").click(function() { - if ($(this).hasClass("out")) { + }) + $("#visbl > ol > li.all").click(function() { + if ($(this).hasClass("out")) { $(this).removeClass("out").addClass("in"); $("#visbl > ol > li.public").removeClass("in").addClass("out"); - filter(); + filter(); }; - }); - //http://flowplayer.org/tools/tooltip.html - $(".extype").tooltip({ - tip: "#tooltip", - position:"top center", - onBeforeShow: function(ev) { + }); + //http://flowplayer.org/tools/tooltip.html + $(".extype").tooltip({ + tip: "#tooltip", + position:"top center", + onBeforeShow: function(ev) { $(this.getTip()).text(this.getTrigger().attr("name")); - } - }); - $("#template div.fullcomment").hide(); - var docAllSigs = $("#template .signature"); - function commentShowFct(fullComment){ - var vis = $(":visible", fullComment); - if (vis.length > 0) { - fullComment.slideUp(100); - } - else { - fullComment.slideDown(100); - } - }; - var docShowSigs = docAllSigs.filter(function(){ - return $("+ div.fullcomment", $(this)).length > 0; - }); - docShowSigs.css("cursor", "help"); - docShowSigs.click(function(){ - commentShowFct($("+ div.fullcomment", $(this))); - }); - function commentToggleFct(shortComment){ - var vis = $("~ div.fullcomment:visible", shortComment); - if (vis.length > 0) { - shortComment.slideDown(100); - vis.slideUp(100); - } - else { - var hid = $("~ div.fullcomment:hidden", shortComment); - hid.slideDown(100); - shortComment.slideUp(100); - } - }; - var docToggleSigs = docAllSigs.filter(function(){ - return $("+ p.shortcomment", $(this)).length > 0; - }); - docToggleSigs.css("cursor", "help"); - docToggleSigs.click(function(){ - commentToggleFct($("+ p.shortcomment", $(this))); - }); - $("p.shortcomment").click(function(){ - commentToggleFct($(this)); - }); + } + }); + $("#template div.fullcomment").hide(); + var docAllSigs = $("#template .signature"); + function commentShowFct(fullComment){ + var vis = $(":visible", fullComment); + if (vis.length > 0) { + fullComment.slideUp(100); + } + else { + fullComment.slideDown(100); + } + }; + var docShowSigs = docAllSigs.filter(function(){ + return $("+ div.fullcomment", $(this)).length > 0; + }); + docShowSigs.css("cursor", "help"); + docShowSigs.click(function(){ + commentShowFct($("+ div.fullcomment", $(this))); + }); + function commentToggleFct(shortComment){ + var vis = $("~ div.fullcomment:visible", shortComment); + if (vis.length > 0) { + shortComment.slideDown(100); + vis.slideUp(100); + } + else { + var hid = $("~ div.fullcomment:hidden", shortComment); + hid.slideDown(100); + shortComment.slideUp(100); + } + }; + var docToggleSigs = docAllSigs.filter(function(){ + return $("+ p.shortcomment", $(this)).length > 0; + }); + docToggleSigs.css("cursor", "help"); + docToggleSigs.click(function(){ + commentToggleFct($("+ p.shortcomment", $(this))); + }); + $("p.shortcomment").click(function(){ + commentToggleFct($(this)); + }); }); function filter() { var outOwners = - $("#mbrsel > div > ol > li.out").map(function(){ - $(this).attr("name") + $("#mbrsel ol#linearization > li.out").map(function(){ + var r = $(this).attr("name"); + return r }).get(); var prtVisbl = $("#visbl > ol > li.all").hasClass("in"); - $(".members > ol > li").each(function(){ - var vis1 = $(this).attr("visbl"); - var qualName1 = $(this).attr("name"); - var owner1 = qualName1.slice(0, qualName1.indexOf("#")); - //var name1 = qualName1.slice(qualName1.indexOf("#") + 1); - var showByOwned = true; + $(".members > ol > li").each(function(){ + var vis1 = $(this).attr("visbl"); + var qualName1 = $(this).attr("name"); + var owner1 = qualName1.slice(0, qualName1.indexOf("#")); + //var name1 = qualName1.slice(qualName1.indexOf("#") + 1); + var showByOwned = true; for (out in outOwners) { - if (out == owner1) { + if (outOwners[out] == owner1) { showByOwned = false; }; }; @@ -118,12 +119,12 @@ function filter() { if (vis1 == "prt") { showByVis = prtVisbl; }; - if (showByOwned && showByVis) { - $(this).show(); - } - else { - $(this).hide(); - }; - }); - return false + if (showByOwned && showByVis) { + $(this).show(); + } + else { + $(this).hide(); + }; + }); + return false }; |