rails_autocomplete 0.0.6 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,38 @@
1
+ We love pull requests. Here's a quick guide:
2
+
3
+ 1. Fork the repo.
4
+
5
+ 2. Run the tests. We only take pull requests with passing tests, and it's great
6
+ to know that you have a clean slate: `bundle && rake`
7
+
8
+ 3. Add a test for your change. Only refactoring and documentation changes
9
+ require no new tests. If you are adding functionality or fixing a bug, we need
10
+ a test!
11
+
12
+ 4. Make the test pass.
13
+
14
+ 5. Push to your fork and submit a pull request.
15
+
16
+
17
+ At this point you're waiting on us. We like to at least comment on, if not
18
+ accept, pull requests within three business days (and, typically, one business
19
+ day). We may suggest some changes or improvements or alternatives.
20
+
21
+ Some things that will increase the chance that your pull request is accepted,
22
+ taken straight from the Ruby on Rails guide:
23
+
24
+ * Use Rails idioms and helpers
25
+ * Include tests that fail without your code, and pass with it
26
+ * Update the documentation, the surrounding one, examples elsewhere, guides,
27
+ whatever is affected by your contribution
28
+
29
+ Syntax:
30
+
31
+ * Two spaces, no tabs.
32
+ * No trailing whitespace. Blank lines should not have any space.
33
+ * Prefer &&/|| over and/or.
34
+ * MyClass.my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
35
+ * a = b and not a=b.
36
+ * Follow the conventions you see used in the source already.
37
+
38
+ And in case we didn't emphasize it enough: we love tests!
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Omar Abdel-Wahab
1
+ Copyright (c) 2013 Raya Social Media
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -42,10 +42,25 @@ app/controllers/posts_controller.rb:
42
42
  end
43
43
  end
44
44
 
45
+ ## Triggers
46
+
47
+ When a text field is autocompleted, it triggers an `autocomplete` event, it also passes the data that has been autocompleted, both `id` and `value`
48
+
49
+ $("#input").on("autocomplete", function(event, data){
50
+ console.log("Autocompleted id is " + data.id);
51
+ console.log("Autocompleted value is "+ data.value);
52
+ });
53
+
45
54
  ## Contributing
46
55
 
47
- 1. Fork it
48
- 2. Create your feature branch (`git checkout -b my-new-feature`)
49
- 3. Commit your changes (`git commit -am 'Add some feature'`)
50
- 4. Push to the branch (`git push origin my-new-feature`)
51
- 5. Create new Pull Request
56
+ Please see CONTRIBUTING.md for details.
57
+
58
+ ##Credits
59
+ rails_autocomplete was originally written by Omar Abdel-Wahab.
60
+
61
+ ![RSM](http://rayasocialmedia.com/images/logo.png)
62
+
63
+ rails_autocomplete is maintained and funded by Raya Social Media.
64
+
65
+ ## License
66
+ rails_autocomplete is Copyright © 2013 Raya Social Media. It is free software, and may be redistributed under the terms specified in the LICENSE file.
@@ -1,3 +1,3 @@
1
1
  module RailsAutocomplete
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -24,7 +24,7 @@ $(function() {
24
24
  },
25
25
  updater: function(item) {
26
26
  selectedItem = map[item].id;
27
- $('input[data-autocomplete-child=' + $(this)[0].$element.data('autocomplete-parent') + ']').attr('value', selectedItem);
27
+ $('input[data-autocomplete-child=' + $(this)[0].$element.data('autocomplete-parent') + ']').attr('value', selectedItem).trigger("autocomplete", map[item]);
28
28
  return item;
29
29
  }
30
30
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_autocomplete
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-01 00:00:00.000000000 Z
12
+ date: 2013-08-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &24079100 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '3.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '3.1'
24
+ version_requirements: *24079100
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: jquery-rails
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &24078260 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ! '>='
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '0'
38
33
  type: :runtime
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
35
+ version_requirements: *24078260
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: twitter-bootstrap-rails
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &24077060 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ! '>='
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: 2.1.0
54
44
  type: :runtime
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 2.1.0
46
+ version_requirements: *24077060
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: bundler
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &24075940 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ! '>='
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: 1.0.0
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: 1.0.0
57
+ version_requirements: *24075940
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: rspec
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &24075220 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ~>
@@ -85,15 +65,10 @@ dependencies:
85
65
  version: '2.3'
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ~>
92
- - !ruby/object:Gem::Version
93
- version: '2.3'
68
+ version_requirements: *24075220
94
69
  - !ruby/object:Gem::Dependency
95
70
  name: sqlite3-ruby
96
- requirement: !ruby/object:Gem::Requirement
71
+ requirement: &24074660 !ruby/object:Gem::Requirement
97
72
  none: false
98
73
  requirements:
99
74
  - - ! '>='
@@ -101,12 +76,7 @@ dependencies:
101
76
  version: '0'
102
77
  type: :development
103
78
  prerelease: false
104
- version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
- requirements:
107
- - - ! '>='
108
- - !ruby/object:Gem::Version
109
- version: '0'
79
+ version_requirements: *24074660
110
80
  description: Hassle-free autocomplete for Rails 3
111
81
  email:
112
82
  - owahab@gmail.com
@@ -115,6 +85,7 @@ extensions: []
115
85
  extra_rdoc_files: []
116
86
  files:
117
87
  - .gitignore
88
+ - CONTRIBUTING.md
118
89
  - Gemfile
119
90
  - LICENSE.txt
120
91
  - README.md
@@ -153,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
124
  version: '0'
154
125
  requirements: []
155
126
  rubyforge_project:
156
- rubygems_version: 1.8.24
127
+ rubygems_version: 1.8.11
157
128
  signing_key:
158
129
  specification_version: 3
159
130
  summary: Hassle-free autocomplete for Rails 3