Browse Source

Latest compile 2.05

pull/227/head
Zach Wise 12 years ago
parent
commit
e09ee38e59
  1. 12
      compiled/js/storyjs-embed-cdn.js
  2. 2
      compiled/js/storyjs-embed-generator.js
  3. 12
      compiled/js/storyjs-embed.js
  4. 10
      compiled/js/timeline-min.js
  5. 317
      compiled/js/timeline.js

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

@ -492,7 +492,7 @@ LoadLib = (function (doc) {
var i = 0, var i = 0,
has_loaded = false; has_loaded = false;
for (i = 0; i < loaded; i++) { for (i = 0; i < loaded.length; i++) {
if (loaded[i] == url) { if (loaded[i] == url) {
has_loaded = true; has_loaded = true;
} }
@ -584,7 +584,7 @@ function createStoryJS(c, src) {
================================================== */ ================================================== */
var storyjs_embedjs, t, te, x, var storyjs_embedjs, t, te, x,
isCDN = false, isCDN = false,
js_version = "2.01", js_version = "2.05",
jquery_version_required = "1.7.1", jquery_version_required = "1.7.1",
jquery_version = "", jquery_version = "",
ready = { ready = {
@ -626,7 +626,13 @@ function createStoryJS(c, src) {
lang: 'en', lang: 'en',
font: 'default', font: 'default',
css: path.css + 'timeline.css?'+js_version, css: path.css + 'timeline.css?'+js_version,
js: path.js + 'timeline-min.js?'+js_version js: path.js + 'timeline-min.js?'+js_version,
api_keys: {
google: "",
flickr: "",
twitter: ""
},
gmap_key: ""
}, },
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' ] },

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

@ -2,4 +2,4 @@
VéritéCo Embed Generator 0.8 VéritéCo Embed Generator 0.8
Designed and built by Zach Wise digitalartwork.net Designed and built by Zach Wise digitalartwork.net
Date: June 21, 2012 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=!1,v=!1,m=!1,g,y,b,w,E;t.value.match("docs.google.com")?E=getUrlVars(t.value).key:t.value==""?E="0Agl_Dv6iEbDadHdKcHlHcTB5bzhvbF9iTWwyMmJHdkE":E=t.value;f.checked&&(d=!0);l.checked&&(v=!0);p.checked&&(m=!0);w="[timeline ";n.value>0&&(w+="width='"+n.value+"' ");r.value>0&&(w+="height='"+n.value+"' ");w+="font='"+u.value+"' ";w+="maptype='"+i.value+"' ";w+="lang='"+s.value+"' ";w+="src='"+t.value+"' ";d&&(w+="start_at_end='"+d+"' ");v&&(w+="hash_bookmark='"+v+"' ");m&&(w+="debug='"+m+"' ");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)+"' ");w+="]";e.wordpress=w;b=embed_path+"?source="+E;b+="&font="+u.value;b+="&maptype="+i.value;b+="&lang="+s.value;d&&(b+="&start_at_end="+d);v&&(b+="&hash_bookmark="+v);m&&(b+="&debug="+m);parseInt(h.value,10)>0&&(b+="&start_at_slide="+parseInt(h.value,10));parseInt(c.value,10)>0&&(b+="&start_zoom_adjust="+parseInt(c.value,10));n.value>0&&(b+="&width="+n.value);r.value>0&&(b+="&height="+r.value);g="<iframe src='"+b+"'";n.value>0&&(g+=" width='"+n.value+"'");r.value>0&&(g+=" height='"+r.value+"'");g+=" frameborder='0'></iframe>";e.iframe=g;e.link=b;a.checked?e.copybox=w:e.copybox=g;return e}function updateEmbedCode(e,t){var n=document.getElementById("embed_code"),r=getLinkAndIframe();n.value=r.copybox;$("#preview-embed-link").attr("href",r.link);$("#preview-embed-iframe").html(r.iframe)}if(typeof embed_path=="undefined"||typeof embed_path=="undefined"){var embed_path=getScriptPath("timeline-embed-generator.js").split("js/")[0];embed_path.match("http")?embed_path=embed_path:embed_path=="/"?embed_path="index.html":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=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;$("#preview-embed-link").attr("href",r.link);$("#preview-embed-iframe").html(r.iframe)}if(typeof embed_path=="undefined"||typeof embed_path=="undefined"){var embed_path=getScriptPath("timeline-embed-generator.js").split("js/")[0];embed_path.match("http")?embed_path=embed_path:embed_path=="/"?embed_path="index.html":embed_path+="index.html"};

12
compiled/js/storyjs-embed.js

@ -413,7 +413,7 @@ LoadLib = (function (doc) {
var i = 0, var i = 0,
has_loaded = false; has_loaded = false;
for (i = 0; i < loaded; i++) { for (i = 0; i < loaded.length; i++) {
if (loaded[i] == url) { if (loaded[i] == url) {
has_loaded = true; has_loaded = true;
} }
@ -505,7 +505,7 @@ function createStoryJS(c, src) {
================================================== */ ================================================== */
var storyjs_embedjs, t, te, x, var storyjs_embedjs, t, te, x,
isCDN = false, isCDN = false,
js_version = "2.01", js_version = "2.05",
jquery_version_required = "1.7.1", jquery_version_required = "1.7.1",
jquery_version = "", jquery_version = "",
ready = { ready = {
@ -547,7 +547,13 @@ function createStoryJS(c, src) {
lang: 'en', lang: 'en',
font: 'default', font: 'default',
css: path.css + 'timeline.css?'+js_version, css: path.css + 'timeline.css?'+js_version,
js: path.js + 'timeline-min.js?'+js_version js: path.js + 'timeline-min.js?'+js_version,
api_keys: {
google: "",
flickr: "",
twitter: ""
},
gmap_key: ""
}, },
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' ] },

10
compiled/js/timeline-min.js vendored

File diff suppressed because one or more lines are too long

317
compiled/js/timeline.js

@ -151,7 +151,8 @@ if (typeof VMM == 'undefined') {
api_keys_master: { api_keys_master: {
flickr: "RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==", flickr: "RAIvxHY4hE/Elm5cieh4X5ptMyDpj7MYIxziGxi0WGCcy1s+yr7rKQ==",
google: "jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo=", //google: "jwNGnYw4hE9lmAez4ll0QD+jo6SKBJFknkopLS4FrSAuGfIwyj57AusuR0s8dAo=",
google: "uQKadH1VMlCsp560gN2aOiMz4evWkl1s34yryl3F/9FJOsn+/948CbBUvKLN46U=",
twitter: "" twitter: ""
}, },
@ -2460,7 +2461,7 @@ LoadLib = (function (doc) {
var i = 0, var i = 0,
has_loaded = false; has_loaded = false;
for (i = 0; i < loaded; i++) { for (i = 0; i < loaded.length; i++) {
if (loaded[i] == url) { if (loaded[i] == url) {
has_loaded = true; has_loaded = true;
} }
@ -2665,6 +2666,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
VMM.attachElement("#"+tweet.id.toString(), twit ); VMM.attachElement("#"+tweet.id.toString(), twit );
VMM.attachElement("#text_thumb_"+tweet.id.toString(), d.text ); VMM.attachElement("#text_thumb_"+tweet.id.toString(), d.text );
VMM.attachElement("#marker_content_" + tweet.id.toString(), d.text );
}) })
.error(function(jqXHR, textStatus, errorThrown) { .error(function(jqXHR, textStatus, errorThrown) {
@ -2923,17 +2925,42 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
}, },
create: function(m) { create: function(m) {
trace(m.url);
VMM.ExternalAPI.googlemaps.createAPIMap(m);
if (m.url[0].match("msid")) {
//VMM.ExternalAPI.googlemaps.createAPIMap(m);
} else {
//VMM.ExternalAPI.googlemaps.createiFrameMap(m);
}
},
createiFrameMap: function(m) {
var embed_url = m.url + "&output=embed",
mc = "",
unique_map_id = m.id.toString() + "_gmap";
mc += "<div class='google-map' id='" + unique_map_id + "' style='width=100%;height=100%;'>";
mc += "<iframe width='100%' height='100%' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='" + embed_url + "'></iframe>";
mc += "</div>";
VMM.attachElement("#" + m.id, mc);
},
createAPIMap: function(m) {
var map_attribution = "", var map_attribution = "",
layer, layer,
map, map,
map_options, map_options,
unique_map_id = m.id.toString() + "_gmap", unique_map_id = m.id.toString() + "_gmap",
map_attribution_html = "", map_attribution_html = "",
location = new google.maps.LatLng(41.875696,-87.624207), location = new google.maps.LatLng(41.875696,-87.624207),
latlong, latlong,
zoom = 11, zoom = 11,
has_location = false, has_location = false,
has_zoom = false, has_zoom = false,
api_limit = false,
map_bounds; map_bounds;
@ -3025,7 +3052,6 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
} }
} }
VMM.attachElement("#" + m.id, "<div class='google-map' id='" + unique_map_id + "' style='width=100%;height=100%;'></div>"); VMM.attachElement("#" + m.id, "<div class='google-map' id='" + unique_map_id + "' style='width=100%;height=100%;'></div>");
map = new google.maps.Map(document.getElementById(unique_map_id), map_options); map = new google.maps.Map(document.getElementById(unique_map_id), map_options);
@ -3039,7 +3065,108 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
VMM.appendElement("#"+unique_map_id, map_attribution_html); VMM.appendElement("#"+unique_map_id, map_attribution_html);
} }
loadKML(); // DETERMINE IF KML IS POSSIBLE
if (m.url[0].match("msid")) {
loadKML();
} else {
loadPlaces();
}
// PLACES
function loadPlaces() {
var api_key,
places_url,
has_key = false;
trace("LOADING PLACES API FOR GOOGLE MAPS");
if (VMM.ExternalAPI.keys.google != "") {
api_key = VMM.ExternalAPI.keys.google;
has_key = true;
} else {
trace("YOU NEED A GOOGLE MAPS API KEY IN ORDER TO USE THIS FEATURE OF TIMELINEJS");
trace("FIND OUT HOW TO GET YOUR KEY HERE: https://developers.google.com/places/documentation/#Authentication");
}
places_url = "https://maps.googleapis.com/maps/api/place/textsearch/json?key=" + api_key + "&sensor=false&language=" + m.lang + "&";
if (type.of(VMM.Util.getUrlVars(m.url)["q"]) == "string") {
places_url += "query=" + VMM.Util.getUrlVars(m.url)["q"];
}
if (has_location) {
places_url += "&location=" + location;
}
if (has_key) {
VMM.getJSON(places_url, function(d) {
trace("PLACES JSON");
var places_location = "",
places_bounds = "",
places_bounds_ne = "",
places_bounds_sw = "";
trace(d);
if (d.status == "OVER_QUERY_LIMIT") {
trace("OVER_QUERY_LIMIT");
if (has_location) {
map.panTo(location);
if (has_zoom) {
map.setZoom(zoom);
}
} else {
trace("DOING TRADITIONAL MAP IFRAME EMBED UNTIL QUERY LIMIT RESTORED");
api_limit = true;
VMM.ExternalAPI.googlemaps.createiFrameMap(m);
}
} else {
if (d.results.length >= 1) {
//location = new google.maps.LatLng(parseFloat(d.results[0].geometry.location.lat),parseFloat(d.results[0].geometry.location.lng));
//map.panTo(location);
places_bounds_ne = new google.maps.LatLng(parseFloat(d.results[0].geometry.viewport.northeast.lat),parseFloat(d.results[0].geometry.viewport.northeast.lng));
places_bounds_sw = new google.maps.LatLng(parseFloat(d.results[0].geometry.viewport.southwest.lat),parseFloat(d.results[0].geometry.viewport.southwest.lng));
places_bounds = new google.maps.LatLngBounds(places_bounds_sw, places_bounds_ne)
map.fitBounds(places_bounds);
} else {
trace("NO RESULTS");
}
if (has_location) {
map.panTo(location);
}
if (has_zoom) {
map.setZoom(zoom);
}
}
})
.error(function(jqXHR, textStatus, errorThrown) {
trace("PLACES JSON ERROR");
trace("PLACES JSON ERROR: " + textStatus + " " + jqXHR.responseText);
})
.success(function(d) {
trace("PLACES JSON SUCCESS");
});
} else {
if (has_location) {
map.panTo(location);
if (has_zoom) {
map.setZoom(zoom);
}
} else {
trace("DOING TRADITIONAL MAP IFRAME EMBED BECAUSE NO GOOGLE MAP API KEY WAS PROVIDED");
VMM.ExternalAPI.googlemaps.createiFrameMap(m);
}
}
}
// KML // KML
function loadKML() { function loadKML() {
@ -3052,7 +3179,8 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
kml_layer.setMap(map); kml_layer.setMap(map);
google.maps.event.addListenerOnce(kml_layer, "defaultviewport_changed", function() { google.maps.event.addListenerOnce(kml_layer, "defaultviewport_changed", function() {
map.fitBounds(kml_layer.getDefaultViewport() ); //map.fitBounds(kml_layer.getDefaultViewport() );
if (has_location) { if (has_location) {
map.panTo(location); map.panTo(location);
} }
@ -3072,6 +3200,7 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') {
}); });
} }
}, },
pushQue: function() { pushQue: function() {
@ -3986,7 +4115,7 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') {
start: 0, start: 0,
hd: false, hd: false,
link: "", link: "",
lang: "", lang: VMM.Language.lang,
uniqueid: VMM.Util.unique_ID(6) uniqueid: VMM.Util.unique_ID(6)
}; };
@ -6179,7 +6308,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
$navigation, $navigation,
slider, slider,
timenav, timenav,
version = "2.01", version = "2.05",
timeline_id = "#timelinejs", timeline_id = "#timelinejs",
events = {}, events = {},
data = {}, data = {},
@ -6218,6 +6347,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
source: "nothing", source: "nothing",
type: "timeline", type: "timeline",
touch: false, touch: false,
orientation: "normal",
maptype: "toner", maptype: "toner",
preload: 4, preload: 4,
current_slide: 0, current_slide: 0,
@ -6288,6 +6418,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
}, },
ease: "easeInOutExpo", ease: "easeInOutExpo",
duration: 1000, duration: 1000,
gmap_key: "",
language: VMM.Language language: VMM.Language
}; };
@ -6348,6 +6479,10 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
VMM.Timeline.Config = config; VMM.Timeline.Config = config;
VMM.master_config.Timeline = VMM.Timeline.Config; VMM.master_config.Timeline = VMM.Timeline.Config;
this.events = config.events; this.events = config.events;
if (config.gmap_key != "") {
config.api_keys.google = config.gmap_key;
}
} }
/* CREATE TIMELINE STRUCTURE /* CREATE TIMELINE STRUCTURE
@ -6412,9 +6547,13 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
} }
function reSize() { function reSize() {
if (orientationChange()) {
setViewport();
}
updateSize(); updateSize();
slider.setSize(config.feature.width, config.feature.height); slider.setSize(config.feature.width, config.feature.height);
timenav.setSize(config.width, config.height); timenav.setSize(config.width, config.height);
}; };
function onSliderLoaded(e) { function onSliderLoaded(e) {
@ -6463,6 +6602,63 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
} }
} }
function getViewport() {
}
function setViewport() {
var viewport_content = "",
viewport_orientation = searchOrientation(window.orientation);
if (VMM.Browser.device == "mobile") {
if (viewport_orientation == "portrait") {
viewport_content = "width=device-width; initial-scale=0.75, maximum-scale=0.75";
} else if (viewport_orientation == "landscape") {
viewport_content = "width=device-width; initial-scale=0.5, maximum-scale=0.5";
} else {
viewport_content = "width=device-width, initial-scale=1, maximum-scale=1.0";
}
} else if (VMM.Browser.device == "tablet") {
viewport_content = "width=device-width, initial-scale=1, maximum-scale=1.0";
}
if (document.getElementById("viewport")) {
VMM.Lib.attr("#viewport", "content", viewport_content);
} else {
VMM.appendElement("head", "<meta id='viewport' name='viewport' content=" + viewport_content + "/>");
}
}
/* ORIENTATION
================================================== */
function searchOrientation(orientation) {
var orient = "";
if ( orientation == 0 || orientation == 180) {
orient = "portrait";
} else if ( orientation == 90 || orientation == -90) {
orient = "landscape";
} else {
orient = "normal";
}
return orient;
}
function orientationChange() {
var orientation = searchOrientation(window.orientation);
if (orientation == config.orientation) {
return false;
} else {
config.orientation = orientation;
return true;
}
}
/* PUBLIC FUNCTIONS /* PUBLIC FUNCTIONS
================================================== */ ================================================== */
this.init = function(c, _data) { this.init = function(c, _data) {
@ -6578,6 +6774,9 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
// RESIZE EVENT LISTENERS // RESIZE EVENT LISTENERS
VMM.bindEvent(global, reSize, config.events.resize); VMM.bindEvent(global, reSize, config.events.resize);
// VIEWPORT
setViewport();
} }
@ -6693,27 +6892,36 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
/* CREATE START PAGE IF AVAILABLE /* CREATE START PAGE IF AVAILABLE
================================================== */ ================================================== */
if (data.headline != null && data.headline != "" && data.text != null && data.text != "") { if (data.headline != null && data.headline != "" && data.text != null && data.text != "") {
var startpage_date = VMM.Date.parse(data.startDate),
_date = {},
td_num = 0,
td;
trace("HAS STARTPAGE"); trace("HAS STARTPAGE");
var _date = {}, td_num = 0, td; trace(startpage_date);
td = _dates[0].startdate; if (startpage_date < _dates[0].startdate) {
_date.startdate = new Date(_dates[0].startdate); _date.startdate = new Date(startpage_date);
if (td.getMonth() === 0 && td.getDate() == 1 && td.getHours() === 0 && td.getMinutes() === 0 ) {
// trace("YEAR ONLY");
_date.startdate.setFullYear(td.getFullYear() - 1);
} else if (td.getDate() <= 1 && td.getHours() === 0 && td.getMinutes() === 0) {
// trace("YEAR MONTH");
_date.startdate.setMonth(td.getMonth() - 1);
} else if (td.getHours() === 0 && td.getMinutes() === 0) {
// trace("YEAR MONTH DAY");
_date.startdate.setDate(td.getDate() - 1);
} else if (td.getMinutes() === 0) {
// trace("YEAR MONTH DAY HOUR");
_date.startdate.setHours(td.getHours() - 1);
} else { } else {
// trace("YEAR MONTH DAY HOUR MINUTE"); td = _dates[0].startdate;
_date.startdate.setMinutes(td.getMinutes() - 1); _date.startdate = new Date(_dates[0].startdate);
if (td.getMonth() === 0 && td.getDate() == 1 && td.getHours() === 0 && td.getMinutes() === 0 ) {
// trace("YEAR ONLY");
_date.startdate.setFullYear(td.getFullYear() - 1);
} else if (td.getDate() <= 1 && td.getHours() === 0 && td.getMinutes() === 0) {
// trace("YEAR MONTH");
_date.startdate.setMonth(td.getMonth() - 1);
} else if (td.getHours() === 0 && td.getMinutes() === 0) {
// trace("YEAR MONTH DAY");
_date.startdate.setDate(td.getDate() - 1);
} else if (td.getMinutes() === 0) {
// trace("YEAR MONTH DAY HOUR");
_date.startdate.setHours(td.getHours() - 1);
} else {
// trace("YEAR MONTH DAY HOUR MINUTE");
_date.startdate.setMinutes(td.getMinutes() - 1);
}
} }
_date.uniqueid = VMM.Util.unique_ID(7); _date.uniqueid = VMM.Util.unique_ID(7);
@ -8228,9 +8436,6 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
if (m.type == "quote" || m.type == "unknown") { if (m.type == "quote" || m.type == "unknown") {
_marker_title = VMM.Util.untagify(m.id); _marker_title = VMM.Util.untagify(m.id);
has_title = true; has_title = true;
} else if (m.type == "twitter") {
has_title = false;
VMM.appendElement(_marker_content, "<h3 id='text_thumb_" + m.id + "'>" + _marker_title + "</h3>");
} else { } else {
has_title = false; has_title = false;
} }
@ -8245,6 +8450,9 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
if (has_title) { if (has_title) {
VMM.appendElement(_marker_content, "<h3>" + _marker_title + "</h3>"); VMM.appendElement(_marker_content, "<h3>" + _marker_title + "</h3>");
} else {
VMM.appendElement(_marker_content, "<h3>" + _marker_title + "</h3>");
VMM.appendElement(_marker_content, "<h3 id='marker_content_" + data[i].uniqueid + "'>" + _marker_title + "</h3>");
} }
// ADD ID // ADD ID
@ -8543,9 +8751,24 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef
googlespreadsheet: { googlespreadsheet: {
getData: function(raw) { getData: function(raw) {
var _key = VMM.Util.getUrlVars(raw)["key"]; var key, url, timeout;
var _url = "https://spreadsheets.google.com/feeds/list/" + _key + "/od6/public/values?alt=json";
VMM.getJSON(_url, VMM.Timeline.DataObj.model.googlespreadsheet.buildData); 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");
}, 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);
});
}, },
buildData: function(d) { buildData: function(d) {
@ -8573,12 +8796,12 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef
if (dd_type.match("start") || dd_type.match("title") ) { if (dd_type.match("start") || dd_type.match("title") ) {
data_obj.timeline.startDate = getGVar(dd.gsx$startdate); data_obj.timeline.startDate = getGVar(dd.gsx$startdate);
data_obj.timeline.headline = getGVar(dd.gsx$headline); data_obj.timeline.headline = getGVar(dd.gsx$headline);
data_obj.timeline.asset.media = getGVar(dd.gsx$media); data_obj.timeline.asset.media = getGVar(dd.gsx$media);
data_obj.timeline.asset.caption = getGVar(dd.gsx$mediacaption); data_obj.timeline.asset.caption = getGVar(dd.gsx$mediacaption);
data_obj.timeline.asset.credit = getGVar(dd.gsx$mediacredit); data_obj.timeline.asset.credit = getGVar(dd.gsx$mediacredit);
data_obj.timeline.text = getGVar(dd.gsx$text); data_obj.timeline.text = getGVar(dd.gsx$text);
data_obj.timeline.type = "google spreadsheet"; data_obj.timeline.type = "google spreadsheet";
} else if (dd_type.match("era")) { } else if (dd_type.match("era")) {
var era = { var era = {
startDate: getGVar(dd.gsx$startdate), startDate: getGVar(dd.gsx$startdate),
@ -8617,19 +8840,21 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef
storify: { storify: {
getData: function(raw) { getData: function(raw) {
var key, url, storify_timeout;
//http://storify.com/number10gov/g8-and-nato-chicago-summit //http://storify.com/number10gov/g8-and-nato-chicago-summit
//http://api.storify.com/v1/stories/number10gov/g8-and-nato-chicago-summit //http://api.storify.com/v1/stories/number10gov/g8-and-nato-chicago-summit
VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Loading Storify..."); VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Loading Storify...");
var _key = raw.split("storify.com\/")[1];
var _url = "http://api.storify.com/v1/stories/" + _key + "?per_page=300&callback=?";
var storify_timeout = setTimeout(function() { key = raw.split("storify.com\/")[1];
url = "http://api.storify.com/v1/stories/" + key + "?per_page=300&callback=?";
storify_timeout = setTimeout(function() {
trace("STORIFY timeout"); trace("STORIFY timeout");
VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Storify is not responding"); VMM.fireEvent(global, VMM.Timeline.Config.events.messege, "Storify is not responding");
}, 6000); }, 6000);
VMM.getJSON(_url, VMM.Timeline.DataObj.model.storify.buildData) VMM.getJSON(url, VMM.Timeline.DataObj.model.storify.buildData)
.error(function(jqXHR, textStatus, errorThrown) { .error(function(jqXHR, textStatus, errorThrown) {
trace("STORIFY error"); trace("STORIFY error");
trace("STORIFY ERROR: " + textStatus + " " + jqXHR.responseText); trace("STORIFY ERROR: " + textStatus + " " + jqXHR.responseText);

Loading…
Cancel
Save