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 (
Mark Daggett (author)
Tue Mar 03 14:35:01 -0800 2009
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Thu May 29 19:47:33 -0700 2008 | |
| |
README | Tue Mar 03 14:15:51 -0800 2009 | |
| |
about.yml | Thu May 29 19:47:33 -0700 2008 | |
| |
dismissible.css | Thu May 29 19:47:33 -0700 2008 | |
| |
init.rb | Thu May 29 19:47:33 -0700 2008 | |
| |
lib/ | Tue Mar 03 14:35:01 -0800 2009 | |
| |
test/ | Thu May 29 19:47:33 -0700 2008 |
README
= Acts As Dismissible
Allows you to create messages in the user interface, which the users can dismiss once read.
The plugin stores the reference to the dismissed message in a cookie.
= Usage Examples
# Add a dismissible message to the view:
<% dismissible_message('site_welcome') do -%>
<p> Hello and welcome to our site. I hope you enjoy your stay. Feel free to look around.</p>
<% end -%>
# Produces:
<div class="dismissible_message" id="hide_dismissible_site_welcome">
<p> Hello and welcome to our site. I hope you enjoy your stay. Feel free to look around.</p>
<p>
<a class="dismissible_link" href="#" onclick="document.cookie = 'hide_dismissible_site_welcome = 1; expires= Sun,
Jan 17 2038 11:14:06 UTC; path=/';document.getElementById('hide_dismissible_site_welcome').style.display = 'none';
return false;">Don't show this again.</a>
</p>
</div>
# Add A custom message
<% dismissible_message('site_welcome', { :message => "Do not show this again" }) do -%>
<p> Hello and welcome to our site. I hope you enjoy your stay. Feel free to look around.</p>
<% end -%>
# Only display this message if a previous dismissible message was dismissed.
<% dismissible_message('cookie_two', { :message => "Do not show this again", :follows => "cookie_one" }) do -%>
<p>Why did you dismiss the last message?</p>
<% end -%>
# Use your own dismiss text or button, and/or specify a callback to execute after the cookie has been set.
<%- dismissible_message('welcome_message', :dismiss_button => 'dismiss_welcome', :callback => 'Effect.BlindUp') do -%>
<p>Hide me!</p>
<a href="#" id="dismiss_welcome" class="hide" title="Hide">Hide</a>
<script type="text/javascript" charset="utf-8">
$('dismiss_welcome').observe('click', function(event){
dismiss_window_hide_dismissible_welcome_message();
});
</script>
<%- end ->
= Authors
# Mark Daggett
= Extra Credit
The cookie implementation for this plugin is based off ideas from Court3 and DanP.
Rick Olson also helped clean up some of this code to make it more succinct.







