This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Jim Fiorato (author)
Wed Mar 18 14:45:45 -0700 2009
commit 085087031a874c9af484dc46e14a5419be848eac
tree cd6e329d9e35470bb270083504bcffb05a437bc0
parent 1b53810c6a348a0b7266efc2a6594b1aeb685be0
tree cd6e329d9e35470bb270083504bcffb05a437bc0
parent 1b53810c6a348a0b7266efc2a6594b1aeb685be0
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Dec 23 08:44:59 -0800 2008 | |
| |
README | Wed Jan 21 06:35:20 -0800 2009 | |
| |
init.rb | Wed Dec 24 05:08:37 -0800 2008 | |
| |
install.rb | Tue Dec 23 08:44:59 -0800 2008 | |
| |
lib/ | Fri Feb 13 06:20:25 -0800 2009 | |
| |
public/ | Wed Mar 18 14:45:45 -0700 2009 | |
| |
tasks/ | Tue Dec 23 08:44:59 -0800 2008 |
README
Growl4Rails
==============
Growl4Rails is a javascript component that provides the UI for growl-like notifications in your rails application.
This plugin requires Prototype 1.6 or higher and Scriptaculous 1.7 or higher.
Installation
===============
If you are on Rails 2.1 or higher:
$ script/plugin install git://github.com/jfiorato/growl4rails.git
For older versions of Rails, cd into your application's vendor/plugins, and execute the following:
$ git clone --depth 1 git://github.com/jfiorato/growl4rails.git
$ mkdir ../../public/javascripts/growl4rails ../../public/stylesheets/growl4rails ../../public/images/growl4rails
$ cp growl4rails/public/javascripts/* ../../public/javascripts/growl4rails/
$ cp growl4rails/public/stylesheets/* ../../public/stylesheets/growl4rails/
$ cp growl4rails/public/images/* ../../public/images/growl4rails/
Usage
=====
In your view put the following:
<%= growl4rails_includes %>
This will set the default growl duration to 5000 milliseconds and the default max number of growls to show to 3.
If you'd like a different default duration and max number to show do the following:
<%= growl4rails_includes(3000, 5) %>
The arguments to this method are:
duration = The amount of time the growl window shows.
max_showing = The maximum number of growls to show at one time.
Then when you'd like the Growl window to appear:
<script type="text/javascript" language="javascript">
Growl4Rails.showGrowl({image_path:"/images/download.png", title:"Foo Bar.pdf", message:"File is ready for
download."});
</script>
Growl4Rails.showGrowl method takes a single hash as an argument. The hash can have the following keys:
image_path - 32x32 icon
title - title of the growl
message - the growl message
To handle the 'click' event from the Growl, you can do the following:
<script type="text/javascript" language="javascript">
var growl_id = Growl4Rails.showGrowl({image_path:"/images/download.png", title:"Foo Bar.pdf", message:"File is ready
for download."});
document.observe(growl_id + ':clicked', function(event) {
console.log('Growl %s was clicked.', Event.findElement(event).id);
});
</script>
Authors
=======
Jim Fiorato -- http://www.writebetterbits.com
Original implementation
Contributors
============








