initforthe-roundabound 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2012 Initforthe Ltd
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,15 @@
1
+ = initforthe-roundabound
2
+
3
+ Some CoffeeScript surrounding Bootstrap's Carousel code to make it easier to implement carousels.
4
+
5
+ = How to use
6
+
7
+ Yes, we really should tell you how to use it. We'll get to that bit.
8
+
9
+ = Why roundabound?
10
+
11
+ http://www.youtube.com/watch?v=2ljFfL-mL70
12
+
13
+ = License
14
+
15
+ MIT
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+ begin
8
+ require 'rdoc/task'
9
+ rescue LoadError
10
+ require 'rdoc/rdoc'
11
+ require 'rake/rdoctask'
12
+ RDoc::Task = Rake::RDocTask
13
+ end
14
+
15
+ RDoc::Task.new(:rdoc) do |rdoc|
16
+ rdoc.rdoc_dir = 'rdoc'
17
+ rdoc.title = 'InitfortheRoundabound'
18
+ rdoc.options << '--line-numbers'
19
+ rdoc.rdoc_files.include('README.rdoc')
20
+ rdoc.rdoc_files.include('lib/**/*.rb')
21
+ end
22
+
23
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,56 @@
1
+ $(document).ready ->
2
+ $('.carousel').each ->
3
+ options = {}
4
+ options.interval = $(this).data('interval') if $(this).data('interval')
5
+ options.pause = $(this).data('pause') if $(this).data('pause')
6
+ $(this).carousel(options)
7
+
8
+ play = $('.carousel').find('[data-slide-play="1"]')
9
+ play.hide()
10
+
11
+ $('.carousel [data-slide-play]').on
12
+ click: (e) ->
13
+ e.preventDefault()
14
+ if $(this).attr('data-slide-play') is '0'
15
+ pause(this)
16
+ else
17
+ resume(this)
18
+
19
+ $('.carousel [data-slide]').on
20
+ click: (e) ->
21
+ pause(this)
22
+
23
+ $('.carousel [data-slide-to]').on
24
+ click: (e) ->
25
+ e.preventDefault()
26
+ pause(this)
27
+ select(this)
28
+
29
+ $('.carousel').on
30
+ slid: (e) ->
31
+ highlight($(e.target))
32
+
33
+ pause = (target) ->
34
+ carousel = $($(target).attr('href'))
35
+ carousel.carousel('pause')
36
+ carousel.find('[data-slide-play="1"]').show() # play
37
+ carousel.find('[data-slide-play="0"]').hide() # pause
38
+
39
+ resume = (target) ->
40
+ carousel = $($(target).attr('href'))
41
+ carousel.carousel('cycle')
42
+ carousel.find('[data-slide-play="1"]').hide() # play
43
+ carousel.find('[data-slide-play="0"]').show() # pause
44
+
45
+ select = (target) ->
46
+ carousel = $($(target).attr('href'))
47
+ pos = $(target).data('slide-to')
48
+ carousel.carousel(pos)
49
+
50
+ highlight = (carousel) ->
51
+ items = carousel.find('.item')
52
+ item = carousel.find('.item.active')[0]
53
+ which = $.inArray(item, items)
54
+
55
+ carousel.find('[data-slide-to]').removeClass('selected')
56
+ $(carousel.find('[data-slide-to]')[which]).addClass('selected')
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: initforthe-roundabound
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Tom Simnett
9
+ - Rob Holland
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2012-06-21 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: &70330460163600 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: 3.1.0
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *70330460163600
26
+ description: CoffeeScript helpers for using the Bootstrap Carousel.
27
+ email:
28
+ - tom@initforthe.com
29
+ - rob@initforthe.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - app/assets/javascripts/initforthe-roundabound.js
35
+ - MIT-LICENSE
36
+ - Rakefile
37
+ - README.rdoc
38
+ homepage: http://github.com/initforthe/initforthe-roundabound
39
+ licenses: []
40
+ post_install_message:
41
+ rdoc_options: []
42
+ require_paths:
43
+ - lib
44
+ required_ruby_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ required_rubygems_version: !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ requirements: []
57
+ rubyforge_project:
58
+ rubygems_version: 1.8.7
59
+ signing_key:
60
+ specification_version: 3
61
+ summary: CoffeeScript helpers for using the Bootstrap Carousel.
62
+ test_files: []