
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@conciergerie-dev/select-a11y
Advanced tools
select-a11y transforms selects (multiple or not) into suggestions list with search input. It is compliant with Web Content Accessibility Guidelines (WCAG) and General Accessibility Framework for Administrations (Référentiel général d'accessibilité pour les administrations - RGAA).
This fork is based on the original select-a11y from Pidila.
To see the demo, three solutions are available:
$ npm install
then $ gulp dev
.All you need is the files in the dist/
directory.
The source files are in the src/
directory.
Call the dist/main.js
script in the bottom of your page, just before the body closing tag, or compile the dist/module.js
with your others scripts.
Add the css or scss in your style files.
You can retrieve dist/select-a11y.css
, an already compiled version.
To be transformed by select-a11y, the fastest way is to add the data-select-a11y
attribute on the select
tag you want to transform.
<!-- select simple -->
<div class="form-group">
<label for="select-option">Is your website…</label>
<select class="form-control" id="select-option" data-select-a11y>
<option>Perceivable</option>
<option>Operable</option>
<option>Understandable</option>
<option>Robust</option>
</select>
</div>
<!-- select multiple -->
<div class="form-group">
<label for="select-element">What do you want to do today?</label>
<select class="form-control" id="select-element" multiple data-select-a11y data-placeholder="Search in list">
<option>Sleeping</option>
<option>Climbing trees</option>
<option>Knitting</option>
<option selected>Dancing with unicorns</option>
<option>Dreaming</option>
</select>
</div>
Then, add the following JavaScript code in one of your file (that must be after select-a11y script):
var selects = document.querySelectorAll('select[data-select-a11y]');
var selectA11ys = Array.prototype.map.call(selects, function(select){
return new Select(select);
});
The default texts used for accessibility can be changed. When creating a new select a11y, you can pass an object containing the text
property as a second parameter:
var selects = document.querySelectorAll('select[data-select-a11y]');
var selectA11ys = Array.prototype.map.call(selects, function(select){
new Select(select, {
text:{
help: 'Utilisez la tabulation (ou la touche flèche du bas) pour naviguer dans la liste des suggestions',
placeholder: 'Rechercher dans la liste',
noResult: 'Aucun résultat',
results: '{x} suggestion(s) disponibles',
deleteItem: 'Supprimer {t}',
delete: 'Supprimer'
}
})
});
The texts in the example are the default texts used in the script.
This project is under Test Driven Development with tape.
Requisite: Node.js 10.x, npm, npm gulp 3.x globally installed.
After cloning this repository, install dependencies:
$ npm install
$ gulp
This task is a combination of the gulp build
(compilation of sources and sending to the demo directory) and gulp dev
(launching the server to display the page locally and recompiling sources on the fly if modified) tasks.
$ npm test
Important note: do not directly modify the assets/scripts/select-a11y.js file or the assets/css/select-a11y.css file : they are generated by the build tasks.
Developpers and reviewers: Alain Batifol, Thomas Beduneau, Nicolas Bovorasmy, Anne Cavalier, Laurent Dutheil, Lucile Houdinet, Aurélien Lévy, Hugues Moreno - For the DILA, Direction de l'information légale et administrative.
MIT and CeCILL-B. Feel free to use it with one or the other.
FAQs
Module de select multiple accessible
We found that @conciergerie-dev/select-a11y 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 researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.