rails-jquery-tokeninput 0.0.1 → 0.1.0

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
- NTY5YmI4ZjRmMDUzZGVmNzQ5ZjIyOTAwY2IxOWIxNDQ1MzY5ZjQzZg==
5
- data.tar.gz: !binary |-
6
- NmI3MTk1YzA1N2MwYmMzZDdiMWU1Yzg2YmRiZThmMGMxMjZjZTVkMw==
2
+ SHA1:
3
+ metadata.gz: 974f0b2b1af47e2135b32cc4b65e4450253be748
4
+ data.tar.gz: faa108096bf05febac12c2671382a9e1db83a4ab
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZjdlNjBlYjA3YzZlMzg3MGZiYTYzYWVlNGEyODQ2NDQ5ODJjNGYwZjNjNTE3
10
- OGViY2Y5OTAyMzBmNWEyOWM1MDQzYmEyMTM5MjBjZDkyOWUxMjkzMWQ4Mjdm
11
- OGI2MzRhNDQ3ZTcwODgxZjBiYmQwZjc2MjIyYWYwMDE0YTYwZjA=
12
- data.tar.gz: !binary |-
13
- MjUzZjIzZGI1NTY3YWQ3ODBmNjc1ZDRmYzNjOTVjNzZmMWYwN2ZiMmM1ZWIx
14
- OGVhOTdlYTljYmU4NmZmYTllZmY0Y2RiZTk2NGIxY2I2ZGM4ZGRhNzdhNGEy
15
- NTk5NTgxMzlmY2Y2ODYxZjMxMjdjMzQ5OGM5M2FhMGYxMDY1ZDc=
6
+ metadata.gz: d973cfca2a2ef7750b1c1328a0a69a6db79e09fb16b9e33ae5ea89d75376629804f169ce1fbc0960b6e38100338e4fb2179124dd0da821005276905a44772418
7
+ data.tar.gz: 661061edefdd15024b2399f44c524d124fde47314d5c21e05c120cae9cdf5bc62ebeacc7b1f5d33fef64512b1a1552f56663b2784c1514d9b0a132a3e3b93c0f
data/README.md CHANGED
@@ -14,14 +14,14 @@ And then execute:
14
14
 
15
15
  $ bundle
16
16
 
17
- Require jquery.tokeninput.js in your application.js
17
+ Require jquery.tokeninput.js in your application.js:
18
18
 
19
19
  ```js
20
20
  //= require jquery
21
21
  //= require rails-jquery-tokeninput
22
22
  ```
23
23
 
24
- Add the stylesheets you want to use in your application.css
24
+ Add the stylesheets you want to use in your application.css:
25
25
 
26
26
  ```css
27
27
  *= require_self
@@ -30,30 +30,23 @@ Add the stylesheets you want to use in your application.css
30
30
 
31
31
  ## Usage
32
32
 
33
- To start using **rails-jquery-tokeninput** you just have to add attributes to your text input:
33
+ To start using **rails-jquery-tokeninput** you just have to add data-attribute to your text input:
34
34
 
35
35
  ```ruby
36
36
  names = [{ id: 1, name: 'John' }, { id: 2, name: 'Mike' }]
37
- options = { options: { theme: 'facebook' } }
38
37
 
39
- f.text_field :names, class: 'tokeninput', data: { tokeninput: {
40
- collection: names,
41
- options: options
42
- }}
38
+ f.text_field :names, data: { tokeninput: { collection: names } }
43
39
  ```
44
40
 
45
- If you are using Simple Form or Formtastic it may looks like:
41
+ Or if you are using Simple Form or Formtastic it may looks like:
46
42
 
47
43
  ```ruby
48
44
  countries = [{ name: 'Hong Kong', iso_code: 'HK' }, { name: 'Jamaica', iso_code: 'JM' }]
49
45
  options = { theme: 'facebook', tokenValue: 'iso_code' }
50
46
 
51
- f.input :countries, as: :string, input_html: { class: 'tokeninput', data: {
52
- tokeninput: {
53
- collection: countries,
54
- options: options
55
- }
56
- }}
47
+ f.input :countries, as: :string, input_html: {
48
+ data: { tokeninput: { collection: countries, options: options } }
49
+ }
57
50
  ```
58
51
 
59
52
  ## Contributing
@@ -1,10 +1,10 @@
1
1
  //= require jquery.tokeninput
2
2
 
3
3
  $(function() {
4
- for (var input in ('.tokeninput')) {
4
+ $.each($('input[data-tokeninput]'), function(index, input) {
5
5
  $(input).tokenInput(
6
6
  $(input).data('tokeninput').collection,
7
7
  $(input).data('tokeninput').options
8
- )
9
- }
8
+ );
9
+ });
10
10
  });
@@ -3,7 +3,8 @@ require 'rails/jquery/tokeninput/version'
3
3
  module Rails
4
4
  module Jquery
5
5
  module Tokeninput
6
- # Your code goes here...
6
+ class Engine < ::Rails::Engine
7
+ end
7
8
  end
8
9
  end
9
10
  end
@@ -1,7 +1,7 @@
1
1
  module Rails
2
2
  module Jquery
3
3
  module Tokeninput
4
- VERSION = '0.0.1'
4
+ VERSION = '0.1.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-jquery-tokeninput
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeny Li
@@ -23,11 +23,11 @@ files:
23
23
  - LICENSE.txt
24
24
  - README.md
25
25
  - Rakefile
26
- - app/assets/javascripts/jquery.tokeninput.js
27
26
  - app/assets/javascripts/rails-jquery-tokeninput.js
28
27
  - lib/rails/jquery/tokeninput.rb
29
28
  - lib/rails/jquery/tokeninput/version.rb
30
29
  - rails-jquery-tokeninput.gemspec
30
+ - vendor/assets/javascripts/jquery.tokeninput.js
31
31
  - vendor/assets/stylesheets/token-input-facebook.css
32
32
  - vendor/assets/stylesheets/token-input-mac.css
33
33
  - vendor/assets/stylesheets/token-input.css
@@ -41,19 +41,18 @@ require_paths:
41
41
  - lib
42
42
  required_ruby_version: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ! '>='
44
+ - - '>='
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  required_rubygems_version: !ruby/object:Gem::Requirement
48
48
  requirements:
49
- - - ! '>='
49
+ - - '>='
50
50
  - !ruby/object:Gem::Version
51
51
  version: '0'
52
52
  requirements: []
53
53
  rubyforge_project:
54
- rubygems_version: 2.1.5
54
+ rubygems_version: 2.0.3
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: Porting Tokeninput plugin
58
58
  test_files: []
59
- has_rdoc: