
Research
/Security News
11 Malicious Go Packages Distribute Obfuscated Remote Payloads
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
bootstrap-tokenfield-jquery3
Advanced tools
Advanced tagging/tokenizing plugin for input fields with a focus on keyboard and copy-paste support.
![NPM version][npm-badge] ![Build status][travis-badge] [npm-badge]: https://badge.fury.io/js/bootstrap-tokenfield.png [travis-badge]: https://travis-ci.org/sliptree/bootstrap-tokenfield.png?branch=master
A jQuery tagging / tokenizer input plugin for Twitter's Bootstrap, by the guys from Sliptree
Check out the demo and docs
Requirements: jQuery 1.9+, Bootstrap 3+ (only CSS)
dist/bootstrap-tokenfield.js
or dist/bootstrap-tokenfield.min.js
in your HTMLdist/css/bootstrap-tokenfield.css
in your HTML$('input').tokenfield()
You can use the tokenfield:createtoken
event for that. Check the event.attrs
property for token value and label,
and the run your duplicate detection logic. If it's a duplicate token, simply do event.preventDefault()
.
Here's a simple example that checks if token's value is equal to any of the existing tokens' values.
$('#my-tokenfield').on('tokenfield:createtoken', function (event) {
var existingTokens = $(this).tokenfield('getTokens');
$.each(existingTokens, function(index, token) {
if (token.value === event.attrs.value)
event.preventDefault();
});
});
Similarly, using tokenfield:createtoken
, you can check to see if a token exists in your autocomplete/typeahead
data. This example checks if the given token already exists and stops its entry if it doesn't.
$('#my-tokenfield').on('tokenfield:createtoken', function (event) {
var available_tokens = bloodhound_tokens.index.datums
var exists = true;
$.each(available_tokens, function(index, token) {
if (token.value === event.attrs.value)
exists = false;
});
if(exists === true)
event.preventDefault();
})
See release notes
Previous releases:
0.10.0
autocomplete="off"
to prevent browser-specific autocomplete suggestionstriggerKeys
has been renamed to delimiter
and accepts a single or an array of characters instead of character codes.0.9.9-1
triggerKeys
option0.9.8
triggerKeys
option0.9.7 Valuable
prevetDuplicateToken
event0.9.5 Typeable
0.9.2 Maintenance release
0.9.0 Bootstrappable
0.7.1
0.7.0 Autocompleted
0.6.7 Crossable
0.6.5 Shiftable
0.6 Editable
0.5 Initial release
FAQs
Advanced tagging/tokenizing plugin for input fields with a focus on keyboard and copy-paste support.
The npm package bootstrap-tokenfield-jquery3 receives a total of 135 weekly downloads. As such, bootstrap-tokenfield-jquery3 popularity was classified as not popular.
We found that bootstrap-tokenfield-jquery3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).