humane-rails 3.0.5.0.1.5 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NjljNTZiM2EyNzY4MzcyNTE3NGI1NzY2NGUwZDk5M2ZhOTQyYWNhZg==
5
+ data.tar.gz: !binary |-
6
+ MDRjYjRiMGY5N2FhYjVhNDVjZDJlNTkxYzNkMDZiYzMzYjg5NTc2ZA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ OWRjMzkxMjFiYTM2NWRkNGQzYmIwZmFlZDIwMWFhYjIyNjlkMWNmMzA1ZTcw
10
+ NzQ4OWExYjk3MTdjMmE2OTFjNWVmZGM0NDM4NjIzMjJkZmYwNmRmZTQ1Mjc2
11
+ YTI5NDcwODY0YTQ1NzI3NGE1ODg5MzUyYjJlODk0YTBkZDcxNjY=
12
+ data.tar.gz: !binary |-
13
+ ODRlZTRhYmVkOTFiNTYyN2YxYjc5OWJiZGEyNjA5ZmI4OWQ3MDljMTMyZGQ5
14
+ YjQ4ZTkzOTEwNzMwNTJkNDNmYTdiOGViMzc5MDc1MTBiNDg1NjViNjdkMDFi
15
+ Y2Q4NmMxMTU0YmZlNWU5YzE4N2RiY2U2NTgwZGU3MzBhYTgwYzA=
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  | | | | |_| | | | | | | (_| | | | | __/_____| | | (_| | | \__ \
5
5
  |_| |_|\__,_|_| |_| |_|\__,_|_| |_|\___| |_| \__,_|_|_|___/
6
6
 
7
- This is a gemified version of Marc Harter's humane-js library. See http://wavded.github.com/humane-js/ for more details.
7
+ This is a gemified version of Marc Harter's humane-js library. See http://wavded.github.com/humane-js for more details.
8
8
 
9
9
  [![Build Status](https://secure.travis-ci.org/harrigan/humane-rails.png)](http://travis-ci.org/harrigan/humane-rails)
10
10
  [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/harrigan/humane-rails)
@@ -13,9 +13,9 @@ This is a gemified version of Marc Harter's humane-js library. See http://wavded
13
13
 
14
14
  Add the following to your Gemfile:
15
15
 
16
- ```
16
+ ```ruby
17
17
  gem "humane-rails"
18
- ``
18
+ ```
19
19
 
20
20
  Then add the following to your `application.js`:
21
21
 
@@ -49,10 +49,11 @@
49
49
  this.queue = []
50
50
  this.baseCls = o.baseCls || 'humane'
51
51
  this.addnCls = o.addnCls || ''
52
- this.timeout = o.timeout || 2500
52
+ this.timeout = 'timeout' in o ? o.timeout : 2500
53
53
  this.waitForMove = o.waitForMove || false
54
54
  this.clickToClose = o.clickToClose || false
55
- this.forceNew = o.forceNew || false
55
+ this.timeoutAfterMove = o.timeoutAfterMove || false
56
+ this.container = o.container
56
57
 
57
58
  try { this._setupEl() } // attempt to setup elements
58
59
  catch (e) {
@@ -65,9 +66,13 @@
65
66
  _setupEl: function () {
66
67
  var el = doc.createElement('div')
67
68
  el.style.display = 'none'
68
- doc.body.appendChild(el)
69
+ if (!this.container){
70
+ if(doc.body) this.container = doc.body;
71
+ else throw 'document.body is null'
72
+ }
73
+ this.container.appendChild(el)
69
74
  this.el = el
70
- this.removeEvent = ENV.bind(this.remove,this)
75
+ this.removeEvent = ENV.bind(function(){ if (!this.timeoutAfterMove){this.remove()} else {setTimeout(ENV.bind(this.remove,this),this.timeout);}},this)
71
76
  this.transEvent = ENV.bind(this._afterAnimation,this)
72
77
  this._run()
73
78
  },
@@ -118,10 +123,13 @@
118
123
 
119
124
  },
120
125
  _setOpacity: function (opacity) {
121
- if (ENV.useFilter)
122
- this.el.filters.item('DXImageTransform.Microsoft.Alpha').Opacity = opacity*100
123
- else
126
+ if (ENV.useFilter){
127
+ try{
128
+ this.el.filters.item('DXImageTransform.Microsoft.Alpha').Opacity = opacity*100
129
+ } catch(err){}
130
+ } else {
124
131
  this.el.style.opacity = String(opacity)
132
+ }
125
133
  },
126
134
  _showMsg: function () {
127
135
  var addnCls = ENV.config(this.currentMsg.addnCls,this.addnCls)
@@ -188,7 +196,7 @@
188
196
  ENV.off(this.el,'touchstart',this.removeEvent)
189
197
  this.removeEventsSet = false
190
198
 
191
- if (cb) this.currentMsg.cb = cb
199
+ if (cb && this.currentMsg) this.currentMsg.cb = cb
192
200
  if (this._animating) this._hideMsg()
193
201
  else if (cb) cb()
194
202
  },
File without changes
@@ -34,11 +34,9 @@ body {
34
34
  background: linear-gradient(top, #000 0%, rgba(0,0,0,0.9) 100%) no-repeat;
35
35
  *background-color: #000;
36
36
  color: #fff;
37
- -moz-border-radius: 15px;
38
37
  -webkit-border-radius: 15px;
39
38
  border-radius: 15px;
40
39
  text-shadow: 0 -1px 1px #ddd;
41
- -moz-box-shadow: 0 15px 15px -15px #000;
42
40
  -webkit-box-shadow: 0 15px 15px -15px #000;
43
41
  box-shadow: 0 15px 15px -15px #000;
44
42
  -moz-transform: scale(0.1);
@@ -33,11 +33,9 @@ body {
33
33
  background: -o-linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat;
34
34
  background: linear-gradient(top, rgba(255,255,255,0.8) 0%, rgba(150,150,150,0.8) 100%) no-repeat;
35
35
  *background-color: #fff;
36
- -moz-border-radius: 15px;
37
36
  -webkit-border-radius: 15px;
38
37
  border-radius: 15px;
39
38
  text-shadow: 0 -1px 1px rgba(221,221,221,0.4);
40
- -moz-box-shadow: 0 4px 4px -4px #eee;
41
39
  -webkit-box-shadow: 0 4px 4px -4px #eee;
42
40
  box-shadow: 0 4px 4px -4px #eee;
43
41
  -moz-transform: scale(1.1);
@@ -33,11 +33,9 @@ body {
33
33
  background: -o-linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat;
34
34
  background: linear-gradient(top, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%) no-repeat;
35
35
  background-color: #fff;
36
- -moz-border-radius: 3px;
37
36
  -webkit-border-radius: 3px;
38
37
  border-radius: 3px;
39
38
  text-shadow: 0 1px 1px rgba(255,255,255,0.8);
40
- -moz-box-shadow: 0 1px 2px rgba(0,0,0,0.5);
41
39
  -webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.5);
42
40
  box-shadow: 0 1px 2px rgba(0,0,0,0.5);
43
41
  -moz-transform: translateY(-100px);
@@ -32,10 +32,8 @@ body {
32
32
  background: -o-linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat;
33
33
  background: linear-gradient(top, rgba(0,0,0,0.9) 0%, rgba(50,50,50,0.9) 100%) no-repeat;
34
34
  *background-color: #000;
35
- -moz-border-radius: 5px;
36
35
  -webkit-border-radius: 5px;
37
36
  border-radius: 5px;
38
- -moz-box-shadow: 0 4px 4px -4px #000;
39
37
  -webkit-box-shadow: 0 4px 4px -4px #000;
40
38
  box-shadow: 0 4px 4px -4px #000;
41
39
  -moz-transform: translateY(-40px);
File without changes
@@ -1,15 +1,19 @@
1
1
  module HumaneFlashMessagesHelper
2
2
  def humane_flash_messages
3
3
  content = ""
4
+
4
5
  unless flash[:notice].blank?
5
- content << javascript_tag("humane.notice(\"#{flash[:notice]}\")")
6
+ content << javascript_tag("humane.notice(\"#{escape_javascript(flash[:notice])}\")")
6
7
  end
8
+
7
9
  unless flash[:error].blank?
8
- content << javascript_tag("humane.error(\"#{flash[:error]}\")")
10
+ content << javascript_tag("humane.error(\"#{escape_javascript(flash[:error])}\")")
9
11
  end
12
+
10
13
  unless flash[:alert].blank?
11
- content << javascript_tag("humane.alert(\"#{flash[:alert]}\")")
14
+ content << javascript_tag("humane.alert(\"#{escape_javascript(flash[:alert])}\")")
12
15
  end
16
+
13
17
  content
14
18
  end
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module HumaneRails
2
- VERSION = "3.0.5.0.1.5"
2
+ VERSION = "3.1.0"
3
3
  end
data/lib/humane-rails.rb CHANGED
@@ -1 +1 @@
1
- require "humane-rails/engine" if defined?(Rails && Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >=1)
1
+ require "humane-rails/engine" if defined?(Rails && Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 1)
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: humane-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.5.0.1.5
5
- prerelease:
4
+ version: 3.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Martin Harrigan
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-04 00:00:00.000000000 Z
11
+ date: 2013-10-17 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: A gemified version of Marc Harter's humane-js.
15
14
  email:
@@ -22,46 +21,39 @@ files:
22
21
  - Gemfile
23
22
  - README.md
24
23
  - Rakefile
24
+ - app/assets/javascripts/humane.jquery.js
25
+ - app/assets/javascripts/humane.js
26
+ - app/assets/stylesheets/bigbox.css
27
+ - app/assets/stylesheets/boldlight.css
28
+ - app/assets/stylesheets/jackedup.css
29
+ - app/assets/stylesheets/libnotify.css
30
+ - app/assets/stylesheets/original.css
25
31
  - app/helpers/humane_flash_messages_helper.rb
26
32
  - humane-rails.gemspec
27
33
  - lib/humane-rails.rb
28
34
  - lib/humane-rails/engine.rb
29
35
  - lib/humane-rails/version.rb
30
- - vendor/assets/javascripts/humane.jquery.js
31
- - vendor/assets/javascripts/humane.js
32
- - vendor/assets/stylesheets/bigbox.css
33
- - vendor/assets/stylesheets/boldlight.css
34
- - vendor/assets/stylesheets/jackedup.css
35
- - vendor/assets/stylesheets/libnotify.css
36
- - vendor/assets/stylesheets/original.css
37
36
  homepage: http://github.com/harrigan/humane-rails
38
37
  licenses: []
38
+ metadata: {}
39
39
  post_install_message:
40
40
  rdoc_options: []
41
41
  require_paths:
42
42
  - lib
43
43
  required_ruby_version: !ruby/object:Gem::Requirement
44
- none: false
45
44
  requirements:
46
45
  - - ! '>='
47
46
  - !ruby/object:Gem::Version
48
47
  version: '0'
49
- segments:
50
- - 0
51
- hash: 1993664415012843790
52
48
  required_rubygems_version: !ruby/object:Gem::Requirement
53
- none: false
54
49
  requirements:
55
50
  - - ! '>='
56
51
  - !ruby/object:Gem::Version
57
52
  version: '0'
58
- segments:
59
- - 0
60
- hash: 1993664415012843790
61
53
  requirements: []
62
54
  rubyforge_project: humane-rails
63
- rubygems_version: 1.8.23
55
+ rubygems_version: 2.0.4
64
56
  signing_key:
65
- specification_version: 3
57
+ specification_version: 4
66
58
  summary: A gemified version of Marc Harter's humane-js.
67
59
  test_files: []