Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jquery.dirtyforms.dialogs.jquery-ui
Advanced tools
A module to enable automatic jQuery UI dialog support when using jQuery Dirty Forms.
This is a dialog module for the jQuery Dirty Forms project.
This module causes Dirty Forms to use jQuery UI as its dialog when the user attempts to leave the page by clicking a hyperlink (but not when interacting with the navigation buttons of the browser).
Only 1 dialog module can be used by Dirty Forms at a time. The default behavior without this package is to use the browser's built in dialog that is fired by the
beforeunload
event.
Prerequesites must be included in this order:
If you are using a Package Manager, these dependencies will be installed automatically, but depending on your environment you may still need to add references to them manually.
There are several different ways to get the code. Some examples below:
The jQuery UI dialog module is available over jsDelivr CDN and can directly be included on every page.
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.dialogs.jquery-ui.min.js"></script>
jsDelivr also supports on-the-fly concatenation of files, so you can reference only 1 URL to get jQuery, jQuery UI, jquery.dirtyforms, and jquery.dirtyforms.dialogs.jquery-ui in one request.
<script type="text/javascript" src="//cdn.jsdelivr.net/g/jquery@1.11.3,jquery.ui@1.11.3,jquery.dirtyforms@2.0.0(jquery.dirtyforms.min.js+jquery.dirtyforms.dialogs.jquery-ui.min.js)"></script>
Download and save one of two available files to include the jQuery UI dialog module to your page, either the latest distribution or the latest minified version.
<script type="text/javascript" src="jquery.dirtyforms.dialogs.jquery-ui.min.js"></script>
You can also conveniently get all of the latest Dirty Forms files in one Zip Download.
The jQuery UI dialog module is even available through NPM, Bower, and NuGet. Just use one of the following commands below to install the dialog module, including all dependencies.
// NPM
$ npm install jquery.dirtyforms.dialogs.jquery-ui
// Bower
$ bower install jquery.dirtyforms.dialogs.jquery-ui
// NuGet
PM> Install-Package jquery.dirtyforms.dialogs.jquery-ui
A SourceMap file is also available via CDN or your favorite package manager.
<script type="text/javascript" src="//cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.dialogs.jquery-ui.min.js.map"></script>
NPM, Bower, and NuGet will install the SourceMap file into the destination directory.
jquery.dirtyforms.dialogs.jquery-ui.min.js.map
This dialog module is automatic. Simply include the reference to the dialog module after the prerequisites and use Dirty Forms as per the documentation and jQuery UI as per the documentation.
// CSS
// jQuery UI (many other themes available at [jsDelivr](https://github.com/jsdelivr/jsdelivr/tree/master/files/jquery.ui/1.11.3/themes))
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.ui/1.11.3/jquery-ui.min.css" />
// JavaScript
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js" type="text/javascript"></script>
<script src="//cdn.jsdelivr.net/jquery.ui/1.11.3/jquery-ui.min.js" type="text/javascript"></script>
<script src="//cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.min.js" type="text/javascript"></script>
<script src="//cdn.jsdelivr.net/jquery.dirtyforms/2.0.0/jquery.dirtyforms.dialogs.jquery-ui.min.js" type="text/javascript"></script>
If not using a CDN, you need to apply the dependencies in the same order as in the example above.
The following options are available to set via $.DirtyForms.dialog.OPTIONNAME = OPTIONVALUE or get via OPTIONVALUE = $.DirtyForms.dialog.OPTIONNAME
Name | Type | Default | Description |
---|---|---|---|
title | string | 'Are you sure you want to do that?' | Sets the title of the dialog. |
proceedButtonText | string | 'Leave This Page' | Sets the text of the continue button of the dialog. |
stayButtonText | string | 'Stay Here' | Sets the text of the cancel button of the dialog. |
preMessageText | string | '' | Sets the text that precedes the message text. May contain HTML. |
postMessageText | string | '' | Sets the text that follows the message text. May contain HTML. |
width | int | 430 | The width of the dialog. |
For help or to report a bug please open an issue at the Dirty Forms development site.
FAQs
A module to enable automatic jQuery UI dialog support when using jQuery Dirty Forms.
The npm package jquery.dirtyforms.dialogs.jquery-ui receives a total of 6 weekly downloads. As such, jquery.dirtyforms.dialogs.jquery-ui popularity was classified as not popular.
We found that jquery.dirtyforms.dialogs.jquery-ui 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.