Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
I've GemPlugin-ized the Redbox library, as I much prefer using gems than I do using plugins.
Install the gem from GemCutter
gem install redbox
Require the gem in your config/environment.rb
config.gem 'redbox'
Redbox requires some static files (an image, a CSS file, and a JS file) to run. Copy those over:
$ script/genrate redbox_static_files
Make sure you're loading the redbox.css
and redbox.js
files in your templates:
javascript_include_tag 'redbox'
stylesheet_link_tag 'redbox'
Then use the methods described below.
The original README follows:
Redbox is a very simple lightbox library, which is a way of display a model popup window which may contain any html, while the rest of the page is faded out behind it. There are already many such libraries around for this, but:
And of course, I wanted it all packaged as a nice rails plugin with handy helpers to use it.
Much of the design, and some of the javascript and css are shamelessly ripped from the Thickbox library, by Cody Lindley.
This library should be considered to be a derivative work of Thickbox, and is also released under the MIT licence.
http://jquery.com/demo/thickbox/
Redbox Rails plugin development by Craig Ambrose
Additional code submissions, testing and bugfixes by:
MIT License
http://www.opensource.org/licenses/mit-license.php
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.
Examine the public methods of redbox_helper.rb
. They will all look familiar, much like the existing link helpers, except that they work with redboxes. You should not need to interact with the javascript directly.
Redbox provides three helpers which are used instead of a regular link_to
helper when linking to a redbox.
link_to_redbox(name, id, html_options = {})
This is used if you already have an HTML element in your page (presumably hidden, but it doesn’t have to be) and you wish to use it for your redbox. Specify it by it’s id, and you’re in business.
link_to_component_redbox(name, url_options = {}, html_options = {})
This serves essentially the same purpose, but it uses the url_options supplied to load another page from your app into a hidden div on page load. This saves you having to do it yourself, but beware that there are definite performance implications to using components.
link_to_remote_redbox(name, link_to_remote_options = {}, html_options = {})
This waits until the link is clicked on to load the redbox using ajax, and displays loading graphics while it’s waiting.
link_to_close_redbox(name, html_options = {})
Allows you to put a link (presumably inside the redbox) to close it. Other way to close it is to refresh the entire page, but obviously closing it with javascript is spiffier.
A static page is maintained for this plugin at:
http://www.craigambrose.com/projects/redbox
Updates are always posted at:
Bugs, once you have tracked down the exact problem and can reproduce a failure case, can be reported to:
If you find this plugin useful, you can give something back to the community by examining your own code and seeing what bits of functionality are generic enough to be useful as a rails plugin. Releasing rails plugins is dead simple, and helps us all do better work.
FAQs
Unknown package
We found that redbox 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.