1
0
mirror of synced 2024-11-23 13:36:01 +03:00
Commit Graph

2109 Commits

Author SHA1 Message Date
Kevin Brown
120672dce7 Added tests for multiple tags and tokenizing
This adds tests to ensure that 3b8cd2e369
will continue to work in the future.
2016-03-27 18:37:27 -04:00
Kevin Brown
3b8cd2e369 Create an option when tokenizing if needed
Previously the tokenizer only worked when creating multiple options
at once if all of the options existed. It always worked when creating
a single option, because all of the special cases were handled by the
tagging module. When working with multiple options, the tagging
module does not kick in until after the query has been run, which
is when the tokenizer does its magic.

This fixes the issue by automatically creating the option tags that
the tagging module would normally create. It only does this if the
options do not already exist, so we don't need to worry about the
tokenizer creating duplicates of existing options.

This closes https://github.com/select2/select2/issues/3458
2016-03-27 18:29:01 -04:00
Kevin Brown
cfb66f5e4f Attempt to detect aborted requests
The error handler should not be raised if a request is aborted while
another one is sent out. This attempts to detect those cases by
handling the case where the error was raised and the request has a
status code of 0, which should either mean we're in offline mode or
the request was aborted.

This closes https://github.com/select2/select2/issues/4205
2016-03-27 15:44:40 -04:00
Kevin Brown
fe26b083eb Fix dropdownAutoWidth so it actually works
Previously the `dropdownAutoWidth` option didn't work because the
dropdown was being absolutely positioned, so setting the width to
`auto` didn't actually have an effect. This cannot be solved by
just setting the width on the container, because that is also
absolutely positioned.

This closes https://github.com/select2/select2/issues/3101
2016-03-27 15:24:37 -04:00
Kevin Brown
ac254ff68d Added tests for jQuery calls to Select2
This adds a test that covers the change made in
c2c1aeef31.
2016-03-27 15:16:22 -04:00
Kevin Brown
c2c1aeef31 Fix calling select2('', args) on multiple elements
This fixes an issue that has existed since Select2 4.0.1 where the
arguments passed into each `<select>` were mutated. This no longer
mutates the arguments for each element, and instead only drops the
first argument once.

This closes https://github.com/select2/select2/issues/4245
2016-03-27 14:59:44 -04:00
jpic
8869b170b1 Set list-style further down the DOM
This closes https://github.com/select2/select2/issues/4225
This closes https://github.com/select2/select2/pull/4226
2016-03-27 14:55:21 -04:00
Kevin Brown
84d6b5d840 Added small example of attaching event listeners
This closes https://github.com/select2/select2/pull/4255
2016-03-27 14:47:06 -04:00
Kevin Brown
962fd63a67 Stub question about event data 2016-03-27 14:46:29 -04:00
Kevin Brown
78cac8972a Merge pull request #4259 from zapodot/master
Added missing Norwegian bokmaal label used for errors
2016-03-27 14:38:11 -04:00
Sondre Eikanger Kvalø
0212edda95 Added missing Norwegian bokmaal label used for errors 2016-03-16 15:51:39 +01:00
Kevin Brown
6844be777b Missed a version identifier 2016-03-08 20:42:47 -05:00
Kevin Brown
622a619d25 Updated version identifiers for 4.0.2 2016-03-08 20:33:38 -05:00
Kevin Brown
68a199fc98 Added initial questions for tagging docs 2016-03-08 20:28:36 -05:00
Kevin Brown
3783354d02 Add documentation on ids needing to be strings
This closes https://github.com/select2/select2/issues/4052
This closes https://github.com/select2/select2/pull/4076
This closes https://github.com/select2/select2/issues/4227
2016-03-08 20:04:57 -05:00
Radu Ungureanu
72d905f9e0 Romanian localization
- updated transaltions
- added translation for errorLoading
- issue fixes - compare characters length instead of message when adding terminal character

This closes https://github.com/select2/select2/pull/4208
2016-03-08 19:54:01 -05:00
Kevin Brown
4901e221c9 Merge pull request #4222 from cheeaun/patch-1
s/incluidng/including
2016-03-01 09:54:50 -05:00
Lim Chee Aun
18a453ed9e s/incluidng/including 2016-03-01 17:16:03 +08:00
Kevin Brown
f2268caf23 Added pull request and issue templates
The issue template is largely based on the questions included in the
canned comment that I use for bugs, which is mostly covered in the
contributing guide. Even though there are a lot of lines, most of it is
just ticking checkboxes.

The issue template is focused on bug reports, as those are considerably
more common than feature requests.

The pull request template was designed to be pretty slim, we haven't had
many issues with these in the past.
2016-02-18 17:34:43 -05:00
Kevin Brown
296d2f8879 Add Sauce Labs matrix to the README
This also updates the Travis CI image to be a vector.
2016-02-17 17:11:17 -05:00
Kevin Brown
664210c271 Update the list of integrations
The integrations are now organized by the name of the integration, and
themes are now separated out from the plugins. The references for this
section have been pulled out at the bottom because there are so many.

This closes https://github.com/select2/select2/issues/4150.
This closes https://github.com/select2/select2/pull/4067.
This closes https://github.com/select2/select2/issues/3957.
2016-02-17 17:10:39 -05:00
Kevin Brown
eae6fcc2bd Update version identifiers to 4.0.2-rc.1 2016-02-14 17:06:23 -05:00
Kevin Brown
37dbe059fc Document DOM events
This closes https://github.com/select2/select2/pull/4115.
2016-02-14 16:14:58 -05:00
Kevin Brown
7f8e9dc62a Document the change.select2 event
This closes https://github.com/select2/select2/issues/3620.
2016-02-14 15:16:08 -05:00
Kevin Brown
ac109685a0 Docs for mapping id and text
These modified snippets are from the announcement.

This closes https://github.com/select2/select2/issues/4086.
2016-02-14 15:03:51 -05:00
Kevin Brown
6369f5f173 Fix the Select2 logo
With the update to Bootstrap it was forcing the Select2 text down.
2016-02-14 14:49:39 -05:00
Kevin Brown
81a4a68b11 Updated Font Awesome to 4.5.0 for docs
This also includes the missing WOFF2 and SVG files that were causing
errors for some.

This closes https://github.com/select2/select2/issues/4160.
2016-02-14 14:34:56 -05:00
Kevin Brown
a5e539b509 Updated Bootstrap to 3.3.6 for docs
This allows us to custom build it without Glyphicons so we don't have
any errors about it not being found.
2016-02-14 14:33:52 -05:00
Vasyl Zuzyak
e3f9466d8b Reuse result of previous calcualtion
This closes https://github.com/select2/select2/pull/4155.
2016-02-14 14:03:49 -05:00
Bruno Sampaio
d976f1c576 added test for recursively applying defaults
This adds tests for 983cd8e765.
2016-02-14 14:00:01 -05:00
Bruno Sampaio
983cd8e765 Recursively apply defaults
This closes https://github.com/select2/select2/pull/4130.
2016-02-14 13:58:14 -05:00
Ben
65179f16de Santize automatically generated ids
This closes https://github.com/select2/select2/issues/3618.
This closes https://github.com/select2/select2/pull/4123.
2016-02-14 13:48:19 -05:00
Kevin Brown
75163d67cb Switched options page to use Jekyll highlighting 2016-02-14 13:33:33 -05:00
Kevin Brown
a126b53b4c CSS changes for Rouge highlighting
This adds a new CSS file and adjusts existing highlighting files for the
Rouge syntax highlighting that was enabled.
2016-01-30 21:01:12 -05:00
Kevin Brown
d5a76aab26 Switched 4.0 announcement to Jekyll highlighting 2016-01-30 18:30:57 -05:00
Kevin Brown
74387b9863 Switched examples to use Jekyll's highlighting
This fixes some bugs that were present in the old Prettify highlighter
when there was a mix of JavaScript and HTML in the same code block. Now
with Rouge, the highlighter used by Jekyll, these cases are properly
handled and HTML no longer looks strange.

This does not convert all of the code blocks over, because there are
still some code blocks which double as the actual JavaScript code
powering the example that need to be migrated.
2016-01-30 18:09:01 -05:00
Kevin Brown
54441e6a22 Switched index to use Jekyll's code highlighting
We previously used Google's Prettify, which worked on the client side.
Now that we are actually using Jekyll, and it has built-in syntax
highlighting, we might as well change to doing highlighting on the
backend.
2016-01-28 11:54:24 -05:00
Kevin Brown
ff9486bbd2 Merge pull request #4127 from drmonkeyninja/patch-1
Replaced protocol-relative URLs with HTTPS protocol
2016-01-28 11:26:00 -05:00
Andy Carter
9b4b9175fc Replaced protocol-relative URLs with HTTPS protocol
Use of protocol-relative URLs is now seen as an anti-pattern as it leaves the door open to attacks. As the CDNs serve over HTTPS it should be recommended that people use HTTPS rather than protocol-relative URLs. See Paul Irish's post on [Protocol-relative URLs](http://www.paulirish.com/2010/the-protocol-relative-url/) for more details.
2016-01-27 10:21:50 +00:00
Kevin Brown
97f7eea9ce Recompile dist 2016-01-14 19:31:16 -05:00
Kevin Brown
0840c3923f Code samples and docs for selections 2016-01-14 19:30:11 -05:00
Kevin Brown
ce2204cff0 Code samples for options affecting the dropdown
This is just code samples, most of this still needs readable (non-code)
documentation that actually explains what is going on with the options.
2016-01-14 19:29:48 -05:00
Kevin Brown
55aa2c64cc More docs for data adapters 2016-01-14 19:26:19 -05:00
Kevin Brown
d6bc96d7de Expand upon the core section of the docs
This adds more code examples where they might be useful, and adds some
more description where it was needed. This clarifies a couple of the
questions that have come up about the AMD support and links to the bug
that Select2 was involved with that some people reported when 4.0.0 was
released.
2016-01-14 18:40:37 -05:00
Kevin Brown
69ef214c92 Display error message on AJAX errors
This display the `errorLoading` translation when there is an error
during the AJAX cycle. Previously we were just throwing these errors
out, now we are actually displaying an error message.

This closes https://github.com/select2/select2/issues/3501
2016-01-04 20:07:37 -05:00
Kevin Brown
db5e947664 Added test for new insertTag option
This adds a basic test that ensures that the `insertTag` option works as
expected.
2016-01-03 19:09:45 -05:00
Stretch
e842797aaf Added insertTag to control the tag position
This adds an option called `insertTag` that controls the location within
the results where the tag is inserted. The function should take in the
results array and the tag, and should modify the array in-place to add
the tag to the results.

This closes https://github.com/select2/select2/issues/3420
This closes https://github.com/select2/select2/pull/4008
2016-01-03 19:08:59 -05:00
Kevin Brown
63d531a9c0 Fixed responsive example in documentation
This fixes the documentation so the responsive example actually works.
Everything was working properly, the example just wasn't updated when
the default for the width was changed to `100%` in
5fd72d2052.
This is a change from the old `resolve` width setting, which is
responsible for parsing the style attribute and getting the width that
was set.

This closes https://github.com/select2/select2/issues/4050
2016-01-03 18:57:49 -05:00
Kevin Brown
f3b9693ad9 Fixed existing selections not being respected with array data
This fixes an edge case that occurred pretty much whenever anyone would
use array data with existing selections along with a placeholder. This
caused the existing selections to be discarded, because the `selected`
property was not being transferred over to the new option. This was
based the new data was being preferred over the data that could be
inferred from the option, and the new data typically did not include the
selected state. As a result, the option was assumed to not be selected.

This was not cause by existing tests because all of the existing tests
only covered cases where the selected option was the first option, and
that was not affected by this bug.
2016-01-03 18:34:59 -05:00
Kevin Brown
d1ed0a513a Add failing test for existing array selections
This adds a broken test that demonstrates the issue seen in
https://github.com/select2/select2/issues/3990 where existing selected
options are being reset once Select2 is initialized. This issue cannot
be reproduced on the options page [1] because the issue only appear to
happen if the selected option is not the first one in the list of
possible options.

[1]: https://select2.github.io/examples.html#data-array
2016-01-03 18:21:09 -05:00