summaryrefslogtreecommitdiff
path: root/book/src/main/resources
diff options
context:
space:
mode:
authorLi Haoyi <haoyi@dropbox.com>2014-10-26 22:54:44 -0700
committerLi Haoyi <haoyi@dropbox.com>2014-10-26 22:54:44 -0700
commit6987ac5195b0112b4bda123f0fced3ace7115932 (patch)
tree6d38c52d6a0d7876cde7f25b8ef39667bd168ef1 /book/src/main/resources
parentab668dead5c3123eb9fb26b9e94c6eccabaf6ab7 (diff)
downloadhands-on-scala-js-6987ac5195b0112b4bda123f0fced3ace7115932.tar.gz
hands-on-scala-js-6987ac5195b0112b4bda123f0fced3ace7115932.tar.bz2
hands-on-scala-js-6987ac5195b0112b4bda123f0fced3ace7115932.zip
stuff works, paragraph-starting-tags still accidentally capturing entire paragraph
Diffstat (limited to 'book/src/main/resources')
-rwxr-xr-xbook/src/main/resources/css/layouts/side-menu.css5
-rwxr-xr-xbook/src/main/resources/js/ui.js12
2 files changed, 15 insertions, 2 deletions
diff --git a/book/src/main/resources/css/layouts/side-menu.css b/book/src/main/resources/css/layouts/side-menu.css
index e04fe81..aba4441 100755
--- a/book/src/main/resources/css/layouts/side-menu.css
+++ b/book/src/main/resources/css/layouts/side-menu.css
@@ -236,3 +236,8 @@ Hides the menu at `48em`, but modify this based on your app's needs.
left: 250px;
}
}
+
+/*Workaround for bug in highlight.js IDEA theme*/
+.hljs-tag{
+ background: none;
+} \ No newline at end of file
diff --git a/book/src/main/resources/js/ui.js b/book/src/main/resources/js/ui.js
index acc38a0..eed641b 100755
--- a/book/src/main/resources/js/ui.js
+++ b/book/src/main/resources/js/ui.js
@@ -1,4 +1,5 @@
-(function (window, document) {
+document.addEventListener("DOMContentLoaded", function(){
+ console.log("HIGHLIGHTING")
var layout = document.getElementById('layout'),
menu = document.getElementById('menu'),
@@ -32,4 +33,11 @@
toggleClass(menuLink, active);
};
-}(this, this.document));
+
+ var snippets = document.getElementsByClassName("highlight-me");
+ for(var i = 0; i < snippets.length; i++){
+ console.log("highlighting", snippets[i])
+ hljs.highlightBlock(snippets[i])
+ }
+
+});