ios-checkboxes 0.1.3 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,11 @@
1
+ 0.2.1 - Fri 25 May 2012
2
+ ========================================
3
+ - Updated to support Rails 3.2
4
+ - No dependency on compass
5
+
6
+
7
+ ... TODO: add missing ...
8
+
1
9
  0.1.3 - Tue 22 Nov 2011
2
10
  ========================================
3
11
  - Ability to customise using SASS mixins as hooks
data/README.md CHANGED
@@ -53,7 +53,7 @@ Basic
53
53
 
54
54
  If the defaut stylesheet doesn't fit your design, you can customize it.
55
55
 
56
- Add a `.css.sass` file to your application and requer it.
56
+ Add a `.css.sass` file to your application and require it.
57
57
  The basic example may look like this:
58
58
 
59
59
  ```sass
@@ -7,7 +7,7 @@ require "ios-checkboxes/version"
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "ios-checkboxes"
9
9
  s.version = IosCheckboxes::VERSION
10
- s.authors = ["Dmytrii Nagirniak, Thomas Reynolds"]
10
+ s.authors = ["Dmytrii Nagirniak", "Thomas Reynolds"]
11
11
  s.email = ["dnagir@gmail.com"]
12
12
  s.homepage = "https://github.com/dnagir/ios-checkboxes"
13
13
  s.summary = "iOS checkboxes for Rails"
@@ -17,9 +17,8 @@ Gem::Specification.new do |s|
17
17
  s.test_files = `git ls-files -- {test,spec,features,build}/*`.split("\n")
18
18
  s.require_paths = ["lib"]
19
19
 
20
- s.add_dependency "rails", "~> 3.1.2"
20
+ s.add_dependency "rails", "~> 3.1"
21
21
  s.add_dependency "sass-rails"
22
- s.add_dependency "compass", ">= 0.12.alpha.1"
23
22
 
24
23
  s.add_development_dependency "rspec-rails"
25
24
  end
@@ -1,3 +1 @@
1
- /*
2
- *= require ios-checkboxes/ios-checkboxes
3
- */
1
+ @import "ios-checkboxes/ios-checkboxes"
@@ -1,4 +1,7 @@
1
- @import "compass/css3/opacity"
1
+ @mixin ios-opacity($opacity)
2
+ opacity: $opacity
3
+ // Borrowed from compass: https://github.com/chriseppstein/compass/blob/stable/frameworks/compass/stylesheets/compass/css3/_opacity.scss
4
+ filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})")
2
5
 
3
6
 
4
7
  $iphone-style-mode: "cross-browser"
@@ -37,7 +40,7 @@ $iphone-style-images-path: 'ios-checkboxes'
37
40
  -khtml-user-select: none
38
41
 
39
42
  =iphone-style-disabled
40
- +opacity(0.5)
43
+ +ios-opacity(0.5)
41
44
 
42
45
  =iphone-style-label
43
46
  padding-top: 5px
@@ -54,7 +57,7 @@ $iphone-style-images-path: 'ios-checkboxes'
54
57
  position: absolute
55
58
  top: 5px
56
59
  left: 30px
57
- +opacity(0)
60
+ +ios-opacity(0)
58
61
  label
59
62
  white-space: nowrap
60
63
  @if $iphone-style-font-size != ''
@@ -1,5 +1,4 @@
1
1
  require 'sass-rails'
2
- require 'compass'
3
2
 
4
3
  module IosCheckboxes
5
4
  class Railtie < ::Rails::Railtie
@@ -1,3 +1,3 @@
1
1
  module IosCheckboxes
2
- VERSION = "0.1.3"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -0,0 +1,3 @@
1
+ # Bundler infers the require statement as 'ios/checkboxes'
2
+ # TODO: Avoid using the 'ios/checkboxes' directory
3
+ require 'ios-checkboxes'
@@ -8,10 +8,26 @@ describe "iOS Checkboxes", ->
8
8
  check.iphoneStyle()
9
9
  check.parent()
10
10
 
11
+ simulateSwitch = (container) ->
12
+ # This sends the up/down events to the element simulating that the button is pressed
13
+ container.trigger $.Event 'mousedown', pageX: 1
14
+ container.trigger $.Event 'mouseup', pageX: 1
11
15
 
12
16
  it "should have jQuery extensions", ->
13
17
  expect(jQuery.fn.iphoneStyle).toBeTruthy()
14
18
 
19
+ it "should be able to switch with mouse", ->
20
+ container = iphonify()
21
+ input = container.find ':checkbox'
22
+ initialVal = input.prop 'checked'
23
+
24
+ simulateSwitch container
25
+ expect( input.prop 'checked' ).toBe not initialVal
26
+
27
+ simulateSwitch container
28
+ expect( input.prop 'checked' ).toBe initialVal
29
+
30
+
15
31
  it "should apply css classes to the on/off button", ->
16
32
  wrap = iphonify()
17
33
  expect(wrap).toBe ".iPhoneCheckContainer"
metadata CHANGED
@@ -1,30 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ios-checkboxes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Dmytrii Nagirniak, Thomas Reynolds
8
+ - Dmytrii Nagirniak
9
+ - Thomas Reynolds
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2011-11-22 00:00:00.000000000 Z
13
+ date: 2012-05-25 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rails
16
- requirement: &70111345873420 !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ~>
20
21
  - !ruby/object:Gem::Version
21
- version: 3.1.2
22
+ version: '3.1'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *70111345873420
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
27
+ requirements:
28
+ - - ~>
29
+ - !ruby/object:Gem::Version
30
+ version: '3.1'
25
31
  - !ruby/object:Gem::Dependency
26
32
  name: sass-rails
27
- requirement: &70111345872840 !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
28
34
  none: false
29
35
  requirements:
30
36
  - - ! '>='
@@ -32,21 +38,15 @@ dependencies:
32
38
  version: '0'
33
39
  type: :runtime
34
40
  prerelease: false
35
- version_requirements: *70111345872840
36
- - !ruby/object:Gem::Dependency
37
- name: compass
38
- requirement: &70111345871800 !ruby/object:Gem::Requirement
41
+ version_requirements: !ruby/object:Gem::Requirement
39
42
  none: false
40
43
  requirements:
41
44
  - - ! '>='
42
45
  - !ruby/object:Gem::Version
43
- version: 0.12.alpha.1
44
- type: :runtime
45
- prerelease: false
46
- version_requirements: *70111345871800
46
+ version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec-rails
49
- requirement: &70111345871320 !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,12 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70111345871320
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
58
63
  description: Easily convert your checkboxes into iPhone style On/Off buttons. Use
59
64
  with Rails 3.1 Assets Pipeline.
60
65
  email:
@@ -100,6 +105,7 @@ files:
100
105
  - lib/ios-style-checkboxes/slider_center.png
101
106
  - lib/ios-style-checkboxes/slider_left.png
102
107
  - lib/ios-style-checkboxes/slider_right.png
108
+ - lib/ios/checkboxes.rb
103
109
  - lib/tasks/ios-checkboxes_tasks.rake
104
110
  - spec/dummy/Rakefile
105
111
  - spec/dummy/app/assets/javascripts/application.js
@@ -153,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
159
  version: '0'
154
160
  segments:
155
161
  - 0
156
- hash: 3583560109010464864
162
+ hash: 576487710261082172
157
163
  required_rubygems_version: !ruby/object:Gem::Requirement
158
164
  none: false
159
165
  requirements:
@@ -162,10 +168,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
168
  version: '0'
163
169
  segments:
164
170
  - 0
165
- hash: 3583560109010464864
171
+ hash: 576487710261082172
166
172
  requirements: []
167
173
  rubyforge_project:
168
- rubygems_version: 1.8.10
174
+ rubygems_version: 1.8.24
169
175
  signing_key:
170
176
  specification_version: 3
171
177
  summary: iOS checkboxes for Rails