
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
server-generated-popups
Advanced tools
Have a controller action that's supposed to respond by showing a modal dialog?
Now you can do it like this:
views/invoices/show.js.erb
Popup("<%=j render @invoice %>").show('up')
Check the live demo.
Animations, styles — all included. One line gets you a fully working solution.
Perfect with Rails and its Server-generated JavaScript Responses, but not limited to them.
gem 'server-generated-popups'
Then require popup
into both your styleheet and javascript files.
Download this repo. Grab popup.js
and popup.css
from the assets
directory and put them wherever you put JS and CSS in your framework. Follow examples in the following section, they are written to apply to any web framework.
Raise a popup from the bottom of the screen:
popup = Popup("<div>Hello</div>").show('up')
Sink the popup down through the bottom of the screen:
popup.hide('down')
Your popup content needs extra padding around it to look good? Pass the value in any units:
Popup("<div>Hello</div>", {padding: '20px'})
Override width of the popup by passing the value in px:
Popup("<div>Hello</div>", {width: 300})
By default the popup will show with a close button in the top right corner and a semi-transparent backdrop beind (like this). You can disable either or both:
Popup("<div>Hello</div>", {closeButton: false, backdrop: false}).show('up')
If you need to do something after the popup slides onto the screen — pass a callback to show
.
editInvoiceDetails = Popup("<%=j render @invoice %>").show('up', function (popupWindow) {
popupWindow.style.backgroundColor = "red"
this.hide('down')
}
})
Open demo/index.html in your browser. Make changes to the code, see the results in real time.
FAQs
Unknown package
We found that server-generated-popups 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
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.