aboutsummaryrefslogtreecommitdiff
path: root/resources/js/main.js
diff options
context:
space:
mode:
authorHeather Miller <heather.miller@epfl.ch>2017-01-03 18:27:06 +0100
committerGitHub <noreply@github.com>2017-01-03 18:27:06 +0100
commitbc9bae33c2d29d56c60ae8851063bc3145d41eef (patch)
tree1e423e12e589909157bc1e5d271b0cf7cf047fb1 /resources/js/main.js
parent8428c40f79060169e85bdf740a9432b933a47160 (diff)
parent21cddf809d02a674f1fac59ccc5dfb3adac3bab2 (diff)
Merge pull request #24 from heathermiller/facelift
Facelift
Diffstat (limited to 'resources/js/main.js')
-rwxr-xr-xresources/js/main.js55
1 files changed, 55 insertions, 0 deletions
diff --git a/resources/js/main.js b/resources/js/main.js
new file mode 100755
index 0000000..289815f
--- /dev/null
+++ b/resources/js/main.js
@@ -0,0 +1,55 @@
+---
+---
+
+$(document).ready(function() {
+ styleCode();
+
+ $(function () {
+ $('[data-toggle="tooltip"]').tooltip()
+ })
+
+ // current page, links with active class
+ $("[href]").each(function() {
+ if (this.href == window.location.href) {
+ $(this).addClass("active");
+ }
+ });
+
+ $('#burger').click(function(){
+ $(this).toggleClass('open');
+ });
+
+});
+
+// speaker deck viewcounts
+// var futuresPromises = getSpeakerdeckStats("cv96bzz6", "futures-promises-views");
+// var picklesSporesScaladays = getSpeakerdeckStats("5gabjggm", "pickles-spores-scaladays");
+// var sporesStrangeloop = getSpeakerdeckStats("d350fdec", "spores-strangeloop");
+// var instantPicklesOopsla = getSpeakerdeckStats("8qzwp7pc", "instant-pickles-oopsla");
+//
+// function getSpeakerdeckStats(key, id) {
+// var url = "http://www.kimonolabs.com/api/" + key + "?apikey=6cd6688b9e11a1f5e1dd19d711e87b98";
+// $.ajax({
+// "url": url,
+// "crossDomain": true,
+// "dataType": "jsonp",
+// success: function(json) {
+// onSuccessfulResponse(json, id);
+// }
+// });
+// };
+//
+// function onSuccessfulResponse(json, id) {
+// var viewcount = json.results.collection1[0].viewcount;
+// // var starcount = json.results.collection1[0].starcount.text;
+// $("#"+id).text(viewcount);
+// };
+
+function styleCode() {
+ if (typeof disableStyleCode != "undefined") { return; }
+ $("pre code").each(function() {
+ if (!$(this).hasClass("prettyprint lang-{{ site.primarylanguage }}")) {
+ $(this).addClass("prettyprint lang-{{ site.primarylanguage }}");
+ }
+ });
+} \ No newline at end of file