showandtell 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +17 -5
- data/lib/assets/images/showandtell/glyphicons-halflings-white.png +0 -0
- data/lib/assets/images/showandtell/glyphicons-halflings.png +0 -0
- data/lib/assets/javascripts/showandtell/bootstrap.min.js +7 -0
- data/lib/assets/javascripts/showandtell/index.js +1 -5
- data/lib/assets/stylesheets/showandtell/bootstrap.min.css +26 -0
- data/lib/assets/stylesheets/showandtell/index.css +1 -1
- data/showandtell-0.0.7.gem +0 -0
- data/showandtell.gemspec +1 -1
- metadata +9 -7
- data/lib/assets/javascripts/showandtell/activate.js +0 -3
- data/lib/assets/javascripts/showandtell/jquery.fancy-notifications.js +0 -69
- data/lib/assets/stylesheets/showandtell/jquery.fancy-notifications.css +0 -29
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Showandtell
|
2
2
|
## Simple, nicer Rails notifications
|
3
3
|
|
4
|
-
Showandtell provides an incredibly easy way to integrate [
|
4
|
+
Showandtell provides an incredibly easy way to integrate [Twitter bootstrap](http://github.com/twitter/bootstrap) notifications into your Rails 3.1+ app.
|
5
5
|
|
6
6
|
1. Add `gem 'showandtell'` to your Gemfile
|
7
7
|
2. Add `//=require showandtell` to your app/assets/javascripts/application.js
|
@@ -10,10 +10,23 @@ Showandtell provides an incredibly easy way to integrate [fancy-rails-notificati
|
|
10
10
|
|
11
11
|
Note that your notifications must have a class of `flash` and an id of `flash_severity` where severity is the type of notification - notice, alert, etc. The appropriate code for this is:
|
12
12
|
|
13
|
-
<% flash
|
14
|
-
|
13
|
+
<% if flash %>
|
14
|
+
<div id="flash_messages">
|
15
|
+
<% flash.each do |name, msg| %>
|
16
|
+
<% if name == :notice %>
|
17
|
+
<div class="alert alert-success">
|
18
|
+
<% elsif name == :alert %>
|
19
|
+
<div class="alert alert-error">
|
20
|
+
<% else %>
|
21
|
+
<div class="alert alert-info">
|
22
|
+
<% end %>
|
23
|
+
<a class="close" data-dismiss="alert">×</a>
|
24
|
+
<%= msg %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
15
28
|
<% end %>
|
16
|
-
|
29
|
+
|
17
30
|
### Bug Reports
|
18
31
|
|
19
32
|
If you run into a bug, please start by searching the [GitHub issue tracker page](https://github.com/roboteti/showandtell/issues). If you find one matching your problem, please feel free to add to the discussion. If you can't find one, please [create a new issue](https://github.com/roboteti/showandtell/issues/new).
|
@@ -25,7 +38,6 @@ If you run into a bug, please start by searching the [GitHub issue tracker page]
|
|
25
38
|
|
26
39
|
### Credits
|
27
40
|
- Gem created by [J-P Teti](http://jpteti.com)
|
28
|
-
- [fancy-rails-notifications](https://github.com/mluckeneder/fancy-rails-notifications) by [mluckeneder](https://github.com/mluckeneder).
|
29
41
|
|
30
42
|
### License
|
31
43
|
Licensed under the [MIT license](https://github.com/roboteti/showandtell/blob/master/LICENSE.txt).
|
Binary file
|
Binary file
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* Bootstrap.js by @fat & @mdo
|
3
|
+
* plugins: bootstrap-transition.js, bootstrap-alert.js
|
4
|
+
* Copyright 2012 Twitter, Inc.
|
5
|
+
* http://www.apache.org/licenses/LICENSE-2.0.txt
|
6
|
+
*/
|
7
|
+
!function(a){a(function(){a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.trigger("closed").remove()}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.trigger("close").removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery)
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/*!
|
2
|
+
* Bootstrap v2.0.1
|
3
|
+
*
|
4
|
+
* Copyright 2012 Twitter, Inc
|
5
|
+
* Licensed under the Apache License v2.0
|
6
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
7
|
+
*
|
8
|
+
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
9
|
+
*/
|
10
|
+
.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";}
|
11
|
+
.clearfix:after{clear:both;}
|
12
|
+
.alert{padding:8px 35px 8px 14px;margin-bottom:18px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
|
13
|
+
.alert,.alert-heading{color:#c09853;}
|
14
|
+
.alert .close{position:relative;top:-2px;right:-21px;line-height:18px;}
|
15
|
+
.alert-success{background-color:#dff0d8;border-color:#d6e9c6;}
|
16
|
+
.alert-success,.alert-success .alert-heading{color:#468847;}
|
17
|
+
.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;}
|
18
|
+
.alert-danger,.alert-error,.alert-danger .alert-heading,.alert-error .alert-heading{color:#b94a48;}
|
19
|
+
.alert-info{background-color:#d9edf7;border-color:#bce8f1;}
|
20
|
+
.alert-info,.alert-info .alert-heading{color:#3a87ad;}
|
21
|
+
.alert-block{padding-top:14px;padding-bottom:14px;}
|
22
|
+
.alert-block>p,.alert-block>ul{margin-bottom:0;}
|
23
|
+
.alert-block p+p{margin-top:5px;}
|
24
|
+
.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;opacity:0.4;filter:alpha(opacity=40);cursor:pointer;}
|
25
|
+
.fade{-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;opacity:0;}.fade.in{opacity:1;}
|
26
|
+
.collapse{-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;position:relative;overflow:hidden;height:0;}.collapse.in{height:auto;}
|
Binary file
|
data/showandtell.gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'showandtell'
|
6
|
-
s.version = '0.0.
|
6
|
+
s.version = '0.0.8'
|
7
7
|
s.author = 'J-P Teti (fancy-rails-notifications by mluckender)'
|
8
8
|
s.email = 'roboteti@gmail.com'
|
9
9
|
s.homepage = "http://github.com/roboteti/showandtell"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: showandtell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-02-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: jquery-rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &10143560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *10143560
|
25
25
|
description:
|
26
26
|
email: roboteti@gmail.com
|
27
27
|
executables: []
|
@@ -29,16 +29,18 @@ extensions: []
|
|
29
29
|
extra_rdoc_files: []
|
30
30
|
files:
|
31
31
|
- ./Gemfile
|
32
|
-
- ./lib/assets/
|
32
|
+
- ./lib/assets/images/showandtell/glyphicons-halflings-white.png
|
33
|
+
- ./lib/assets/images/showandtell/glyphicons-halflings.png
|
34
|
+
- ./lib/assets/javascripts/showandtell/bootstrap.min.js
|
33
35
|
- ./lib/assets/javascripts/showandtell/index.js
|
34
|
-
- ./lib/assets/
|
36
|
+
- ./lib/assets/stylesheets/showandtell/bootstrap.min.css
|
35
37
|
- ./lib/assets/stylesheets/showandtell/index.css
|
36
|
-
- ./lib/assets/stylesheets/showandtell/jquery.fancy-notifications.css
|
37
38
|
- ./lib/showandtell.rb
|
38
39
|
- ./LICENSE.txt
|
39
40
|
- ./Rakefile
|
40
41
|
- ./README.md
|
41
42
|
- ./showandtell-0.0.6.gem
|
43
|
+
- ./showandtell-0.0.7.gem
|
42
44
|
- ./showandtell.gemspec
|
43
45
|
homepage: http://github.com/roboteti/showandtell
|
44
46
|
licenses: []
|
@@ -1,69 +0,0 @@
|
|
1
|
-
// =======================================================================
|
2
|
-
// Fancy jQuery Notifications
|
3
|
-
//
|
4
|
-
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
5
|
-
//
|
6
|
-
//
|
7
|
-
// Requires: jquery
|
8
|
-
//
|
9
|
-
// Author: Michael Luckeneder (https://github.com/mluckeneder)
|
10
|
-
//
|
11
|
-
//
|
12
|
-
// =======================================================================
|
13
|
-
|
14
|
-
(function( $ ){
|
15
|
-
var $closeTimeout;
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
var setupNotificationBehavior = function(){
|
20
|
-
$(".flash").click(function(){
|
21
|
-
$.FancyNotifications.close();
|
22
|
-
$(this).slideUp('slow');
|
23
|
-
});
|
24
|
-
$('.flash').slideDown('slow');
|
25
|
-
$closeTimeout = setTimeout("$('.flash').slideUp('slow',function(){ $(this).remove();});","3000");
|
26
|
-
};
|
27
|
-
|
28
|
-
|
29
|
-
$.FancyNotifications = function() {
|
30
|
-
setupNotificationBehavior();
|
31
|
-
};
|
32
|
-
|
33
|
-
$.FancyNotifications.error = function(message){
|
34
|
-
$.FancyNotifications.close();
|
35
|
-
this.showMessage("error", message);
|
36
|
-
};
|
37
|
-
|
38
|
-
$.FancyNotifications.alert = function(message){
|
39
|
-
$.FancyNotifications.close();
|
40
|
-
this.showMessage("alert", message);
|
41
|
-
};
|
42
|
-
|
43
|
-
$.FancyNotifications.notice = function(message){
|
44
|
-
$.FancyNotifications.close();
|
45
|
-
this.showMessage("notice", message);
|
46
|
-
};
|
47
|
-
|
48
|
-
$.FancyNotifications.showMessage = function(type,message){
|
49
|
-
var $div = $("<div></div>");
|
50
|
-
$div.attr("class","flash");
|
51
|
-
$div.attr("id", "flash_"+type);
|
52
|
-
$div.hide();
|
53
|
-
$div.html(message);
|
54
|
-
|
55
|
-
$('body').prepend($div);
|
56
|
-
|
57
|
-
setupNotificationBehavior();
|
58
|
-
};
|
59
|
-
|
60
|
-
$.FancyNotifications.close = function(){
|
61
|
-
clearTimeout($closeTimeout);
|
62
|
-
$('.flash').slideUp('slow',function(){ $(this).remove();});
|
63
|
-
};
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
})( jQuery );
|
@@ -1,29 +0,0 @@
|
|
1
|
-
#flash_error {
|
2
|
-
background-color:#FCC;
|
3
|
-
}
|
4
|
-
#flash_alert{
|
5
|
-
background-color:#FFE5CC;
|
6
|
-
}
|
7
|
-
|
8
|
-
|
9
|
-
#flash_notice {
|
10
|
-
background-color:#CFC;
|
11
|
-
}
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
.flash {
|
16
|
-
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
|
17
|
-
cursor:pointer;
|
18
|
-
display:none;
|
19
|
-
width:100%;
|
20
|
-
text-align:center;
|
21
|
-
padding-top:0.5em;
|
22
|
-
padding-bottom:0.5em;
|
23
|
-
font-size:1.3em;
|
24
|
-
position:fixed;
|
25
|
-
top:0;
|
26
|
-
height:1.3em;
|
27
|
-
left:0;
|
28
|
-
z-index:10000;
|
29
|
-
}
|