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 +++++++++++------ slide_config.js | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) 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; } } } diff --git a/slide_config.js b/slide_config.js index a849147..8d370fd 100644 --- a/slide_config.js +++ b/slide_config.js @@ -3,7 +3,10 @@ var SLIDE_CONFIG = { settings: { title: 'Title Goes Here
Up To Two Lines', subtitle: 'Subtitle Goes Here', - //eventTitle: 'Google I/O 2013', + //eventInfo: { + // title: 'Google I/O', + // date: '6/x/2013' + //}, useBuilds: true, // Default: true. False will turn off slide animation builds. usePrettify: true, // Default: true enableSlideAreas: true, // Default: true. False turns off the click areas on either slide of the slides. -- cgit v1.2.3