carousel 1.0.0 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 201328851306758b7da39746e21e61af1bc91e4f00c71c305dc3414327faec53
4
+ data.tar.gz: df19b6b3909a7cbe25c526983ce2441728a941b9466d37ecf8f3f719b508122a
5
+ SHA512:
6
+ metadata.gz: 9aadf122100899880ca2c40696793323a63aea301c280d9f07d413fc9c5d822883ff3a5fcf3d8679300326e2f59459fc59a879618ad5928718e24316ec07a2f3
7
+ data.tar.gz: 7f5053570f7256cc0dfa9c416c5e5674bc8ae37fe51492c0ba4e780435e2cf93aa5755ac350e41f299b093234edb489b3311558b6249c0120336265131aaaaeb
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ > ⚠️ **DEPRECATED**: carousel is no longer maintained. Modern Rails uses Sprockets/Propshaft/importmap/jsbundling-rails or webpacker; per-gem CoffeeScript/SCSS asset injection is no longer the preferred pattern. This is the final release.
2
+
1
3
  Carousel
2
4
  ========
3
5
 
@@ -113,5 +115,5 @@ Sub-Licenses
113
115
  ------------
114
116
 
115
117
  Portions of this code were written by
116
- "Leandro Vieira Pinho":http://leandrovieira.com. These portions are distributed
117
- under the CCAttribution-Share-Alike 2.5 (Brazil) license.
118
+ [Leandro Vieira Pinho](http://leandrovieira.com). These portions are
119
+ distributed under the CCAttribution-Share-Alike 2.5 (Brazil) license.
data/carousel.gemspec CHANGED
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: carousel 1.1.3 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "carousel"
8
- s.version = "1.0.0"
9
+ s.version = "1.1.3"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Tim Morgan"]
12
- s.date = "2012-04-20"
14
+ s.date = "2014-12-20"
13
15
  s.description = "Adds CoffeeScript and SCSS files to your Rails apps allowing you to easily create an Ajax-powered Carousel."
14
16
  s.email = "rubygems@timothymorgan.info"
15
17
  s.extra_rdoc_files = [
@@ -34,35 +36,43 @@ Gem::Specification.new do |s|
34
36
  ]
35
37
  s.homepage = "http://github.com/RISCfuture/carousel"
36
38
  s.licenses = ["MIT"]
37
- s.require_paths = ["lib"]
38
- s.rubygems_version = "1.8.21"
39
- s.summary = "Simple image carousels in your Rails apps."
39
+ s.rubygems_version = "2.4.5"
40
+ s.summary = "[DEPRECATED] Simple image carousels in your Rails apps."
41
+ s.post_install_message = <<~MSG
42
+
43
+ ⚠️ DEPRECATED: carousel is no longer maintained.
44
+
45
+ No longer maintained. Modern Rails uses Sprockets/Propshaft/importmap/jsbundling-rails or webpacker; per-gem CoffeeScript/SCSS asset injection is no longer the preferred pattern.
46
+
47
+ This is the final release. No further updates are planned.
48
+
49
+ MSG
40
50
 
41
51
  if s.respond_to? :specification_version then
42
- s.specification_version = 3
52
+ s.specification_version = 4
43
53
 
44
54
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
45
55
  s.add_runtime_dependency(%q<rails>, [">= 0"])
46
- s.add_runtime_dependency(%q<compass>, [">= 0"])
47
56
  s.add_runtime_dependency(%q<jquery-rails>, [">= 0"])
48
57
  s.add_development_dependency(%q<yard>, [">= 0"])
58
+ s.add_development_dependency(%q<redcarpet>, [">= 0"])
49
59
  s.add_development_dependency(%q<bundler>, [">= 0"])
50
60
  s.add_development_dependency(%q<jeweler>, [">= 0"])
51
61
  s.add_development_dependency(%q<paperclip>, [">= 0"])
52
62
  else
53
63
  s.add_dependency(%q<rails>, [">= 0"])
54
- s.add_dependency(%q<compass>, [">= 0"])
55
64
  s.add_dependency(%q<jquery-rails>, [">= 0"])
56
65
  s.add_dependency(%q<yard>, [">= 0"])
66
+ s.add_dependency(%q<redcarpet>, [">= 0"])
57
67
  s.add_dependency(%q<bundler>, [">= 0"])
58
68
  s.add_dependency(%q<jeweler>, [">= 0"])
59
69
  s.add_dependency(%q<paperclip>, [">= 0"])
60
70
  end
61
71
  else
62
72
  s.add_dependency(%q<rails>, [">= 0"])
63
- s.add_dependency(%q<compass>, [">= 0"])
64
73
  s.add_dependency(%q<jquery-rails>, [">= 0"])
65
74
  s.add_dependency(%q<yard>, [">= 0"])
75
+ s.add_dependency(%q<redcarpet>, [">= 0"])
66
76
  s.add_dependency(%q<bundler>, [">= 0"])
67
77
  s.add_dependency(%q<jeweler>, [">= 0"])
68
78
  s.add_dependency(%q<paperclip>, [">= 0"])
@@ -1,4 +1,25 @@
1
+ # An image carousel. Loads images from an Ajax endpoint and displays them in a
2
+ # grid. Clicking an image reveals it in a lightbox. The carousel uses infinite
3
+ # scrolling.
4
+ #
5
+ # The endpoint must return data in a specific format; see the README.md file.
6
+ #
7
+ # Use the `$(...).carousel(...)` method for a more jQuery-like syntax.
8
+ #
1
9
  class Carousel
10
+
11
+ # Creates a new carousel manager.
12
+ #
13
+ # @param [jQuery element array] element The element to render the carousel
14
+ # into.
15
+ # @param [String] url The Ajax JSON endpoint that returns image metadata.
16
+ # @param [String] orientation Either 'horizontal' or 'vertical'.
17
+ # @param [Object] options Additional options.
18
+ # @option options [Boolean] captions (true) Whether to display captions next
19
+ # to images. (Captions are always displayed in lightboxes.)
20
+ # @option options [Boolean] lightboxes (true) Whether to enable lightbox
21
+ # functionality.
22
+ #
2
23
  constructor: (@element, @url, @orientation, @options={}) ->
3
24
  @options = $.extend({ captions: true, lightboxes: true }, @options)
4
25
  @element.addClass "carousel-#{@orientation}"
@@ -7,6 +28,8 @@ class Carousel
7
28
  this.refresh()
8
29
  this.setScroll()
9
30
 
31
+ # Reloads images from the endpoint.
32
+ #
10
33
  refresh: ->
11
34
  this.clear()
12
35
  $.ajax @url,
@@ -16,10 +39,13 @@ class Carousel
16
39
  success: (data) =>
17
40
  this.populate data
18
41
 
42
+ # Empties this carousel of images.
43
+ #
19
44
  clear: ->
20
45
  @element.find('>li').remove()
21
46
  @data = []
22
47
 
48
+ # @private
23
49
  populate: (data) ->
24
50
  @data = @data.concat(data) # must clone it
25
51
 
@@ -45,30 +71,41 @@ class Carousel
45
71
 
46
72
  this.loadNextPage() if this.noScroll() and data.length > 0
47
73
 
74
+ # Replaces the contents of this carousel with an error message.
75
+ #
76
+ # @param [String] error The error message.
48
77
  setError: (error) ->
49
78
  this.clear()
50
79
  li = $('<li/>').addClass('center').appendTo @element
51
80
  $('<p/>').addClass('error').text(error).appendTo li
52
81
 
82
+ # Replaces the contents of this carousel with a message.
83
+ #
84
+ # @param [String] note The message.
85
+ #
53
86
  setNote: (note) ->
54
87
  this.clear()
55
88
  li = $('<li/>').addClass('center').appendTo @element
56
89
  $('<p/>').addClass('note').text(note).appendTo li
57
90
 
91
+ # @private
58
92
  setScroll: ->
59
93
  @element.scroll =>
60
94
  this.loadNextPage() if this.isAtEnd()
61
95
 
96
+ # @private
62
97
  noScroll: ->
63
98
  switch @orientation
64
99
  when 'horizontal' then @element.width() == @element[0].scrollWidth
65
100
  when 'vertical' then @element.height() == @element[0].scrollHeight
66
101
 
102
+ # @private
67
103
  isAtEnd: ->
68
104
  switch @orientation
69
105
  when 'horizontal' then @element.scrollLeft() == @element[0].scrollWidth - @element.width()
70
- when 'vertical' then @element.scrollTop() == @element[0].scrollheight - @element.height()
106
+ when 'vertical' then @element.scrollTop() == @element[0].scrollHeight - @element.height()
71
107
 
108
+ # @private
72
109
  loadNextPage: ->
73
110
  return if @data.length == 0
74
111
  $.ajax @url,
@@ -80,5 +117,12 @@ class Carousel
80
117
  this.populate data
81
118
 
82
119
  $.fn.extend
120
+
121
+ # Renders a new carousel into the target.
122
+ # @param [String] url The Ajax JSON endpoint that returns image metadata.
123
+ # @param [String] orientation Either 'horizontal' or 'vertical'.
124
+ # @param [Object] options Additional options to pass to {Carousel}.
125
+ # @return [Carousel] The new carousel manager.
126
+ #
83
127
  carousel: (url, orient, options={}) ->
84
128
  new Carousel(this, url, orient, options)
@@ -1,13 +1,11 @@
1
1
  @import "vars";
2
- @import "compass/css3/box";
3
- @import "compass/css3/border-radius";
4
2
 
5
3
  @mixin carousel {
6
- @include border-radius(5px);
4
+ border-radius: 5px;
7
5
 
8
6
  margin-top: 1em;
9
7
 
10
- >li {
8
+ &>li {
11
9
  margin: 0.5em;
12
10
  width: 140px;
13
11
  }
@@ -20,10 +18,14 @@
20
18
 
21
19
  ul.carousel-horizontal {
22
20
  @include carousel;
23
- @include display-box;
24
- @include box-orient(horizontal);
21
+ display: flex;
22
+ flex-flow: row nowrap;
25
23
 
26
24
  overflow-x: auto;
25
+
26
+ &>li {
27
+ flex: 0 0 auto;
28
+ }
27
29
  }
28
30
 
29
31
  ul.carousel-vertical {
metadata CHANGED
@@ -1,126 +1,110 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carousel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.1.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tim Morgan
9
- autorequire:
10
8
  bindir: bin
11
9
  cert_chain: []
12
- date: 2012-04-21 00:00:00.000000000 Z
10
+ date: 2014-12-20 00:00:00.000000000 Z
13
11
  dependencies:
14
12
  - !ruby/object:Gem::Dependency
15
13
  name: rails
16
14
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
15
  requirements:
19
- - - ! '>='
16
+ - - ">="
20
17
  - !ruby/object:Gem::Version
21
18
  version: '0'
22
19
  type: :runtime
23
20
  prerelease: false
24
21
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
22
  requirements:
27
- - - ! '>='
23
+ - - ">="
28
24
  - !ruby/object:Gem::Version
29
25
  version: '0'
30
26
  - !ruby/object:Gem::Dependency
31
- name: compass
27
+ name: jquery-rails
32
28
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
29
  requirements:
35
- - - ! '>='
30
+ - - ">="
36
31
  - !ruby/object:Gem::Version
37
32
  version: '0'
38
33
  type: :runtime
39
34
  prerelease: false
40
35
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
36
  requirements:
43
- - - ! '>='
37
+ - - ">="
44
38
  - !ruby/object:Gem::Version
45
39
  version: '0'
46
40
  - !ruby/object:Gem::Dependency
47
- name: jquery-rails
41
+ name: yard
48
42
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
43
  requirements:
51
- - - ! '>='
44
+ - - ">="
52
45
  - !ruby/object:Gem::Version
53
46
  version: '0'
54
- type: :runtime
47
+ type: :development
55
48
  prerelease: false
56
49
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
50
  requirements:
59
- - - ! '>='
51
+ - - ">="
60
52
  - !ruby/object:Gem::Version
61
53
  version: '0'
62
54
  - !ruby/object:Gem::Dependency
63
- name: yard
55
+ name: redcarpet
64
56
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
57
  requirements:
67
- - - ! '>='
58
+ - - ">="
68
59
  - !ruby/object:Gem::Version
69
60
  version: '0'
70
61
  type: :development
71
62
  prerelease: false
72
63
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
64
  requirements:
75
- - - ! '>='
65
+ - - ">="
76
66
  - !ruby/object:Gem::Version
77
67
  version: '0'
78
68
  - !ruby/object:Gem::Dependency
79
69
  name: bundler
80
70
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
71
  requirements:
83
- - - ! '>='
72
+ - - ">="
84
73
  - !ruby/object:Gem::Version
85
74
  version: '0'
86
75
  type: :development
87
76
  prerelease: false
88
77
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
78
  requirements:
91
- - - ! '>='
79
+ - - ">="
92
80
  - !ruby/object:Gem::Version
93
81
  version: '0'
94
82
  - !ruby/object:Gem::Dependency
95
83
  name: jeweler
96
84
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
85
  requirements:
99
- - - ! '>='
86
+ - - ">="
100
87
  - !ruby/object:Gem::Version
101
88
  version: '0'
102
89
  type: :development
103
90
  prerelease: false
104
91
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
92
  requirements:
107
- - - ! '>='
93
+ - - ">="
108
94
  - !ruby/object:Gem::Version
109
95
  version: '0'
110
96
  - !ruby/object:Gem::Dependency
111
97
  name: paperclip
112
98
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
99
  requirements:
115
- - - ! '>='
100
+ - - ">="
116
101
  - !ruby/object:Gem::Version
117
102
  version: '0'
118
103
  type: :development
119
104
  prerelease: false
120
105
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
106
  requirements:
123
- - - ! '>='
107
+ - - ">="
124
108
  - !ruby/object:Gem::Version
125
109
  version: '0'
126
110
  description: Adds CoffeeScript and SCSS files to your Rails apps allowing you to easily
@@ -149,29 +133,31 @@ files:
149
133
  homepage: http://github.com/RISCfuture/carousel
150
134
  licenses:
151
135
  - MIT
152
- post_install_message:
136
+ metadata: {}
137
+ post_install_message: |2+
138
+
139
+ ⚠️ DEPRECATED: carousel is no longer maintained.
140
+
141
+ No longer maintained. Modern Rails uses Sprockets/Propshaft/importmap/jsbundling-rails or webpacker; per-gem CoffeeScript/SCSS asset injection is no longer the preferred pattern.
142
+
143
+ This is the final release. No further updates are planned.
144
+
153
145
  rdoc_options: []
154
146
  require_paths:
155
147
  - lib
156
148
  required_ruby_version: !ruby/object:Gem::Requirement
157
- none: false
158
149
  requirements:
159
- - - ! '>='
150
+ - - ">="
160
151
  - !ruby/object:Gem::Version
161
152
  version: '0'
162
- segments:
163
- - 0
164
- hash: 2934254892831708062
165
153
  required_rubygems_version: !ruby/object:Gem::Requirement
166
- none: false
167
154
  requirements:
168
- - - ! '>='
155
+ - - ">="
169
156
  - !ruby/object:Gem::Version
170
157
  version: '0'
171
158
  requirements: []
172
- rubyforge_project:
173
- rubygems_version: 1.8.23
174
- signing_key:
175
- specification_version: 3
176
- summary: Simple image carousels in your Rails apps.
159
+ rubygems_version: 4.0.11
160
+ specification_version: 4
161
+ summary: "[DEPRECATED] Simple image carousels in your Rails apps."
177
162
  test_files: []
163
+ ...