muruca_widgets 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -44,8 +44,8 @@ function TimelineRunner(params, tl_data) {
|
|
44
44
|
new_band.date = Timeline.DateTime.parseIso8601DateTime(bands[band].date || '1900-01-01');
|
45
45
|
new_band.theme = this.theme;
|
46
46
|
new_band.layout = (bands[band].layout || 'original');
|
47
|
-
if(band.syncWith) { new_band.syncWith = bands[band].syncWith; }
|
48
|
-
if(band.highlight) { new_band.highlight = bands[band].highlight; }
|
47
|
+
if(bands[band].syncWith) { new_band.syncWith = bands[band].syncWith; }
|
48
|
+
if(bands[band].highlight) { new_band.highlight = bands[band].highlight; }
|
49
49
|
this.bands.push(Timeline.createBandInfo(new_band));
|
50
50
|
}
|
51
51
|
return this.bands;
|
@@ -8,21 +8,21 @@ module TimelineHelper
|
|
8
8
|
end
|
9
9
|
|
10
10
|
# Create a new timeline. Example:
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
11
|
+
# timeline('tl',
|
12
|
+
# theme => 'ClassicTheme'
|
13
|
+
# startDate => '1900-01-01'
|
14
|
+
# stopDate => '2000-01-01'
|
15
|
+
# url => '.'
|
16
|
+
# bands => [{
|
17
|
+
# intervalUnit => 'DECADE',
|
18
|
+
# intervalPixels => 100,
|
19
|
+
# date => '1900-01-01',
|
20
|
+
# layout => 'original'
|
21
|
+
# # syncWith => 0,
|
22
|
+
# # highlight => true
|
23
|
+
# }],
|
24
|
+
# data => { ...timeline data... }
|
25
|
+
# )
|
26
26
|
#
|
27
27
|
# You can set the :only_with_data option if you want no timeline for an
|
28
28
|
# empty dataset
|
data/lib/timeline.rb
CHANGED
@@ -6,12 +6,12 @@ class Timeline
|
|
6
6
|
|
7
7
|
# The main options that can be given to the timeline are
|
8
8
|
#
|
9
|
-
# [*config*]
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
# [*data*]
|
14
|
-
#
|
9
|
+
# [*config*] The configuration for timeline, including the bands configuration.
|
10
|
+
# This will be directly passed on to timline.js, see there for more
|
11
|
+
# documentation. If no :bands option is given, a default band
|
12
|
+
# is created for the timeline.
|
13
|
+
# [*data*] A TimelineSource object containing the data for this timeline OR a
|
14
|
+
# hash with the options to create the TimelineSource
|
15
15
|
def initialize(options)
|
16
16
|
raise(ArgumentError, 'Expecting an option hash here.') unless(options.is_a?(Hash))
|
17
17
|
options.to_options!
|
data/lib/timeline_source.rb
CHANGED
@@ -7,48 +7,48 @@ class TimelineSource
|
|
7
7
|
# Create a new timeline source. There are several ways to fill this with data:
|
8
8
|
#
|
9
9
|
# [*raw_data*] The most straightforward method is to pass the :raw_data option which
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
10
|
+
# must contain an array containing each
|
11
|
+
# event on the timeline as a hash. Each event must at least contain the
|
12
|
+
# :start (start date), :title (Event title). Other than that, all,
|
13
|
+
# options that are valid for the simile timeline events will be accepted.
|
14
14
|
#
|
15
15
|
# [*sources*] The :sources option must contain a list of ActiveSource objects.
|
16
|
-
#
|
16
|
+
# By default this will try to take the dcns:date property from all objects.
|
17
17
|
#
|
18
18
|
# [*source_finder*] Alternatively, you may pass the :source_finder option. This option should
|
19
|
-
#
|
19
|
+
# contain a hash that will be passed into ActiveSource.find(:all)
|
20
20
|
#
|
21
21
|
# Other options that can be used to configure the working of the timeline
|
22
22
|
# data source are:
|
23
23
|
#
|
24
|
-
# [*start_property*]
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
24
|
+
# [*start_property*] Only valid with the :sources or :source_finder option.
|
25
|
+
# The class will try to retrieve the start date from this property. If an
|
26
|
+
# ISO 8601 duration is found in the field a duration event is created (unless
|
27
|
+
# an :end_property had been explicitly set). [default: dcns:date]
|
28
28
|
#
|
29
|
-
# [*end_property*]
|
30
|
-
#
|
29
|
+
# [*end_property*] Take the end date of each event from this property. This will disable the
|
30
|
+
# automatic handling of ISO 8601 durations (see :start_property)
|
31
31
|
#
|
32
|
-
# [*title_property*]
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
32
|
+
# [*title_property*] Take the event title from this property. If the title is not found, the
|
33
|
+
# system will try the dcns:label property and if that fails use the
|
34
|
+
# local part of the source URL. This is only valid with the :sources or
|
35
|
+
# :source_finder options. [default: dcns:title]
|
36
36
|
#
|
37
|
-
# [*description_property*]
|
38
|
-
#
|
39
|
-
#
|
37
|
+
# [*description_property*] Take the description of the event from this field. If not found,
|
38
|
+
# the title value is used. This is only valid with the :sources or
|
39
|
+
# :source_finder options. [default: dcns:abstract]
|
40
40
|
#
|
41
|
-
# [*link_property*]
|
42
|
-
#
|
41
|
+
# [*link_property*] Property to take the link from. By default a link to the element's own URL is created.
|
42
|
+
# This is only valid with the :sources or :source_finder options.
|
43
43
|
#
|
44
|
-
# [*color*]
|
44
|
+
# [*color*] Default color entry for the events. [default: 'blue']
|
45
45
|
#
|
46
|
-
# [*text_color]
|
46
|
+
# [*text_color*] Default text color for the events [default: 'black']
|
47
47
|
#
|
48
|
-
# [*start_year*]
|
49
|
-
#
|
48
|
+
# [*start_year*] Year that the timeline starts in. If not given, this will automatically be
|
49
|
+
# calculated from the dataset
|
50
50
|
#
|
51
|
-
# [*final_year*]
|
51
|
+
# [*final_year*] Last year of the timeline. See :start_year
|
52
52
|
def initialize(options)
|
53
53
|
@events = []
|
54
54
|
@options = process_options(options)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muruca_widgets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Hahn
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-03-08 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|