Commit ed4bb08a authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Update Select2 to version 3.5.2 (Bug #1384484)"

parents 32279679 d8caa62a
Contributing to Select2
Looking to contribute something to Select2? **Here's how you can help.**
Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.
Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue or assessing
patches and features.
Using the issue tracker
When [reporting bugs][reporting-bugs] or
[requesting features][requesting-features], the
[issue tracker on GitHub][issue-tracker] is the recommended channel to use.
The issue tracker **is not** a place for support requests. The
[mailing list][mailing-list] or [IRC channel][irc-channel] are better places to
get help.
Reporting bugs with Select2
We really appreciate clear bug reports that _consistently_ show an issue
_within Select2_.
The ideal bug report follows these guidelines:
1. **Use the [GitHub issue search][issue-search]** — Check if the issue
has already been reported.
2. **Check if the issue has been fixed** — Try to reproduce the problem
using the code in the `master` branch.
3. **Isolate the problem** — Try to create an
[isolated test case][isolated-case] that consistently reproduces the problem.
Please try to be as detailed as possible in your bug report, especially if an
isolated test case cannot be made. Some useful questions to include the answer
to are:
- What steps can be used to reproduce the issue?
- What is the bug and what is the expected outcome?
- What browser(s) and Operating System have you tested with?
- Does the bug happen consistently across all tested browsers?
- What version of jQuery are you using? And what version of Select2?
- Are you using Select2 with other plugins?
All of these questions will help people fix and identify any potential bugs.
Requesting features in Select2
Select2 is a large library that carries with it a lot of functionality. Because
of this, many feature requests will not be implemented in the core library.
Before starting work on a major feature for Select2, **contact the
[community][community] first** or you may risk spending a considerable amount of
time on something which the project developers are not interested in bringing
into the project.
### Select2 4.0
Many feature requests will be closed off until 4.0, where Select2 plans to adopt
a more flexible API. If you are interested in helping with the development of
the next major Select2 release, please send a message to the
[mailing list][mailing-list] or [irc channel][irc-channel] for more information.
Triaging issues and pull requests
Anyone can help the project maintainers triage issues and review pull requests.
### Handling new issues
Select2 regularly receives new issues which need to be tested and organized.
When a new issue that comes in that is similar to another existing issue, it
should be checked to make sure it is not a duplicate. Duplicates issues should
be marked by replying to the issue with "Duplicate of #[issue number]" where
`[issue number]` is the url or issue number for the existing issue. This will
allow the project maintainers to quickly close off additional issues and keep
the discussion focused within a single issue.
If you can test issues that are reported to Select2 that contain test cases and
confirm under what conditions bugs happen, that will allow others to identify
what causes a bug quicker.
### Reviewing pull requests
It is very common for pull requests to be opened for issues that contain a clear
solution to the problem. These pull requests should be rigorously reviewed by
the community before being accepted. If you are not sure about a piece of
submitted code, or know of a better way to do something, do not hesitate to make
a comment on the pull request.
It should also be made clear that **all code contributed to Select** must be
licensable under the [Apache 2 or GPL 2 licenses][licensing]. Code that cannot
be released under either of these licenses **cannot be accepted** into the
[reporting-bugs]: #reporting-bugs-with-select2
[requesting-features]: #requesting-features-in-select2
......@@ -24,43 +24,58 @@ Browser compatibility
* Firefox 10+
* Safari 3+
* Opera 10.6+
You can source Select2 directly from a [CDN like JSDliver](!select2), [download it from this GitHub repo](, or use one of the integrations below.
You can source Select2 directly from a CDN like [JSDliver](!select2) or [CDNJS](, [download it from this GitHub repo](, or use one of the integrations below.
* [Wicket-Select2]( (Java / [Apache Wicket](
* [select2-rails]( (Ruby on Rails)
* [AngularUI]( ([AngularJS](
* [AngularUI]( ([AngularJS](
* [Django](
* [Symfony](
* [Symfony2](
* [Bootstrap 2]( and [Bootstrap 3]( (CSS skins)
* [Meteor]( (modern reactive JavaScript framework; + [Bootstrap 3 skin](
* [Meteor](
* [Yii 2.x](
* [Yii 1.x](
* [AtmosphereJS](
### Example Integrations
* [Knockout.js](
* [Socket.IO](
* [PHP](
* [.Net MVC] (
Internationalization (i18n)
Select2 supports multiple languages by simply including the right
language JS file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.).
Select2 supports multiple languages by simply including the right language JS
file (`select2_locale_it.js`, `select2_locale_nl.js`, etc.) after `select2.js`.
Missing a language? Just copy `select2_locale_en.js.template`, translate
it, and make a pull request back to Select2 here on GitHub.
Bug tracker
The documentation for Select2 is available [through GitHub Pages]( and is located within this repository in the [`gh-pages` branch](
### Bug tracker
Have a bug? Please create an issue here on GitHub!
Mailing list
### Mailing list
Have a question? Ask on our mailing list!
......@@ -68,6 +83,15 @@
### IRC channel
Need help implementing Select2 in your project? Ask in our IRC channel!
**Network:** [Freenode]( (``)
**Channel:** `#select2`
**Web access:**
Copyright and license
"name": "select2",
"version": "3.5.2",
"main": ["select2.js", "select2.css", "select2.png", "select2x2.png", "select2-spinner.gif"],
"dependencies": {
"jquery": ">= 1.7.1"
"name": "select2",
"repo": "ivaynberg/select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"version": "3.5.2",
"demo": "",
"keywords": [
"main": "select2.js",
"styles": [
"scripts": [
"images": [
"license": "MIT"
"description": "Select2 is a jQuery based replacement for select boxes.",
"version": "3.5.2",
"type": "component",
"homepage": "",
"license": "Apache-2.0",
"require": {
"robloach/component-installer": "*",
"components/jquery": ">=1.7.1"
"extra": {
"component": {
"scripts": [
"files": [
"name" : "Select2",
"description": "Select2 is a jQuery based replacement for select boxes. It supports searching, remote data sets, and infinite scrolling of results.",
"homepage": "",
"author": "Igor Vaynberg",
"repository": {"type": "git", "url": "git://"},
"main": "select2.js",
"version": "3.5.2",
"jspm": {
"main": "select2",
"files": ["select2.js", "select2.png", "select2.css", "select2-spinner.gif"],
"shim": {
"select2": {
"imports": ["jquery", "./select2.css!"],
"exports": "$"
"buildConfig": { "uglify": true }
set -e
echo -n "Enter the version for this release: "
read ver
if [ ! $ver ]; then
echo "Invalid version."
curbranch=`git branch | grep "*" | sed "s/* //"`
echo "Pulling from origin"
git pull
echo "Updating Version Identifiers"
sed -E -e "s/\"version\": \"([0-9\.]+)\",/\"version\": \"$ver\",/g" -i -- bower.json select2.jquery.json component.json composer.json package.json
git add bower.json
git add select2.jquery.json
git add component.json
git add composer.json
git add package.json
git commit -m "modified version identifiers in descriptors for release $ver"
git push
git branch "$branch"
git checkout "$branch"
echo "Tokenizing..."
find . -name "$js" | xargs -I{} sed -e "$tokens" -i -- {}
find . -name "$css" | xargs -I{} sed -e "$tokens" -i -- {}
sed -e "s/latest/$ver/g" -i -- bower.json
git add "$js"
git add "$css"
echo "Minifying..."
echo "/*" > "$mini"
cat LICENSE | sed "$tokens" >> "$mini"
echo "*/" >> "$mini"
curl -s \
--data-urlencode "js_code@$js" \ \
>> "$mini"
git add "$mini"
git commit -m "release $ver"
echo "Tagging..."
git tag -a "$tag" -m "tagged version $ver"
git push "$remote" --tags
echo "Cleaning Up..."
git checkout "$curbranch"
git branch -D "$branch"
echo "Done"
.form-control .select2-choice {
border: 0;
border-radius: 2px;
.form-control .select2-choice .select2-arrow {
border-radius: 0 2px 2px 0;
.form-control.select2-container {
height: auto !important;
padding: 0;
.form-control.select2-container.select2-dropdown-open {
border-color: #5897FB;
border-radius: 3px 3px 0 0;
.form-control .select2-container.select2-dropdown-open .select2-choices {
border-radius: 3px 3px 0 0;
.form-control.select2-container .select2-choices {
border: 0 !important;
border-radius: 3px;
.control-group.warning .select2-container .select2-choice,
.control-group.warning .select2-container .select2-choices,
.control-group.warning .select2-container-active .select2-choice,
.control-group.warning .select2-container-active .select2-choices,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.warning .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.warning .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #C09853 !important;
.control-group.warning .select2-container .select2-choice div {
border-left: 1px solid #C09853 !important;
background: #FCF8E3 !important;
.control-group.error .select2-container .select2-choice,
.control-group.error .select2-container .select2-choices,
.control-group.error .select2-container-active .select2-choice,
.control-group.error .select2-container-active .select2-choices,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.error .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.error .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #B94A48 !important;
.control-group.error .select2-container .select2-choice div {
border-left: 1px solid #B94A48 !important;
background: #F2DEDE !important;
} .select2-container .select2-choice, .select2-container .select2-choices, .select2-container-active .select2-choice, .select2-container-active .select2-choices, .select2-dropdown-open.select2-drop-above .select2-choice, .select2-dropdown-open.select2-drop-above .select2-choices, .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #3A87AD !important;
} .select2-container .select2-choice div {
border-left: 1px solid #3A87AD !important;
background: #D9EDF7 !important;
.control-group.success .select2-container .select2-choice,
.control-group.success .select2-container .select2-choices,
.control-group.success .select2-container-active .select2-choice,
.control-group.success .select2-container-active .select2-choices,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choice,
.control-group.success .select2-dropdown-open.select2-drop-above .select2-choices,
.control-group.success .select2-container-multi.select2-container-active .select2-choices {
border: 1px solid #468847 !important;
.control-group.success .select2-container .select2-choice div {
border-left: 1px solid #468847 !important;
background: #DFF0D8 !important;
Version: 3.5.2 Timestamp: Sat Nov 1 14:43:36 EDT 2014
.select2-container {
margin: 0;
position: relative;
display: inline-block;
/* inline-block for ie7 */
zoom: 1;
*display: inline;
vertical-align: middle;
.select2-search input {
Force border-box so that % widths fit the parent
container without overlap because of margin/padding.
More Info :
-webkit-box-sizing: border-box; /* webkit */
-moz-box-sizing: border-box; /* firefox */
box-sizing: border-box; /* css3 */
.select2-container .select2-choice {
display: block;
height: 26px;
padding: 0 0 0 8px;
overflow: hidden;
position: relative;
border: 1px solid #aaa;
white-space: nowrap;
line-height: 26px;
color: #444;
text-decoration: none;
border-radius: 4px;
background-clip: padding-box;
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
background-color: #fff;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.5, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 50%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 50%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '#ffffff', endColorstr = '#eeeeee', GradientType = 0);
background-image: linear-gradient(to top, #eee 0%, #fff 50%);
html[dir="rtl"] .select2-container .select2-choice {
padding: 0 8px 0 0;
.select2-container.select2-drop-above .select2-choice {
border-bottom-color: #aaa;
border-radius: 0 0 4px 4px;
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0, #eee), color-stop(0.9, #fff));
background-image: -webkit-linear-gradient(center bottom, #eee 0%, #fff 90%);
background-image: -moz-linear-gradient(center bottom, #eee 0%, #fff 90%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0);
background-image: linear-gradient(to bottom, #eee 0%, #fff 90%);
.select2-container.select2-allowclear .select2-choice .select2-chosen {
margin-right: 42px;
.select2-container .select2-choice > .select2-chosen {
margin-right: 26px;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
float: none;
width: auto;
html[dir="rtl"] .select2-container .select2-choice > .select2-chosen {
margin-left: 26px;
margin-right: 0;
.select2-container .select2-choice abbr {
display: none;
width: 12px;
height: 12px;
position: absolute;
right: 24px;
top: 8px;
font-size: 1px;
text-decoration: none;
border: 0;
background: url('select2.png') right top no-repeat;
cursor: pointer;
outline: 0;
.select2-container.select2-allowclear .select2-choice abbr {
display: inline-block;
.select2-container .select2-choice abbr:hover {
background-position: right -11px;
cursor: pointer;