timeliner_rails 0.0.2 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- YjljMzYwOGZlMWNkNmFiMTliMGRmMzI2OGE3MjkzMDQ1YmY0OWFiNQ==
5
- data.tar.gz: !binary |-
6
- MGM0YTNmMTc2ODQ2MWI2MzNlMTQ1ZWU3NjRiODg0NDljMjdhMWM3Yg==
2
+ SHA1:
3
+ metadata.gz: d39506f1120893f0246bc4059cbe74247fe88909
4
+ data.tar.gz: 4c9aa62fe162665495af7bbac670851fd612fcad
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- YmUyNTg1NWUzNWRlODZjNWYxOTljOGIzMjNmMjdjNzMyMmZlMjBlZGYzM2Nk
10
- ZmJmMTdhMTVlMmMxNzVjNWQ4ZDA5Yjc1ZmRmNGUxMzVmOTQ5Mzg4MTI1ZjY4
11
- YmFlNzMwNjAyNjM2ZDY3YjlhMDVlNWNmZGJkZWViZWIyMDFlOTA=
12
- data.tar.gz: !binary |-
13
- M2VmOTk0M2Q3YTMyMzVkZjI4NjlmZTk0NDViOWIwNDg1MzkwY2RhNmM3NzI0
14
- YmI5ZjdhM2FjYWQyMWVmNTQzZDhhMmM1ZTU0NDliM2IxZTkzOTM0OTgxOGIw
15
- MzAyYWQ2OGU4ZmI3M2ZhMWMyNmUzNTk3OGQ5MzE4NjkwZDdkZjQ=
6
+ metadata.gz: e41fe34a45d3b113ce8981f3ceb47d4e50cbf6a38db549d0b57997f6feaa78d87fff5864cc123a95bd38ee38a9cd07d86b2490e1f6a77d3869f395d6f2be3d02
7
+ data.tar.gz: cea26c903bc5b7722ac3ff4b24ef4a8e1f2b6310f10ab7ee84c51b6f262955263ea37f78636582e6642022d4c2094ad983518fee2f5f62ddc80fb1f944b6621f
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # TimelinerRails
2
2
 
3
- timeliner_rails packages the []() jquery plugin (javascripts, stylesheets and images) for use with the rails 3.1+ asset pipeline.
3
+ timeliner_rails packages the [timeliner](https://github.com/technotarek/timeliner) jquery plugin
4
+ (javascripts, stylesheets and images) for use with the rails 3.1+ asset pipeline.
4
5
 
5
6
  ## Installation
6
7
 
@@ -8,7 +9,6 @@ Add this line to your application's Gemfile:
8
9
 
9
10
  gem 'timeliner_rails'
10
11
 
11
-
12
12
  ## Usage
13
13
 
14
14
  Add this line to your `application.js`:
@@ -1,58 +1,95 @@
1
1
  /*
2
2
  * Timeliner.js
3
- * @version 1.5.1
3
+ * @version 1.6.1
4
4
  * @copyright Tarek Anandan (http://www.technotarek.com)
5
5
  */
6
6
  ;(function($) {
7
7
 
8
- var settings;
9
- $.timeliner = function(options){
10
- // default plugin settings
11
- settings = jQuery.extend({
12
- timelineContainer: '#timelineContainer', // value: selector of the main element holding the timeline's content, default to #timelineContainer
13
- startState: 'closed', // value: closed | open, default to closed; sets whether the timeline is initially collapsed or fully expanded
14
- startOpen: [], // value: array of IDs of single timelineEvents, default to empty; sets the minor events that you want to display open by default on page load
15
- baseSpeed: 200, // value: numeric, default to 200; sets the base speed for animation of the event marker
16
- speed: 4, // value: numeric, defalut to 4; a multiplier applied to the base speed that sets the speed at which an event's conents are displayed and hidden
17
- fontOpen: '1.2em', // value: any valid CSS font-size value, defaults to 1em; sets the font size of an event after it is opened
18
- fontClosed: '1em', // value: any valid CSS font-size value, defaults to 1em; sets the font size of an event after it is closed
19
- expandAllText: '+ expand all', // value: string, sets the text of the expandAll selector after the timeline is fully collapsed
20
- collapseAllText: '- collapse all' // // value: string, sets the text of the expandAll selector after the timeline is fully expanded
21
- }, options);
22
-
23
- $(document).ready(function() {
24
-
25
- function openEvent(eventHeading,eventBody) {
26
- $(eventHeading)
27
- .removeClass('closed')
28
- .addClass('open')
29
- .animate({ fontSize: settings.fontOpen }, settings.baseSpeed);
30
- $(eventBody).show(settings.speed*settings.baseSpeed);
31
- }
32
-
33
- function closeEvent(eventHeading,eventBody) {
34
- $(eventHeading)
35
- .animate({ fontSize: settings.fontClosed }, 0)
36
- .removeClass('open')
37
- .addClass('closed');
38
- $(eventBody).hide(settings.speed*settings.baseSpeed);
39
- }
8
+ $.timeliner = function(options) {
9
+ if ($.timeliners == null) {
10
+ $.timeliners = { options: [] };
11
+ $.timeliners.options.push(options);
12
+ }
13
+ else {
14
+ $.timeliners.options.push(options);
15
+ }
16
+ $(document).ready(function() {
17
+ for (var i=0; i<$.timeliners.options.length; i++) {
18
+ startTimeliner($.timeliners.options[i]);
19
+ }
20
+ });
21
+ }
22
+
23
+ function startTimeliner(options){
24
+ var settings = {
25
+ timelineContainer: options['timelineContainer'] || '#timelineContainer', // value: selector of the main element holding the timeline's content, default to #timelineContainer
26
+ startState: options['startState'] || 'closed', // value: closed | open,
27
+ // default to closed; sets whether the timeline is
28
+ // initially collapsed or fully expanded
29
+ startOpen: options['startOpen'] || [], // value: array of IDs of
30
+ // single timelineEvents, default to empty; sets
31
+ // the minor events that you want to display open
32
+ // by default on page load
33
+ baseSpeed: options['baseSpeed'] || 200, // value: numeric, default to
34
+ // 200; sets the base speed for animation of the
35
+ // event marker
36
+ speed: options['speed'] || 4, // value: numeric, defalut to 4; a
37
+ // multiplier applied to the base speed that sets
38
+ // the speed at which an event's conents are
39
+ // displayed and hidden
40
+ fontOpen: options['fontOpen'] || '1.2em', // value: any valid CSS
41
+ // font-size value, defaults to 1em; sets the font
42
+ // size of an event after it is opened
43
+ fontClosed: options['fontClosed'] || '1em', // value: any valid CSS
44
+ // font-size value, defaults to 1em; sets the font
45
+ // size of an event after it is closed
46
+ expandAllText: options ['expandAllText'] || '+ expand all', // value:
47
+ // string, sets the text of the expandAll selector
48
+ // after the timeline is fully collapsed
49
+ collapseAllText: options['collapseAllText'] || '- collapse all' // // value:
50
+ // string, sets the text of the expandAll selector
51
+ // after the timeline is fully expanded
52
+ };
53
+
54
+ function openEvent(eventHeading,eventBody) {
55
+ $(eventHeading)
56
+ .removeClass('closed')
57
+ .addClass('open')
58
+ .animate({ fontSize: settings.fontOpen }, settings.baseSpeed);
59
+ $(eventBody).show(settings.speed*settings.baseSpeed);
60
+ }
61
+
62
+ function closeEvent(eventHeading,eventBody) {
63
+ $(eventHeading)
64
+ .animate({ fontSize: settings.fontClosed }, 0)
65
+ .removeClass('open')
66
+ .addClass('closed');
67
+ $(eventBody).hide(settings.speed*settings.baseSpeed);
68
+ }
69
+
70
+
71
+ if ($(settings.timelineContainer).data('started')) {
72
+ return; // we already initialized this timelineContainer
73
+ } else {
74
+ $(settings.timelineContainer).data('started', true);
75
+ $(settings.timelineContainer+" "+".expandAll").html(settings.expandAllText);
76
+ $(settings.timelineContainer+" "+".collapseAll").html(settings.collapseAllText);
40
77
 
41
78
  // If startState option is set to closed, hide all the events; else, show fully expanded upon load
42
79
  if(settings.startState==='closed')
43
80
  {
44
81
  // Close all items
45
- $(".timelineEvent").hide();
82
+ $(settings.timelineContainer+" "+".timelineEvent").hide();
46
83
 
47
84
  // show startOpen events
48
85
  $.each($(settings.startOpen), function(index, value) {
49
- openEvent($(value).parent(".timelineMinor").find("dt a"),$(value));
86
+ openEvent($(value).parent(settings.timelineContainer+" "+".timelineMinor").find("dt a"),$(value));
50
87
  });
51
88
 
52
89
  }else{
53
90
 
54
91
  // Open all items
55
- openEvent($(".timelineMinor dt a"),$(".timelineEvent"));
92
+ openEvent($(settings.timelineContainer+" "+".timelineMinor dt a"),$(settings.timelineContainer+" "+".timelineEvent"));
56
93
 
57
94
  }
58
95
 
@@ -98,7 +135,7 @@
98
135
  });
99
136
 
100
137
  // All Markers/Events
101
- $(".expandAll").click(function()
138
+ $(settings.timelineContainer+" "+".expandAll").click(function()
102
139
  {
103
140
  if($(this).hasClass('expanded'))
104
141
  {
@@ -113,6 +150,6 @@
113
150
 
114
151
  }
115
152
  });
116
- });
153
+ }
117
154
  };
118
155
  })(jQuery);
@@ -56,11 +56,16 @@ a img {
56
56
 
57
57
  p {
58
58
  margin:0 0 10px 8px;
59
- font-size:1.3em;
59
+ font-size:1.5em;
60
60
  font-weight:400;
61
61
  line-height:1.6em;
62
62
  }
63
63
 
64
+ .lead {
65
+ font-size:2em;
66
+ margin-bottom:40px;
67
+ }
68
+
64
69
  .clear {
65
70
  clear:both;
66
71
  line-height:0;
@@ -69,7 +74,7 @@ p {
69
74
 
70
75
  /* ============ TIMELINE ============= */
71
76
 
72
- div#timelineContainer {
77
+ .timelineContainer {
73
78
  border-left:2px solid #ccc;
74
79
  margin:20px auto;
75
80
  width:900px;
@@ -1,3 +1,3 @@
1
1
  module TimelinerRails
2
- VERSION = "0.0.2"
2
+ VERSION = "1.6.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timeliner_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luisa Lima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-30 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -42,14 +42,14 @@ dependencies:
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: This gem packages the Timeliner.js assets (javascripts, stylesheets,
@@ -84,20 +84,19 @@ require_paths:
84
84
  - lib
85
85
  required_ruby_version: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - '>='
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ! '>='
92
+ - - '>='
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
96
  rubyforge_project:
97
- rubygems_version: 2.2.0
97
+ rubygems_version: 2.3.0
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: This gem packages the Timeliner.js assets (javascripts, stylesheets, and
101
101
  images) for the Rails 3.1+ asset pipeline.
102
102
  test_files: []
103
- has_rdoc: