paul_revere 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -25,7 +25,7 @@ end
25
25
 
26
26
  spec = Gem::Specification.new do |s|
27
27
  s.name = "paul_revere"
28
- s.version = "0.1.2"
28
+ s.version = "0.1.3"
29
29
  s.summary = "Simple announcement plugin to include 'one off' style announcements in Rails web apps."
30
30
  s.author = "Thoughtbot"
31
31
  s.email = "support@thoughtbot.com"
@@ -7,5 +7,3 @@ module AnnouncementsHelper
7
7
  @current_announcement ||= Announcement.current
8
8
  end
9
9
  end
10
-
11
-
@@ -0,0 +1,9 @@
1
+ <% if current_announcement.exists? and not announcement_hidden?(current_announcement) %>
2
+ <div id="announcement">
3
+ <%= current_announcement.body %>
4
+ <div class="hide">
5
+ <%= link_to_function "hide", "hideAnnouncement('announcement_#{current_announcement.created_at}');" %>
6
+ </div>
7
+ </div>
8
+ <% end %>
9
+
@@ -1,6 +1,15 @@
1
-
2
1
  function hideAnnouncement(announcement_created_at) {
3
- setCookie(announcement_created_at, 'hidden');
4
- $("announcement").fade();
2
+ createCookie(announcement_created_at, 'hidden', 1);
3
+ $("#announcement").slideUp();
5
4
  }
6
5
 
6
+ // http://www.quirksmode.org/js/cookies.html
7
+ function createCookie(name,value,days) {
8
+ if (days) {
9
+ var date = new Date();
10
+ date.setTime(date.getTime()+(days*24*60*60*1000));
11
+ var expires = "; expires="+date.toGMTString();
12
+ }
13
+ else var expires = "";
14
+ document.cookie = name+"="+value+expires+"; path=/";
15
+ }
data/lib/paul_revere.rb CHANGED
@@ -1 +1,4 @@
1
- # PaulRevere
1
+ module PaulRevere
2
+ class Engine < Rails::Engine
3
+ end
4
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paul_revere
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Thoughtbot
@@ -97,6 +97,7 @@ files:
97
97
  - app/helpers/announcements_helper.rb
98
98
  - app/models/announcement.rb
99
99
  - app/views/announcements/_announcement.html.erb
100
+ - app/views/announcements/_announcement_for_all.html.erb
100
101
  - app/views/announcements/_email_announcement.erb
101
102
  has_rdoc: true
102
103
  homepage: http://thoughtbot.com/community