From c8f7ab56ff42bb66580942d1c8040324189e1381 Mon Sep 17 00:00:00 2001 From: Rufus Pollock Date: Sat, 24 Aug 2013 13:25:28 +0100 Subject: [PATCH] [#316,timeline][s]: complete upgrade to v2.25 of timelinejs with support for BC dates <= 10k BC. --- _includes/recline-deps.html | 4 ++-- docs/tutorial-views.markdown | 4 ++-- test/index.html | 4 ++-- test/view.timeline.test.js | 9 ++++++++- vendor/timeline/js/timeline.js | 10 ++++++++-- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/_includes/recline-deps.html b/_includes/recline-deps.html index ca6de2ce..2f4b241a 100644 --- a/_includes/recline-deps.html +++ b/_includes/recline-deps.html @@ -8,7 +8,7 @@ - + @@ -36,7 +36,7 @@ - + diff --git a/docs/tutorial-views.markdown b/docs/tutorial-views.markdown index 3aab9627..f8d4a916 100644 --- a/docs/tutorial-views.markdown +++ b/docs/tutorial-views.markdown @@ -248,11 +248,11 @@ First, add the additional dependencies for the timeline view. The timeline is bu {% highlight html %} - + - + {% endhighlight %} Now, create a new div for the map (must have an explicit height for the timeline to render): diff --git a/test/index.html b/test/index.html index 34f9b026..1dc22ed8 100644 --- a/test/index.html +++ b/test/index.html @@ -4,7 +4,7 @@ Qunit Tests - + @@ -26,7 +26,7 @@ - + diff --git a/test/view.timeline.test.js b/test/view.timeline.test.js index b57b8757..12850279 100644 --- a/test/view.timeline.test.js +++ b/test/view.timeline.test.js @@ -37,7 +37,13 @@ test('extract dates and timelineJSON', function () { }); test('render etc', function () { - var dataset = Fixture.getDataset(); + var dataset = new recline.Model.Dataset({ + records: [ + {'Date': '-10000', 'title': 'first'}, + {'Date': '2012-03-20', 'title': 'second'}, + {'Date': '2012-03-25', 'title': 'third'} + ] + }); var view = new recline.View.Timeline({ model: dataset }); @@ -63,6 +69,7 @@ test('_parseDate', function () { [ '1914-08-01T08:00', '1914,08,01,08,00' ], [ '03-20-1914', '03/20/1914' ], [ '20/03/1914', '20/03/1914' ], + [ '-10000', '-10000' ], [ null, null ] ]; _.each(testData, function(item) { diff --git a/vendor/timeline/js/timeline.js b/vendor/timeline/js/timeline.js index a64dea2b..4c7745aa 100644 --- a/vendor/timeline/js/timeline.js +++ b/vendor/timeline/js/timeline.js @@ -7300,7 +7300,13 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') { createConfig(c); createStructure(); - if (type.of(_data) == "string") { + // FIX + // Current is + // if (type.of(_data) == "string") { + // BUT surely should just be + // type.of(_data) !== null + // OR - should not allow _data as an argument + if (type.of(_data) !== null) { config.source = _data; } @@ -10006,4 +10012,4 @@ if (typeof VMM.Timeline !== 'undefined' && typeof VMM.Timeline.DataObj == 'undef }; -} \ No newline at end of file +}