select2-rails 4.0.1 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +12 -2
- data/lib/select2-rails/source_file.rb +10 -7
- data/lib/select2-rails/version.rb +1 -1
- data/select2-rails.gemspec +1 -1
- data/vendor/assets/javascripts/select2-full.js +6457 -0
- data/vendor/assets/javascripts/select2.js +283 -107
- data/vendor/assets/javascripts/select2_locale_ar.js +2 -2
- data/vendor/assets/javascripts/select2_locale_az.js +1 -1
- data/vendor/assets/javascripts/select2_locale_bg.js +1 -1
- data/vendor/assets/javascripts/select2_locale_ca.js +1 -1
- data/vendor/assets/javascripts/select2_locale_cs.js +1 -1
- data/vendor/assets/javascripts/select2_locale_da.js +2 -2
- data/vendor/assets/javascripts/select2_locale_de.js +2 -2
- data/vendor/assets/javascripts/select2_locale_el.js +3 -0
- data/vendor/assets/javascripts/select2_locale_en.js +1 -1
- data/vendor/assets/javascripts/select2_locale_es.js +1 -1
- data/vendor/assets/javascripts/select2_locale_et.js +1 -1
- data/vendor/assets/javascripts/select2_locale_eu.js +1 -1
- data/vendor/assets/javascripts/select2_locale_fa.js +1 -1
- data/vendor/assets/javascripts/select2_locale_fi.js +2 -2
- data/vendor/assets/javascripts/select2_locale_fr.js +2 -2
- data/vendor/assets/javascripts/select2_locale_gl.js +2 -2
- data/vendor/assets/javascripts/select2_locale_he.js +1 -1
- data/vendor/assets/javascripts/select2_locale_hi.js +1 -1
- data/vendor/assets/javascripts/select2_locale_hr.js +1 -1
- data/vendor/assets/javascripts/select2_locale_hu.js +2 -2
- data/vendor/assets/javascripts/select2_locale_hy.js +3 -0
- data/vendor/assets/javascripts/select2_locale_id.js +1 -1
- data/vendor/assets/javascripts/select2_locale_is.js +1 -1
- data/vendor/assets/javascripts/select2_locale_it.js +1 -1
- data/vendor/assets/javascripts/select2_locale_ja.js +1 -1
- data/vendor/assets/javascripts/select2_locale_km.js +3 -0
- data/vendor/assets/javascripts/select2_locale_ko.js +1 -1
- data/vendor/assets/javascripts/select2_locale_lt.js +2 -2
- data/vendor/assets/javascripts/select2_locale_lv.js +1 -1
- data/vendor/assets/javascripts/select2_locale_mk.js +1 -1
- data/vendor/assets/javascripts/select2_locale_ms.js +1 -1
- data/vendor/assets/javascripts/select2_locale_nb.js +2 -2
- data/vendor/assets/javascripts/select2_locale_nl.js +1 -1
- data/vendor/assets/javascripts/select2_locale_pl.js +1 -1
- data/vendor/assets/javascripts/select2_locale_pt-BR.js +1 -1
- data/vendor/assets/javascripts/select2_locale_pt.js +2 -2
- data/vendor/assets/javascripts/select2_locale_ro.js +2 -2
- data/vendor/assets/javascripts/select2_locale_ru.js +1 -1
- data/vendor/assets/javascripts/select2_locale_sk.js +1 -1
- data/vendor/assets/javascripts/select2_locale_sl.js +3 -0
- data/vendor/assets/javascripts/select2_locale_sr-Cyrl.js +1 -1
- data/vendor/assets/javascripts/select2_locale_sr.js +1 -1
- data/vendor/assets/javascripts/select2_locale_sv.js +1 -1
- data/vendor/assets/javascripts/select2_locale_th.js +2 -2
- data/vendor/assets/javascripts/select2_locale_tr.js +2 -2
- data/vendor/assets/javascripts/select2_locale_uk.js +1 -1
- data/vendor/assets/javascripts/select2_locale_vi.js +1 -1
- data/vendor/assets/javascripts/select2_locale_zh-CN.js +1 -1
- data/vendor/assets/javascripts/select2_locale_zh-TW.js +1 -1
- data/vendor/assets/stylesheets/select2-bootstrap.css +38 -26
- data/vendor/assets/stylesheets/select2.css +2 -0
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b3a13d5a9e7fbcc4b945844c6f7f145c43c7e336276bfcc7360b2d4da116b747
|
4
|
+
data.tar.gz: 21e5669c238cda498b1b5634a0c27f68589783310ede45d8a64e5aff34a40034
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9cec2483c920f79cdb7e97256f09adf919def50f27e69225cfc6440dfdd6cf63f71fcd966d2b833bc6f3623bb927eb8ef579c53c5974efad78b817e2cdcdd717
|
7
|
+
data.tar.gz: f576fbcb38aad984cffb4cc0be60a53c640ce298997a33c643a93633404100d491383cabb7498dca86a887832297de132189d4407e43e8fc687dd62d3e56cec6
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#Select2 for rails asset pipeline
|
1
|
+
# Select2 for rails asset pipeline
|
2
2
|
|
3
3
|
[Select2](https://github.com/select2/select2) is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
|
4
4
|
|
@@ -20,6 +20,10 @@ Add the following to your `app/assets/javascripts/application.js`:
|
|
20
20
|
|
21
21
|
//= require select2
|
22
22
|
|
23
|
+
To add `select2-full.js` instead of `select2.js`, add the following instead :
|
24
|
+
|
25
|
+
//= require select2-full
|
26
|
+
|
23
27
|
### Include select2-rails stylesheet assets
|
24
28
|
|
25
29
|
Add to your `app/assets/stylesheets/application.css`:
|
@@ -44,9 +48,15 @@ Add the following to your `app/assets/javascripts/application.js`:
|
|
44
48
|
|
45
49
|
//= require select2_locale_"any possible language"
|
46
50
|
|
51
|
+
To apply the language, pass whatever language you'd like to use to the [`language`](https://select2.github.io/examples.html#language) option when initializing Select2:
|
52
|
+
|
53
|
+
$( "#dropdown" ).select2({
|
54
|
+
language: "zh-TW"
|
55
|
+
});
|
56
|
+
|
47
57
|
Possible languages:
|
48
58
|
|
49
|
-
az, bg, ca, cs, da, de, en, es, et, eu, fi, fr, gl, hi, hr, hu, id, is, it, lt, lv, mk, nb, nl, pl, pt
|
59
|
+
ar, az, bg, ca, cs, da, de, el, en, es, et, eu, fa, fi, fr, gl, he, hi, hr, hu, hy, id, is, it, ja, km, ko, lt, lv, mk, ms, nb, nl, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-Cyrl, sv, th, tr, uk, vi, zh-CN, zh-TW
|
50
60
|
|
51
61
|
## Example
|
52
62
|
Code [here](https://github.com/argerim/select_2_example)
|
@@ -12,8 +12,9 @@ class SourceFile < Thor
|
|
12
12
|
self.destination_root = "vendor/assets"
|
13
13
|
remote = "https://github.com/select2/select2"
|
14
14
|
get "#{remote}/raw/#{tag}/dist/css/select2.css", "stylesheets/select2.css"
|
15
|
+
get "#{remote}/raw/#{tag}/dist/js/select2.full.js", "javascripts/select2-full.js"
|
15
16
|
get "#{remote}/raw/#{tag}/dist/js/select2.js", "javascripts/select2.js"
|
16
|
-
languages.each do |lang|
|
17
|
+
languages(tag).each do |lang|
|
17
18
|
get "#{remote}/raw/#{tag}/dist/js/i18n/#{lang}.js", "javascripts/select2_locale_#{lang}.js"
|
18
19
|
end
|
19
20
|
end
|
@@ -21,15 +22,17 @@ class SourceFile < Thor
|
|
21
22
|
private
|
22
23
|
|
23
24
|
def fetch_tags
|
24
|
-
|
25
|
-
response = JSON.parse(http.get("https://api.github.com/repos/select2/select2/tags").body)
|
25
|
+
response = JSON.parse(http_client.get("https://api.github.com/repos/select2/select2/tags").body)
|
26
26
|
response.map{|tag| tag["name"]}.sort
|
27
27
|
end
|
28
28
|
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
|
29
|
+
def http_client
|
30
|
+
@http_client ||= HTTPClient.new
|
31
|
+
end
|
32
|
+
|
33
|
+
def languages(tag)
|
34
|
+
response = JSON.parse(http_client.get("https://api.github.com/repos/select2/select2/contents/src/js/select2/i18n?ref=#{tag}").body)
|
35
|
+
response.map {|file| file["name"].gsub('.js', '')}.sort
|
33
36
|
end
|
34
37
|
|
35
38
|
def select msg, elements
|
data/select2-rails.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
|
18
|
-
s.
|
18
|
+
s.add_development_dependency "thor", "~> 1"
|
19
19
|
s.add_development_dependency "bundler", "~> 1.0"
|
20
20
|
s.add_development_dependency "rails", ">= 3.0"
|
21
21
|
s.add_development_dependency "httpclient", "~> 2.2"
|