Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
conditionize
Advanced tools
jQuery plugin for forms conditions to show/hide controls depending on its values
jQuery plugin for forms conditions to show/hide controls depending on its values.
<script src="conditionize/dist/conditionize.min.js"></script>
Link directly from unpkg
<script src="https://unpkg.com/conditionize@1/dist/conditionize.min.js"></script>
<form class="my-form" action="#">
<h1>Conditionize</h1>
<input type="text" name="text-control" placeholder="Type 'magic'">
<div data-cond="[name=text-control] == magic">Magically show when text control contains 'magic' word.</div>
<select name="select-control">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three. Wow, you will see the new control below...</option>
</select>
<label data-cond="[name=select-control] == 3">
<input type="checkbox" name="checkbox-control">
Is checked?
<span data-cond="[name=checkbox-control] != true">Nope</span>
<span data-cond="[name=checkbox-control]">Yep</span>
</label>
<div>
<a href="https://github.com/nk-o/conditionize" data-cond="[name=select-control] == 3 && [name=checkbox-control] == true">GitHub</a>
</div>
</form>
$('.my-cond-form').conditionize({
selector: '[data-cond]'
});
Name | Type | Default | Description |
---|---|---|---|
selector | string | [data-cond] | Condition blocks jQuery selector. |
conditionAttr | string | data-cond | Condition atribute that will be checked. |
checkDebounce | int | 150 | Debounce timeout for better performance. |
Events used the same way as Options.
Name | Description |
---|---|
onInit | Called after init end. |
onDestroy | Called after destroy. |
onCheck | Called when check function ended work (available 2 arguments [ $item, show ] ). |
customToggle | Custom toggle for conditional blocks. You can define your own function to show/hide blocks. |
Example of customToggle
function:
{
customToggle: function( $item, show ) {
if ( show ) {
$item.show();
} else {
$item.hide();
}
}
}
Name | Result | Description |
---|---|---|
destroy | - | Destroy Conditionize and set block as it was before plugin init. |
$('.my-cond-form').conditionize('destroy');
If you already have jQuery.fn.conditionize, you can rename the plugin.
jQuery.fn.newConditionize = jQuery.fn.conditionize.noConflict();
npm install
in the command line. Or if you need to update some dependencies, run npm update
npm run build
to run buildnpm run js-lint
to show eslint errorsnpm run js-lint-fix
to automatically fix some of the eslint errorsFAQs
jQuery plugin for forms conditions to show/hide controls depending on its values
The npm package conditionize receives a total of 2 weekly downloads. As such, conditionize popularity was classified as not popular.
We found that conditionize 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.