combo_box 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE.txt → LICENSE} +0 -0
- data/VERSION +1 -1
- data/lib/assets/javascripts/combo_box.js +6 -6
- data/lib/combo_box.rb +2 -2
- data/lib/combo_box/{engine.rb → rails/engine.rb} +0 -0
- data/lib/combo_box/{railtie.rb → rails/railtie.rb} +0 -0
- data/test/helper.rb +24 -0
- data/test/test_combo_box.rb +8 -0
- metadata +27 -27
- data/Gemfile +0 -9
data/{LICENSE.txt → LICENSE}
RENAMED
File without changes
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.11
|
@@ -24,16 +24,16 @@
|
|
24
24
|
var element = $(this);
|
25
25
|
if (element.prop("alreadyBound") !== true) {
|
26
26
|
element.comboBoxCache = element.val();
|
27
|
-
element.prop("valueField", $('#' + element.
|
27
|
+
element.prop("valueField", $('#' + element.data('value-container')));
|
28
28
|
if ($.isEmptyObject(element.prop("valueField")[0])) {
|
29
|
-
alert('An input ' + element.id + ' with a "data-combo-box" attribute must contain a "data-value-container" attribute (#' + element.
|
29
|
+
alert('An input ' + element.id + ' with a "data-combo-box" attribute must contain a "data-value-container" attribute (#' + element.data('value-container') + ')');
|
30
30
|
}
|
31
|
-
element.maxSize = parseInt(element.
|
31
|
+
element.maxSize = parseInt(element.data('max-size'), 10);
|
32
32
|
if (isNaN(element.maxSize) || element.maxSize === 0) { element.maxSize = 64; }
|
33
33
|
element.size = (element.comboBoxCache.length < 32 ? 32 : element.comboBoxCache.length > element.maxSize ? element.maxSize : element.comboBoxCache.length);
|
34
34
|
|
35
35
|
element.autocomplete({
|
36
|
-
source: element.
|
36
|
+
source: element.data('combo-box'),
|
37
37
|
minLength: 1,
|
38
38
|
select: function (event, ui) {
|
39
39
|
return $.setComboBox(element, ui.item);
|
@@ -52,9 +52,9 @@
|
|
52
52
|
$(document).ajaxComplete($.initializeComboBoxes);
|
53
53
|
|
54
54
|
$("a[data-permute-combo-box]").live("click", function () {
|
55
|
-
var elements = $($(this).
|
55
|
+
var elements = $($(this).data("permute-combo-box")), i;
|
56
56
|
for (i = 0; i < elements.length; i += 1) {
|
57
|
-
if ($(elements[i]).
|
57
|
+
if ($(elements[i]).data("combo-box") === undefined || $(elements[i]).data("combo-box") === null) {
|
58
58
|
elements[i] = $("input[data-value-container='" + $(elements[i]).attr("id") + "']");
|
59
59
|
}
|
60
60
|
}
|
data/lib/combo_box.rb
CHANGED
File without changes
|
File without changes
|
data/test/helper.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'active_support'
|
12
|
+
require 'action_pack'
|
13
|
+
require 'action_view'
|
14
|
+
require 'action_controller'
|
15
|
+
require 'action_dispatch'
|
16
|
+
|
17
|
+
require 'test/unit'
|
18
|
+
|
19
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
20
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
21
|
+
require 'combo_box'
|
22
|
+
|
23
|
+
class Test::Unit::TestCase
|
24
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: combo_box
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: !binary |-
|
5
|
+
MC4wLjEx
|
5
6
|
prerelease:
|
6
7
|
platform: ruby
|
7
8
|
authors:
|
@@ -9,22 +10,27 @@ authors:
|
|
9
10
|
autorequire:
|
10
11
|
bindir: bin
|
11
12
|
cert_chain: []
|
12
|
-
date: 2012-
|
13
|
+
date: 2012-08-07 00:00:00.000000000 Z
|
13
14
|
dependencies:
|
14
15
|
- !ruby/object:Gem::Dependency
|
15
16
|
name: rails
|
16
|
-
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'
|
22
|
+
version: '3.1'
|
22
23
|
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
version_requirements:
|
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: jquery-rails
|
27
|
-
requirement:
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
28
34
|
none: false
|
29
35
|
requirements:
|
30
36
|
- - ! '>='
|
@@ -32,41 +38,36 @@ dependencies:
|
|
32
38
|
version: '0'
|
33
39
|
type: :runtime
|
34
40
|
prerelease: false
|
35
|
-
version_requirements:
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: jeweler
|
38
|
-
requirement: &15097480 !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:
|
44
|
-
type: :development
|
45
|
-
prerelease: false
|
46
|
-
version_requirements: *15097480
|
46
|
+
version: '0'
|
47
47
|
description: Adds helpers for Rails views and controller in order to manage 'dynamic
|
48
48
|
select'. It uses jQuery UI as support for inobtrusive use in forms. It's not the
|
49
49
|
classic Autocompleter, its use is limited to belongs_to reflections.
|
50
|
-
email:
|
50
|
+
email: burisu@oneiros.fr
|
51
51
|
executables: []
|
52
52
|
extensions: []
|
53
53
|
extra_rdoc_files:
|
54
|
-
- LICENSE
|
54
|
+
- LICENSE
|
55
55
|
- README.rdoc
|
56
56
|
files:
|
57
|
-
-
|
58
|
-
- LICENSE.txt
|
57
|
+
- LICENSE
|
59
58
|
- README.rdoc
|
60
59
|
- VERSION
|
61
60
|
- lib/assets/javascripts/combo_box.js
|
62
61
|
- lib/assets/stylesheets/combo_box.css
|
63
62
|
- lib/combo_box.rb
|
64
63
|
- lib/combo_box/action_controller.rb
|
65
|
-
- lib/combo_box/engine.rb
|
66
64
|
- lib/combo_box/generator.rb
|
67
65
|
- lib/combo_box/helpers.rb
|
68
66
|
- lib/combo_box/helpers/form_tag_helper.rb
|
69
|
-
- lib/combo_box/
|
67
|
+
- lib/combo_box/rails/engine.rb
|
68
|
+
- lib/combo_box/rails/railtie.rb
|
69
|
+
- test/helper.rb
|
70
|
+
- test/test_combo_box.rb
|
70
71
|
homepage: http://github.com/burisu/combo_box
|
71
72
|
licenses:
|
72
73
|
- MIT
|
@@ -80,9 +81,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
81
|
- - ! '>='
|
81
82
|
- !ruby/object:Gem::Version
|
82
83
|
version: '0'
|
83
|
-
segments:
|
84
|
-
- 0
|
85
|
-
hash: -265677814268791972
|
86
84
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
85
|
none: false
|
88
86
|
requirements:
|
@@ -91,8 +89,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
89
|
version: '0'
|
92
90
|
requirements: []
|
93
91
|
rubyforge_project:
|
94
|
-
rubygems_version: 1.8.
|
92
|
+
rubygems_version: 1.8.23
|
95
93
|
signing_key:
|
96
94
|
specification_version: 3
|
97
95
|
summary: Adds the combo_box control in Rails 3 based on jQuery UI
|
98
|
-
test_files:
|
96
|
+
test_files:
|
97
|
+
- test/helper.rb
|
98
|
+
- test/test_combo_box.rb
|