
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
modal-dialog
Advanced tools
Window modal dialogs for browser (eg. with simq). Depends on jQuery, instance of EventEmitter, uses q promise library.
Unfortunately I don't have any more time to maintain this repository :-(
$ npm install modal-dialog
var Dialog = require('modal-dialog');
var d = new Dialog(window.jQuery);
d.title = 'Title of my window';
d.content = 'Lorem lipsum dolor sit amet...';
d.info = 'Info in footer';
d.addButton('OK', function() {
alert('OK button was clicked');
d.hide();
});
d.show();
If you want to set some element directly into header or footer, you can set these variables. Title
and info
variables
are just shortcuts for setting texts.
d.header = $('<div>my custom header</div>');
d.footer = $('<div>my custom footer</div>');
There are three methods for changing data. Unfortunately you can not change everything (just title, content and info).
d.changeTitle('new title');
d.changeContent('new content');
d.changeInfo('new info');
This modal dialog comes with one simple style which is sincerely horrible, so I recommend to use your own style. You just have to disable the default one.
Dialog.styles = false;
Now you can write your own styles in your css files. Modal dialog has got some classes for you. Names of these classes can
be also changed in variable classes
. Here are the default ones.
Dialog.classes = {
container: 'modal_dialog',
title: 'title',
header: 'header',
content: 'content',
footer: 'footer',
info: 'info',
buttons: 'buttons',
button: 'button',
};
Settings described above were default settings, but you can set these options for each dialog separately.
d.show({
styles: false
});
There is prepared also simple confirmation dialog with two buttons (OK
and Cancel
).
var Confirm = require('modal-dialog/ConfirmDialog');
var c = new Confirm(window.jQuery, 'Are you really want to continue?');
c.on('true', function() {
alert('You clicked on the OK button');
});
c.on('false', function() {
alert('You clicked on the Cancel button');
});
Here is how to set own captions for these two buttons.
var c = new Confirm(window.jQuery, 'Some question', 'Yes', 'No');
beforeShow
(dialog): Called before dialog is openedafterShow
(dialog): Called after dialog is opened (after all animations)beforeHide
(dialog): Called before dialog is closedafterHide
(dialog): Called after dialog is closed (after all animations)true
(only confirmations): Called when true button is clickedfalse
(only confirmations): Called when false button is clickedExample:
d.on('afterShow', function(dialog) {
d === dialog; //true
console.log('Window is open');
});
$ npm test
1.6.3
1.6.2
1.6.1
1.6.0
1.5.0
1.4.0
1.3.3 - 1.3.4
1.3.2
1.3.1
1.3.0
1.2.2 - 1.2.4
1.2.1
1.2.0
isOpen
method1.1.1
1.1.0
1.0.0
FAQs
[ABANDONED] Window modal dialogs for browser
The npm package modal-dialog receives a total of 794 weekly downloads. As such, modal-dialog popularity was classified as not popular.
We found that modal-dialog 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
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.