|
|
@ -1,18 +1,7 @@ |
|
|
|
/* * VéritéCo Timeline Loader 0.8 |
|
|
|
/* |
|
|
|
* Designed and built by Zach Wise digitalartwork.net |
|
|
|
VéritéCo Embed Loader 0.8 |
|
|
|
|
|
|
|
Designed and built by Zach Wise digitalartwork.net |
|
|
|
* This program is free software: you can redistribute it and/or modify |
|
|
|
Date: June 21, 2012 |
|
|
|
* it under the terms of the GNU General Public License as published by |
|
|
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
|
|
|
|
|
|
|
* (at your option) any later version. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful, |
|
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
|
|
|
|
|
* GNU General Public License for more details. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* CodeKit Import |
|
|
|
/* CodeKit Import |
|
|
@ -22,9 +11,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
var WebFontConfig; |
|
|
|
var WebFontConfig; |
|
|
|
|
|
|
|
|
|
|
|
if(typeof timeline_path == 'undefined' || typeof timeline_path == 'undefined') { |
|
|
|
if(typeof embed_path == 'undefined' || typeof embed_path == 'undefined') { |
|
|
|
// REPLACE WITH YOUR BASEPATH IF YOU WANT OTHERWISE IT WILL TRY AND FIGURE IT OUT
|
|
|
|
// REPLACE WITH YOUR BASEPATH IF YOU WANT OTHERWISE IT WILL TRY AND FIGURE IT OUT
|
|
|
|
var timeline_path = getScriptPath("timeline-embed.js").split("js/")[0]; |
|
|
|
var embed_path = getScriptPath("timeline-embed.js").split("js/")[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
function getScriptPath(scriptname) { |
|
|
|
function getScriptPath(scriptname) { |
|
|
|
var scriptTags = document.getElementsByTagName('script'), |
|
|
|
var scriptTags = document.getElementsByTagName('script'), |
|
|
@ -48,8 +37,8 @@ function getScriptPath(scriptname) { |
|
|
|
|
|
|
|
|
|
|
|
/* VARS |
|
|
|
/* VARS |
|
|
|
================================================== */ |
|
|
|
================================================== */ |
|
|
|
var timelinejs, t, te, x, isCDN = false, |
|
|
|
var embedjs, t, te, x, isCDN = false, |
|
|
|
timeline_js_version = "1.62", |
|
|
|
js_version = "1.68", |
|
|
|
jquery_version_required = "1.7.1", |
|
|
|
jquery_version_required = "1.7.1", |
|
|
|
jquery_version = "", |
|
|
|
jquery_version = "", |
|
|
|
ready = { |
|
|
|
ready = { |
|
|
@ -67,19 +56,19 @@ function getScriptPath(scriptname) { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
path = { |
|
|
|
path = { |
|
|
|
base: timeline_path, |
|
|
|
base: embed_path, |
|
|
|
css: timeline_path + "css/", |
|
|
|
css: embed_path + "css/", |
|
|
|
js: timeline_path + "js/", |
|
|
|
js: embed_path + "js/", |
|
|
|
locale: timeline_path + "js/locale/", |
|
|
|
locale: embed_path + "js/locale/", |
|
|
|
jquery: "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", |
|
|
|
jquery: "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js", |
|
|
|
font: { |
|
|
|
font: { |
|
|
|
google: false, |
|
|
|
google: false, |
|
|
|
css: timeline_path + "css/themes/font/", |
|
|
|
css: embed_path + "css/themes/font/", |
|
|
|
js: "http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js" |
|
|
|
js: "http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
embed_config = { |
|
|
|
embed_config = { |
|
|
|
version: timeline_js_version, |
|
|
|
version: js_version, |
|
|
|
debug: false, |
|
|
|
debug: false, |
|
|
|
embed: true, |
|
|
|
embed: true, |
|
|
|
width: '100%', |
|
|
|
width: '100%', |
|
|
@ -87,8 +76,8 @@ function getScriptPath(scriptname) { |
|
|
|
source: 'https://docs.google.com/spreadsheet/pub?key=0Agl_Dv6iEbDadFYzRjJPUGktY0NkWXFUWkVIZDNGRHc&output=html', |
|
|
|
source: 'https://docs.google.com/spreadsheet/pub?key=0Agl_Dv6iEbDadFYzRjJPUGktY0NkWXFUWkVIZDNGRHc&output=html', |
|
|
|
lang: 'en', |
|
|
|
lang: 'en', |
|
|
|
font: 'default', |
|
|
|
font: 'default', |
|
|
|
css: path.css + 'timeline.css?'+timeline_js_version, |
|
|
|
css: path.css + 'timeline.css?'+js_version, |
|
|
|
js: path.js + 'timeline-min.js?'+timeline_js_version |
|
|
|
js: path.js + 'timeline-min.js?'+js_version |
|
|
|
}, |
|
|
|
}, |
|
|
|
font_presets = [ |
|
|
|
font_presets = [ |
|
|
|
{ name: "Merriweather-NewsCycle", google: [ 'News+Cycle:400,700:latin', 'Merriweather:400,700,900:latin' ] }, |
|
|
|
{ name: "Merriweather-NewsCycle", google: [ 'News+Cycle:400,700:latin', 'Merriweather:400,700,900:latin' ] }, |
|
|
@ -148,17 +137,16 @@ function getScriptPath(scriptname) { |
|
|
|
if (embed_config.lang.match("/")) { |
|
|
|
if (embed_config.lang.match("/")) { |
|
|
|
path.locale = embed_config.lang; |
|
|
|
path.locale = embed_config.lang; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
path.locale = path.locale + embed_config.lang + ".js?" + timeline_js_version; |
|
|
|
path.locale = path.locale + embed_config.lang + ".js?" + js_version; |
|
|
|
} |
|
|
|
} |
|
|
|
// Check for old installs still using the old method of language
|
|
|
|
// Check for old installs still using the old method of language
|
|
|
|
if (embed_config.js.match("locale")) { |
|
|
|
if (embed_config.js.match("locale")) { |
|
|
|
embed_config.lang = embed_config.js.split("locale/")[1].replace(".js", ""); |
|
|
|
embed_config.lang = embed_config.js.split("locale/")[1].replace(".js", ""); |
|
|
|
embed_config.js = path.js + 'timeline-min.js?'+timeline_js_version; |
|
|
|
embed_config.js = path.js + 'timeline-min.js?' + js_version; |
|
|
|
} |
|
|
|
} |
|
|
|
/* PREPARE |
|
|
|
/* PREPARE |
|
|
|
================================================== */ |
|
|
|
================================================== */ |
|
|
|
timeline_config = embed_config; |
|
|
|
createEmbedDiv(); |
|
|
|
createTimelineDiv(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Load CSS |
|
|
|
/* Load CSS |
|
|
|
================================================== */ |
|
|
|
================================================== */ |
|
|
@ -178,7 +166,7 @@ function getScriptPath(scriptname) { |
|
|
|
path.font.css = embed_config.font; |
|
|
|
path.font.css = embed_config.font; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
path.font.name = embed_config.font; |
|
|
|
path.font.name = embed_config.font; |
|
|
|
path.font.css = path.font.css + embed_config.font + ".css?" + timeline_js_version; |
|
|
|
path.font.css = path.font.css + embed_config.font + ".css?" + js_version; |
|
|
|
} |
|
|
|
} |
|
|
|
LazyLoad.css(path.font.css, onloaded_font_css); |
|
|
|
LazyLoad.css(path.font.css, onloaded_font_css); |
|
|
|
|
|
|
|
|
|
|
@ -262,7 +250,7 @@ function getScriptPath(scriptname) { |
|
|
|
if (ready.js && ready.css && ready.font.css && ready.font.js && ready.language) { |
|
|
|
if (ready.js && ready.css && ready.font.css && ready.font.js && ready.language) { |
|
|
|
if (!ready.finished) { |
|
|
|
if (!ready.finished) { |
|
|
|
ready.finished = true; |
|
|
|
ready.finished = true; |
|
|
|
buildTimeline(); |
|
|
|
buildEmbed(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
ready.timeout = setTimeout('onloaded_check_again();', 250); |
|
|
|
ready.timeout = setTimeout('onloaded_check_again();', 250); |
|
|
@ -275,11 +263,11 @@ function getScriptPath(scriptname) { |
|
|
|
|
|
|
|
|
|
|
|
/* Build Timeline |
|
|
|
/* Build Timeline |
|
|
|
================================================== */ |
|
|
|
================================================== */ |
|
|
|
function createTimelineDiv() { |
|
|
|
function createEmbedDiv() { |
|
|
|
t = document.createElement('div'); |
|
|
|
t = document.createElement('div'); |
|
|
|
te = document.getElementById("timeline-embed"); |
|
|
|
te = document.getElementById("timeline-embed"); |
|
|
|
te.appendChild(t); |
|
|
|
te.appendChild(t); |
|
|
|
t.setAttribute("id", 'timeline'); |
|
|
|
t.setAttribute("id", 'timelinejs'); |
|
|
|
|
|
|
|
|
|
|
|
if (embed_config.width.toString().match("%") ) { |
|
|
|
if (embed_config.width.toString().match("%") ) { |
|
|
|
te.style.width = embed_config.width; |
|
|
|
te.style.width = embed_config.width; |
|
|
@ -302,12 +290,12 @@ function getScriptPath(scriptname) { |
|
|
|
t.style.position = 'relative'; |
|
|
|
t.style.position = 'relative'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function buildTimeline() { |
|
|
|
function buildEmbed() { |
|
|
|
VMM.debug = embed_config.debug; |
|
|
|
VMM.debug = embed_config.debug; |
|
|
|
timelinejs = new VMM.Timeline(); |
|
|
|
embedjs = new VMM.Timeline(); |
|
|
|
timelinejs.init(embed_config.source); |
|
|
|
embedjs.init(embed_config.source); |
|
|
|
if (isCDN) { |
|
|
|
if (isCDN) { |
|
|
|
VMM.bindEvent(global, onTimelineHeadline, "TIMELINE_HEADLINE"); |
|
|
|
VMM.bindEvent(global, onHeadline, "HEADLINE"); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|