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.
Flat, responsive, lightweight, easy customizable modal window plugin with declarative state notation and hash tracking.
Flat, responsive, lightweight, fast, easy customizable modal window plugin with declarative state notation and hash tracking.
#IMPORTANT!
v0.4.0 has incompatible changes.
lt-ie9
class to the html
element, as modernizr does.That's very simple to start using Remodal.
Download it. You can use bower: bower install remodal
.
Add this in the head section:
<link rel="stylesheet" href="path/to/your/jquery.remodal.css">
Add this before the </body>
or in the head:
<script src="path/to/your/jquery.remodal.min.js"></script>
Define the background container for the modal(for effects like a blur). It can be any simple content wrapper:
<div class="remodal-bg">
...Page content...
</div>
And now create the modal dialog:
<div class="remodal" data-remodal-id="modal">
<h1>Remodal</h1>
<p>
Flat, responsive, lightweight, fast, easy customizable modal window plugin
with declarative state notation and hash tracking.
</p>
<br>
<a class="remodal-cancel" href="#">Cancel</a>
<a class="remodal-confirm" href="#">OK</a>
</div>
So, now you can call it with the hash:
<a href="#modal">Call the modal with data-remodal-id="modal"</a>
Or:
<a data-remodal-target="modal">Call the modal with data-remodal-id="modal"</a>
<script>
window.remodalGlobals = {
namespace: "modal",
defaults: {
hashTracking: false
}
};
</script>
<script src="js/jquery.remodal.js"></script>
Base HTML class for your modals. CSS theme will need to be updated to reflect this.
Extends default settings.
You can pass additional options by the data-remodal-options
attribute.
<div class="remodal" data-remodal-id="modal"
data-remodal-options="hashTracking: false">
<h1>Remodal</h1>
<p>
Flat, responsive, lightweight, fast, easy customizable modal window plugin
with declarative state notation and hash tracking.
</p>
<br>
<a class="remodal-cancel" href="#">Cancel</a>
<a class="remodal-confirm" href="#">OK</a>
</div>
Default: true
To open the modal without the hash, use data-remodal-target
attribute.
<a data-remodal-target="modal" href="#modal">Call the modal with data-remodal-id="modal"</a>
Default: true
If set to true, closes a modal window after clicking confirm button.
Default: true
If set to true, closes a modal window after clicking cancel button.
Default: true
If set to true, closes a modal window after pressing ESC button.
Default: true
If set to true, closes a modal window by clicking anywhere on the page.
$(document).on('open', '.remodal', function () {
console.log('open');
});
$(document).on('opened', '.remodal', function () {
console.log('opened');
});
$(document).on('close', '.remodal', function (e) {
console.log('close');
// "confirmation", or "cancellation", or undefined
console.log(e.reason);
});
$(document).on('closed', '.remodal', function (e) {
console.log('closed');
// "confirmation", or "cancellation", or undefined
console.log(e.reason);
});
$(document).on('confirm', '.remodal', function () {
console.log('confirm');
});
$(document).on('cancel', '.remodal', function () {
console.log('cancel');
});
Ok, don't set the class attribute and write something like this:
<script>
var options = {...};
$('[data-remodal-id=modal]').remodal(options).open();
</script>
Don't use id
attribute, if you want to avoid the anchor jump.
Get the instance of the modal and call a method:
var inst = $.remodal.lookup[$('[data-remodal-id=modal]').data('remodal')];
// open the modal
inst.open();
// close the modal
inst.close();
The MIT License (MIT)
Copyright (c) 2014 Ilya Makarov, http://vodkabears.github.io
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
FAQs
Responsive, lightweight, fast, synchronized with CSS animations, fully customizable modal window plugin with declarative configuration and hash tracking.
We found that remodal 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.