summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
diff options
context:
space:
mode:
authorDamien <damien.obrist@gmail.com>2012-06-13 21:41:06 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-07-02 13:34:15 +0200
commitc85b4a495619ca69a5d0c0b69fc30233fbea3dff (patch)
treef6d1f8dfc124bc0cebbe8997905bdfef09bd2808 /src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js
parentfba65513d1195b162f958a5c25124958d6e7ea52 (diff)
downloadscala-c85b4a495619ca69a5d0c0b69fc30233fbea3dff.tar.gz
scala-c85b4a495619ca69a5d0c0b69fc30233fbea3dff.tar.bz2
scala-c85b4a495619ca69a5d0c0b69fc30233fbea3dff.zip
Scaladoc class diagrams part 2
This commit contains the svg diagram generation using the graphviz package, the template changes, the css styling and javascript code that enables displaying and interacting with the diagrams. The full history is located at: https://github.com/damienobrist/scala/tree/feature/diagrams-dev The diagrams are included as svg markup inside the html code. This enables interacting with the image beyond what would be possible with a static image (highlighting, scaling, tooltips, links to nodes, etc). The svg generation has four main phases: model => dot, dot => svg (using the graphviz package), svg postprocessing, inclusion in the html page. This commit also fixes SI-5212 - links to individual pages automatically load the left navigation panel of the website. Commit summary: - diagram generation - model => dot (DotDiagramGenerator.scala, DiagramGenerator.scala) - dot => svg (DotRunner.scala) - svg post-processing (DotDiagramGenerator.scala) - svg inclusion in the html (Template.scala) - diagram interaction - css, js and image files Review by @heathermiller, @kzys. Also fixed the memory leak that was causing the testsuite to timeout.
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js')
-rw-r--r--src/compiler/scala/tools/nsc/doc/html/resource/lib/template.js18
1 files changed, 8 insertions, 10 deletions
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 33fbd83bee..c418c3280b 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
@@ -8,7 +8,8 @@ $(document).ready(function(){
name == 'scala.Predef.any2stringfmt' ||
name == 'scala.Predef.any2stringadd' ||
name == 'scala.Predef.any2ArrowAssoc' ||
- name == 'scala.Predef.any2Ensuring'
+ name == 'scala.Predef.any2Ensuring' ||
+ name == 'scala.collection.TraversableOnce.alternateImplicit'
};
$("#linearization li:gt(0)").filter(function(){
@@ -184,21 +185,18 @@ $(document).ready(function(){
});
/* Linear super types and known subclasses */
- function toggleShowContentFct(outerElement){
- var content = $(".hiddenContent", outerElement);
- var vis = $(":visible", content);
- if (vis.length > 0) {
+ function toggleShowContentFct(e){
+ e.toggleClass("open");
+ var content = $(".hiddenContent", e.parent().get(0));
+ if (content.is(':visible')) {
content.slideUp(100);
- $(".showElement", outerElement).show();
- $(".hideElement", outerElement).hide();
}
else {
content.slideDown(100);
- $(".showElement", outerElement).hide();
- $(".hideElement", outerElement).show();
}
};
- $(".toggleContainer").click(function() {
+
+ $(".toggle:not(.diagram-link)").click(function() {
toggleShowContentFct($(this));
});