select2-rails 3.5.2 → 3.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -26,6 +26,10 @@ Add to your `app/assets/stylesheets/application.css`:
26
26
 
27
27
  *= require select2
28
28
 
29
+ If you are using Twitter Boostrap you can require ethe bootstrap theme CSS
30
+
31
+ *= require select2-bootstrap
32
+
29
33
  ## Internationalization (i18n)
30
34
 
31
35
  The `select2-rails` now supports multiple languages.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Select2 Ukrainian translation.
3
+ *
4
+ * @author bigmihail <bigmihail@bigmir.net>
5
+ * @author Uriy Efremochkin <efremochkin@uriy.me>
6
+ */
7
+ (function ($) {
8
+ "use strict";
9
+
10
+ $.extend($.fn.select2.defaults, {
11
+ formatNoMatches: function () { return "Нічого не знайдено"; },
12
+ formatInputTooShort: function (input, min) { return "Введіть буль ласка ще" + character(min - input.length, "символ"); },
13
+ formatInputTooLong: function (input, max) { return "Введіть буль ласка на" + character(input.length - max, "символ") + " менше"; },
14
+ formatSelectionTooBig: function (limit) { return "Ви можете вибрати лише" + character(limit, "елемент"); },
15
+ formatLoadMore: function (pageNumber) { return "Завантаження даних…"; },
16
+ formatSearching: function () { return "Пошук…"; }
17
+ });
18
+
19
+ function character (n, word) {
20
+ return " " + n + " " + word + (n%10 < 5 && n%10 > 0 && (n%100 < 5 || n%100 > 19) ? n%10 > 1 ? "и" : "" : "ів");
21
+ }
22
+ })(jQuery);
@@ -0,0 +1,87 @@
1
+ .form-control .select2-choice {
2
+ border: 0;
3
+ border-radius: 2px;
4
+ }
5
+
6
+ .form-control .select2-choice .select2-arrow {
7
+ border-radius: 0 2px 2px 0;
8
+ }
9
+
10
+ .form-control.select2-container {
11
+ height: auto !important;
12
+ padding: 0px;
13
+ }
14
+
15
+ .form-control.select2-container.select2-dropdown-open {
16
+ border-color: #5897FB;
17
+ border-radius: 3px 3px 0 0;
18
+ }
19
+
20
+ .form-control .select2-container.select2-dropdown-open .select2-choices {
21
+ border-radius: 3px 3px 0 0;
22
+ }
23
+
24
+ .form-control.select2-container .select2-choices {
25
+ border: 0 !important;
26
+ border-radius: 3px;
27
+ }
28
+
29
+ .control-group.warning .select2-container .select2-choice,
30
+ .control-group.warning .select2-container .select2-choices,
31
+ .control-group.warning .select2-container-active .select2-choice,
32
+ .control-group.warning .select2-container-active .select2-choices,
33
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
34
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
35
+ .control-group.warning .select2-container-multi.select2-container-active .select2-choices {
36
+ border: 1px solid #C09853 !important;
37
+ }
38
+
39
+ .control-group.warning .select2-container .select2-choice div {
40
+ border-left: 1px solid #C09853 !important;
41
+ background: #FCF8E3 !important;
42
+ }
43
+
44
+ .control-group.error .select2-container .select2-choice,
45
+ .control-group.error .select2-container .select2-choices,
46
+ .control-group.error .select2-container-active .select2-choice,
47
+ .control-group.error .select2-container-active .select2-choices,
48
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
49
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
50
+ .control-group.error .select2-container-multi.select2-container-active .select2-choices {
51
+ border: 1px solid #B94A48 !important;
52
+ }
53
+
54
+ .control-group.error .select2-container .select2-choice div {
55
+ border-left: 1px solid #B94A48 !important;
56
+ background: #F2DEDE !important;
57
+ }
58
+
59
+ .control-group.info .select2-container .select2-choice,
60
+ .control-group.info .select2-container .select2-choices,
61
+ .control-group.info .select2-container-active .select2-choice,
62
+ .control-group.info .select2-container-active .select2-choices,
63
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
64
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
65
+ .control-group.info .select2-container-multi.select2-container-active .select2-choices {
66
+ border: 1px solid #3A87AD !important;
67
+ }
68
+
69
+ .control-group.info .select2-container .select2-choice div {
70
+ border-left: 1px solid #3A87AD !important;
71
+ background: #D9EDF7 !important;
72
+ }
73
+
74
+ .control-group.success .select2-container .select2-choice,
75
+ .control-group.success .select2-container .select2-choices,
76
+ .control-group.success .select2-container-active .select2-choice,
77
+ .control-group.success .select2-container-active .select2-choices,
78
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
79
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
80
+ .control-group.success .select2-container-multi.select2-container-active .select2-choices {
81
+ border: 1px solid #468847 !important;
82
+ }
83
+
84
+ .control-group.success .select2-container .select2-choice div {
85
+ border-left: 1px solid #468847 !important;
86
+ background: #DFF0D8 !important;
87
+ }
@@ -0,0 +1,87 @@
1
+ .form-control .select2-choice {
2
+ border: 0;
3
+ border-radius: 2px;
4
+ }
5
+
6
+ .form-control .select2-choice .select2-arrow {
7
+ border-radius: 0 2px 2px 0;
8
+ }
9
+
10
+ .form-control.select2-container {
11
+ height: auto !important;
12
+ padding: 0px;
13
+ }
14
+
15
+ .form-control.select2-container.select2-dropdown-open {
16
+ border-color: #5897FB;
17
+ border-radius: 3px 3px 0 0;
18
+ }
19
+
20
+ .form-control .select2-container.select2-dropdown-open .select2-choices {
21
+ border-radius: 3px 3px 0 0;
22
+ }
23
+
24
+ .form-control.select2-container .select2-choices {
25
+ border: 0 !important;
26
+ border-radius: 3px;
27
+ }
28
+
29
+ .control-group.warning .select2-container .select2-choice,
30
+ .control-group.warning .select2-container .select2-choices,
31
+ .control-group.warning .select2-container-active .select2-choice,
32
+ .control-group.warning .select2-container-active .select2-choices,
33
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
34
+ .control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
35
+ .control-group.warning .select2-container-multi.select2-container-active .select2-choices {
36
+ border: 1px solid #C09853 !important;
37
+ }
38
+
39
+ .control-group.warning .select2-container .select2-choice div {
40
+ border-left: 1px solid #C09853 !important;
41
+ background: #FCF8E3 !important;
42
+ }
43
+
44
+ .control-group.error .select2-container .select2-choice,
45
+ .control-group.error .select2-container .select2-choices,
46
+ .control-group.error .select2-container-active .select2-choice,
47
+ .control-group.error .select2-container-active .select2-choices,
48
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
49
+ .control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
50
+ .control-group.error .select2-container-multi.select2-container-active .select2-choices {
51
+ border: 1px solid #B94A48 !important;
52
+ }
53
+
54
+ .control-group.error .select2-container .select2-choice div {
55
+ border-left: 1px solid #B94A48 !important;
56
+ background: #F2DEDE !important;
57
+ }
58
+
59
+ .control-group.info .select2-container .select2-choice,
60
+ .control-group.info .select2-container .select2-choices,
61
+ .control-group.info .select2-container-active .select2-choice,
62
+ .control-group.info .select2-container-active .select2-choices,
63
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choice,
64
+ .control-group.info .select2-dropdown-open.select2-drop-above .select2-choices,
65
+ .control-group.info .select2-container-multi.select2-container-active .select2-choices {
66
+ border: 1px solid #3A87AD !important;
67
+ }
68
+
69
+ .control-group.info .select2-container .select2-choice div {
70
+ border-left: 1px solid #3A87AD !important;
71
+ background: #D9EDF7 !important;
72
+ }
73
+
74
+ .control-group.success .select2-container .select2-choice,
75
+ .control-group.success .select2-container .select2-choices,
76
+ .control-group.success .select2-container-active .select2-choice,
77
+ .control-group.success .select2-container-active .select2-choices,
78
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
79
+ .control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
80
+ .control-group.success .select2-container-multi.select2-container-active .select2-choices {
81
+ border: 1px solid #468847 !important;
82
+ }
83
+
84
+ .control-group.success .select2-container .select2-choice div {
85
+ border-left: 1px solid #468847 !important;
86
+ background: #DFF0D8 !important;
87
+ }
@@ -1,3 +1,6 @@
1
+ //= depend_on_asset "select2.png"
2
+ //= depend_on_asset "select2-spinner.gif"
3
+ //= depend_on_asset "select2x2.png"
1
4
  /*
2
5
  Version: 3.4.5 Timestamp: Mon Nov 4 08:22:42 PST 2013
3
6
  */
@@ -15,6 +15,7 @@ class SourceFile < Thor
15
15
  get "#{remote}/raw/#{tag}/select2x2.png", "images/select2x2.png"
16
16
  get "#{remote}/raw/#{tag}/select2-spinner.gif", "images/select2-spinner.gif"
17
17
  get "#{remote}/raw/#{tag}/select2.css", "stylesheets/select2.css"
18
+ get "#{remote}/raw/#{tag}/select2-bootstrap.css", "stylesheets/select2-bootstrap.css"
18
19
  get "#{remote}/raw/#{tag}/select2.js", "javascripts/select2.js"
19
20
  languages.each do |lang|
20
21
  get "#{remote}/raw/#{tag}/select2_locale_#{lang}.js", "javascripts/select2_locale_#{lang}.js"
@@ -26,6 +27,7 @@ class SourceFile < Thor
26
27
  self.destination_root = "app/assets"
27
28
  inside destination_root do
28
29
  run("cp stylesheets/select2.css stylesheets/select2.css.erb")
30
+ build_image_dependencies
29
31
  gsub_file 'stylesheets/select2.css.erb', %r/url\(([^\)]*)\)/, 'url(<%= asset_path(\1) %>)'
30
32
  end
31
33
  end
@@ -35,7 +37,9 @@ class SourceFile < Thor
35
37
  self.destination_root = "app/assets"
36
38
  remove_file "stylesheets/select2.css"
37
39
  end
40
+
38
41
  private
42
+
39
43
  def fetch_tags
40
44
  http = HTTPClient.new
41
45
  response = JSON.parse(http.get("https://api.github.com/repos/ivaynberg/select2/tags").body)
@@ -54,4 +58,19 @@ class SourceFile < Thor
54
58
  result = ask(msg).to_i
55
59
  elements[result - 1]
56
60
  end
61
+
62
+ def build_image_dependencies
63
+ f = File.open("stylesheets/select2.css.erb", "r+")
64
+ lines = f.readlines
65
+ f.close
66
+ lines = ["//= depend_on_asset \"select2.png\"\n"] +
67
+ ["//= depend_on_asset \"select2-spinner.gif\"\n"] +
68
+ ["//= depend_on_asset \"select2x2.png\"\n"] +
69
+ lines
70
+
71
+ output = File.new("stylesheets/select2.css.erb", "w")
72
+ lines.each { |line| output.write line }
73
+ output.close
74
+ end
75
+
57
76
  end
@@ -1,5 +1,5 @@
1
1
  module Select2
2
2
  module Rails
3
- VERSION = "3.5.2"
3
+ VERSION = "3.5.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: select2-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.2
4
+ version: 3.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-11-22 00:00:00.000000000 Z
13
+ date: 2014-02-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -132,9 +132,12 @@ files:
132
132
  - app/assets/javascripts/select2_locale_th.js
133
133
  - app/assets/javascripts/select2_locale_tr.js
134
134
  - app/assets/javascripts/select2_locale_ua.js
135
+ - app/assets/javascripts/select2_locale_uk.js
135
136
  - app/assets/javascripts/select2_locale_vi.js
136
137
  - app/assets/javascripts/select2_locale_zh-CN.js
137
138
  - app/assets/javascripts/select2_locale_zh-TW.js
139
+ - app/assets/stylesheets/select2-bootstrap.css
140
+ - app/assets/stylesheets/select2-bootstrap.css.erb
138
141
  - app/assets/stylesheets/select2.css.erb
139
142
  - lib/select2-rails.rb
140
143
  - lib/select2-rails/engine.rb