
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
dndalertjs
Advanced tools
DNDAlert is a simple JavaScript library alert for web developers.
const Alert = new DNDAlert({
message: "DNDAlert is a simple JavaScript library alert for web developers.",
});
const Alert = new DNDAlert({
title: "Test Alert",
message:
"<b>DNDAlert</b> is a simple JavaScript library alert for web developers.",
type: "warning",
html: true,
buttons: [
{
text: "Ok",
class: "btn btn-primary",
onClick: (bag) => {
alert("Ok button clicked");
},
},
{
text: "Cancel",
type: "danger",
onClick: (bag) => {
bag.CLOSE_MODAL();
},
},
],
closeBackgroundClick: true,
portalElement: document.querySelector("#modal"),
portalOverflowHidden: true,
textAlign: "center",
theme: "dark",
onOpen: (bag) => {
console.log("Modal Opened");
console.log(bag);
},
onClose: (bag) => {
console.log("Modal Closed");
console.log(bag.PROPERTIES);
},
opacity: 1,
autoCloseDuration: 3000,
draggable: true,
animationStatus: true,
closeIcon: false,
sourceControlWarning: true,
});
[title]
[html]
[buttons]
It is an array. Keeps the buttons inside.
[text] Text inside the button
[class] Sets the class of the button. * If not defined, it comes with the library's default button style (light)
[type] Default button styles available in the library [primary,secondary,success,danger,warning,light]
[onClick] Function to run after clicking the button.
onClick: (BAG_ELEMENT) => {
BAG_ELEMENT.CLOSE_MODAL();
},
[closeBackgroundClick] If true, clicking (not Modal) the background closes the Modal
[autoCloseDuration] Takes value (X) in milliseconds and closes modal after X milliseconds.
[onOpen] The function is called by the library when the modal is opened.
[onClose] The function is called by the library when the modal is closed.
[closeIcon] Sets the status of the close button on the top right (invisible if false)
[portalElement] To call a modal on an element other than body
[portalOverflowHidden] Portal overflow hidden
[textAlign] Css property of message
[theme] Theme (dark AND white)
[type] success,error,warning and info | If it is not entered, the type will not be displayed, only the message will be show.
[opacity] Modal css opacity.
[animationStatus] If true, opening and closing will be accompanied by animation.
[draggable] Modal draggable. (Title required)
[sourceControlWarning] If true, when the modal is run, it makes a request to NPM and compares the current version with the local version. If the versions are different, a warning message in the console. (If you don't want to make a npm version request, you can turn it off.)
cd my-web-project
npm i dndalertjs
or
cd my-web-project
git clone https://github.com/ismailfp/DNDAlert.js.git
Property | Value |
---|---|
portalElement | document.body |
portalOverflowHidden | true |
animationStatus | true |
closeIcon | true |
closeBackgroundClick | true |
sourceControlWarning | true |
type | false |
autoCloseDuration | false |
draggable | false |
html | false |
title | false |
buttons[] > class | light |
theme | white |
opacity | 1.00 |
textAlign | left |
Property | ? |
---|---|
CLOSE_MODAL | Modal closing function |
PROPERTIES | Contains general information |
PROPERTIES->CREATED_TIME | Modal opening date |
PROPERTIES->THEME | THEME |
PROPERTIES->VERSION | Current version (DNDAlert - NPM) |
PROPERTIES->CONTEXT | Everything in Context |
PROPERTIES->HOW_MANY_SECONDS | Only onClose BAG (Shows how many seconds the alert on after closing) |
FAQs
DNDAlert is a simple JavaScript library alert for web developers.
We found that dndalertjs 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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.