-
Notifications
You must be signed in to change notification settings - Fork 0
/
titlebar.js
27 lines (22 loc) · 839 Bytes
/
titlebar.js
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
/**
* A plugin which adds the presentation title to the presentation.
*
* @author sedrubal
*
*/
var RevealTitleBar = window.RevealTitleBar || (function(){
var default_title = [];
if (document.querySelector('meta[name=author]') !== undefined) {
default_title.push(document.querySelector('meta[name=author]').content);
}
if (document.getElementsByTagName('title').length >= 1) {
default_title.push(document.getElementsByTagName('title')[0].innerText);
}
var options = Reveal.getConfig().titlebar || {};
options.title = options.title || default_title.join([separator = ' - ']);
// create breadcrumb bar
var title_bar = document.createElement('div');
title_bar.classList.add('title-bar');
document.getElementsByClassName('reveal')[0].appendChild(title_bar);
title_bar.innerHTML = options.title;
})();