jquery_notify_bar 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/README +3 -0
- data/Rakefile +1 -0
- data/jquery_notify_bar.gemspec +20 -0
- data/lib/jquery_notify_bar/railtie.rb +8 -0
- data/lib/jquery_notify_bar/version.rb +3 -0
- data/lib/jquery_notify_bar/view_helpers.rb +35 -0
- data/lib/jquery_notify_bar.rb +2 -0
- metadata +54 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "jquery_notify_bar/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "jquery_notify_bar"
|
7
|
+
s.version = JqueryNotifyBar::VERSION
|
8
|
+
s.authors = ["Jose Carlos Ustra Junior"]
|
9
|
+
s.email = ["contato@ustrajunior.com"]
|
10
|
+
s.homepage = "http://ustrajunior.com/apps/jquery_notify_bar"
|
11
|
+
s.summary = %q{jquery.notifyBar in your app}
|
12
|
+
s.description = %q{A simple gem to include jquery.notifyBar to your rails app.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "jquery_notify_bar"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module JqueryNotifyBar
|
2
|
+
module ViewHelpers
|
3
|
+
def include_jquery_notify_bar
|
4
|
+
"<link rel='stylesheet' href='/stylesheets/jquery.notifyBar.css?' type='text/css' media='screen' />".html_safe
|
5
|
+
"<script src='/javascripts/jquery.notifyBar.js' type='text/javascript'></script>".html_safe
|
6
|
+
end
|
7
|
+
|
8
|
+
def jquery_notify_bar(opts = {})
|
9
|
+
opts.reverse_merge! :flash => :notice, :delay => 2000, :animation_speed => 'normal', :close => false, :cls => 'notice'
|
10
|
+
html = ''
|
11
|
+
Array.wrap(opts[:flash]).each do |f|
|
12
|
+
if html = flash[f]
|
13
|
+
opts[:cls] ||= f.to_s
|
14
|
+
break
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
if html.blank?
|
19
|
+
''
|
20
|
+
else
|
21
|
+
javascript_tag do
|
22
|
+
%($(function () {
|
23
|
+
$.notifyBar({
|
24
|
+
html: '#{html}',
|
25
|
+
delay: #{opts[:delay]},
|
26
|
+
animationSpeed: '#{opts[:animation_speed]}',
|
27
|
+
cls: '#{opts[:cls]}'
|
28
|
+
});
|
29
|
+
});
|
30
|
+
)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jquery_notify_bar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Jose Carlos Ustra Junior
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-07-13 00:00:00.000000000Z
|
13
|
+
dependencies: []
|
14
|
+
description: A simple gem to include jquery.notifyBar to your rails app.
|
15
|
+
email:
|
16
|
+
- contato@ustrajunior.com
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- Gemfile
|
23
|
+
- README
|
24
|
+
- Rakefile
|
25
|
+
- jquery_notify_bar.gemspec
|
26
|
+
- lib/jquery_notify_bar.rb
|
27
|
+
- lib/jquery_notify_bar/railtie.rb
|
28
|
+
- lib/jquery_notify_bar/version.rb
|
29
|
+
- lib/jquery_notify_bar/view_helpers.rb
|
30
|
+
homepage: http://ustrajunior.com/apps/jquery_notify_bar
|
31
|
+
licenses: []
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
require_paths:
|
35
|
+
- lib
|
36
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
+
none: false
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
requirements: []
|
49
|
+
rubyforge_project: jquery_notify_bar
|
50
|
+
rubygems_version: 1.8.5
|
51
|
+
signing_key:
|
52
|
+
specification_version: 3
|
53
|
+
summary: jquery.notifyBar in your app
|
54
|
+
test_files: []
|