From 2adc2138ef5060fecd41e05968149b4cbcbae9fd Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sat, 24 Aug 2013 13:14:07 +0100 Subject: [PATCH] [#316,timeline][s]: upgrade timelinejs vendor lib to v2.25 for better date extents (need to patch again to get working). --- vendor/timeline/{2.24 => 2.25}/LICENSE | 0 .../timeline/{2.24 => 2.25}/css/loading.gif | Bin .../timeline/{2.24 => 2.25}/css/timeline.css | 0 .../timeline/{2.24 => 2.25}/css/timeline.png | Bin .../{2.24 => 2.25}/css/timeline@2x.png | Bin vendor/timeline/{2.24 => 2.25}/js/timeline.js | 30 ++++++++++++++---- 6 files changed, 23 insertions(+), 7 deletions(-) rename vendor/timeline/{2.24 => 2.25}/LICENSE (100%) rename vendor/timeline/{2.24 => 2.25}/css/loading.gif (100%) rename vendor/timeline/{2.24 => 2.25}/css/timeline.css (100%) rename vendor/timeline/{2.24 => 2.25}/css/timeline.png (100%) rename vendor/timeline/{2.24 => 2.25}/css/timeline@2x.png (100%) rename vendor/timeline/{2.24 => 2.25}/js/timeline.js (99%) diff --git a/vendor/timeline/2.24/LICENSE b/vendor/timeline/2.25/LICENSE similarity index 100% rename from vendor/timeline/2.24/LICENSE rename to vendor/timeline/2.25/LICENSE diff --git a/vendor/timeline/2.24/css/loading.gif b/vendor/timeline/2.25/css/loading.gif similarity index 100% rename from vendor/timeline/2.24/css/loading.gif rename to vendor/timeline/2.25/css/loading.gif diff --git a/vendor/timeline/2.24/css/timeline.css b/vendor/timeline/2.25/css/timeline.css similarity index 100% rename from vendor/timeline/2.24/css/timeline.css rename to vendor/timeline/2.25/css/timeline.css diff --git a/vendor/timeline/2.24/css/timeline.png b/vendor/timeline/2.25/css/timeline.png similarity index 100% rename from vendor/timeline/2.24/css/timeline.png rename to vendor/timeline/2.25/css/timeline.png diff --git a/vendor/timeline/2.24/css/timeline@2x.png b/vendor/timeline/2.25/css/timeline@2x.png similarity index 100% rename from vendor/timeline/2.24/css/timeline@2x.png rename to vendor/timeline/2.25/css/timeline@2x.png diff --git a/vendor/timeline/2.24/js/timeline.js b/vendor/timeline/2.25/js/timeline.js similarity index 99% rename from vendor/timeline/2.24/js/timeline.js rename to vendor/timeline/2.25/js/timeline.js index 4ac28981..a64dea2b 100644 --- a/vendor/timeline/2.24/js/timeline.js +++ b/vendor/timeline/2.25/js/timeline.js @@ -1277,6 +1277,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') { }; if (type.of(d) == "date") { + trace("DEBUG THIS, ITs A DATE"); date = d; } else { date = new Date(0, 0, 1, 0, 0, 0, 0); @@ -1398,7 +1399,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') { p.second = true; p.millisecond = true; } - } else if (d.length <= 5) { + } else if (d.length <= 8) { p.year = true; date.setFullYear(parseInt(d, 10)); date.setMonth(0); @@ -1446,6 +1447,13 @@ if(typeof VMM != 'undefined' && typeof VMM.Date == 'undefined') { } else { date = new Date(Date.parse(d)); + p.year = true; + p.month = true; + p.day = true; + p.hour = true; + p.minute = true; + p.second = true; + p.millisecond = true; } } else { p.year = true; @@ -2899,6 +2907,11 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { }, + errorTimeOutOembed: function(tweet) { + trace("TWITTER JSON ERROR TIMEOUT " + tweet.mid); + VMM.attachElement("#"+tweet.id.toString(), VMM.MediaElement.loadingmessage("Still waiting on Twitter: " + tweet.mid) ); + }, + pushQue: function() { if (VMM.master_config.twitter.que.length > 0) { VMM.ExternalAPI.twitter.create(VMM.master_config.twitter.que[0], VMM.ExternalAPI.twitter.pushQue); @@ -2908,7 +2921,9 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { getOEmbed: function(tweet, callback) { - var the_url = "http://api.twitter.com/1/statuses/oembed.json?id=" + tweet.mid + "&omit_script=true&include_entities=true&callback=?"; + var the_url = "http://api.twitter.com/1/statuses/oembed.json?id=" + tweet.mid + "&omit_script=true&include_entities=true&callback=?", + twitter_timeout = setTimeout(VMM.ExternalAPI.twitter.errorTimeOutOembed, VMM.master_config.timers.api, tweet); + //callback_timeout= setTimeout(callback, VMM.master_config.timers.api, tweet); VMM.getJSON(the_url, function(d) { var twit = "", @@ -2936,9 +2951,13 @@ if(typeof VMM != 'undefined' && typeof VMM.ExternalAPI == 'undefined') { .error(function(jqXHR, textStatus, errorThrown) { trace("TWITTER error"); trace("TWITTER ERROR: " + textStatus + " " + jqXHR.responseText); + clearTimeout(twitter_timeout); + //clearTimeout(callback_timeout); VMM.attachElement("#"+tweet.id, VMM.MediaElement.loadingmessage("ERROR LOADING TWEET " + tweet.mid) ); }) .success(function(d) { + clearTimeout(twitter_timeout); + clearTimeout(callback_timeout); callback(); }); @@ -7281,10 +7300,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { createConfig(c); createStructure(); - // surely this should just be type.of(_data) !== null - // if (type.of(_data) == "string") { - // OR - should not use _data as an argument - if (type.of(_data) != null) { + if (type.of(_data) == "string") { config.source = _data; } @@ -9990,4 +10006,4 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef }; -} +} \ No newline at end of file