-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new callback: beforeSelectionAdd #34
Open
mimhof1
wants to merge
202
commits into
wuyuntao:master
Choose a base branch
from
hlsolutions:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ing when pressing escape
…ing when pressing escape
…ection). In general, user inputs have to be escaped before using jQuery's code-injection features like $(..).html(maliciousUserInput). That is guaranteed now. Test cases are attached! Additionally, this will add support for custom html renderer. A jQuery object which is defined via configuration key "selectedItemProp" will be appended directly to the result or selection list. Tests cases are attached. Because of both changes (XSS protection and custom HTML renderers), the highlighter had to be changed to work with html escaped content. Tests cases are attached. In preparation for an internal rewrite of data storage I had introduced the local "Selections" holder. Instead of trusting on a hidden field with comma separated strings, this is a real domain object. It supports add(value), remove(value), exists(value), getAll() and clear(). Nearly all usages of the hidden field were replaced in favor of "Selections". For backwards compatibility, the hidden field will be synchronized on every modification. Note: The XSS execution issues will work with the current versions. Following test cases will be appended - XSS: Type a malicious code fragment which must not be executed (new token, no result list). - XSS: Type a part of malicious code fragment which is part of a result list. Neither the result list's nor the selection list's code must be executed. - Extended example/test using a custom formatter with "formatList" (basic). - Extended example/test using a custom formatter and prefilling "preFill". The prefilled data should generate the selection correctly (basic). - Extended example/test using a custom formatter, prefilling and a custom selection renderer. - A combination of all tests: custom result list item renderer, custom selection list item renderer and XSS check.
* deleting must be working with special content, too
…ming, adds SASS, adds Mins. # 1: I'm introducing the usage of `grunt`. This will replace the old `make.sh` and several other manual required steps. To verify a change, just type `grunt test`. To make a new build into destination, just type `grunt build`. The default and recommended way is only `grunt` which all compile all, test all and make all required build artifacts at the destination. Based on a common `grunt` setup this projects have a set of several additional tasks: coffee, coffeelint, cssmin, sass and a misc (utils). Credits by https://github.com/Takazudo/gruntExamples. # 2: CoffeeScript This plugin is now rewritten in CoffeeScript. Basically, this is still the old code base. However, some functions and loops were already optimized. But there are still some tasks to do… # 3: SASS The plugin's stylesheet was converted to a SASS one. Like the CoffeeScript migration, this is not a optimized SASS target. # 4: Testing / QUnit / PhantomJS The tests were optimized to use PhantomJS. In addition to that, `grunt` helps to start a mini web server for each test run. With the result that all tests will run in a real environment with no problems of cross origins because of a local file system. Moreover, an additional `jquery.simulate2` was added supporting a more flexible key event instrument.
Adds missing informations about the canGenerateNewSelections option
Allows selection by hitting ENTER if neverSubmit is true
… it will create a new keyword
Adds creationText option to display a line in the results to indicate it will create a new keyword
* Adds a new configuration option for `maxChars`. Works similarly to `minChars` * Added validation message for `minChars` * Added validation message for `maxChars` * Added `onRenderErrorMessage` callback which can be overridden in order to customize validation behavior. * Added corresponding tests. * Updated readme and change log. * Bumped version.
Add validation messages for `minChars` and `maxChars` fixes #24
Everywhere else we use namespace CSS selectors with `as`. It makes sense to use the namespace on `error` as well - especially since `error` is a commonly used class name and thus there's a high likelihood that it could cause namespace collisions.
Add `as` namespace to validation error CSS class name
This commit addresses several bugs related to whitespace: * You can no longer add a tags which consist entirely of whitespace * You can no longer workaround the `minChars` validation by adding whitespace Code changes are pretty minimal. Tests included for both these cases. Lemme know if you have any questions.
Ignore whitespace when adding and validating tags
Typo in README
Add a Bitdeli Badge to README
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A callback that is run when a selection is made by choosing one from the results dropdown or by using the tab/comma keys to add one and fires before afterSelectionAdd. It returns false or element or altered element. If false, element is not added. Example would be to run selected element against filters, for example, check if valid email.