From fa1c41da5a639fd54c064a5a34fdef9cbb794cd8 Mon Sep 17 00:00:00 2001
From: Eric Bidelman
Date: Mon, 15 Apr 2013 16:31:09 -0700
Subject: Adding eventInfo config support
---
js/slide-deck.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
(limited to 'js')
diff --git a/js/slide-deck.js b/js/slide-deck.js
index 6fc99eb..caebaf3 100644
--- a/js/slide-deck.js
+++ b/js/slide-deck.js
@@ -316,8 +316,8 @@ SlideDeck.prototype.loadConfig_ = function(config) {
if (settings.title) {
document.title = settings.title.replace(/
/, ' ');
- if (settings.eventTitle) {
- document.title += ' - ' + settings.eventTitle;
+ if (settings.eventInfo && settings.eventInfo.title) {
+ document.title += ' - ' + settings.eventInfo.title;
}
document.querySelector('[data-config-title]').innerHTML = settings.title;
}
@@ -334,7 +334,11 @@ SlideDeck.prototype.loadConfig_ = function(config) {
if (presenters.length == 1) {
var p = presenters[0];
- html = [p.name, p.company].join('
');
+ var presenterTitle = [p.name];
+ if (p.company) {
+ presenterTitle.push(p.company);
+ }
+ html = presenterTitle.join(' - ') + '
';
var gplus = p.gplus ? 'g+' + p.gplus.replace(/https?:\/\//, '') + '' : '';
@@ -367,9 +371,10 @@ SlideDeck.prototype.loadConfig_ = function(config) {
var dataConfigPresenter = document.querySelector('[data-config-presenter]');
if (dataConfigPresenter) {
dataConfigPresenter.innerHTML = html;
- if (settings.eventTitle) {
- dataConfigPresenter.innerHTML = dataConfigPresenter.innerHTML + '
' +
- settings.eventTitle;
+ if (settings.eventInfo) {
+ var date = settings.eventInfo.date;
+ var dateInfo = date ? ' - ' : '';
+ dataConfigPresenter.innerHTML += settings.eventInfo.title + dateInfo;
}
}
}
--
cgit v1.2.3