jquery-growl-rails 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3894e69cf21603918623b2643ee26930936c066e
4
+ data.tar.gz: 22bef0947b36ec36c10b9d22d419a1e3c9a5beb7
5
+ SHA512:
6
+ metadata.gz: 0f64fb31bab30c319990fa09ac6ad0a7300223385a61ab71b8745612d482b0239d875acc2b3989f712bfd5c4d5795b234da287e993bb7836fafd85a2fba0d803
7
+ data.tar.gz: 9e3ea95dbeed9cd3ea7faaf5e29b1d38da61509ac410e5d7dd14206095126f49bb3b16066f969146bddb63ffd40182985a6b09abcc310dc604fb5fd7df9a3acd
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Nathan Sharpe
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,53 @@
1
+ # Jquery::Growl::Rails
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'jquery-growl-rails'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install jquery-growl-rails
20
+
21
+ ## Usage
22
+
23
+ Require javascripts:
24
+
25
+ ```
26
+ //= require jquery
27
+ ...
28
+ //= require jquery.growl
29
+ ```
30
+
31
+ Require styles:
32
+
33
+ ```
34
+ /*
35
+ ...
36
+ *= require jquery.growl
37
+ ...
38
+ */
39
+ ```
40
+
41
+ OR (for .scss):
42
+
43
+ ```
44
+ @import 'jquery.growl'
45
+ ```
46
+
47
+ ## Contributing
48
+
49
+ 1. Fork it ( https://github.com/[my-github-username]/jquery-growl-rails/fork )
50
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
51
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
52
+ 4. Push to the branch (`git push origin my-new-feature`)
53
+ 5. Create a new Pull Request
@@ -0,0 +1,10 @@
1
+ require "jquery/growl/rails/version"
2
+
3
+ module Jquery
4
+ module Growl
5
+ module Rails
6
+ class Engine < ::Rails::Engine
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ module Jquery
2
+ module Growl
3
+ module Rails
4
+ VERSION = "1.1.9"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,221 @@
1
+ // Generated by CoffeeScript 1.6.3
2
+ /*
3
+ jQuery Growl
4
+ Copyright 2013 Kevin Sylvestre
5
+ 1.1.8
6
+ */
7
+
8
+
9
+ (function() {
10
+ "use strict";
11
+ var $, Animation, Growl,
12
+ __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
13
+
14
+ $ = jQuery;
15
+
16
+ Animation = (function() {
17
+ function Animation() {}
18
+
19
+ Animation.transitions = {
20
+ "webkitTransition": "webkitTransitionEnd",
21
+ "mozTransition": "mozTransitionEnd",
22
+ "oTransition": "oTransitionEnd",
23
+ "transition": "transitionend"
24
+ };
25
+
26
+ Animation.transition = function($el) {
27
+ var el, result, type, _ref;
28
+ el = $el[0];
29
+ _ref = this.transitions;
30
+ for (type in _ref) {
31
+ result = _ref[type];
32
+ if (el.style[type] != null) {
33
+ return result;
34
+ }
35
+ }
36
+ };
37
+
38
+ return Animation;
39
+
40
+ })();
41
+
42
+ Growl = (function() {
43
+ Growl.settings = {
44
+ namespace: 'growl',
45
+ duration: 3200,
46
+ close: "&times;",
47
+ location: "default",
48
+ style: "default",
49
+ size: "medium"
50
+ };
51
+
52
+ Growl.growl = function(settings) {
53
+ if (settings == null) {
54
+ settings = {};
55
+ }
56
+ this.initialize();
57
+ return new Growl(settings);
58
+ };
59
+
60
+ Growl.initialize = function() {
61
+ return $("body:not(:has(#growls))").append('<div id="growls" />');
62
+ };
63
+
64
+ function Growl(settings) {
65
+ if (settings == null) {
66
+ settings = {};
67
+ }
68
+ this.html = __bind(this.html, this);
69
+ this.$growl = __bind(this.$growl, this);
70
+ this.$growls = __bind(this.$growls, this);
71
+ this.animate = __bind(this.animate, this);
72
+ this.remove = __bind(this.remove, this);
73
+ this.dismiss = __bind(this.dismiss, this);
74
+ this.present = __bind(this.present, this);
75
+ this.cycle = __bind(this.cycle, this);
76
+ this.close = __bind(this.close, this);
77
+ this.unbind = __bind(this.unbind, this);
78
+ this.bind = __bind(this.bind, this);
79
+ this.render = __bind(this.render, this);
80
+ this.settings = $.extend({}, Growl.settings, settings);
81
+ this.$growls().attr('class', this.settings.location);
82
+ this.render();
83
+ }
84
+
85
+ Growl.prototype.render = function() {
86
+ var $growl;
87
+ $growl = this.$growl();
88
+ this.$growls().append($growl);
89
+ if (this.settings["static"] != null) {
90
+ this.present();
91
+ } else {
92
+ this.cycle();
93
+ }
94
+ };
95
+
96
+ Growl.prototype.bind = function($growl) {
97
+ if ($growl == null) {
98
+ $growl = this.$growl();
99
+ }
100
+ return $growl.on("contextmenu", this.close).find("." + this.settings.namespace + "-close").on("click", this.close);
101
+ };
102
+
103
+ Growl.prototype.unbind = function($growl) {
104
+ if ($growl == null) {
105
+ $growl = this.$growl();
106
+ }
107
+ return $growl.off("contextmenu", this.close).find("." + (this.settings.namespace - close)).off("click", this.close);
108
+ };
109
+
110
+ Growl.prototype.close = function(event) {
111
+ var $growl;
112
+ event.preventDefault();
113
+ event.stopPropagation();
114
+ $growl = this.$growl();
115
+ return $growl.stop().queue(this.dismiss).queue(this.remove);
116
+ };
117
+
118
+ Growl.prototype.cycle = function() {
119
+ var $growl;
120
+ $growl = this.$growl();
121
+ return $growl.queue(this.present).delay(this.settings.duration).queue(this.dismiss).queue(this.remove);
122
+ };
123
+
124
+ Growl.prototype.present = function(callback) {
125
+ var $growl;
126
+ $growl = this.$growl();
127
+ this.bind($growl);
128
+ return this.animate($growl, "" + this.settings.namespace + "-incoming", 'out', callback);
129
+ };
130
+
131
+ Growl.prototype.dismiss = function(callback) {
132
+ var $growl;
133
+ $growl = this.$growl();
134
+ this.unbind($growl);
135
+ return this.animate($growl, "" + this.settings.namespace + "-outgoing", 'in', callback);
136
+ };
137
+
138
+ Growl.prototype.remove = function(callback) {
139
+ this.$growl().remove();
140
+ return callback();
141
+ };
142
+
143
+ Growl.prototype.animate = function($element, name, direction, callback) {
144
+ var transition;
145
+ if (direction == null) {
146
+ direction = 'in';
147
+ }
148
+ transition = Animation.transition($element);
149
+ $element[direction === 'in' ? 'removeClass' : 'addClass'](name);
150
+ $element.offset().position;
151
+ $element[direction === 'in' ? 'addClass' : 'removeClass'](name);
152
+ if (callback == null) {
153
+ return;
154
+ }
155
+ if (transition != null) {
156
+ $element.one(transition, callback);
157
+ } else {
158
+ callback();
159
+ }
160
+ };
161
+
162
+ Growl.prototype.$growls = function() {
163
+ return this.$_growls != null ? this.$_growls : this.$_growls = $('#growls');
164
+ };
165
+
166
+ Growl.prototype.$growl = function() {
167
+ return this.$_growl != null ? this.$_growl : this.$_growl = $(this.html());
168
+ };
169
+
170
+ Growl.prototype.html = function() {
171
+ return "<div class='" + this.settings.namespace + " " + this.settings.namespace + "-" + this.settings.style + " " + this.settings.namespace + "-" + this.settings.size + "'>\n <div class='" + this.settings.namespace + "-close'>" + this.settings.close + "</div>\n <div class='" + this.settings.namespace + "-title'>" + this.settings.title + "</div>\n <div class='" + this.settings.namespace + "-message'>" + this.settings.message + "</div>\n</div>";
172
+ };
173
+
174
+ return Growl;
175
+
176
+ })();
177
+
178
+ $.growl = function(options) {
179
+ if (options == null) {
180
+ options = {};
181
+ }
182
+ return Growl.growl(options);
183
+ };
184
+
185
+ $.growl.error = function(options) {
186
+ var settings;
187
+ if (options == null) {
188
+ options = {};
189
+ }
190
+ settings = {
191
+ title: "Error!",
192
+ style: "error"
193
+ };
194
+ return $.growl($.extend(settings, options));
195
+ };
196
+
197
+ $.growl.notice = function(options) {
198
+ var settings;
199
+ if (options == null) {
200
+ options = {};
201
+ }
202
+ settings = {
203
+ title: "Notice!",
204
+ style: "notice"
205
+ };
206
+ return $.growl($.extend(settings, options));
207
+ };
208
+
209
+ $.growl.warning = function(options) {
210
+ var settings;
211
+ if (options == null) {
212
+ options = {};
213
+ }
214
+ settings = {
215
+ title: "Warning!",
216
+ style: "warning"
217
+ };
218
+ return $.growl($.extend(settings, options));
219
+ };
220
+
221
+ }).call(this);
@@ -0,0 +1,74 @@
1
+ /* jQuery Growl
2
+ * Copyright 2013 Kevin Sylvestre
3
+ * 1.1.8
4
+ */
5
+ #growls {
6
+ z-index: 50000;
7
+ position: fixed; }
8
+ #growls.default {
9
+ top: 10px;
10
+ right: 10px; }
11
+ #growls.tl {
12
+ top: 10px;
13
+ left: 10px; }
14
+ #growls.tr {
15
+ top: 10px;
16
+ right: 10px; }
17
+ #growls.bl {
18
+ bottom: 10px;
19
+ left: 10px; }
20
+ #growls.br {
21
+ bottom: 10px;
22
+ right: 10px; }
23
+
24
+ .growl {
25
+ opacity: 0.8;
26
+ filter: alpha(opacity=80);
27
+ position: relative;
28
+ border-radius: 4px;
29
+ -webkit-transition: all 0.4s ease-in-out;
30
+ -moz-transition: all 0.4s ease-in-out;
31
+ transition: all 0.4s ease-in-out; }
32
+ .growl.growl-incoming {
33
+ opacity: 0;
34
+ filter: alpha(opacity=0); }
35
+ .growl.growl-outgoing {
36
+ opacity: 0;
37
+ filter: alpha(opacity=0); }
38
+ .growl.growl-small {
39
+ width: 200px;
40
+ padding: 5px;
41
+ margin: 5px; }
42
+ .growl.growl-medium {
43
+ width: 250px;
44
+ padding: 10px;
45
+ margin: 10px; }
46
+ .growl.growl-large {
47
+ width: 300px;
48
+ padding: 15px;
49
+ margin: 15px; }
50
+ .growl.growl-default {
51
+ color: white;
52
+ background: #7f8c8d; }
53
+ .growl.growl-error {
54
+ color: white;
55
+ background: #c0392b; }
56
+ .growl.growl-notice {
57
+ color: white;
58
+ background: #2ecc71; }
59
+ .growl.growl-warning {
60
+ color: white;
61
+ background: #f39c12; }
62
+ .growl .growl-close {
63
+ cursor: pointer;
64
+ float: right;
65
+ font-size: 14px;
66
+ line-height: 18px;
67
+ font-weight: normal;
68
+ font-family: helvetica, verdana, sans-serif; }
69
+ .growl .growl-title {
70
+ font-size: 18px;
71
+ line-height: 24px; }
72
+ .growl .growl-message {
73
+ font-size: 14px;
74
+ line-height: 18px; }
metadata ADDED
@@ -0,0 +1,80 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jquery-growl-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.1.9
5
+ platform: ruby
6
+ authors:
7
+ - Nathan Sharpe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ description: Include jquery-growl (http://ksylvest.github.io/jquery-growl/), a simple
42
+ notification library by Kevin Sylvestre in your Rails application.
43
+ email:
44
+ - nathan@cliftonlabs.com
45
+ executables: []
46
+ extensions: []
47
+ extra_rdoc_files: []
48
+ files:
49
+ - MIT-LICENSE
50
+ - README.md
51
+ - lib/jquery/growl/rails.rb
52
+ - lib/jquery/growl/rails/version.rb
53
+ - vendor/assets/javascripts/jquery.growl.js
54
+ - vendor/assets/stylesheets/jquery.growl.scss
55
+ homepage: ''
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ requirements: []
74
+ rubyforge_project:
75
+ rubygems_version: 2.2.2
76
+ signing_key:
77
+ specification_version: 4
78
+ summary: Include jquery-growl in your Rails application.
79
+ test_files: []
80
+ has_rdoc: