summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/ScalaReference.js20
-rw-r--r--resources/scala-ref-template.html52
-rw-r--r--resources/style.css20
3 files changed, 41 insertions, 1 deletions
diff --git a/resources/ScalaReference.js b/resources/ScalaReference.js
new file mode 100644
index 0000000000..51be0cf05b
--- /dev/null
+++ b/resources/ScalaReference.js
@@ -0,0 +1,20 @@
+$(function() {
+
+ var popoutTOC = $('<div>');
+ popoutTOC.attr('id', 'popoutTOC');
+
+ var popoutTOChead = $('<span class="head">Jump to...</span>');
+ popoutTOChead.appendTo(popoutTOC);
+
+ var content = $('<div class="links">');
+ $('#TOC > *').clone().appendTo(content);
+ content.appendTo(popoutTOC);
+ var enter = function() { content.css('display', 'block') };
+ var exit = function() { content.css('display', 'none') };
+
+ popoutTOC.hover(enter, exit);
+
+ // disabled for now, until better styled
+ // popoutTOC.appendTo($('body'));
+
+}) \ No newline at end of file
diff --git a/resources/scala-ref-template.html5 b/resources/scala-ref-template.html5
index 424170d3d8..526543d69c 100644
--- a/resources/scala-ref-template.html5
+++ b/resources/scala-ref-template.html5
@@ -26,6 +26,8 @@ $endif$
$for(css)$
<link rel="stylesheet" href="$css$">
$endfor$
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
+ <script type="text/javascript" src="resources/ScalaReference.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
diff --git a/resources/style.css b/resources/style.css
index 833e76815e..fae6e5155a 100644
--- a/resources/style.css
+++ b/resources/style.css
@@ -36,7 +36,9 @@ code {
/* examples */
ol[type="1"] {
list-style-type: none;
- margin-left: 0;
+ margin-left: 3em;
+ margin-right: 3em;
+ padding: 0;
}
ol[type="1"] li {
@@ -48,4 +50,20 @@ ol[type="1"] li {
ol[type="1"] li:before {
content: "Example ";
+}
+
+#popoutTOC {
+ position: fixed;
+ top: 0;
+ left: 0;
+ margin: 0;
+ padding: 0;
+}
+
+#popoutTOC .head {
+
+}
+
+#popoutTOC .links {
+ display: none;
} \ No newline at end of file