Skip to content
This repository was archived by the owner on Sep 23, 2021. It is now read-only.

Commit 57d3df1

Browse files
committed
Autoformat
1 parent e7921d0 commit 57d3df1

File tree

1 file changed

+90
-43
lines changed

1 file changed

+90
-43
lines changed

static/js/slides.js

Lines changed: 90 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,113 @@
11
function isPreview() {
2-
return !!window.location.search.match(/preview/gi);
2+
return !!window.location.search.match(/preview/gi);
33
}
44

55
function initializeReveal() {
6-
// Full list of configuration options available at:
7-
// https://github.com/hakimel/reveal.js#configuration
8-
Reveal.initialize({
9-
controls: true,
10-
progress: true,
11-
history: true,
12-
center: true,
13-
transition: 'slide', // none/fade/slide/convex/concave/zoom
14-
transitionSpeed: isPreview() ? 'fast' : 'default',
15-
embedded: isPreview() ? true : false,
16-
17-
// Optional reveal.js plugins
18-
dependencies: [
19-
{ src: '/static/revealjs/lib/js/classList.js', condition: function() { return !document.body.classList; } },
20-
{ src: '/static/revealjs/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
21-
{ src: '/static/revealjs/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); }, callback: function() { externalLinksInNewWindow(); } },
22-
{ src: '/static/revealjs/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
23-
{ src: '/static/revealjs/plugin/zoom-js/zoom.js', async: true },
24-
{ src: '/static/revealjs/plugin/notes/notes.js', async: true }
25-
]
26-
});
6+
// Full list of configuration options available at:
7+
// https://github.com/hakimel/reveal.js#configuration
8+
Reveal.initialize({
9+
controls: true,
10+
progress: true,
11+
history: true,
12+
center: true,
13+
transition: 'slide', // none/fade/slide/convex/concave/zoom
14+
transitionSpeed: isPreview() ? 'fast' : 'default',
15+
embedded: isPreview() ? true : false,
16+
17+
// Optional reveal.js plugins
18+
dependencies: [{
19+
src: '/static/reveal.js/lib/js/classList.js',
20+
condition: function() {
21+
return !document.body.classList;
22+
}
23+
},
24+
25+
// Interpret Markdown in <section> elements
26+
{
27+
src: '/static/reveal.js/plugin/markdown/marked.js',
28+
condition: function() {
29+
return !!document.querySelector('[data-markdown]');
30+
}
31+
}, {
32+
src: '/static/reveal.js/plugin/markdown/markdown.js',
33+
condition: function() {
34+
return !!document.querySelector('[data-markdown]');
35+
}
36+
},
37+
38+
// Syntax highlight for <code> elements
39+
{
40+
src: '/static/reveal.js/plugin/highlight/highlight.js',
41+
async: true,
42+
callback: function() {
43+
hljs.initHighlightingOnLoad();
44+
}
45+
},
46+
47+
// Zoom in and out with Alt+click
48+
{
49+
src: '/static/reveal.js/plugin/zoom-js/zoom.js',
50+
async: true
51+
},
52+
53+
// Speaker notes
54+
{
55+
src: '/static/reveal.js/plugin/notes/notes.js',
56+
async: true
57+
},
58+
59+
// MathJax
60+
{
61+
src: '/static/reveal.js/plugin/math/math.js',
62+
async: true
63+
}
64+
65+
{
66+
src: '/static/reveal.js/static/revealjs/lib/js/classList.js',
67+
condition: function() {
68+
return !document.body.classList;
69+
}
70+
}
71+
d
72+
]
73+
});
2774
}
2875

2976
function highlightAnyCodeBlocks() {
30-
$(document).ready(function() {
31-
$('pre code').each(function(i, block) {
32-
hljs.highlightBlock(block);
77+
$(document).ready(function() {
78+
$('pre code').each(function(i, block) {
79+
hljs.highlightBlock(block);
80+
});
3381
});
34-
});
3582
}
3683

3784
function insertMarkdownReference() {
38-
var markdownReference = $('<section/>', {
39-
'data-markdown': "/slides.md",
40-
'data-separator': "^-( *)-( *)-( *-*)*",
41-
'data-separator-notes': "^Note:",
42-
'data-charset': "utf-8"
43-
});
44-
45-
$('.slides').html(markdownReference);
85+
var markdownReference = $('<section/>', {
86+
'data-markdown': "/slides.md",
87+
'data-separator': "^-( *)-( *)-( *-*)*",
88+
'data-separator-notes': "^Note:",
89+
'data-charset': "utf-8"
90+
});
91+
92+
$('.slides').html(markdownReference);
4693
}
4794

4895
function scrollToCurrentSlide() {
49-
var i = Reveal.getIndices();
50-
Reveal.slide(i.h, i.v, i.f);
96+
var i = Reveal.getIndices();
97+
Reveal.slide(i.h, i.v, i.f);
5198
}
5299

53100
function reloadMarkdown() {
54-
insertMarkdownReference();
55-
RevealMarkdown.initialize();
56-
highlightAnyCodeBlocks();
57-
scrollToCurrentSlide();
101+
insertMarkdownReference();
102+
RevealMarkdown.initialize();
103+
highlightAnyCodeBlocks();
104+
scrollToCurrentSlide();
58105
}
59106

60107
function externalLinksInNewWindow() {
61-
$(document.links).filter(function() {
62-
return this.hostname != window.location.hostname;
63-
}).attr('target', '_blank');
108+
$(document.links).filter(function() {
109+
return this.hostname != window.location.hostname;
110+
}).attr('target', '_blank');
64111
}
65112

66113
insertMarkdownReference();

0 commit comments

Comments
 (0)