chained-rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/app/assets/javascripts/jquery.chained.js +106 -0
- data/app/assets/javascripts/jquery.chained.min.js +2 -0
- data/app/assets/javascripts/jquery.chained.remote.js +167 -0
- data/app/assets/javascripts/jquery.chained.remote.min.js +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/chained-rails.gemspec +30 -0
- data/lib/chained/rails.rb +8 -0
- data/lib/chained/rails/version.rb +5 -0
- metadata +91 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 84f5e0f772cb8ab7c03e4fd0e9e36caa825fe894
|
4
|
+
data.tar.gz: 4b1e3ea7434cef2cbd5f65229aebaadb9ae73ff7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7d259198b0c592008f8c6bc9caff43e6fa6ef89ade1cab31671028268df39060f23e86e5c0d318bc26a4a4676297d9bc66426a7a8848f063ffb623fdc9bb0254
|
7
|
+
data.tar.gz: fe37990f0a740ec8423a12a15be0bd17ea4dd9251d87c11e81b6cbdcd3e32ea76731949f3b24244e26c3977f16cd68c3f4342aa653e6310d63194e75b6020145
|
data/.gitignore
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at jhqy2011@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 xiajian
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# Chained::Rails
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/chained/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'chained-rails'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install chained-rails
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/chained-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
/*
|
2
|
+
* Chained - jQuery / Zepto chained selects plugin
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010-2014 Mika Tuupola
|
5
|
+
*
|
6
|
+
* Licensed under the MIT license:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
*
|
9
|
+
* Project home:
|
10
|
+
* http://www.appelsiini.net/projects/chained
|
11
|
+
*
|
12
|
+
* Version: 1.0.0
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
|
16
|
+
;(function($, window, document, undefined) {
|
17
|
+
"use strict";
|
18
|
+
|
19
|
+
$.fn.chained = function(parent_selector) {
|
20
|
+
|
21
|
+
return this.each(function() {
|
22
|
+
|
23
|
+
/* Save this to child because this changes when scope changes. */
|
24
|
+
var child = this;
|
25
|
+
var backup = $(child).clone();
|
26
|
+
|
27
|
+
/* Handles maximum two parents now. */
|
28
|
+
$(parent_selector).each(function() {
|
29
|
+
$(this).bind("change", function() {
|
30
|
+
updateChildren();
|
31
|
+
});
|
32
|
+
|
33
|
+
/* Force IE to see something selected on first page load, */
|
34
|
+
/* unless something is already selected */
|
35
|
+
if (!$("option:selected", this).length) {
|
36
|
+
$("option", this).first().attr("selected", "selected");
|
37
|
+
}
|
38
|
+
|
39
|
+
/* Force updating the children. */
|
40
|
+
updateChildren();
|
41
|
+
});
|
42
|
+
|
43
|
+
function updateChildren() {
|
44
|
+
var trigger_change = true;
|
45
|
+
var currently_selected_value = $("option:selected", child).val();
|
46
|
+
|
47
|
+
$(child).html(backup.html());
|
48
|
+
|
49
|
+
/* If multiple parents build classname like foo\bar. */
|
50
|
+
var selected = "";
|
51
|
+
$(parent_selector).each(function() {
|
52
|
+
var selectedClass = $("option:selected", this).val();
|
53
|
+
if (selectedClass) {
|
54
|
+
if (selected.length > 0) {
|
55
|
+
if (window.Zepto) {
|
56
|
+
/* Zepto class regexp dies with classes like foo\bar. */
|
57
|
+
selected += "\\\\";
|
58
|
+
} else {
|
59
|
+
selected += "\\";
|
60
|
+
}
|
61
|
+
}
|
62
|
+
selected += selectedClass;
|
63
|
+
}
|
64
|
+
});
|
65
|
+
|
66
|
+
/* Also check for first parent without subclassing. */
|
67
|
+
/* TODO: This should be dynamic and check for each parent */
|
68
|
+
/* without subclassing. */
|
69
|
+
var first;
|
70
|
+
if ($.isArray(parent_selector)) {
|
71
|
+
first = $(parent_selector[0]).first();
|
72
|
+
} else {
|
73
|
+
first = $(parent_selector).first();
|
74
|
+
}
|
75
|
+
var selected_first = $("option:selected", first).val();
|
76
|
+
|
77
|
+
$("option", child).each(function() {
|
78
|
+
/* Remove unneeded items but save the default value. */
|
79
|
+
if ($(this).hasClass(selected) && $(this).val() === currently_selected_value) {
|
80
|
+
$(this).prop("selected", true);
|
81
|
+
trigger_change = false;
|
82
|
+
} else if (!$(this).hasClass(selected) && !$(this).hasClass(selected_first) && $(this).val() !== "") {
|
83
|
+
$(this).remove();
|
84
|
+
}
|
85
|
+
});
|
86
|
+
|
87
|
+
/* If we have only the default value disable select. */
|
88
|
+
if (1 === $("option", child).size() && $(child).val() === "") {
|
89
|
+
$(child).prop("disabled", true);
|
90
|
+
} else {
|
91
|
+
$(child).prop("disabled", false);
|
92
|
+
}
|
93
|
+
if (trigger_change) {
|
94
|
+
$(child).trigger("change");
|
95
|
+
}
|
96
|
+
}
|
97
|
+
});
|
98
|
+
};
|
99
|
+
|
100
|
+
/* Alias for those who like to use more English like syntax. */
|
101
|
+
$.fn.chainedTo = $.fn.chained;
|
102
|
+
|
103
|
+
/* Default settings for plugin. */
|
104
|
+
$.fn.chained.defaults = {};
|
105
|
+
|
106
|
+
})(window.jQuery || window.Zepto, window, document);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! Chained 1.0.0 - MIT license - Copyright 2010-2014 Mika Tuupola */
|
2
|
+
!function(a,b){"use strict";a.fn.chained=function(c){return this.each(function(){function d(){var d=!0,g=a("option:selected",e).val();a(e).html(f.html());var h="";a(c).each(function(){var c=a("option:selected",this).val();c&&(h.length>0&&(h+=b.Zepto?"\\\\":"\\"),h+=c)});var i;i=a.isArray(c)?a(c[0]).first():a(c).first();var j=a("option:selected",i).val();a("option",e).each(function(){a(this).hasClass(h)&&a(this).val()===g?(a(this).prop("selected",!0),d=!1):a(this).hasClass(h)||a(this).hasClass(j)||""===a(this).val()||a(this).remove()}),1===a("option",e).size()&&""===a(e).val()?a(e).prop("disabled",!0):a(e).prop("disabled",!1),d&&a(e).trigger("change")}var e=this,f=a(e).clone();a(c).each(function(){a(this).bind("change",function(){d()}),a("option:selected",this).length||a("option",this).first().attr("selected","selected"),d()})})},a.fn.chainedTo=a.fn.chained,a.fn.chained.defaults={}}(window.jQuery||window.Zepto,window,document);
|
@@ -0,0 +1,167 @@
|
|
1
|
+
/*
|
2
|
+
* Chained - jQuery / Zepto chained selects plugin
|
3
|
+
*
|
4
|
+
* Copyright (c) 2010-2014 Mika Tuupola
|
5
|
+
*
|
6
|
+
* Licensed under the MIT license:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
*
|
9
|
+
* Project home:
|
10
|
+
* http://www.appelsiini.net/projects/chained
|
11
|
+
*
|
12
|
+
* Version: 1.0.0
|
13
|
+
*
|
14
|
+
*/
|
15
|
+
|
16
|
+
;(function($, window, document, undefined) {
|
17
|
+
"use strict";
|
18
|
+
|
19
|
+
$.fn.remoteChained = function(options) {
|
20
|
+
|
21
|
+
var settings = $.extend({}, $.fn.remoteChained.defaults, options);
|
22
|
+
|
23
|
+
/* Loading text always clears the select. */
|
24
|
+
if (settings.loading) {
|
25
|
+
settings.clear = true;
|
26
|
+
}
|
27
|
+
|
28
|
+
return this.each(function() {
|
29
|
+
|
30
|
+
/* Save this to self because this changes when scope changes. */
|
31
|
+
var self = this;
|
32
|
+
var request = false; /* Track xhr requests. */
|
33
|
+
|
34
|
+
$(settings.parents).each(function() {
|
35
|
+
$(this).bind("change", function() {
|
36
|
+
|
37
|
+
/* Build data array from parents values. */
|
38
|
+
var data = {};
|
39
|
+
$(settings.parents).each(function() {
|
40
|
+
var id = $(this).attr(settings.attribute);
|
41
|
+
var value = ($(this).is("select") ? $(":selected", this) : $(this)).val();
|
42
|
+
data[id] = value;
|
43
|
+
|
44
|
+
/* Optionally also depend on values from these inputs. */
|
45
|
+
if (settings.depends) {
|
46
|
+
$(settings.depends).each(function() {
|
47
|
+
/* Do not include own value. */
|
48
|
+
if (self !== this) {
|
49
|
+
var id = $(this).attr(settings.attribute);
|
50
|
+
var value = $(this).val();
|
51
|
+
data[id] = value;
|
52
|
+
}
|
53
|
+
});
|
54
|
+
}
|
55
|
+
});
|
56
|
+
|
57
|
+
/* If previous request running, abort it. */
|
58
|
+
/* TODO: Probably should use Sinon to test this. */
|
59
|
+
if (request && $.isFunction(request.abort)) {
|
60
|
+
request.abort();
|
61
|
+
request = false;
|
62
|
+
}
|
63
|
+
|
64
|
+
if (settings.clear) {
|
65
|
+
if (settings.loading) {
|
66
|
+
/* Clear the select and show loading text. */
|
67
|
+
build.call(self, {"" : settings.loading});
|
68
|
+
} else {
|
69
|
+
/* Clear the select. */
|
70
|
+
$("option", self).remove();
|
71
|
+
}
|
72
|
+
|
73
|
+
/* Force updating the children to clear too. */
|
74
|
+
$(self).trigger("change");
|
75
|
+
}
|
76
|
+
|
77
|
+
request = $.getJSON(settings.url, data, function(json) {
|
78
|
+
build.call(self, json);
|
79
|
+
/* Force updating the children. */
|
80
|
+
$(self).trigger("change");
|
81
|
+
});
|
82
|
+
});
|
83
|
+
|
84
|
+
/* If we have bootstrapped data given in options. */
|
85
|
+
if (settings.bootstrap) {
|
86
|
+
build.call(self, settings.bootstrap);
|
87
|
+
settings.bootstrap = null;
|
88
|
+
}
|
89
|
+
});
|
90
|
+
|
91
|
+
/* Build the select from given data. */
|
92
|
+
function build(json) {
|
93
|
+
/* If select already had something selected, preserve it. */
|
94
|
+
var selected_key = $(":selected", self).val();
|
95
|
+
|
96
|
+
/* Clear the select. */
|
97
|
+
$("option", self).remove();
|
98
|
+
|
99
|
+
var option_list = [];
|
100
|
+
if ($.isArray(json)) {
|
101
|
+
if ($.isArray(json[0])) {
|
102
|
+
/* JSON is already an array of arrays. */
|
103
|
+
/* [["","--"],["series-1","1 series"],["series-3","3 series"]] */
|
104
|
+
option_list = json;
|
105
|
+
} else {
|
106
|
+
/* JSON is an array of objects. */
|
107
|
+
/* [{"":"--"},{"series-1":"1 series"},{"series-3":"3 series"}] */
|
108
|
+
option_list = $.map(json, function(value) {
|
109
|
+
return $.map(value, function(value, index) {
|
110
|
+
return [[index, value]];
|
111
|
+
});
|
112
|
+
});
|
113
|
+
}
|
114
|
+
} else {
|
115
|
+
/* JSON is an JavaScript object. Rebuild it as an array. */
|
116
|
+
/* {"":"--","series-1":"1 series","series-3":"3 series"} */
|
117
|
+
for (var index in json) {
|
118
|
+
if (json.hasOwnProperty(index)) {
|
119
|
+
option_list.push([index, json[index]]);
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
/* Add new options from json. */
|
125
|
+
for (var i=0; i!==option_list.length; i++) {
|
126
|
+
var key = option_list[i][0];
|
127
|
+
var value = option_list[i][1];
|
128
|
+
|
129
|
+
/* Set the selected option from JSON. */
|
130
|
+
if ("selected" === key) {
|
131
|
+
selected_key = value;
|
132
|
+
continue;
|
133
|
+
}
|
134
|
+
var option = $("<option />").val(key).append(value);
|
135
|
+
$(self).append(option);
|
136
|
+
}
|
137
|
+
|
138
|
+
/* Loop option again to set selected. IE needed this... */
|
139
|
+
$(self).children().each(function() {
|
140
|
+
if ($(this).val() === selected_key + "") {
|
141
|
+
$(this).attr("selected", "selected");
|
142
|
+
}
|
143
|
+
});
|
144
|
+
|
145
|
+
/* If we have only the default value disable select. */
|
146
|
+
if (1 === $("option", self).size() && $(self).val() === "") {
|
147
|
+
$(self).prop("disabled", true);
|
148
|
+
} else {
|
149
|
+
$(self).prop("disabled", false);
|
150
|
+
}
|
151
|
+
}
|
152
|
+
});
|
153
|
+
};
|
154
|
+
|
155
|
+
/* Alias for those who like to use more English like syntax. */
|
156
|
+
$.fn.remoteChainedTo = $.fn.remoteChained;
|
157
|
+
|
158
|
+
/* Default settings for plugin. */
|
159
|
+
$.fn.remoteChained.defaults = {
|
160
|
+
attribute: "name",
|
161
|
+
depends : null,
|
162
|
+
bootstrap : null,
|
163
|
+
loading : null,
|
164
|
+
clear : false
|
165
|
+
};
|
166
|
+
|
167
|
+
})(window.jQuery || window.Zepto, window, document);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! Chained 1.0.0 - MIT license - Copyright 2010-2014 Mika Tuupola */
|
2
|
+
!function(a){"use strict";a.fn.remoteChained=function(b){var c=a.extend({},a.fn.remoteChained.defaults,b);return c.loading&&(c.clear=!0),this.each(function(){function b(b){var c=a(":selected",d).val();a("option",d).remove();var e=[];if(a.isArray(b))e=a.isArray(b[0])?b:a.map(b,function(b){return a.map(b,function(a,b){return[[b,a]]})});else for(var f in b)b.hasOwnProperty(f)&&e.push([f,b[f]]);for(var g=0;g!==e.length;g++){var h=e[g][0],i=e[g][1];if("selected"!==h){var j=a("<option />").val(h).append(i);a(d).append(j)}else c=i}a(d).children().each(function(){a(this).val()===c+""&&a(this).attr("selected","selected")}),1===a("option",d).size()&&""===a(d).val()?a(d).prop("disabled",!0):a(d).prop("disabled",!1)}var d=this,e=!1;a(c.parents).each(function(){a(this).bind("change",function(){var f={};a(c.parents).each(function(){var b=a(this).attr(c.attribute),e=(a(this).is("select")?a(":selected",this):a(this)).val();f[b]=e,c.depends&&a(c.depends).each(function(){if(d!==this){var b=a(this).attr(c.attribute),e=a(this).val();f[b]=e}})}),e&&a.isFunction(e.abort)&&(e.abort(),e=!1),c.clear&&(c.loading?b.call(d,{"":c.loading}):a("option",d).remove(),a(d).trigger("change")),e=a.getJSON(c.url,f,function(c){b.call(d,c),a(d).trigger("change")})}),c.bootstrap&&(b.call(d,c.bootstrap),c.bootstrap=null)})})},a.fn.remoteChainedTo=a.fn.remoteChained,a.fn.remoteChained.defaults={attribute:"name",depends:null,bootstrap:null,loading:null,clear:!1}}(window.jQuery||window.Zepto,window,document);
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "chained/rails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'chained/rails/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "chained-rails"
|
8
|
+
spec.version = Chained::Rails::VERSION
|
9
|
+
spec.authors = ["xiajian"]
|
10
|
+
spec.email = ["jhqy2011@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Simple chained selects with jQuery or Zepto}
|
13
|
+
spec.description = %q{Chained is simple chained selects plugin. It works with both jQuery and Zepto. Use class based version if you do not want to make external queries. It uses HTML class names of select options to decide content. To create selects from AJAX queries use remote version instead. This version makes an external AJAX query and uses the returned JSON to build child selects.}
|
14
|
+
spec.homepage = "https://github.com/tuupola/jquery_chained"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
unless spec.respond_to?(:metadata)
|
20
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
21
|
+
end
|
22
|
+
|
23
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
spec.bindir = "exe"
|
25
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
+
spec.require_paths = ["lib"]
|
27
|
+
|
28
|
+
spec.add_development_dependency "bundler", "~> 1.8"
|
29
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: chained-rails
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- xiajian
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.8'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Chained is simple chained selects plugin. It works with both jQuery and
|
42
|
+
Zepto. Use class based version if you do not want to make external queries. It uses
|
43
|
+
HTML class names of select options to decide content. To create selects from AJAX
|
44
|
+
queries use remote version instead. This version makes an external AJAX query and
|
45
|
+
uses the returned JSON to build child selects.
|
46
|
+
email:
|
47
|
+
- jhqy2011@gmail.com
|
48
|
+
executables: []
|
49
|
+
extensions: []
|
50
|
+
extra_rdoc_files: []
|
51
|
+
files:
|
52
|
+
- ".gitignore"
|
53
|
+
- CODE_OF_CONDUCT.md
|
54
|
+
- Gemfile
|
55
|
+
- LICENSE.txt
|
56
|
+
- README.md
|
57
|
+
- Rakefile
|
58
|
+
- app/assets/javascripts/jquery.chained.js
|
59
|
+
- app/assets/javascripts/jquery.chained.min.js
|
60
|
+
- app/assets/javascripts/jquery.chained.remote.js
|
61
|
+
- app/assets/javascripts/jquery.chained.remote.min.js
|
62
|
+
- bin/console
|
63
|
+
- bin/setup
|
64
|
+
- chained-rails.gemspec
|
65
|
+
- lib/chained/rails.rb
|
66
|
+
- lib/chained/rails/version.rb
|
67
|
+
homepage: https://github.com/tuupola/jquery_chained
|
68
|
+
licenses:
|
69
|
+
- MIT
|
70
|
+
metadata: {}
|
71
|
+
post_install_message:
|
72
|
+
rdoc_options: []
|
73
|
+
require_paths:
|
74
|
+
- lib
|
75
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
requirements: []
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 2.4.8
|
88
|
+
signing_key:
|
89
|
+
specification_version: 4
|
90
|
+
summary: Simple chained selects with jQuery or Zepto
|
91
|
+
test_files: []
|