Skip to content

Commit d27f25e

Browse files
committed
Merge branch 'master' into disabled-options-take-2
Conflicts: chosen/chosen.jquery.js chosen/chosen.jquery.min.js chosen/chosen.proto.js chosen/chosen.proto.min.js
2 parents 596062a + aeb15a4 commit d27f25e

13 files changed

+236
-57
lines changed

LICENSE.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Chosen, a Select Box Enhancer for jQuery and Prototype
2-
## by Patrick Filler for [Harvest](http://getharvest.com)
1+
#### Chosen
2+
- by Patrick Filler for [Harvest](http://getharvest.com)
3+
- Copyright (c) 2011-2013 by Harvest
34

45
Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
56

6-
Copyright (c) 2011-2013 by Harvest
7-
87
Permission is hereby granted, free of charge, to any person obtaining a copy
98
of this software and associated documentation files (the "Software"), to deal
109
in the Software without restriction, including without limitation the rights

README.md

+9-34
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,18 @@ Chosen is a library for making long, unwieldy select boxes more user friendly.
88
For documentation, usage, and examples, see:
99
http://harvesthq.github.io/chosen/
1010

11-
### Contributing to Chosen
11+
### Contributing to this project
1212

13-
Contributions and pull requests are very welcome. Please follow these guidelines when submitting new code.
14-
15-
1. Make all changes in Coffeescript files, **not** JavaScript files.
16-
2. For feature changes, update both jQuery *and* Prototype versions
17-
3. Use `npm install -d` to install the correct development dependencies.
18-
4. Use `cake build` or `cake watch` to generate Chosen's JavaScript file and minified version.
19-
5. Don't touch the `VERSION` file
20-
6. Submit a Pull Request using GitHub.
21-
22-
### Using CoffeeScript & Cake
23-
24-
First, make sure you have the proper CoffeeScript / Cake set-up in place. We have added a package.json that makes this easy:
25-
26-
```
27-
npm install -d
28-
```
29-
30-
This will install `coffee-script` and `uglifyjs`.
31-
32-
Once you're configured, building the JavasScript from the command line is easy:
33-
34-
cake build # build Chosen from source
35-
cake watch # watch coffee/ for changes and build Chosen
36-
37-
If you're interested, you can find the recipes in Cakefile.
13+
We welcome all to participate in making Chosen the best software it can be. The repository is maintained by only a few people, but has accepted contributions from over 50 authors after reviewing hundreds of pull requests related to thousands of issues. You can help reduce the maintainers' workload (and increase your chance of having an accepted contribution to Chosen) by following the
14+
[guidelines for contributing](contributing.md).
3815

16+
* [Bug reports](contributing.md#bugs)
17+
* [Feature requests](contributing.md#features)
18+
* [Pull requests](contributing.md#pull-requests)
3919

4020
### Chosen Credits
4121

42-
- Built by [Harvest](http://www.getharvest.com/). Want to work on projects like this? [We’re hiring](http://www.getharvest.com/careers)!
43-
- Concept and development by [Patrick Filler](http://www.patrickfiller.com/)
22+
- Concept and development by [Patrick Filler](http://patrickfiller.com) for [Harvest](http://getharvest.com/).
4423
- Design and CSS by [Matthew Lettini](http://matthewlettini.com/)
45-
46-
### Notable Forks
47-
48-
- [Chosen for MooTools](https://github.com/julesjanssen/chosen), by Jules Janssen
49-
- [Chosen Drupal 7 Module](http://drupal.org/project/chosen), by Pol Dell'Aiera, Arshad Chummun, Bart Feenstra, Kálmán Hosszu, etc.
50-
- [Chosen CakePHP Plugin](https://github.com/paulredmond/chosen-cakephp), by Paul Redmond
24+
- Repository maintained by [@pfiller](https://github.com/pfiller), [@kenearley](https://github.com/kenearley) and [@stof](https://github.com/stof).
25+
- Chosen includes [contributions by many fine folks](https://github.com/harvesthq/chosen/contributors).

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.9.14
1+
0.9.15

chosen.jquery.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"multiselect",
88
"dropdown"
99
],
10-
"version": "0.9.14",
10+
"version": "0.9.15",
1111
"author": {
1212
"name": "harvest",
1313
"url": "http://getharvest.com"

chosen/chosen.css

+5
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@
7373
-ms-text-overflow: ellipsis;
7474
text-overflow: ellipsis;
7575
}
76+
.chzn-container-single .chzn-single-with-deselect span {
77+
margin-right: 38px;
78+
}
79+
7680
.chzn-container-single .chzn-single abbr {
7781
display: block;
7882
position: absolute;
@@ -409,6 +413,7 @@
409413
.chzn-rtl { text-align: right; }
410414
.chzn-rtl .chzn-single { padding: 0 8px 0 0; overflow: visible; }
411415
.chzn-rtl .chzn-single span { margin-left: 26px; margin-right: 0; direction: rtl; }
416+
.chzn-rtl .chzn-single-with-deselect span { margin-left: 38px; }
412417

413418
.chzn-rtl .chzn-single div { left: 3px; right: auto; }
414419
.chzn-rtl .chzn-single abbr {

chosen/chosen.jquery.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Chosen, a Select Box Enhancer for jQuery and Prototype
22
// by Patrick Filler for Harvest, http://getharvest.com
33
//
4-
// Version 0.9.14
4+
// Version 0.9.15
55
// Full source at https://github.com/harvesthq/chosen
66
// Copyright (c) 2011 Harvest http://getharvest.com
77

@@ -703,7 +703,7 @@ Copyright (c) 2011 by Harvest
703703

704704
this.form_field_label = this.form_field_jq.parents("label");
705705
if (!this.form_field_label.length && this.form_field.id.length) {
706-
this.form_field_label = $("label[for=" + this.form_field.id + "]");
706+
this.form_field_label = $("label[for='" + this.form_field.id + "']");
707707
}
708708
if (this.form_field_label.length > 0) {
709709
return this.form_field_label.click(function(evt) {
@@ -899,9 +899,13 @@ Copyright (c) 2011 by Harvest
899899
};
900900

901901
Chosen.prototype.single_deselect_control_build = function() {
902-
if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
903-
return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
902+
if (!this.allow_single_deselect) {
903+
return;
904+
}
905+
if (!this.selected_item.find("abbr").length) {
906+
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
904907
}
908+
return this.selected_item.addClass("chzn-single-with-deselect");
905909
};
906910

907911
Chosen.prototype.winnow_results = function() {

chosen/chosen.jquery.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

chosen/chosen.proto.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Chosen, a Select Box Enhancer for jQuery and Prototype
22
// by Patrick Filler for Harvest, http://getharvest.com
33
//
4-
// Version 0.9.14
4+
// Version 0.9.15
55
// Full source at https://github.com/harvesthq/chosen
66
// Copyright (c) 2011 Harvest http://getharvest.com
77

@@ -691,7 +691,7 @@ Copyright (c) 2011 by Harvest
691691

692692
this.form_field_label = this.form_field.up("label");
693693
if (this.form_field_label == null) {
694-
this.form_field_label = $$("label[for=" + this.form_field.id + "]").first();
694+
this.form_field_label = $$("label[for='" + this.form_field.id + "']").first();
695695
}
696696
if (this.form_field_label != null) {
697697
return this.form_field_label.observe("click", function(evt) {
@@ -895,11 +895,15 @@ Copyright (c) 2011 by Harvest
895895
};
896896

897897
Chosen.prototype.single_deselect_control_build = function() {
898-
if (this.allow_single_deselect && !this.selected_item.down("abbr")) {
899-
return this.selected_item.down("span").insert({
898+
if (!this.allow_single_deselect) {
899+
return;
900+
}
901+
if (!this.selected_item.down("abbr")) {
902+
this.selected_item.down("span").insert({
900903
after: "<abbr class=\"search-choice-close\"></abbr>"
901904
});
902905
}
906+
return this.selected_item.addClassName("chzn-single-with-deselect");
903907
};
904908

905909
Chosen.prototype.winnow_results = function() {

chosen/chosen.proto.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coffee/chosen.jquery.coffee

+4-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ class Chosen extends AbstractChosen
255255
set_label_behavior: ->
256256
@form_field_label = @form_field_jq.parents("label") # first check for a parent label
257257
if not @form_field_label.length and @form_field.id.length
258-
@form_field_label = $("label[for=#{@form_field.id}]") #next check for a for=#{id}
258+
@form_field_label = $("label[for='#{@form_field.id}']") #next check for a for=#{id}
259259

260260
if @form_field_label.length > 0
261261
@form_field_label.click (evt) => if @is_multiple then this.container_mousedown(evt) else this.activate_field()
@@ -398,7 +398,9 @@ class Chosen extends AbstractChosen
398398
return false
399399

400400
single_deselect_control_build: ->
401-
@selected_item.find("span").first().after "<abbr class=\"search-choice-close\"></abbr>" if @allow_single_deselect and @selected_item.find("abbr").length < 1
401+
return unless @allow_single_deselect
402+
@selected_item.find("span").first().after "<abbr class=\"search-choice-close\"></abbr>" unless @selected_item.find("abbr").length
403+
@selected_item.addClass("chzn-single-with-deselect")
402404

403405
winnow_results: ->
404406
this.no_results_clear()

coffee/chosen.proto.coffee

+4-2
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ class Chosen extends AbstractChosen
242242
set_label_behavior: ->
243243
@form_field_label = @form_field.up("label") # first check for a parent label
244244
if not @form_field_label?
245-
@form_field_label = $$("label[for=#{@form_field.id}]").first() #next check for a for=#{id}
245+
@form_field_label = $$("label[for='#{@form_field.id}']").first() #next check for a for=#{id}
246246

247247
if @form_field_label?
248248
@form_field_label.observe "click", (evt) => if @is_multiple then this.container_mousedown(evt) else this.activate_field()
@@ -386,7 +386,9 @@ class Chosen extends AbstractChosen
386386
return false
387387

388388
single_deselect_control_build: ->
389-
@selected_item.down("span").insert { after: "<abbr class=\"search-choice-close\"></abbr>" } if @allow_single_deselect and not @selected_item.down("abbr")
389+
return unless @allow_single_deselect
390+
@selected_item.down("span").insert { after: "<abbr class=\"search-choice-close\"></abbr>" } unless @selected_item.down("abbr")
391+
@selected_item.addClassName("chzn-single-with-deselect")
390392

391393
winnow_results: ->
392394
this.no_results_clear()

contributing.md

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Contributing to this project
2+
3+
Please take a moment to review this document in order to make the contribution
4+
process easy and effective for everyone involved.
5+
6+
Following these guidelines will help us get back to you more quickly, and will
7+
show that you care about making Chosen better just like we do. In return, we'll
8+
do our best to respond to your issue or pull request as soon as possible with
9+
the same respect.
10+
11+
_**Please Note:** These guidelines are adapted from [@necolas](https://github.com/necolas)'s
12+
[issue-guidelines](https://github.com/necolas/issue-guidelines) and serve as
13+
an excellent starting point for contributing to any open source project._
14+
15+
16+
## Using the issue tracker
17+
18+
The [issue tracker](https://github.com/harvesthq/chosen/issues) is the
19+
preferred channel for [bug reports](#bugs), [features requests](#features)
20+
and [submitting pull requests](#pull-requests), but please respect the
21+
following restrictions:
22+
23+
* Please **do not** use the issue tracker for personal support requests (use
24+
[Stack Overflow](http://stackoverflow.com)).
25+
26+
* Please **do not** derail or troll issues. Keep the discussion on topic and
27+
respect the opinions of others.
28+
29+
30+
<a name="bugs"></a>
31+
## Bug reports
32+
33+
A bug is a _demonstrable problem_ that is caused by the code in the repository.
34+
Good bug reports are extremely helpful &mdash; thank you!
35+
36+
Guidelines for bug reports:
37+
38+
1. **Use the [GitHub issue search](https://github.com/harvesthq/chosen/search?type=Issues)** &mdash; check if the issue has already been
39+
reported.
40+
41+
2. **Check if the bug has already been fixed** &mdash; try to reproduce it using the
42+
repository's latest `master` changes.
43+
44+
3. **Isolate the problem** &mdash; ideally create a [reduced test
45+
case](http://css-tricks.com/6263-reduced-test-cases/) and a live example
46+
(perhaps a [fiddle](http://jsfiddle.net)).
47+
48+
A good bug report shouldn't leave others needing to contact you for more
49+
information. Please try to be as detailed as possible in your report. What is
50+
your environment? What steps will reproduce the issue? What browser(s) and OS
51+
experience the problem? What outcome did you expect, and how did it differ from
52+
what you actually saw? All these details will help people to fix any potential
53+
bugs.
54+
55+
Example:
56+
57+
> Short and descriptive example bug report title
58+
>
59+
> A summary of the issue and the browser/OS environment in which it occurs. If
60+
> suitable, include the steps required to reproduce the bug.
61+
>
62+
> 1. This is the first step
63+
> 2. This is the second step
64+
> 3. Further steps, etc.
65+
>
66+
> `<url>` - a link to the reduced test case
67+
>
68+
> Any other information you want to share that is relevant to the issue being
69+
> reported. This might include the lines of code that you have identified as
70+
> causing the bug, and potential solutions (and your opinions on their
71+
> merits).
72+
73+
74+
<a name="features"></a>
75+
## Feature requests
76+
77+
Feature requests are welcome. But take a moment to find out whether your idea
78+
fits with the scope and aims of the project. It's up to *you* to make a strong
79+
case to convince the project's developers of the merits of this feature. Please
80+
provide as much detail and context as possible.
81+
82+
Building something great means choosing features carefully especially because it
83+
is much, much easier to add features than it is to take them away. Additions
84+
to Chosen will be evaluated on a combination of scope (how well it fits into the
85+
project), maintenance burden and general usefulness.
86+
87+
Creating something great often means saying no to seemingly good ideas. Don't
88+
dispair if your feature request isn't accepted, take action! Fork the
89+
repository, build your idea and share it with others. We released Chosen under
90+
the MIT License for this purpose precisely. Open source works best when smart
91+
and dedicated people riff off of each others' ideas to make even greater things.
92+
93+
94+
95+
<a name="pull-requests"></a>
96+
## Pull requests
97+
98+
Good pull requests &mdash; patches, improvements, new features &mdash; are a fantastic help.
99+
They should remain focused in scope and avoid containing unrelated commits.
100+
101+
**Please ask first** before embarking on any significant pull request (e.g.
102+
implementing features, refactoring code, porting to a different language),
103+
otherwise you risk spending a lot of time working on something that the
104+
project's developers might not want to merge into the project. You can solicit
105+
feedback and opinions in an open feature request thread or create a new one.
106+
107+
Please use the [git flow for pull requesets](#git-flow) and follow Chosen's
108+
[code conventions](#code-conventions) before submitting your work. Adhering to
109+
these guidelines is the best way to get your work included in Chosen.
110+
111+
<a name="git-flow"></a>
112+
#### Git Flow for pull requests
113+
114+
1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork,
115+
and configure the remotes:
116+
117+
```bash
118+
# Clone your fork of the repo into the current directory
119+
git clone [email protected]:<YOUR_USERNAME>/chosen.git
120+
# Navigate to the newly cloned directory
121+
cd chosen
122+
# Assign the original repo to a remote called "upstream"
123+
git remote add upstream https://github.com/harvesthq/chosen
124+
```
125+
126+
2. If you cloned a while ago, get the latest changes from upstream:
127+
128+
```bash
129+
git checkout master
130+
git pull upstream master
131+
```
132+
133+
3. Create a new topic branch (off the main project development branch) to
134+
contain your feature, change, or fix:
135+
136+
```bash
137+
git checkout -b <topic-branch-name>
138+
```
139+
140+
4. Commit your changes in logical chunks. Please adhere to these [git commit
141+
message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
142+
or your code is unlikely be merged into the main project. Use Git's
143+
[interactive rebase](https://help.github.com/articles/interactive-rebase)
144+
feature to tidy up your commits before making them public.
145+
146+
5. Locally merge (or rebase) the upstream development branch into your topic branch:
147+
148+
```bash
149+
git pull [--rebase] upstream master
150+
```
151+
152+
6. Push your topic branch up to your fork:
153+
154+
```bash
155+
git push origin <topic-branch-name>
156+
```
157+
158+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
159+
with a clear title and description.
160+
161+
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to
162+
license your work under the [MIT License](http://en.wikipedia.org/wiki/MIT_License).
163+
164+
<a name="code-conventions"></a>
165+
#### Chosen Code Conventions
166+
167+
1. Make all changes in CoffeeScript files, **not** JavaScript files.
168+
2. Use [cake](#cake) to build the JavaScript files.
169+
3. For feature changes, update both jQuery *and* Prototype versions
170+
4. Don't touch the `VERSION` file
171+
172+
<a name="cake"></a>
173+
#### Using CoffeeScript and Cake
174+
175+
First, make sure you have the proper CoffeeScript / Cake setup in place. We have added a package.json that makes this easy:
176+
177+
```
178+
npm install -d
179+
```
180+
181+
This will install `coffee-script` and `uglifyjs`.
182+
183+
Once you're configured, building the JavaScript from the command line is easy:
184+
185+
cake build # build Chosen from source
186+
cake watch # watch coffee/ for changes and build Chosen
187+
188+
If you're interested, you can find the recipes in [Cakefile](https://github.com/harvesthq/chosen/blob/master/Cakefile).

0 commit comments

Comments
 (0)