select2-rails 3.5.9.1 → 3.5.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f905192c7ef87ad156560a77960c975629d45bd1
4
- data.tar.gz: 78f225b8fd3081ddea3c5d228f4d1d54dfff874d
3
+ metadata.gz: 45a51cd138f4061db35c67941d59577cfb2effb9
4
+ data.tar.gz: ba4b06edc8fb49619bba17800a430ee517e62588
5
5
  SHA512:
6
- metadata.gz: d4059e2a9461fe63a12ae4e9d406d02b3e4f98c5e0a3498596f99b4f0649d3a8a48d32a2e0572e8f5a799e3d07bf15353a8ff43ed219b9b34476270d759fdfc9
7
- data.tar.gz: 1b7e800c6eed3d3f3b34c6281cfc485196dfa1603e22f47dbb7e60a498fb68a54f9374850264671722419d5cca16f3b56c2a7c9f68aecf9dd0801486e74979b6
6
+ metadata.gz: 7c892de7958c6703d5716030adb47d50bc2450e16c518a52f7efe44167a423e73a9c54de19309fa4fb047525cc34b2c5bddd136ae72b4128bbabde86bcd60eda
7
+ data.tar.gz: 0f2355b3cb2a448270672954627009ae37cbab80bbd128b36f40820321d3f0e0f963f02e29a2e96992068a3a077dff44a10d356eb80f7f90728ffa25e813b399
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  #Select2 for rails asset pipeline
2
2
 
3
- [Select2](https://github.com/ivaynberg/select2) is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.
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
 
5
5
  The `select2-rails` gem integrates the `Select2` jQuery plugin with the Rails asset pipeline.
6
6
 
data/Rakefile CHANGED
@@ -7,5 +7,4 @@ task "update-select2" do
7
7
  files = SourceFile.new
8
8
  files.fetch
9
9
  files.convert
10
- files.cleanup
11
10
  end
@@ -10,7 +10,7 @@ class SourceFile < Thor
10
10
  filtered_tags = fetch_tags
11
11
  tag = select("Which tag do you want to fetch?", filtered_tags)
12
12
  self.destination_root = "vendor/assets"
13
- remote = "https://github.com/ivaynberg/select2"
13
+ remote = "https://github.com/select2/select2"
14
14
  get "#{remote}/raw/#{tag}/select2.png", "images/select2.png"
15
15
  get "#{remote}/raw/#{tag}/select2x2.png", "images/select2x2.png"
16
16
  get "#{remote}/raw/#{tag}/select2-spinner.gif", "images/select2-spinner.gif"
@@ -34,14 +34,15 @@ class SourceFile < Thor
34
34
 
35
35
  def fetch_tags
36
36
  http = HTTPClient.new
37
- response = JSON.parse(http.get("https://api.github.com/repos/ivaynberg/select2/tags").body)
37
+ #http.ssl_config.ssl_version = :SSLv23
38
+ response = JSON.parse(http.get("https://api.github.com/repos/select2/select2/tags").body)
38
39
  response.map{|tag| tag["name"]}.sort
39
40
  end
40
41
 
41
42
  def languages
42
- [ "ar", "bg", "ca", "cs", "da", "de", "el", "es", "et", "eu", "fa", "fi", "fr", "gl", "he", "hr",
43
- "hu", "id", "is", "it", "ja", "ka", "ko", "lt", "lv", "mk", "ms", "nl", "no", "pl", "pt-BR",
44
- "pt-PT", "ro", "rs", "ru", "sk", "sv", "th", "tr", "uk", "vi", "zh-CN", "zh-TW"
43
+ [ "ar", "az", "bg", "ca", "cs", "da", "de", "el", "es", "et", "eu", "fa", "fi", "fr", "gl", "he", "hr",
44
+ "hu", "id", "is", "it", "ja", "ka", "ko", "lt", "lv", "mk", "ms", "nb", "nl", "pl", "pt-BR",
45
+ "pt-PT", "ro", "rs", "ru", "sk", "sv", "th", "tr", "ug-CN", "uk", "vi", "zh-CN", "zh-TW"
45
46
  ].sort
46
47
  end
47
48
 
@@ -1,5 +1,5 @@
1
1
  module Select2
2
2
  module Rails
3
- VERSION = "3.5.9.1"
3
+ VERSION = "3.5.9.3"
4
4
  end
5
5
  end
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  Copyright 2012 Igor Vaynberg
3
3
 
4
- Version: 3.5.1
4
+ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
5
5
 
6
6
  This software is licensed under the Apache License, Version 2.0 (the "Apache License") or the GNU
7
7
  General Public License version 2 (the "GPL License"). You may choose either license to govern your
@@ -46,7 +46,7 @@ the specific language governing permissions and limitations under the Apache Lic
46
46
  return;
47
47
  }
48
48
 
49
- var KEY, AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
49
+ var AbstractSelect2, SingleSelect2, MultiSelect2, nextUid, sizer,
50
50
  lastMousePosition={x:0,y:0}, $document, scrollBarDimensions,
51
51
 
52
52
  KEY = {
@@ -132,7 +132,7 @@ the specific language governing permissions and limitations under the Apache Lic
132
132
 
133
133
  function measureScrollbar () {
134
134
  var $template = $( MEASURE_SCROLLBAR_TEMPLATE );
135
- $template.appendTo('body');
135
+ $template.appendTo(document.body);
136
136
 
137
137
  var dim = {
138
138
  width: $template.width() - $template[0].clientWidth,
@@ -160,16 +160,16 @@ the specific language governing permissions and limitations under the Apache Lic
160
160
  }
161
161
 
162
162
  /**
163
- * Splits the string into an array of values, trimming each value. An empty array is returned for nulls or empty
163
+ * Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty
164
164
  * strings
165
165
  * @param string
166
166
  * @param separator
167
167
  */
168
- function splitVal(string, separator) {
168
+ function splitVal(string, separator, transform) {
169
169
  var val, i, l;
170
170
  if (string === null || string.length < 1) return [];
171
171
  val = string.split(separator);
172
- for (i = 0, l = val.length; i < l; i = i + 1) val[i] = $.trim(val[i]);
172
+ for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]);
173
173
  return val;
174
174
  }
175
175
 
@@ -311,7 +311,7 @@ the specific language governing permissions and limitations under the Apache Lic
311
311
  whiteSpace: "nowrap"
312
312
  });
313
313
  sizer.attr("class","select2-sizer");
314
- $("body").append(sizer);
314
+ $(document.body).append(sizer);
315
315
  }
316
316
  sizer.text(e.val());
317
317
  return sizer.width();
@@ -450,7 +450,7 @@ the specific language governing permissions and limitations under the Apache Lic
450
450
  hasError: true,
451
451
  jqXHR: jqXHR,
452
452
  textStatus: textStatus,
453
- errorThrown: errorThrown,
453
+ errorThrown: errorThrown
454
454
  };
455
455
 
456
456
  query.callback(results);
@@ -699,12 +699,15 @@ the specific language governing permissions and limitations under the Apache Lic
699
699
 
700
700
  this.container = this.createContainer();
701
701
 
702
- this.liveRegion = $("<span>", {
703
- role: "status",
704
- "aria-live": "polite"
705
- })
706
- .addClass("select2-hidden-accessible")
707
- .appendTo(document.body);
702
+ this.liveRegion = $('.select2-hidden-accessible');
703
+ if (this.liveRegion.length == 0) {
704
+ this.liveRegion = $("<span>", {
705
+ role: "status",
706
+ "aria-live": "polite"
707
+ })
708
+ .addClass("select2-hidden-accessible")
709
+ .appendTo(document.body);
710
+ }
708
711
 
709
712
  this.containerId="s2id_"+(opts.element.attr("id") || "autogen"+nextUid());
710
713
  this.containerEventName= this.containerId
@@ -714,7 +717,7 @@ the specific language governing permissions and limitations under the Apache Lic
714
717
 
715
718
  this.container.attr("title", opts.element.attr("title"));
716
719
 
717
- this.body = $("body");
720
+ this.body = $(document.body);
718
721
 
719
722
  syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
720
723
 
@@ -850,9 +853,11 @@ the specific language governing permissions and limitations under the Apache Lic
850
853
 
851
854
  this.close();
852
855
 
853
- if (element.length && element[0].detachEvent) {
856
+ if (element.length && element[0].detachEvent && self._sync) {
854
857
  element.each(function () {
855
- this.detachEvent("onpropertychange", self._sync);
858
+ if (self._sync) {
859
+ this.detachEvent("onpropertychange", self._sync);
860
+ }
856
861
  });
857
862
  }
858
863
  if (this.propertyObserver) {
@@ -866,7 +871,7 @@ the specific language governing permissions and limitations under the Apache Lic
866
871
  select2.liveRegion.remove();
867
872
  select2.dropdown.remove();
868
873
  element
869
- .removeClass("select2-offscreen")
874
+ .show()
870
875
  .removeData("select2")
871
876
  .off(".select2")
872
877
  .prop("autofocus", this.autofocus || false);
@@ -1058,7 +1063,7 @@ the specific language governing permissions and limitations under the Apache Lic
1058
1063
  if (opts.initSelection === undefined) {
1059
1064
  opts.initSelection = function (element, callback) {
1060
1065
  var data = [];
1061
- $(splitVal(element.val(), opts.separator)).each(function () {
1066
+ $(splitVal(element.val(), opts.separator, opts.transformVal)).each(function () {
1062
1067
  var obj = { id: this, text: this },
1063
1068
  tags = opts.tags;
1064
1069
  if ($.isFunction(tags)) tags=tags();
@@ -1113,11 +1118,15 @@ the specific language governing permissions and limitations under the Apache Lic
1113
1118
  if (readonly === undefined) readonly = false;
1114
1119
  this.readonly(readonly);
1115
1120
 
1116
- syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
1117
- this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));
1121
+ if (this.container) {
1122
+ syncCssClasses(this.container, this.opts.element, this.opts.adaptContainerCssClass);
1123
+ this.container.addClass(evaluate(this.opts.containerCssClass, this.opts.element));
1124
+ }
1118
1125
 
1119
- syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
1120
- this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));
1126
+ if (this.dropdown) {
1127
+ syncCssClasses(this.dropdown, this.opts.element, this.opts.adaptDropdownCssClass);
1128
+ this.dropdown.addClass(evaluate(this.opts.dropdownCssClass, this.opts.element));
1129
+ }
1121
1130
 
1122
1131
  });
1123
1132
 
@@ -1222,9 +1231,10 @@ the specific language governing permissions and limitations under the Apache Lic
1222
1231
  // abstract
1223
1232
  positionDropdown: function() {
1224
1233
  var $dropdown = this.dropdown,
1225
- offset = this.container.offset(),
1226
- height = this.container.outerHeight(false),
1227
- width = this.container.outerWidth(false),
1234
+ container = this.container,
1235
+ offset = container.offset(),
1236
+ height = container.outerHeight(false),
1237
+ width = container.outerWidth(false),
1228
1238
  dropHeight = $dropdown.outerHeight(false),
1229
1239
  $window = $(window),
1230
1240
  windowWidth = $window.width(),
@@ -1236,7 +1246,12 @@ the specific language governing permissions and limitations under the Apache Lic
1236
1246
  enoughRoomBelow = dropTop + dropHeight <= viewportBottom,
1237
1247
  enoughRoomAbove = (offset.top - dropHeight) >= $window.scrollTop(),
1238
1248
  dropWidth = $dropdown.outerWidth(false),
1239
- enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight,
1249
+ enoughRoomOnRight = function() {
1250
+ return dropLeft + dropWidth <= viewPortRight;
1251
+ },
1252
+ enoughRoomOnLeft = function() {
1253
+ return offset.left + viewPortRight + container.outerWidth(false) > dropWidth;
1254
+ },
1240
1255
  aboveNow = $dropdown.hasClass("select2-drop-above"),
1241
1256
  bodyOffset,
1242
1257
  above,
@@ -1271,7 +1286,6 @@ the specific language governing permissions and limitations under the Apache Lic
1271
1286
  dropTop = offset.top + height;
1272
1287
  dropLeft = offset.left;
1273
1288
  dropWidth = $dropdown.outerWidth(false);
1274
- enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight;
1275
1289
  $dropdown.show();
1276
1290
 
1277
1291
  // fix so the cursor does not move to the left within the search-textbox in IE
@@ -1286,7 +1300,6 @@ the specific language governing permissions and limitations under the Apache Lic
1286
1300
  dropWidth = $dropdown.outerWidth(false) + (resultsListNode.scrollHeight === resultsListNode.clientHeight ? 0 : scrollBarDimensions.width);
1287
1301
  dropWidth > width ? width = dropWidth : dropWidth = width;
1288
1302
  dropHeight = $dropdown.outerHeight(false);
1289
- enoughRoomOnRight = dropLeft + dropWidth <= viewPortRight;
1290
1303
  }
1291
1304
  else {
1292
1305
  this.container.removeClass('select2-drop-auto-width');
@@ -1302,7 +1315,7 @@ the specific language governing permissions and limitations under the Apache Lic
1302
1315
  dropLeft -= bodyOffset.left;
1303
1316
  }
1304
1317
 
1305
- if (!enoughRoomOnRight) {
1318
+ if (!enoughRoomOnRight() && enoughRoomOnLeft()) {
1306
1319
  dropLeft = offset.left + this.container.outerWidth(false) - dropWidth;
1307
1320
  }
1308
1321
 
@@ -1391,7 +1404,7 @@ the specific language governing permissions and limitations under the Apache Lic
1391
1404
 
1392
1405
  // create the dropdown mask if doesn't already exist
1393
1406
  mask = $("#select2-drop-mask");
1394
- if (mask.length == 0) {
1407
+ if (mask.length === 0) {
1395
1408
  mask = $(document.createElement("div"));
1396
1409
  mask.attr("id","select2-drop-mask").attr("class","select2-drop-mask");
1397
1410
  mask.hide();
@@ -1525,7 +1538,7 @@ the specific language governing permissions and limitations under the Apache Lic
1525
1538
  }
1526
1539
  }
1527
1540
 
1528
- rb = results.offset().top + results.outerHeight(true);
1541
+ rb = results.offset().top + results.outerHeight(false);
1529
1542
  if (hb > rb) {
1530
1543
  results.scrollTop(results.scrollTop() + (hb - rb));
1531
1544
  }
@@ -1648,7 +1661,7 @@ the specific language governing permissions and limitations under the Apache Lic
1648
1661
  self.postprocessResults(data, false, false);
1649
1662
 
1650
1663
  if (data.more===true) {
1651
- more.detach().appendTo(results).text(evaluate(self.opts.formatLoadMore, self.opts.element, page+1));
1664
+ more.detach().appendTo(results).html(self.opts.escapeMarkup(evaluate(self.opts.formatLoadMore, self.opts.element, page+1)));
1652
1665
  window.setTimeout(function() { self.loadMoreIfNeeded(); }, 10);
1653
1666
  } else {
1654
1667
  more.remove();
@@ -1701,7 +1714,7 @@ the specific language governing permissions and limitations under the Apache Lic
1701
1714
  self.liveRegion.text(results.text());
1702
1715
  }
1703
1716
  else {
1704
- self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable').length));
1717
+ self.liveRegion.text(self.opts.formatMatches(results.find('.select2-result-selectable:not(".select2-selected")').length));
1705
1718
  }
1706
1719
  }
1707
1720
 
@@ -2096,6 +2109,7 @@ the specific language governing permissions and limitations under the Apache Lic
2096
2109
  this.focusser.attr("id", "s2id_autogen"+idSuffix);
2097
2110
 
2098
2111
  elementLabel = $("label[for='" + this.opts.element.attr("id") + "']");
2112
+ this.opts.element.focus(this.bind(function () { this.focus(); }));
2099
2113
 
2100
2114
  this.focusser.prev()
2101
2115
  .text(elementLabel.text())
@@ -2200,11 +2214,17 @@ the specific language governing permissions and limitations under the Apache Lic
2200
2214
  }));
2201
2215
 
2202
2216
  selection.on("mousedown touchstart", "abbr", this.bind(function (e) {
2203
- if (!this.isInterfaceEnabled()) return;
2217
+ if (!this.isInterfaceEnabled()) {
2218
+ return;
2219
+ }
2220
+
2204
2221
  this.clear();
2205
2222
  killEventImmediately(e);
2206
2223
  this.close();
2207
- this.selection.focus();
2224
+
2225
+ if (this.selection) {
2226
+ this.selection.focus();
2227
+ }
2208
2228
  }));
2209
2229
 
2210
2230
  selection.on("mousedown touchstart", this.bind(function (e) {
@@ -2253,7 +2273,7 @@ the specific language governing permissions and limitations under the Apache Lic
2253
2273
  }));
2254
2274
 
2255
2275
  this.initContainerWidth();
2256
- this.opts.element.addClass("select2-offscreen");
2276
+ this.opts.element.hide();
2257
2277
  this.setPlaceholder();
2258
2278
 
2259
2279
  },
@@ -2582,7 +2602,6 @@ the specific language governing permissions and limitations under the Apache Lic
2582
2602
  self=this;
2583
2603
 
2584
2604
  // TODO validate placeholder is a string if specified
2585
-
2586
2605
  if (opts.element.get(0).tagName.toLowerCase() === "select") {
2587
2606
  // install the selection initializer
2588
2607
  opts.initSelection = function (element, callback) {
@@ -2597,7 +2616,7 @@ the specific language governing permissions and limitations under the Apache Lic
2597
2616
  } else if ("data" in opts) {
2598
2617
  // install default initSelection when applied to hidden input and data is local
2599
2618
  opts.initSelection = opts.initSelection || function (element, callback) {
2600
- var ids = splitVal(element.val(), opts.separator);
2619
+ var ids = splitVal(element.val(), opts.separator, opts.transformVal);
2601
2620
  //search in data by array of ids, storing matching items in a list
2602
2621
  var matches = [];
2603
2622
  opts.query({
@@ -2674,8 +2693,7 @@ the specific language governing permissions and limitations under the Apache Lic
2674
2693
  this.selection = selection = this.container.find(selector);
2675
2694
 
2676
2695
  var _this = this;
2677
- this.selection.on("click", ".select2-search-choice:not(.select2-locked)", function (e) {
2678
- //killEvent(e);
2696
+ this.selection.on("click", ".select2-container:not(.select2-container-disabled) .select2-search-choice:not(.select2-locked)", function (e) {
2679
2697
  _this.search[0].focus();
2680
2698
  _this.selectChoice($(this));
2681
2699
  });
@@ -2686,6 +2704,7 @@ the specific language governing permissions and limitations under the Apache Lic
2686
2704
  this.search.prev()
2687
2705
  .text($("label[for='" + this.opts.element.attr("id") + "']").text())
2688
2706
  .attr('for', this.search.attr('id'));
2707
+ this.opts.element.focus(this.bind(function () { this.focus(); }));
2689
2708
 
2690
2709
  this.search.on("input paste", this.bind(function() {
2691
2710
  if (this.search.attr('placeholder') && this.search.val().length == 0) return;
@@ -2837,7 +2856,7 @@ the specific language governing permissions and limitations under the Apache Lic
2837
2856
  }));
2838
2857
 
2839
2858
  this.initContainerWidth();
2840
- this.opts.element.addClass("select2-offscreen");
2859
+ this.opts.element.hide();
2841
2860
 
2842
2861
  // set the placeholder if necessary
2843
2862
  this.clearSearch();
@@ -3046,7 +3065,7 @@ the specific language governing permissions and limitations under the Apache Lic
3046
3065
 
3047
3066
  formatted=this.opts.formatSelection(data, choice.find("div"), this.opts.escapeMarkup);
3048
3067
  if (formatted != undefined) {
3049
- choice.find("div").replaceWith("<div>"+formatted+"</div>");
3068
+ choice.find("div").replaceWith($("<div></div>").html(formatted));
3050
3069
  }
3051
3070
  cssClass=this.opts.formatSelectionCssClass(data, choice.find("div"));
3052
3071
  if (cssClass != undefined) {
@@ -3144,7 +3163,7 @@ the specific language governing permissions and limitations under the Apache Lic
3144
3163
  }
3145
3164
  });
3146
3165
 
3147
- if (this.highlight() == -1 && noHighlightUpdate !== false){
3166
+ if (this.highlight() == -1 && noHighlightUpdate !== false && this.opts.closeOnSelect === true){
3148
3167
  self.highlight(0);
3149
3168
  }
3150
3169
 
@@ -3201,7 +3220,7 @@ the specific language governing permissions and limitations under the Apache Lic
3201
3220
  return val === null ? [] : val;
3202
3221
  } else {
3203
3222
  val = this.opts.element.val();
3204
- return splitVal(val, this.opts.separator);
3223
+ return splitVal(val, this.opts.separator, this.opts.transformVal);
3205
3224
  }
3206
3225
  },
3207
3226
 
@@ -3231,7 +3250,7 @@ the specific language governing permissions and limitations under the Apache Lic
3231
3250
  if (equal(this.opts.id(current[i]), this.opts.id(old[j]))) {
3232
3251
  current.splice(i, 1);
3233
3252
  if(i>0){
3234
- i--;
3253
+ i--;
3235
3254
  }
3236
3255
  old.splice(j, 1);
3237
3256
  j--;
@@ -3414,11 +3433,14 @@ the specific language governing permissions and limitations under the Apache Lic
3414
3433
  dropdownCssClass: "",
3415
3434
  formatResult: function(result, container, query, escapeMarkup) {
3416
3435
  var markup=[];
3417
- markMatch(result.text, query.term, markup, escapeMarkup);
3436
+ markMatch(this.text(result), query.term, markup, escapeMarkup);
3418
3437
  return markup.join("");
3419
3438
  },
3439
+ transformVal: function(val) {
3440
+ return $.trim(val);
3441
+ },
3420
3442
  formatSelection: function (data, container, escapeMarkup) {
3421
- return data ? escapeMarkup(data.text) : undefined;
3443
+ return data ? escapeMarkup(this.text(data)) : undefined;
3422
3444
  },
3423
3445
  sortResults: function (results, container, query) {
3424
3446
  return results;
@@ -3430,6 +3452,17 @@ the specific language governing permissions and limitations under the Apache Lic
3430
3452
  maximumInputLength: null,
3431
3453
  maximumSelectionSize: 0,
3432
3454
  id: function (e) { return e == undefined ? null : e.id; },
3455
+ text: function (e) {
3456
+ if (e && this.data && this.data.text) {
3457
+ if ($.isFunction(this.data.text)) {
3458
+ return this.data.text(e);
3459
+ } else {
3460
+ return e[this.data.text];
3461
+ }
3462
+ } else {
3463
+ return e.text;
3464
+ }
3465
+ },
3433
3466
  matcher: function(term, text) {
3434
3467
  return stripDiacritics(''+text).toUpperCase().indexOf(stripDiacritics(''+term).toUpperCase()) >= 0;
3435
3468
  },
@@ -3473,7 +3506,7 @@ the specific language governing permissions and limitations under the Apache Lic
3473
3506
  formatInputTooLong: function (input, max) { var n = input.length - max; return "Please delete " + n + " character" + (n == 1 ? "" : "s"); },
3474
3507
  formatSelectionTooBig: function (limit) { return "You can only select " + limit + " item" + (limit == 1 ? "" : "s"); },
3475
3508
  formatLoadMore: function (pageNumber) { return "Loading more results…"; },
3476
- formatSearching: function () { return "Searching…"; },
3509
+ formatSearching: function () { return "Searching…"; }
3477
3510
  };
3478
3511
 
3479
3512
  $.extend($.fn.select2.defaults, $.fn.select2.locales['en']);
@@ -1,4 +1,4 @@
1
- /**
1
+ /**
2
2
  * Select2 Arabic translation.
3
3
  *
4
4
  * Author: Adel KEDJOUR <adel@kedjour.com>
@@ -10,7 +10,7 @@
10
10
  formatNoMatches: function () { return "لم يتم العثور على مطابقات"; },
11
11
  formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; },
12
12
  formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; },
13
- formatSelectionTooBig: function (limit) { if (n == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return n == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + n + " إختيارات فقط"; },
13
+ formatSelectionTooBig: function (limit) { if (limit == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return limit == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + limit + " إختيارات فقط"; },
14
14
  formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; },
15
15
  formatSearching: function () { return "البحث…"; }
16
16
  };
@@ -5,12 +5,14 @@
5
5
  "use strict";
6
6
 
7
7
  $.fn.select2.locales['es'] = {
8
+ formatMatches: function (matches) { if (matches === 1) { return "Un resultado disponible, presione enter para seleccionarlo."; } return matches + " resultados disponibles, use las teclas de dirección para navegar."; },
8
9
  formatNoMatches: function () { return "No se encontraron resultados"; },
9
10
  formatInputTooShort: function (input, min) { var n = min - input.length; return "Por favor, introduzca " + n + " car" + (n == 1? "ácter" : "acteres"); },
10
11
  formatInputTooLong: function (input, max) { var n = input.length - max; return "Por favor, elimine " + n + " car" + (n == 1? "ácter" : "acteres"); },
11
12
  formatSelectionTooBig: function (limit) { return "Sólo puede seleccionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
12
13
  formatLoadMore: function (pageNumber) { return "Cargando más resultados…"; },
13
- formatSearching: function () { return "Buscando…"; }
14
+ formatSearching: function () { return "Buscando…"; },
15
+ formatAjaxError: function() { return "La carga falló"; }
14
16
  };
15
17
 
16
18
  $.extend($.fn.select2.defaults, $.fn.select2.locales['es']);
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Select2 Norwegian Bokmål translation.
3
+ *
4
+ * Author: Torgeir Veimo <torgeir.veimo@gmail.com>
5
+ * Author: Bjørn Johansen <post@bjornjohansen.no>
6
+ */
7
+ (function ($) {
8
+ "use strict";
9
+
10
+ $.fn.select2.locales['nb'] = {
11
+ formatMatches: function (matches) { if (matches === 1) { return "Ett resultat er tilgjengelig, trykk enter for å velge det."; } return matches + " resultater er tilgjengelig. Bruk piltastene opp og ned for å navigere."; },
12
+ formatNoMatches: function () { return "Ingen treff"; },
13
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Vennligst skriv inn " + n + (n>1 ? " flere tegn" : " tegn til"); },
14
+ formatInputTooLong: function (input, max) { var n = input.length - max; return "Vennligst fjern " + n + " tegn"; },
15
+ formatSelectionTooBig: function (limit) { return "Du kan velge maks " + limit + " elementer"; },
16
+ formatLoadMore: function (pageNumber) { return "Laster flere resultater …"; },
17
+ formatSearching: function () { return "Søker …"; }
18
+ };
19
+
20
+ $.extend($.fn.select2.defaults, $.fn.select2.locales['no']);
21
+ })(jQuery);
22
+
@@ -1,25 +1,54 @@
1
1
  /**
2
2
  * Select2 Polish translation.
3
- *
3
+ *
4
4
  * @author Jan Kondratowicz <jan@kondratowicz.pl>
5
5
  * @author Uriy Efremochkin <efremochkin@uriy.me>
6
6
  * @author Michał Połtyn <mike@poltyn.com>
7
+ * @author Damian Zajkowski <damian.zajkowski@gmail.com>
7
8
  */
8
- (function ($) {
9
+ (function($) {
9
10
  "use strict";
10
11
 
11
12
  $.fn.select2.locales['pl'] = {
12
- formatNoMatches: function () { return "Brak wyników"; },
13
- formatInputTooShort: function (input, min) { return "Wpisz co najmniej" + character(min - input.length, "znak", "i"); },
14
- formatInputTooLong: function (input, max) { return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i"); },
15
- formatSelectionTooBig: function (limit) { return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y"); },
16
- formatLoadMore: function (pageNumber) { return "Ładowanie wyników…"; },
17
- formatSearching: function () { return "Szukanie…"; }
13
+ formatNoMatches: function() {
14
+ return "Brak wyników";
15
+ },
16
+ formatInputTooShort: function(input, min) {
17
+ return "Wpisz co najmniej" + character(min - input.length, "znak", "i");
18
+ },
19
+ formatInputTooLong: function(input, max) {
20
+ return "Wpisana fraza jest za długa o" + character(input.length - max, "znak", "i");
21
+ },
22
+ formatSelectionTooBig: function(limit) {
23
+ return "Możesz zaznaczyć najwyżej" + character(limit, "element", "y");
24
+ },
25
+ formatLoadMore: function(pageNumber) {
26
+ return "Ładowanie wyników…";
27
+ },
28
+ formatSearching: function() {
29
+ return "Szukanie…";
30
+ }
18
31
  };
19
32
 
20
33
  $.extend($.fn.select2.defaults, $.fn.select2.locales['pl']);
21
34
 
22
- function character (n, word, pluralSuffix) {
23
- return " " + n + " " + word + (n == 1 ? "" : n%10 < 5 && n%10 > 1 && (n%100 < 5 || n%100 > 20) ? pluralSuffix : "ów");
35
+ function character(n, word, pluralSuffix) {
36
+ //Liczba pojedyncza - brak suffiksu
37
+ //jeden znak
38
+ //jeden element
39
+ var suffix = '';
40
+ if (n > 1 && n < 5) {
41
+ //Liczaba mnoga ilość od 2 do 4 - własny suffiks
42
+ //Dwa znaki, trzy znaki, cztery znaki.
43
+ //Dwa elementy, trzy elementy, cztery elementy
44
+ suffix = pluralSuffix;
45
+ } else if (n == 0 || n >= 5) {
46
+ //Ilość 0 suffiks ów
47
+ //Liczaba mnoga w ilości 5 i więcej - suffiks ów (nie poprawny dla wszystkich wyrazów, np. 100 wiadomości)
48
+ //Zero znaków, Pięć znaków, sześć znaków, siedem znaków, osiem znaków.
49
+ //Zero elementów Pięć elementów, sześć elementów, siedem elementów, osiem elementów.
50
+ suffix = 'ów';
51
+ }
52
+ return " " + n + " " + word + suffix;
24
53
  }
25
54
  })(jQuery);
@@ -6,7 +6,8 @@
6
6
 
7
7
  $.fn.select2.locales['pt-BR'] = {
8
8
  formatNoMatches: function () { return "Nenhum resultado encontrado"; },
9
- formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite mais " + n + " caracter" + (n == 1? "" : "es"); },
9
+ formatAjaxError: function () { return "Erro na busca"; },
10
+ formatInputTooShort: function (input, min) { var n = min - input.length; return "Digite " + (min == 1 ? "" : "mais") + " " + n + " caracter" + (n == 1? "" : "es"); },
10
11
  formatInputTooLong: function (input, max) { var n = input.length - max; return "Apague " + n + " caracter" + (n == 1? "" : "es"); },
11
12
  formatSelectionTooBig: function (limit) { return "Só é possível selecionar " + limit + " elemento" + (limit == 1 ? "" : "s"); },
12
13
  formatLoadMore: function (pageNumber) { return "Carregando mais resultados…"; },
@@ -27,7 +27,7 @@
27
27
  var n = input.length - max;
28
28
  if (n == 1) {
29
29
  return "Prosím, zadajte o jeden znak menej";
30
- } else if (n <= 4) {
30
+ } else if (n >= 2 && n <= 4) {
31
31
  return "Prosím, zadajte o "+smallNumbers[n](true)+" znaky menej";
32
32
  } else {
33
33
  return "Prosím, zadajte o "+n+" znakov menej";
@@ -36,7 +36,7 @@
36
36
  formatSelectionTooBig: function (limit) {
37
37
  if (limit == 1) {
38
38
  return "Môžete zvoliť len jednu položku";
39
- } else if (limit <= 4) {
39
+ } else if (limit >= 2 && limit <= 4) {
40
40
  return "Môžete zvoliť najviac "+smallNumbers[limit](false)+" položky";
41
41
  } else {
42
42
  return "Môžete zvoliť najviac "+limit+" položiek";
@@ -1,87 +1,497 @@
1
- .form-control .select2-choice {
2
- border: 0;
3
- border-radius: 2px;
1
+ /**
2
+ * Select2 Bootstrap 3 CSS v1.4.1
3
+ * Tested with Bootstrap v3.2.0 and Select2 v3.3.2, v3.4.1-v3.4.5, v3.5.1, master
4
+ * in latest Chrome, Safari, Firefox, Opera (Mac) and IE8-IE11
5
+ * MIT License
6
+ */
7
+ /**
8
+ * Reset Bootstrap 3 .form-control styles which - if applied to the
9
+ * original <select>-element the Select2-plugin may be run against -
10
+ * are copied to the .select2-container.
11
+ *
12
+ * 1. Overwrite .select2-container's original display:inline-block
13
+ * with Bootstrap 3's default for .form-control, display:block;
14
+ * courtesy of @juristr (@see https://github.com/fk/select2-bootstrap-css/pull/1)
15
+ */
16
+ .select2-container.form-control {
17
+ background: transparent;
18
+ border: none;
19
+ display: block;
20
+ /* 1 */
21
+ margin: 0;
22
+ padding: 0;
4
23
  }
5
24
 
6
- .form-control .select2-choice .select2-arrow {
7
- border-radius: 0 2px 2px 0;
25
+ /**
26
+ * Adjust Select2 inputs to fit Bootstrap 3 default .form-control appearance.
27
+ */
28
+ .select2-container .select2-choices .select2-search-field input,
29
+ .select2-container .select2-choice,
30
+ .select2-container .select2-choices {
31
+ background: none;
32
+ padding: 0;
33
+ border-color: #cccccc;
34
+ border-radius: 4px;
35
+ color: #555555;
36
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
37
+ background-color: white;
38
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
39
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
40
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
8
41
  }
9
42
 
10
- .form-control.select2-container {
11
- height: auto !important;
12
- padding: 0;
43
+ .select2-search input {
44
+ border-color: #cccccc;
45
+ border-radius: 4px;
46
+ color: #555555;
47
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
48
+ background-color: white;
49
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
50
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
51
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
13
52
  }
14
53
 
15
- .form-control.select2-container.select2-dropdown-open {
16
- border-color: #5897FB;
17
- border-radius: 3px 3px 0 0;
54
+ .select2-container .select2-choices .select2-search-field input {
55
+ -webkit-box-shadow: none;
56
+ box-shadow: none;
18
57
  }
19
58
 
20
- .form-control .select2-container.select2-dropdown-open .select2-choices {
21
- border-radius: 3px 3px 0 0;
59
+ /**
60
+ * Adjust Select2 input heights to match the Bootstrap default.
61
+ */
62
+ .select2-container .select2-choice {
63
+ height: 34px;
64
+ line-height: 1.42857;
22
65
  }
23
66
 
24
- .form-control.select2-container .select2-choices {
25
- border: 0 !important;
26
- border-radius: 3px;
67
+ /**
68
+ * Address Multi Select2's height which - depending on how many elements have been selected -
69
+ * may grown higher than their initial size.
70
+ */
71
+ .select2-container.select2-container-multi.form-control {
72
+ height: auto;
27
73
  }
28
74
 
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;
75
+ /**
76
+ * Address Bootstrap 3 control sizing classes
77
+ * @see http://getbootstrap.com/css/#forms-control-sizes
78
+ */
79
+ .select2-container.input-sm .select2-choice,
80
+ .input-group-sm .select2-container .select2-choice {
81
+ height: 30px;
82
+ line-height: 1.5;
83
+ border-radius: 3px;
37
84
  }
38
85
 
39
- .control-group.warning .select2-container .select2-choice div {
40
- border-left: 1px solid #C09853 !important;
41
- background: #FCF8E3 !important;
86
+ .select2-container.input-lg .select2-choice,
87
+ .input-group-lg .select2-container .select2-choice {
88
+ height: 46px;
89
+ line-height: 1.33;
90
+ border-radius: 6px;
42
91
  }
43
92
 
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;
93
+ .select2-container-multi .select2-choices .select2-search-field input {
94
+ height: 32px;
52
95
  }
53
96
 
54
- .control-group.error .select2-container .select2-choice div {
55
- border-left: 1px solid #B94A48 !important;
56
- background: #F2DEDE !important;
97
+ .select2-container-multi.input-sm .select2-choices .select2-search-field input,
98
+ .input-group-sm .select2-container-multi .select2-choices .select2-search-field input {
99
+ height: 28px;
57
100
  }
58
101
 
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;
102
+ .select2-container-multi.input-lg .select2-choices .select2-search-field input,
103
+ .input-group-lg .select2-container-multi .select2-choices .select2-search-field input {
104
+ height: 44px;
67
105
  }
68
106
 
69
- .control-group.info .select2-container .select2-choice div {
70
- border-left: 1px solid #3A87AD !important;
71
- background: #D9EDF7 !important;
107
+ /**
108
+ * Adjust height and line-height for .select2-search-field amd multi-select Select2 widgets.
109
+ *
110
+ * 1. Class repetition to address missing .select2-chosen in Select2 < 3.3.2.
111
+ */
112
+ .select2-container-multi .select2-choices .select2-search-field input {
113
+ margin: 0;
72
114
  }
73
115
 
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;
116
+ .select2-chosen,
117
+ .select2-choice > span:first-child,
118
+ .select2-container .select2-choices .select2-search-field input {
119
+ padding: 6px 12px;
82
120
  }
83
121
 
84
- .control-group.success .select2-container .select2-choice div {
85
- border-left: 1px solid #468847 !important;
86
- background: #DFF0D8 !important;
122
+ .input-sm .select2-chosen,
123
+ .input-group-sm .select2-chosen,
124
+ .input-sm .select2-choice > span:first-child,
125
+ .input-group-sm .select2-choice > span:first-child,
126
+ .input-sm .select2-choices .select2-search-field input,
127
+ .input-group-sm .select2-choices .select2-search-field input {
128
+ padding: 5px 10px;
129
+ }
130
+
131
+ .input-lg .select2-chosen,
132
+ .input-group-lg .select2-chosen,
133
+ .input-lg .select2-choice > span:first-child,
134
+ .input-group-lg .select2-choice > span:first-child,
135
+ .input-lg .select2-choices .select2-search-field input,
136
+ .input-group-lg .select2-choices .select2-search-field input {
137
+ padding: 10px 16px;
138
+ }
139
+
140
+ .select2-container-multi .select2-choices .select2-search-choice {
141
+ margin-top: 5px;
142
+ margin-bottom: 3px;
143
+ }
144
+
145
+ .select2-container-multi.input-sm .select2-choices .select2-search-choice,
146
+ .input-group-sm .select2-container-multi .select2-choices .select2-search-choice {
147
+ margin-top: 3px;
148
+ margin-bottom: 2px;
149
+ }
150
+
151
+ .select2-container-multi.input-lg .select2-choices .select2-search-choice,
152
+ .input-group-lg .select2-container-multi .select2-choices .select2-search-choice {
153
+ line-height: 24px;
154
+ }
155
+
156
+ /**
157
+ * Adjust the single Select2's dropdown arrow button appearance.
158
+ *
159
+ * 1. For Select2 v.3.3.2.
160
+ */
161
+ .select2-container .select2-choice .select2-arrow,
162
+ .select2-container .select2-choice div {
163
+ border-left: 1px solid #cccccc;
164
+ background: none;
165
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
166
+ }
167
+
168
+ .select2-dropdown-open .select2-choice .select2-arrow,
169
+ .select2-dropdown-open .select2-choice div {
170
+ border-left-color: transparent;
171
+ background: none;
172
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
173
+ }
174
+
175
+ /**
176
+ * Adjust the dropdown arrow button icon position for the single-select Select2 elements
177
+ * to make it line up vertically now that we increased the height of .select2-container.
178
+ *
179
+ * 1. Class repetition to address missing .select2-chosen in Select2 v.3.3.2.
180
+ */
181
+ .select2-container .select2-choice .select2-arrow b,
182
+ .select2-container .select2-choice div b {
183
+ background-position: 0 3px;
184
+ }
185
+
186
+ .select2-dropdown-open .select2-choice .select2-arrow b,
187
+ .select2-dropdown-open .select2-choice div b {
188
+ background-position: -18px 3px;
189
+ }
190
+
191
+ .select2-container.input-sm .select2-choice .select2-arrow b,
192
+ .input-group-sm .select2-container .select2-choice .select2-arrow b,
193
+ .select2-container.input-sm .select2-choice div b,
194
+ .input-group-sm .select2-container .select2-choice div b {
195
+ background-position: 0 1px;
196
+ }
197
+
198
+ .select2-dropdown-open.input-sm .select2-choice .select2-arrow b,
199
+ .input-group-sm .select2-dropdown-open .select2-choice .select2-arrow b,
200
+ .select2-dropdown-open.input-sm .select2-choice div b,
201
+ .input-group-sm .select2-dropdown-open .select2-choice div b {
202
+ background-position: -18px 1px;
203
+ }
204
+
205
+ .select2-container.input-lg .select2-choice .select2-arrow b,
206
+ .input-group-lg .select2-container .select2-choice .select2-arrow b,
207
+ .select2-container.input-lg .select2-choice div b,
208
+ .input-group-lg .select2-container .select2-choice div b {
209
+ background-position: 0 9px;
210
+ }
211
+
212
+ .select2-dropdown-open.input-lg .select2-choice .select2-arrow b,
213
+ .input-group-lg .select2-dropdown-open .select2-choice .select2-arrow b,
214
+ .select2-dropdown-open.input-lg .select2-choice div b,
215
+ .input-group-lg .select2-dropdown-open .select2-choice div b {
216
+ background-position: -18px 9px;
217
+ }
218
+
219
+ /**
220
+ * Address Bootstrap's validation states and change Select2's border colors and focus states.
221
+ * Apply .has-warning, .has-danger or .has-succes to #select2-drop to match Bootstraps' colors.
222
+ */
223
+ .has-warning .select2-choice,
224
+ .has-warning .select2-choices {
225
+ border-color: #8a6d3b;
226
+ }
227
+ .has-warning .select2-container-active .select2-choice,
228
+ .has-warning .select2-container-multi.select2-container-active .select2-choices {
229
+ border-color: #66512c;
230
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
231
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #c0a16b;
232
+ }
233
+ .has-warning.select2-drop-active {
234
+ border-color: #66512c;
235
+ }
236
+ .has-warning.select2-drop-active.select2-drop.select2-drop-above {
237
+ border-top-color: #66512c;
238
+ }
239
+
240
+ .has-error .select2-choice,
241
+ .has-error .select2-choices {
242
+ border-color: #a94442;
243
+ }
244
+ .has-error .select2-container-active .select2-choice,
245
+ .has-error .select2-container-multi.select2-container-active .select2-choices {
246
+ border-color: #843534;
247
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
248
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ce8483;
249
+ }
250
+ .has-error.select2-drop-active {
251
+ border-color: #843534;
252
+ }
253
+ .has-error.select2-drop-active.select2-drop.select2-drop-above {
254
+ border-top-color: #843534;
255
+ }
256
+
257
+ .has-success .select2-choice,
258
+ .has-success .select2-choices {
259
+ border-color: #3c763d;
260
+ }
261
+ .has-success .select2-container-active .select2-choice,
262
+ .has-success .select2-container-multi.select2-container-active .select2-choices {
263
+ border-color: #2b542c;
264
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
265
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #67b168;
266
+ }
267
+ .has-success.select2-drop-active {
268
+ border-color: #2b542c;
269
+ }
270
+ .has-success.select2-drop-active.select2-drop.select2-drop-above {
271
+ border-top-color: #2b542c;
272
+ }
273
+
274
+ /**
275
+ * Make Select2's active-styles - applied to .select2-container when the widget receives focus -
276
+ * fit Bootstrap 3's .form-element:focus appearance.
277
+ */
278
+ .select2-container-active .select2-choice,
279
+ .select2-container-multi.select2-container-active .select2-choices {
280
+ border-color: #66afe9;
281
+ outline: none;
282
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
283
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
284
+ -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
285
+ -o-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
286
+ transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
287
+ }
288
+
289
+ .select2-drop-active {
290
+ border-color: #66afe9;
291
+ }
292
+
293
+ .select2-drop-auto-width,
294
+ .select2-drop.select2-drop-above.select2-drop-active {
295
+ border-top-color: #66afe9;
296
+ }
297
+
298
+ /**
299
+ * Select2 widgets in Bootstrap Input Groups
300
+ *
301
+ * When Select2 widgets are combined with other elements using Bootstrap 3's
302
+ * "Input Group" component, we don't want specific edges of the Select2 container
303
+ * to have a border-radius.
304
+ *
305
+ * In Bootstrap 2, input groups required a markup where these style adjustments
306
+ * could be bound to a CSS-class identifying if the additional elements are appended,
307
+ * prepended or both.
308
+ *
309
+ * Bootstrap 3 doesn't rely on these classes anymore, so we have to use our own.
310
+ * Use .select2-bootstrap-prepend and .select2-bootstrap-append on a Bootstrap 3 .input-group
311
+ * to let the contained Select2 widget know which edges should not be rounded as they are
312
+ * directly followed by another element.
313
+ *
314
+ * @see http://getbootstrap.com/components/#input-groups
315
+ */
316
+ .input-group.select2-bootstrap-prepend [class^="select2-choice"] {
317
+ border-bottom-left-radius: 0 !important;
318
+ border-top-left-radius: 0 !important;
319
+ }
320
+
321
+ .input-group.select2-bootstrap-append [class^="select2-choice"] {
322
+ border-bottom-right-radius: 0 !important;
323
+ border-top-right-radius: 0 !important;
324
+ }
325
+
326
+ .select2-dropdown-open [class^="select2-choice"] {
327
+ border-bottom-right-radius: 0 !important;
328
+ border-bottom-left-radius: 0 !important;
329
+ }
330
+
331
+ .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
332
+ border-top-right-radius: 0 !important;
333
+ border-top-left-radius: 0 !important;
334
+ border-bottom-right-radius: 4px !important;
335
+ border-bottom-left-radius: 4px !important;
336
+ }
337
+ .input-group.select2-bootstrap-prepend .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
338
+ border-bottom-left-radius: 0 !important;
339
+ border-top-left-radius: 0 !important;
340
+ }
341
+ .input-group.select2-bootstrap-append .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
342
+ border-bottom-right-radius: 0 !important;
343
+ border-top-right-radius: 0 !important;
344
+ }
345
+ .input-group.input-group-sm.select2-bootstrap-prepend .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
346
+ border-bottom-right-radius: 3px !important;
347
+ }
348
+ .input-group.input-group-lg.select2-bootstrap-prepend .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
349
+ border-bottom-right-radius: 6px !important;
350
+ }
351
+ .input-group.input-group-sm.select2-bootstrap-append .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
352
+ border-bottom-left-radius: 3px !important;
353
+ }
354
+ .input-group.input-group-lg.select2-bootstrap-append .select2-dropdown-open.select2-drop-above [class^="select2-choice"] {
355
+ border-bottom-left-radius: 6px !important;
356
+ }
357
+
358
+ /**
359
+ * Adjust Select2's choices hover and selected styles to match Bootstrap 3's default dropdown styles.
360
+ */
361
+ .select2-results .select2-highlighted {
362
+ color: white;
363
+ background-color: #428bca;
364
+ }
365
+
366
+ /**
367
+ * Adjust alignment of Bootstrap 3 buttons in Bootstrap 3 Input Groups to address
368
+ * Multi Select2's height which - depending on how many elements have been selected -
369
+ * may grown higher than their initial size.
370
+ */
371
+ .select2-bootstrap-append .select2-container-multiple,
372
+ .select2-bootstrap-append .input-group-btn,
373
+ .select2-bootstrap-append .input-group-btn .btn,
374
+ .select2-bootstrap-prepend .select2-container-multiple,
375
+ .select2-bootstrap-prepend .input-group-btn,
376
+ .select2-bootstrap-prepend .input-group-btn .btn {
377
+ vertical-align: top;
378
+ }
379
+
380
+ /**
381
+ * Make Multi Select2's choices match Bootstrap 3's default button styles.
382
+ */
383
+ .select2-container-multi .select2-choices .select2-search-choice {
384
+ color: #555555;
385
+ background: white;
386
+ border-color: #cccccc;
387
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
388
+ -webkit-box-shadow: none;
389
+ box-shadow: none;
390
+ }
391
+
392
+ .select2-container-multi .select2-choices .select2-search-choice-focus {
393
+ background: #ebebeb;
394
+ border-color: #adadad;
395
+ color: #333333;
396
+ -webkit-box-shadow: none;
397
+ box-shadow: none;
398
+ }
399
+
400
+ /**
401
+ * Address Multi Select2's choice close-button vertical alignment.
402
+ */
403
+ .select2-search-choice-close {
404
+ margin-top: -7px;
405
+ top: 50%;
406
+ }
407
+
408
+ /**
409
+ * Adjust the single Select2's clear button position (used to reset the select box
410
+ * back to the placeholder value and visible once a selection is made
411
+ * activated by Select2's "allowClear" option).
412
+ */
413
+ .select2-container .select2-choice abbr {
414
+ top: 50%;
415
+ }
416
+
417
+ /**
418
+ * Adjust "no results" and "selection limit" messages to make use
419
+ * of Bootstrap 3's default "Alert" style.
420
+ *
421
+ * @see http://getbootstrap.com/components/#alerts-default
422
+ */
423
+ .select2-results .select2-no-results,
424
+ .select2-results .select2-searching,
425
+ .select2-results .select2-selection-limit {
426
+ background-color: #fcf8e3;
427
+ color: #8a6d3b;
428
+ }
429
+
430
+ /**
431
+ * Address disabled Select2 styles.
432
+ *
433
+ * 1. For Select2 v.3.3.2.
434
+ * 2. Revert border-left:0 inherited from Select2's CSS to prevent the arrow
435
+ * from jumping when switching from disabled to enabled state and vice versa.
436
+ */
437
+ .select2-container.select2-container-disabled .select2-choice,
438
+ .select2-container.select2-container-disabled .select2-choices {
439
+ cursor: not-allowed;
440
+ background-color: #eeeeee;
441
+ border-color: #cccccc;
442
+ }
443
+ .select2-container.select2-container-disabled .select2-choice .select2-arrow,
444
+ .select2-container.select2-container-disabled .select2-choice div,
445
+ .select2-container.select2-container-disabled .select2-choices .select2-arrow,
446
+ .select2-container.select2-container-disabled .select2-choices div {
447
+ background-color: transparent;
448
+ border-left: 1px solid transparent;
449
+ /* 2 */
450
+ }
451
+
452
+ /**
453
+ * Address Select2's loading indicator position - which should not stick
454
+ * to the right edge of Select2's search input.
455
+ *
456
+ * 1. in .select2-search input
457
+ * 2. in Multi Select2's .select2-search-field input
458
+ * 3. in the status-message of infinite-scroll with remote data (@see http://ivaynberg.github.io/select2/#infinite)
459
+ *
460
+ * These styles alter Select2's default background-position of 100%
461
+ * and supply the new background-position syntax to browsers which support it:
462
+ *
463
+ * 1. Android, Safari < 6/Mobile, IE<9: change to a relative background-position of 99%
464
+ * 2. Chrome 25+, Firefox 13+, IE 9+, Opera 10.5+: use the new CSS3-background-position syntax
465
+ *
466
+ * @see http://www.w3.org/TR/css3-background/#background-position
467
+ *
468
+ * @todo Since both Select2 and Bootstrap 3 only support IE8 and above,
469
+ * we could use the :after-pseudo-element to display the loading indicator.
470
+ * Alternatively, we could supply an altered loading indicator image which already
471
+ * contains an offset to the right.
472
+ */
473
+ .select2-search input.select2-active,
474
+ .select2-container-multi .select2-choices .select2-search-field input.select2-active,
475
+ .select2-more-results.select2-active {
476
+ background-position: 99%;
477
+ /* 4 */
478
+ background-position: right 4px center;
479
+ /* 5 */
480
+ }
481
+
482
+ /**
483
+ * To support Select2 pre v3.4.2 in combination with Bootstrap v3.2.0,
484
+ * ensure that .select2-offscreen width, height and position can not be overwritten.
485
+ *
486
+ * This adresses changes in Bootstrap somewhere after the initial v3.0.0 which -
487
+ * in combination with Select2's pre-v3.4.2 CSS missing the "!important" after
488
+ * the following rules - allow Bootstrap to overwrite the latter, which results in
489
+ * the original <select> element Select2 is replacing not be properly being hidden
490
+ * when used in a "Bootstrap Input Group with Addon".
491
+ **/
492
+ .select2-offscreen,
493
+ .select2-offscreen:focus {
494
+ width: 1px !important;
495
+ height: 1px !important;
496
+ position: absolute !important;
87
497
  }
@@ -1,5 +1,5 @@
1
1
  /*
2
- Version: 3.5.1 Timestamp: Tue Jul 22 18:58:56 EDT 2014
2
+ Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
3
3
  */
4
4
  .select2-container {
5
5
  margin: 0;
@@ -586,7 +586,7 @@ html[dir="rtl"] .select2-container-multi .select2-choices li
586
586
  background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eee));
587
587
  background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
588
588
  background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
589
- background-image: linear-gradient(to top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
589
+ background-image: linear-gradient(to bottom, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
590
590
  }
591
591
  html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
592
592
  {
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.9.1
4
+ version: 3.5.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rogerio Medeiros
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-18 00:00:00.000000000 Z
12
+ date: 2015-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -118,6 +118,7 @@ files:
118
118
  - vendor/assets/javascripts/select2_locale_lv.js
119
119
  - vendor/assets/javascripts/select2_locale_mk.js
120
120
  - vendor/assets/javascripts/select2_locale_ms.js
121
+ - vendor/assets/javascripts/select2_locale_nb.js
121
122
  - vendor/assets/javascripts/select2_locale_nl.js
122
123
  - vendor/assets/javascripts/select2_locale_no.js
123
124
  - vendor/assets/javascripts/select2_locale_pl.js
@@ -157,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
157
158
  version: '0'
158
159
  requirements: []
159
160
  rubyforge_project:
160
- rubygems_version: 2.2.2
161
+ rubygems_version: 2.4.5
161
162
  signing_key:
162
163
  specification_version: 4
163
164
  summary: Integrate Select2 javascript library with Rails asset pipeline