Browse Source

Latest compile v2.12

Content will fill the slider more and the next and back arrows will hide until you mouseover them when the width is 640 or below.

Changed Google Doc getJson timeout so that it tries several times to get data if it times out.
pull/246/head
Zach Wise 12 years ago
parent
commit
3a8971efcf
  1. 2
      compiled/js/storyjs-embed-cdn.js
  2. 2
      compiled/js/storyjs-embed-generator.js
  3. 2
      compiled/js/storyjs-embed.js
  4. 12
      compiled/js/timeline-min.js
  5. 210
      compiled/js/timeline.js

2
compiled/js/storyjs-embed-cdn.js

File diff suppressed because one or more lines are too long

2
compiled/js/storyjs-embed-generator.js

@ -2,4 +2,4 @@
VéritéCo Embed Generator 2.1
Designed and built by Zach Wise digitalartwork.net
Date: June 21, 2012
*/function getScriptPath(e){var t=document.getElementsByTagName("script"),n="";for(var r=0;r<t.length;r++)t[r].src.match(e)&&(n=t[r].src);return n.split("?")[0].split("/").slice(0,-1).join("/")+"/"}function getUrlVars(e){var t=[],n,r,i=e.toString();i.match("&#038;")?i=i.replace("&#038;","&"):i.match("&#38;")?i=i.replace("&#38;","&"):i.match("&amp;")&&(i=i.replace("&amp;","&"));i.match("#")&&(i=i.split("#")[0]);r=i.slice(i.indexOf("?")+1).split("&");for(var s=0;s<r.length;s++){n=r[s].split("=");t.push(n[0]);t[n[0]]=n[1]}return t}function getLinkAndIframe(){var e={},t=document.getElementById("embed-source-url"),n=document.getElementById("embed-width"),r=document.getElementById("embed-height"),i=document.getElementById("embed-maptype"),s=document.getElementById("embed-language"),o=document.getElementById("embed_code"),u=document.getElementById("embed-font"),a=document.getElementById("embed-wordpressplugin"),f=document.getElementById("embed-startatend"),l=document.getElementById("embed-hashbookmark"),c=document.getElementById("embed-startzoomadjust"),h=document.getElementById("embed-startatslide"),p=document.getElementById("embed-debug"),d=document.getElementById("embed-googlemapkey"),v=!1,m=!1,g=!1,y,b,w,E,S;t.value.match("docs.google.com")?S=getUrlVars(t.value).key:t.value==""?S="0Agl_Dv6iEbDadHdKcHlHcTB5bzhvbF9iTWwyMmJHdkE":S=t.value;f.checked&&(v=!0);l.checked&&(m=!0);p.checked&&(g=!0);E="[timeline ";n.value>0&&(E+="width='"+n.value+"' ");r.value>0&&(E+="height='"+n.value+"' ");E+="font='"+u.value+"' ";E+="maptype='"+i.value+"' ";E+="lang='"+s.value+"' ";E+="src='"+t.value+"' ";v&&(E+="start_at_end='"+v+"' ");m&&(E+="hash_bookmark='"+m+"' ");g&&(E+="debug='"+g+"' ");d.value!=""&&(E+="gmap_key='"+d.value+"' ");parseInt(h.value,10)>0&&(E+="start_at_slide='"+parseInt(h.value,10)+"' ");parseInt(c.value,10)>0&&(E+="start_zoom_adjust='"+parseInt(c.value,10)+"' ");E+="]";e.wordpress=E;w=generator_embed_path+"?source="+S;w+="&font="+u.value;w+="&maptype="+i.value;w+="&lang="+s.value;v&&(w+="&start_at_end="+v);m&&(w+="&hash_bookmark="+m);g&&(w+="&debug="+g);parseInt(h.value,10)>0&&(w+="&start_at_slide="+parseInt(h.value,10));parseInt(c.value,10)>0&&(w+="&start_zoom_adjust="+parseInt(c.value,10));d.value!=""&&(w+="&gmap_key="+d.value);n.value>0&&(w+="&width="+n.value);r.value>0&&(w+="&height="+r.value);y="<iframe src='"+w+"'";n.value>0&&(y+=" width='"+n.value+"'");r.value>0&&(y+=" height='"+r.value+"'");y+=" frameborder='0'></iframe>";e.iframe=y;e.link=w;a.checked?e.copybox=E:e.copybox=y;return e}function updateEmbedCode(e,t){var n=document.getElementById("embed_code"),r=getLinkAndIframe();n.value=r.copybox;jQuery("#preview-embed-link").attr("href",r.link);jQuery("#preview-embed-iframe").html(r.iframe);jQuery("#preview-embed").css("display","block")}if(typeof generator_embed_path=="undefined"||typeof generator_embed_path=="undefined"){var generator_embed_path=getScriptPath("storyjs-embed-generator.js").split("js/")[0];generator_embed_path.match("http")?generator_embed_path=generator_embed_path:generator_embed_path=="/"?generator_embed_path="index.html":generator_embed_path+="index.html"};
*/function getScriptPath(e){var t=document.getElementsByTagName("script"),n="";for(var r=0;r<t.length;r++)t[r].src.match(e)&&(n=t[r].src);return n.split("?")[0].split("/").slice(0,-1).join("/")+"/"}function getUrlVars(e){var t=[],n,r,i=e.toString();i.match("&#038;")?i=i.replace("&#038;","&"):i.match("&#38;")?i=i.replace("&#38;","&"):i.match("&amp;")&&(i=i.replace("&amp;","&"));i.match("#")&&(i=i.split("#")[0]);r=i.slice(i.indexOf("?")+1).split("&");for(var s=0;s<r.length;s++){n=r[s].split("=");t.push(n[0]);t[n[0]]=n[1]}return t}function getLinkAndIframe(){var e={},t=document.getElementById("embed-source-url"),n=document.getElementById("embed-width"),r=document.getElementById("embed-height"),i=document.getElementById("embed-maptype"),s=document.getElementById("embed-language"),o=document.getElementById("embed_code"),u=document.getElementById("embed-font"),a=document.getElementById("embed-wordpressplugin"),f=document.getElementById("embed-startatend"),l=document.getElementById("embed-hashbookmark"),c=document.getElementById("embed-startzoomadjust"),h=document.getElementById("embed-startatslide"),p=document.getElementById("embed-debug"),d=document.getElementById("embed-googlemapkey"),v=!1,m=!1,g=!1,y,b,w,E,S;t.value.match("docs.google.com")?S=getUrlVars(t.value).key:t.value==""?S="0Agl_Dv6iEbDadHdKcHlHcTB5bzhvbF9iTWwyMmJHdkE":S=t.value;f.checked&&(v=!0);l.checked&&(m=!0);p.checked&&(g=!0);E="[timeline ";n.value>0&&(E+="width='"+n.value+"' ");r.value>0&&(E+="height='"+n.value+"' ");E+="font='"+u.value+"' ";E+="maptype='"+i.value+"' ";E+="lang='"+s.value+"' ";E+="src='"+t.value+"' ";v&&(E+="start_at_end='"+v+"' ");m&&(E+="hash_bookmark='"+m+"' ");g&&(E+="debug='"+g+"' ");d.value!=""&&(E+="gmap_key='"+d.value+"' ");parseInt(h.value,10)>0&&(E+="start_at_slide='"+parseInt(h.value,10)+"' ");parseInt(c.value,10)>0&&(E+="start_zoom_adjust='"+parseInt(c.value,10)+"' ");E+="]";e.wordpress=E;w=generator_embed_path+"?source="+S;w+="&font="+u.value;w+="&maptype="+i.value;w+="&lang="+s.value;v&&(w+="&start_at_end="+v);m&&(w+="&hash_bookmark="+m);g&&(w+="&debug="+g);parseInt(h.value,10)>0&&(w+="&start_at_slide="+parseInt(h.value,10));parseInt(c.value,10)>0&&(w+="&start_zoom_adjust="+parseInt(c.value,10));d.value!=""&&(w+="&gmap_key="+d.value);n.value>0&&(w+="&width="+n.value);r.value>0&&(w+="&height="+r.value);y="<iframe src='"+w+"'";if(n.value>0||n.value.match("%"))y+=" width='"+n.value+"'";if(r.value>0||r.value.match("%"))y+=" height='"+r.value+"'";y+=" frameborder='0'></iframe>";e.iframe=y;e.link=w;a.checked?e.copybox=E:e.copybox=y;return e}function updateEmbedCode(e,t){var n=document.getElementById("embed_code"),r=getLinkAndIframe();n.value=r.copybox;jQuery("#preview-embed-link").attr("href",r.link);jQuery("#preview-embed-iframe").html(r.iframe);jQuery("#preview-embed").css("display","block")}if(typeof generator_embed_path=="undefined"||typeof generator_embed_path=="undefined"){var generator_embed_path=getScriptPath("storyjs-embed-generator.js").split("js/")[0];generator_embed_path.match("http")?generator_embed_path=generator_embed_path:generator_embed_path=="/"?generator_embed_path="index.html":generator_embed_path+="index.html"};

2
compiled/js/storyjs-embed.js

File diff suppressed because one or more lines are too long

12
compiled/js/timeline-min.js vendored

File diff suppressed because one or more lines are too long

210
compiled/js/timeline.js

@ -1,6 +1,6 @@
/*!
TimelineJS
Version 2.11
Version 2.12
Designed and built by Zach Wise at VéritéCo
This Source Code Form is subject to the terms of the Mozilla Public
@ -1287,6 +1287,29 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') {
if ( date_array[2] ) { date.setFullYear( date_array[2]); }
if ( date_array[0] > 1 ) { date.setMonth( date_array[0] - 1); }
if ( date_array[1] > 1 ) { date.setDate( date_array[1]); }
} else if (d.match("now")) {
var now = new Date();
date.setFullYear(now.getFullYear());
date.setMonth(now.getMonth());
date.setDate(now.getDate());
if (d.match("hours")) {
date.setHours(now.getHours());
}
if (d.match("minutes")) {
date.setHours(now.getHours());
date.setMinutes(now.getMinutes());
}
if (d.match("seconds")) {
date.setHours(now.getHours());
date.setMinutes(now.getMinutes());
date.setSeconds(now.getSeconds());
}
if (d.match("milliseconds")) {
date.setHours(now.getHours());
date.setMinutes(now.getMinutes());
date.setSeconds(now.getSeconds());
date.setMilliseconds(now.getMilliseconds());
}
} else if (d.length <= 5) {
date.setFullYear(parseInt(d, 10));
date.setMonth(0);
@ -4705,7 +4728,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
content: {
width: 720,
height: 400,
padding: 130
padding: 120,
padding_default: 120
},
nav: {
width: 100,
@ -4818,6 +4842,13 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
config.slider.nav.height = VMM.Lib.height(navigation.prevBtnContainer);
// Handle smaller sizes
if (VMM.Browser.device == "mobile" || current_width <= 640) {
config.slider.content.padding = 10;
} else {
config.slider.content.padding = config.slider.content.padding_default;
}
config.slider.content.width = current_width - (config.slider.content.padding *2);
VMM.Lib.width($slides_items, (slides.length * config.slider.content.width));
@ -4995,6 +5026,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
layout_media = ".slider-item .layout-media .media .media-container ",
layout_both = ".slider-item .media .media-container",
layout_caption = ".slider-item .media .media-container .media-shadow .caption",
is_skinny = false,
mediasize = {
text_media: {
width: (config.slider.content.width/100) * 60,
@ -5017,6 +5049,12 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
}
}
};
// Handle smaller sizes
if (VMM.Browser.device == "mobile" || current_width <= 640) {
is_skinny = true;
}
VMM.master_config.sizes.api.width = mediasize.media.width;
VMM.master_config.sizes.api.height = mediasize.media.height;
@ -5027,20 +5065,12 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.Lib.css(".slider-item", "width", config.slider.content.width );
VMM.Lib.height(".slider-item", config.slider.height);
// HANDLE SMALLER SIZES
var is_skinny = false;
if (current_width <= 640) {
is_skinny = true;
} else if (VMM.Browser.device == "mobile" && VMM.Browser.orientation == "portrait") {
is_skinny = true;
} else if (VMM.Browser.device == "tablet" && VMM.Browser.orientation == "portrait") {
//is_skinny = true;
}
if (is_skinny) {
mediasize.text_media.width = config.slider.content.width;
mediasize.text_media.width = config.slider.content.width - (config.slider.content.padding*2);
mediasize.media.width = config.slider.content.width - (config.slider.content.padding*2);
mediasize.text_media.height = ((config.slider.height/100) * 50 ) - 50;
mediasize.media.height = ((config.slider.height/100) * 70 ) - 40;
@ -5050,7 +5080,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.Lib.css(".slider-item .layout-text-media .text", "width", "100%" );
VMM.Lib.css(".slider-item .layout-text-media .text", "display", "block" );
VMM.Lib.css(".slider-item .layout-text-media .text .container", "display", "block" );
VMM.Lib.css(".slider-item .layout-text-media .text .container", "width", config.slider.content.width );
VMM.Lib.css(".slider-item .layout-text-media .text .container", "width", mediasize.media.width );
VMM.Lib.css(".slider-item .layout-text-media .text .container .start", "width", "auto" );
VMM.Lib.css(".slider-item .layout-text-media .media", "float", "none" );
VMM.Lib.addClass(".slider-item .content-container", "pad-top");
@ -5122,13 +5153,17 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
VMM.Lib.css( layout_both + ".soundcloud", "max-height", 168 );
// MAPS
VMM.Lib.height( layout_text_media + ".map", mediasize.text_media.height);
VMM.Lib.css( layout_media + ".map", "max-height", mediasize.media.height);
VMM.Lib.width( layout_media + ".map", mediasize.media.width);
VMM.Lib.height( layout_text_media + ".map", mediasize.text_media.height);
VMM.Lib.width( layout_text_media + ".map", mediasize.text_media.width);
VMM.Lib.css( layout_media + ".map", "max-height", mediasize.media.height);
VMM.Lib.width( layout_media + ".map", mediasize.media.width);
// DOCS
VMM.Lib.height( layout_text_media + ".doc", mediasize.text_media.height);
VMM.Lib.width( layout_text_media + ".doc", mediasize.text_media.width);
VMM.Lib.height( layout_media + ".doc", mediasize.media.height);
VMM.Lib.width( layout_media + ".doc", mediasize.media.width);
// IE8 NEEDS THIS
VMM.Lib.width( layout_media + ".wikipedia", mediasize.media.width);
@ -5139,6 +5174,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
// CAPTION WIDTH
VMM.Lib.css( layout_text_media + ".caption", "max-width", mediasize.text_media.video.width);
VMM.Lib.css( layout_media + ".caption", "max-width", mediasize.media.video.width);
//VMM.Lib.css( layout_text_media + ".caption", "max-width", mediasize.text_media.width);
//VMM.Lib.css( layout_media + ".caption", "max-width", mediasize.media.width);
// MAINTAINS VERTICAL CENTER IF IT CAN
for(i = 0; i < slides.length; i++) {
@ -5208,45 +5245,54 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
if (ease != null && ease != "") {_ease = ease};
if (duration != null && duration != "") {_duration = duration};
/* set proper nav titles and dates etc.
/* NAVIGATION
set proper nav titles and dates etc.
================================================== */
if (is_first) {
// Handle smaller sizes
if (VMM.Browser.device == "mobile") {
//if (VMM.Browser.device == "mobile" || current_width <= 640) {
VMM.Lib.visible(navigation.prevBtn, false);
VMM.Lib.visible(navigation.nextBtn, false);
} else {
VMM.Lib.visible(navigation.prevBtn, true);
_title = VMM.Util.unlinkify(data[current_slide - 1].title)
if (config.type == "timeline") {
if(typeof data[current_slide - 1].date === "undefined") {
VMM.attachElement(navigation.prevDate, _title);
VMM.attachElement(navigation.prevTitle, "");
if (is_first) {
VMM.Lib.visible(navigation.prevBtn, false);
} else {
VMM.Lib.visible(navigation.prevBtn, true);
_title = VMM.Util.unlinkify(data[current_slide - 1].title)
if (config.type == "timeline") {
if(typeof data[current_slide - 1].date === "undefined") {
VMM.attachElement(navigation.prevDate, _title);
VMM.attachElement(navigation.prevTitle, "");
} else {
VMM.attachElement(navigation.prevDate, VMM.Date.prettyDate(data[current_slide - 1].startdate));
VMM.attachElement(navigation.prevTitle, _title);
}
} else {
VMM.attachElement(navigation.prevDate, VMM.Date.prettyDate(data[current_slide - 1].startdate));
VMM.attachElement(navigation.prevTitle, _title);
}
} else {
VMM.attachElement(navigation.prevTitle, _title);
}
}
if (is_last) {
VMM.Lib.visible(navigation.nextBtn, false);
} else {
VMM.Lib.visible(navigation.nextBtn, true);
_title = VMM.Util.unlinkify(data[current_slide + 1].title);
if (config.type == "timeline") {
if(typeof data[current_slide + 1].date === "undefined") {
VMM.attachElement(navigation.nextDate, _title);
VMM.attachElement(navigation.nextTitle, "");
}
if (is_last) {
VMM.Lib.visible(navigation.nextBtn, false);
} else {
VMM.Lib.visible(navigation.nextBtn, true);
_title = VMM.Util.unlinkify(data[current_slide + 1].title);
if (config.type == "timeline") {
if(typeof data[current_slide + 1].date === "undefined") {
VMM.attachElement(navigation.nextDate, _title);
VMM.attachElement(navigation.nextTitle, "");
} else {
VMM.attachElement(navigation.nextDate, VMM.Date.prettyDate(data[current_slide + 1].startdate) );
VMM.attachElement(navigation.nextTitle, _title);
}
} else {
VMM.attachElement(navigation.nextDate, VMM.Date.prettyDate(data[current_slide + 1].startdate) );
VMM.attachElement(navigation.nextTitle, _title);
VMM.attachElement(navigation.nextTitle, _title);
}
} else {
VMM.attachElement(navigation.nextTitle, _title);
}
}
}
/* ANIMATE SLIDE
================================================== */
if (fast) {
@ -6556,7 +6602,8 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
content: {
width: 720,
height: 400,
padding: 130
padding: 130,
padding_default:130
},
nav: {
width: 100,
@ -6961,12 +7008,22 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
config.nav.width = config.width;
config.feature.width = config.width;
config.feature.height = config.height - config.nav.height - 3;
if (VMM.Browser.device == "mobile") {
//config.feature.height = config.height;
} else {
//config.feature.height = config.height - config.nav.height - 3;
/*
if (VMM.Browser.orientation == "portrait") {
config.feature.height = 480;
config.height = 480 + config.nav.height;
} else if(VMM.Browser.orientation == "landscape") {
config.feature.height = 320;
config.height = 320 + config.nav.height;
} else {
config.feature.height = config.height - config.nav.height - 3;
}
*/
}
config.feature.height = config.height - config.nav.height - 3;
};
// BUILD DATE OBJECTS
@ -8377,7 +8434,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
$timenavline = VMM.appendAndGetElement($timebackground, "<div>", "timenav-line");
$timenavindicator = VMM.appendAndGetElement($timebackground, "<div>", "timenav-indicator");
$timeintervalbackground = VMM.appendAndGetElement($timebackground, "<div>", "timenav-interval-background", "<div class='top-highlight'></div>");
$toolbar = VMM.appendAndGetElement(layout, "<div>", "toolbar");
$toolbar = VMM.appendAndGetElement(layout, "<div>", "vco-toolbar");
buildInterval();
@ -8394,25 +8451,31 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
if (config.start_page) {
$backhome = VMM.appendAndGetElement($toolbar, "<div>", "back-home", "<div class='icon'></div>");
VMM.bindEvent(".back-home", onBackHome, "click");
VMM.Lib.css($toolbar, "top", 27);
VMM.Lib.attribute($backhome, "title", VMM.master_config.language.messages.return_to_title);
VMM.Lib.attribute($backhome, "rel", "tooltip");
}
$zoomin = VMM.appendAndGetElement($toolbar, "<div>", "zoom-in", "<div class='icon'></div>");
$zoomout = VMM.appendAndGetElement($toolbar, "<div>", "zoom-out", "<div class='icon'></div>");
// MAKE TIMELINE DRAGGABLE/TOUCHABLE
$dragslide = new VMM.DragSlider;
$dragslide.createPanel(layout, $timenav, config.nav.constraint, config.touch);
// ZOOM EVENTS
VMM.bindEvent($zoomin, onZoomIn, "click");
VMM.bindEvent($zoomout, onZoomOut, "click");
if (!config.touch) {
if (config.touch && config.start_page) {
VMM.Lib.addClass($toolbar, "touch");
VMM.Lib.css($toolbar, "top", 55);
VMM.Lib.css($toolbar, "left", 10);
} else {
if (config.start_page) {
VMM.Lib.css($toolbar, "top", 27);
}
$zoomin = VMM.appendAndGetElement($toolbar, "<div>", "zoom-in", "<div class='icon'></div>");
$zoomout = VMM.appendAndGetElement($toolbar, "<div>", "zoom-out", "<div class='icon'></div>");
// ZOOM EVENTS
VMM.bindEvent($zoomin, onZoomIn, "click");
VMM.bindEvent($zoomout, onZoomOut, "click");
// TOOLTIP
VMM.Lib.attribute($zoomin, "title", VMM.master_config.language.messages.expand_timeline);
VMM.Lib.attribute($zoomin, "rel", "tooltip");
@ -8420,6 +8483,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
VMM.Lib.attribute($zoomout, "rel", "tooltip");
$toolbar.tooltip({selector: "div[rel=tooltip]", placement: "right"});
// MOUSE EVENTS
VMM.bindEvent(layout, onMouseScroll, 'DOMMouseScroll');
VMM.bindEvent(layout, onMouseScroll, 'mousewheel');
@ -8906,24 +8970,34 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef
googlespreadsheet: {
getData: function(raw) {
var key, url, timeout;
var getjsondata, key, url, timeout, tries = 0;
key = VMM.Util.getUrlVars(raw)["key"];
url = "https://spreadsheets.google.com/feeds/list/" + key + "/od6/public/values?alt=json";
timeout = setTimeout(function() {
trace("Google Docs timeout");
VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Google Docs is not responding");
if (tries < 3) {
VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Still waiting on Google Docs, trying again " + tries);
tries ++;
requestJsonData();
} else {
VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Google Docs is not responding");
}
}, 6000);
VMM.getJSON(url, VMM.Timeline.DataObj.model.googlespreadsheet.buildData)
.error(function(jqXHR, textStatus, errorThrown) {
trace("Google Docs ERROR");
trace("Google Docs ERROR: " + textStatus + " " + jqXHR.responseText);
})
.success(function(d) {
clearTimeout(timeout);
});
function requestJsonData() {
getjsondata = VMM.getJSON(url, VMM.Timeline.DataObj.model.googlespreadsheet.buildData)
.error(function(jqXHR, textStatus, errorThrown) {
trace("Google Docs ERROR");
trace("Google Docs ERROR: " + textStatus + " " + jqXHR.responseText);
})
.success(function(d) {
clearTimeout(timeout);
});
}
requestJsonData();
},
buildData: function(d) {

Loading…
Cancel
Save