Skip to content

Commit feedfe2

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents d8a9f69 + c4cba75 commit feedfe2

53 files changed

Lines changed: 509 additions & 229 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Browser compatibility
2424
* Firefox 10+
2525
* Safari 3+
2626
* Opera 10.6+
27+
28+
Usage
29+
-----
30+
You can source Select2 directly from a [CDN like JSDliver](http://www.jsdelivr.com/#!select2), [download it from this GitHub repo](https://github.com/ivaynberg/select2/tags), or use one of the integrations below.
2731

2832
Integrations
2933
------------
@@ -34,14 +38,25 @@ Integrations
3438
* [Django](https://github.com/applegrew/django-select2)
3539
* [Symfony](https://github.com/19Gerhard85/sfSelect2WidgetsPlugin)
3640
* [Symfony2](https://github.com/avocode/FormExtensions)
37-
* [Bootstrap](https://github.com/t0m/select2-bootstrap-css) (CSS skin)
38-
* [Yii](https://github.com/tonybolzan/yii-select2)
41+
* [Bootstrap 2](https://github.com/t0m/select2-bootstrap-css) and [Bootstrap 3](https://github.com/t0m/select2-bootstrap-css/tree/bootstrap3) (CSS skins)
42+
* [Meteor](https://github.com/nate-strauser/meteor-select2) (modern reactive JavaScript framework; + [Bootstrap 3 skin](https://github.com/esperadomedia/meteor-select2-bootstrap3-css/))
43+
* [Meteor](https://jquery-select2.meteor.com)
44+
* [Yii 2.x](http://demos.krajee.com/widgets#select2)
45+
* [Yii 1.x](https://github.com/tonybolzan/yii-select2)
46+
* [AtmosphereJS](https://atmospherejs.com/package/jquery-select2)
47+
48+
### Example Integrations
49+
50+
* [Knockout.js](https://github.com/ivaynberg/select2/wiki/Knockout.js-Integration)
51+
* [Socket.IO](https://github.com/ivaynberg/select2/wiki/Socket.IO-Integration)
52+
* [PHP](https://github.com/ivaynberg/select2/wiki/PHP-Example)
53+
* [.Net MVC] (https://github.com/ivaynberg/select2/wiki/.Net-MVC-Example)
3954

4055
Internationalization (i18n)
4156
---------------------------
4257

43-
Select2 supports multiple languages by simply including the right
44-
language JS file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.).
58+
Select2 supports multiple languages by simply including the right language JS
59+
file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
4560

4661
Missing a language? Just copy `select2_locale_en.js.template`, translate
4762
it, and make a pull request back to Select2 here on GitHub.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "select2",
3-
"version": "3.4.6",
3+
"version": "3.5.0",
44
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
55
"dependencies": {
66
"jquery": ">= 1.7.1"

component.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "select2",
33
"repo": "ivaynberg/select2",
44
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
5-
"version": "3.4.6",
5+
"version": "3.5.0",
66
"demo": "http://ivaynberg.github.io/select2/",
77
"keywords": [
88
"jquery"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name":
33
"ivaynberg/select2",
44
"description": "Select2 is a jQuery based replacement for select boxes.",
5-
"version": "3.4.6",
5+
"version": "3.5.0",
66
"type": "component",
77
"homepage": "http://ivaynberg.github.io/select2/",
88
"license": "Apache-2.0",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Igor Vaynberg",
66
"repository": {"type": "git", "url": "git://github.com/ivaynberg/select2.git"},
77
"main": "select2.js",
8-
"version": "3.4.6",
8+
"version": "3.5.0",
99
"jspm": {
1010
"main": "select2",
1111
"files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"],

select2.css

Lines changed: 69 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ Version: @@ver@@ Timestamp: @@timestamp@@
5656
background-image: linear-gradient(to top, #eee 0%, #fff 50%);
5757
}
5858

59+
html[dir="rtl"] .select2-container .select2-choice {
60+
padding: 0 8px 0 0;
61+
}
62+
5963
.select2-container.select2-drop-above .select2-choice {
6064
border-bottom-color: #aaa;
6165

@@ -84,6 +88,11 @@ Version: @@ver@@ Timestamp: @@timestamp@@
8488
width: auto;
8589
}
8690

91+
html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
92+
margin-left: 26px;
93+
margin-right: 0;
94+
}
95+
8796
.select2-container .select2-choice abbr {
8897
display: none;
8998
width: 12px;
@@ -196,13 +205,26 @@ Version: @@ver@@ Timestamp: @@timestamp@@
196205
background-image: linear-gradient(to top, #ccc 0%, #eee 60%);
197206
}
198207

208+
html[dir="rtl"] .select2-container .select2-choice .select2-arrow {
209+
left: 0;
210+
right: auto;
211+
212+
border-left: none;
213+
border-right: 1px solid #aaa;
214+
border-radius: 4px 0 0 4px;
215+
}
216+
199217
.select2-container .select2-choice .select2-arrow b {
200218
display: block;
201219
width: 100%;
202220
height: 100%;
203221
background: url('select2.png') no-repeat 0 1px;
204222
}
205223

224+
html[dir="rtl"] .select2-container .select2-choice .select2-arrow b {
225+
background-position: 2px 1px;
226+
}
227+
206228
.select2-search {
207229
display: inline-block;
208230
width: 100%;
@@ -241,6 +263,16 @@ Version: @@ver@@ Timestamp: @@timestamp@@
241263
background: url('select2.png') no-repeat 100% -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
242264
}
243265

266+
html[dir="rtl"] .select2-search input {
267+
padding: 4px 5px 4px 20px;
268+
269+
background: #fff url('select2.png') no-repeat -37px -22px;
270+
background: url('select2.png') no-repeat -37px -22px, -webkit-gradient(linear, left bottom, left top, color-stop(0.85, #fff), color-stop(0.99, #eee));
271+
background: url('select2.png') no-repeat -37px -22px, -webkit-linear-gradient(center bottom, #fff 85%, #eee 99%);
272+
background: url('select2.png') no-repeat -37px -22px, -moz-linear-gradient(center bottom, #fff 85%, #eee 99%);
273+
background: url('select2.png') no-repeat -37px -22px, linear-gradient(to bottom, #fff 85%, #eee 99%) 0 0;
274+
}
275+
244276
.select2-drop.select2-drop-above .select2-search input {
245277
margin-top: 4px;
246278
}
@@ -295,10 +327,18 @@ Version: @@ver@@ Timestamp: @@timestamp@@
295327
border-left: none;
296328
filter: none;
297329
}
330+
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow {
331+
border-right: none;
332+
}
333+
298334
.select2-dropdown-open .select2-choice .select2-arrow b {
299335
background-position: -18px 1px;
300336
}
301337

338+
html[dir="rtl"] .select2-dropdown-open .select2-choice .select2-arrow b {
339+
background-position: -16px 1px;
340+
}
341+
302342
.select2-hidden-accessible {
303343
border: 0;
304344
clip: rect(0 0 0 0);
@@ -321,6 +361,11 @@ Version: @@ver@@ Timestamp: @@timestamp@@
321361
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
322362
}
323363

364+
html[dir="rtl"] .select2-results {
365+
padding: 0 4px 0 0;
366+
margin: 4px 0 4px 4px;
367+
}
368+
324369
.select2-results ul.select2-result-sub {
325370
margin: 0;
326371
padding-left: 0;
@@ -350,15 +395,13 @@ Version: @@ver@@ Timestamp: @@timestamp@@
350395
user-select: none;
351396
}
352397

353-
.select2-results-dept-0 .select2-result-label { padding-left: 20px }
354-
.select2-results-dept-1 .select2-result-label { padding-left: 40px }
355-
.select2-results-dept-2 .select2-result-label { padding-left: 60px }
356-
.select2-results-dept-3 .select2-result-label { padding-left: 80px }
357-
.select2-results-dept-4 .select2-result-label { padding-left: 100px }
358-
.select2-results-dept-5 .select2-result-label { padding-left: 110px }
359-
.select2-results-dept-6 .select2-result-label { padding-left: 120px }
360-
361-
398+
.select2-results-dept-1 .select2-result-label { padding-left: 20px }
399+
.select2-results-dept-2 .select2-result-label { padding-left: 40px }
400+
.select2-results-dept-3 .select2-result-label { padding-left: 60px }
401+
.select2-results-dept-4 .select2-result-label { padding-left: 80px }
402+
.select2-results-dept-5 .select2-result-label { padding-left: 100px }
403+
.select2-results-dept-6 .select2-result-label { padding-left: 110px }
404+
.select2-results-dept-7 .select2-result-label { padding-left: 120px }
362405

363406
.select2-results .select2-highlighted {
364407
background: #3875d7;
@@ -379,9 +422,9 @@ Version: @@ver@@ Timestamp: @@timestamp@@
379422
color: #000;
380423
}
381424

382-
383425
.select2-results .select2-no-results,
384426
.select2-results .select2-searching,
427+
.select2-results .select2-ajax-error,
385428
.select2-results .select2-selection-limit {
386429
background: #f4f4f4;
387430
display: list-item;
@@ -411,6 +454,10 @@ disabled look for disabled choices in the results dropdown
411454
background: #f4f4f4 url('select2-spinner.gif') no-repeat 100%;
412455
}
413456

457+
.select2-results .select2-ajax-error {
458+
background: rgba(255, 50, 50, .2);
459+
}
460+
414461
.select2-more-results {
415462
background: #f4f4f4;
416463
display: list-item;
@@ -442,7 +489,7 @@ disabled look for disabled choices in the results dropdown
442489
height: auto !important;
443490
height: 1%;
444491
margin: 0;
445-
padding: 0;
492+
padding: 0 5px 0 0;
446493
position: relative;
447494

448495
border: 1px solid #aaa;
@@ -456,6 +503,10 @@ disabled look for disabled choices in the results dropdown
456503
background-image: linear-gradient(to bottom, #eee 1%, #fff 15%);
457504
}
458505

506+
html[dir="rtl"] .select2-container-multi .select2-choices {
507+
padding: 0 0 0 5px;
508+
}
509+
459510
.select2-locked {
460511
padding: 3px 5px 3px 5px !important;
461512
}
@@ -539,8 +590,8 @@ html[dir="rtl"] .select2-container-multi .select2-choices li
539590
}
540591
html[dir="rtl"] .select2-container-multi .select2-choices .select2-search-choice
541592
{
542-
margin-left: 0;
543-
margin-right: 5px;
593+
margin: 3px 5px 3px 0;
594+
padding: 3px 18px 3px 5px;
544595
}
545596
.select2-container-multi .select2-choices .select2-search-choice .select2-chosen {
546597
cursor: default;
@@ -570,6 +621,11 @@ html[dir="rtl"] .select2-search-choice-close {
570621
left: 3px;
571622
}
572623

624+
html[dir="rtl"] .select2-container-multi .select2-search-choice-close {
625+
left: auto;
626+
right: 2px;
627+
}
628+
573629
.select2-container-multi .select2-choices .select2-search-choice .select2-search-choice-close:hover {
574630
background-position: right -11px;
575631
}

select2.jquery.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"tag",
1212
"tagging"
1313
],
14-
"version": "3.4.6",
14+
"version": "3.5.0",
1515
"author": {
1616
"name": "Igor Vaynberg",
1717
"url": "https://github.com/ivaynberg"

select2.js

Lines changed: 208 additions & 108 deletions
Large diffs are not rendered by default.

select2_locale_ar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
(function ($) {
77
"use strict";
88

9-
$.extend($.fn.select2.defaults, {
9+
$.fn.select2.locales['ar'] = {
1010
formatNoMatches: function () { return "لم يتم العثور على مطابقات"; },
1111
formatInputTooShort: function (input, min) { var n = min - input.length; if (n == 1){ return "الرجاء إدخال حرف واحد على الأكثر"; } return n == 2 ? "الرجاء إدخال حرفين على الأكثر" : "الرجاء إدخال " + n + " على الأكثر"; },
1212
formatInputTooLong: function (input, max) { var n = input.length - max; if (n == 1){ return "الرجاء إدخال حرف واحد على الأقل"; } return n == 2 ? "الرجاء إدخال حرفين على الأقل" : "الرجاء إدخال " + n + " على الأقل "; },
1313
formatSelectionTooBig: function (limit) { if (n == 1){ return "يمكنك أن تختار إختيار واحد فقط"; } return n == 2 ? "يمكنك أن تختار إختيارين فقط" : "يمكنك أن تختار " + n + " إختيارات فقط"; },
1414
formatLoadMore: function (pageNumber) { return "تحميل المزيد من النتائج…"; },
1515
formatSearching: function () { return "البحث…"; }
16-
});
16+
};
17+
18+
$.extend($.fn.select2.defaults, $.fn.select2.locales['ar']);
1719
})(jQuery);

select2_locale_az.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Select2 Azerbaijani translation.
3+
*
4+
* Author: Farhad Safarov <farhad.safarov@gmail.com>
5+
*/
6+
(function ($) {
7+
"use strict";
8+
9+
$.extend($.fn.select2.defaults, {
10+
formatMatches: function (matches) { return matches + " nəticə mövcuddur, hərəkət etdirmək üçün yuxarı və aşağı düymələrindən istifadə edin."; },
11+
formatNoMatches: function () { return "Nəticə tapılmadı"; },
12+
formatInputTooShort: function (input, min) { var n = min - input.length; return n + " simvol daxil edin"; },
13+
formatInputTooLong: function (input, max) { var n = input.length - max; return n + " simvol silin"; },
14+
formatSelectionTooBig: function (limit) { return "Sadəcə " + limit + " element seçə bilərsiniz"; },
15+
formatLoadMore: function (pageNumber) { return "Daha çox nəticə yüklənir…"; },
16+
formatSearching: function () { return "Axtarılır…"; }
17+
});
18+
})(jQuery);

0 commit comments

Comments
 (0)