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.
basiccontext
Advanced tools
Easy-to-use context-menu for your website or web-app.
Name | Description | Link |
---|---|---|
Basic demo | basicContext works with all kind of events | Try it on CodePen |
Position demo | basicContext never leaves the visible screen-area | Try it on CodePen |
Scroll demo | basicContext is scrollable when the context height is bigger than the browser height | Try it on CodePen |
Custom close function demo | basicContext lets you define a custom close function | Try it on CodePen |
Custom position demo | basicContext accepts an object with custom coordinates | Try it on CodePen |
jQuery demo | Use basicContext with the jQuery Event Object | Demo |
basicContext is written in Vanilla JS and only dependents on the following browser APIs:
All of these APIs are capable of being polyfilled in older browser. Check the linked resources above to determine if you must polyfill to achieve your desired level of browser support.
We recommend to install basicContext using Bower or npm.
bower install basicContext
npm install basiccontext
Include the CSS-files in the head
and the JS-file at the end of your body
:
<link rel="stylesheet" href="dist/basicContext.min.css">
<link rel="stylesheet" href="dist/themes/default.min.css">
<script src="dist/basicContext.min.js"></script>
Skip the JS-file if you want to use basicContext as module together with Browserify:
let basicContext = require('basiccontext')
Show a context-menu by using the following command:
document.querySelector('.btn').addEventListener('click', function(e) {
let items = [
{ title: 'Add Sites', icon: 'ion-plus-round', fn: clicked },
{ title: 'Reset Login', icon: 'ion-person', fn: clicked },
{ title: 'Help', icon: 'ion-help-buoy', fn: clicked },
{ title: 'Disabled', icon: 'ion-minus-circled', fn: clicked, disabled: true },
{ title: 'Invisible', icon: 'ion-eye-disabled', fn: clicked, visible: false },
{ },
{ title: 'Logout', icon: 'ion-log-out', fn: clicked }
]
basicContext.show(items, e)
})
basicContext doesn't work properly with the normalized jQuery Event Object, but you can easily bypass this issue using e.originalEvent
:
$('.btn').on('click', function(e) {
let items = [
{ title: 'Add Sites', icon: 'ion-plus-round', fn: clicked },
{ title: 'Reset Login', icon: 'ion-person', fn: clicked },
{ title: 'Help', icon: 'ion-help-buoy', fn: clicked },
{ title: 'Disabled', icon: 'ion-minus-circled', fn: clicked, disabled: true },
{ title: 'Invisible', icon: 'ion-eye-disabled', fn: clicked, visible: false },
{ },
{ title: 'Logout', icon: 'ion-log-out', fn: clicked }
]
basicContext.show(items, e.originalEvent)
})
Layout and theme are separated CSS-files. This makes it easy to style your own context or to choose from the included themes.
Name | Preview | CSS-File | Demo |
---|---|---|---|
Default theme | CSS-File | Demo | |
Bright theme | CSS-File | Demo | |
Dark theme | CSS-File | Demo |
Include the following CSS-files to enhance the look and functionality of your contexts.
Name | Preview | CSS-File | Demo |
---|---|---|---|
PopIn effect | CSS-File | Demo | |
FadeIn effect | CSS-File | Demo |
FAQs
Easy-to-use context-menu for your website or webapp
The npm package basiccontext receives a total of 67 weekly downloads. As such, basiccontext popularity was classified as not popular.
We found that basiccontext 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.