Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/** Just a bunch of useful scripts **/
(function () {
var $ = (Document.prototype.$ = Document.prototype.querySelector).bind(document);
var $$ = (Document.prototype.$$ = Document.prototype.querySelectorAll).bind(document);
Element.prototype.$ = Element.prototype.querySelector;
Element.prototype.$$ = Element.prototype.querySelectorAll;
NodeList.prototype.forEach = Array.prototype.forEach;
NodeList.prototype.map = Array.prototype.map;
(window.Reveal ? window.Reveal : document).addEventListener('ready', function() {
/* Transform #?? links into GitHub issues links */
$$('a[href^="#"]').forEach(function (a) {
var match = /#(\d+)/.exec(a.href);
if (match !== null) {
a.href = 'https://github.com/OpenDreamKit/OpenDreamKit/issues/' + match[1];
a.dataset['issue'] = match[1];
}
});
/* Fetch description of GitHub issues from GH api */
var issues = $$('a[data-issue]');
if (issues.length > 0) {
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://api.github.com/repos/OpenDreamKit/OpenDreamKit/issues?per_page=100&labels=deliverable&filter=all&state=all');
xhr.responseType = 'json';
xhr.onload = function() {
issues.forEach(function(a) {
if (!a.classList.contains('no-ghapi')) {
var issue = xhr.response.filter(function (i) {
return i.number == a.dataset.issue;
});
if (issue.length > 0) {
a.textContent = issue[0].title;
} else {
a.style.color = 'red';
console.log('Unknown issue ' + a.dataset.issue);
}
}
});
};
xhr.send();
}
});
})();
/* Reveal scrolling for long slides */
function resetSlideScrolling(slide) {
$(slide).removeClass('scrollable-slide');
}
function handleSlideScrolling(slide) {
if ($(slide).height() >= 800) {
$(slide).addClass('scrollable-slide');
}
}
Reveal.addEventListener('ready', function (event) {
handleSlideScrolling(event.currentSlide);
});
Reveal.addEventListener('slidechanged', function (event) {
resetSlideScrolling(event.previousSlide)
handleSlideScrolling(event.currentSlide);
});