michael_hintbuble 1.0.0 → 1.0.1
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.
- data/.specification +4 -4
- data/README.rdoc +16 -16
- data/VERSION +1 -1
- data/generators/michael_hintbuble/templates/michael_hintbuble.js +15 -19
- data/lib/generators/michael_hintbuble/templates/michael_hintbuble.js +11 -15
- data/lib/michael_hintbuble/helpers.rb +0 -2
- data/michael_hintbuble.gemspec +2 -2
- metadata +4 -4
data/.specification
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: michael_hintbuble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
|
+
- 1
|
7
8
|
- 0
|
8
9
|
- 1
|
9
|
-
|
10
|
-
version: 0.1.5
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Coroutine
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-10-
|
20
|
+
date: 2010-10-13 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
data/README.rdoc
CHANGED
@@ -77,7 +77,7 @@ the string "_frame".
|
|
77
77
|
By default, the top-level class assignments are "michael_hintbuble_bubble" and "michael_hintbuble_bubble_frame".
|
78
78
|
|
79
79
|
If you set the <tt>:class</tt> option to <tt>:error_bubble</tt>, the top-level class assignments will be
|
80
|
-
"error_bubble" and "
|
80
|
+
"error_bubble" and "error_bubble_frame".
|
81
81
|
|
82
82
|
The <tt>:style</tt> option can be used to provide one-off styling, as needed.
|
83
83
|
|
@@ -130,6 +130,21 @@ in the mix.
|
|
130
130
|
|
131
131
|
|
132
132
|
|
133
|
+
== Installation & Generators (Rails 3)
|
134
|
+
|
135
|
+
Install me from RubyGems.org by adding a gem dependency to your Gemfile. Bundler does
|
136
|
+
the rest.
|
137
|
+
|
138
|
+
gem "michael_hintbuble"
|
139
|
+
|
140
|
+
$ bundle install
|
141
|
+
|
142
|
+
Then generate the required javascript file and the starter stylesheet and image.
|
143
|
+
|
144
|
+
$ rails g michael_hintbuble
|
145
|
+
|
146
|
+
|
147
|
+
|
133
148
|
== Installation & Generators (Rails 2)
|
134
149
|
|
135
150
|
Install me from RubyGems.org and add a gem dependency in the appropriate file.
|
@@ -147,21 +162,6 @@ stylesheet and image.
|
|
147
162
|
|
148
163
|
|
149
164
|
|
150
|
-
== Installation & Generators (Rails 3)
|
151
|
-
|
152
|
-
Install me from RubyGems.org by adding a gem dependency to your Gemfile. Bundler does
|
153
|
-
the rest.
|
154
|
-
|
155
|
-
gem "michael_hintbuble"
|
156
|
-
|
157
|
-
$ bundle install
|
158
|
-
|
159
|
-
Then generate the required javascript file and the starter stylesheet and image.
|
160
|
-
|
161
|
-
$ rails g michael_hintbuble
|
162
|
-
|
163
|
-
|
164
|
-
|
165
165
|
== Gemroll
|
166
166
|
|
167
167
|
If you think I'm awesome, you should check out my soulmate
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
@@ -35,9 +35,9 @@ MichaelHintbuble.Bubble = function(target_id, content, options) {
|
|
35
35
|
this._positioner = null;
|
36
36
|
this._isShowing = null;
|
37
37
|
|
38
|
-
this._class = options["class"] || "
|
38
|
+
this._class = options["class"] || "michael_hintbuble_bubble";
|
39
39
|
this._style = options["style"] || "";
|
40
|
-
this._eventNames = options["eventNames"] || ["mouseover"
|
40
|
+
this._eventNames = options["eventNames"] || ["mouseover"]
|
41
41
|
this._position = options["position"] || "right";
|
42
42
|
this._beforeShow = options["beforeShow"] || Prototype.emptyFunction
|
43
43
|
this._afterShow = options["afterShow"] || Prototype.emptyFunction
|
@@ -154,20 +154,16 @@ MichaelHintbuble.Bubble.prototype._attachObservers = function() {
|
|
154
154
|
this.hide();
|
155
155
|
}.bind(this));
|
156
156
|
}
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
this.setPosition();
|
168
|
-
}
|
169
|
-
}.bind(this));
|
170
|
-
}
|
157
|
+
Event.observe(window, "resize", function() {
|
158
|
+
if (this.isShowing()) {
|
159
|
+
this.setPosition();
|
160
|
+
}
|
161
|
+
}.bind(this));
|
162
|
+
Event.observe(window, "scroll", function() {
|
163
|
+
if (this.isShowing()) {
|
164
|
+
this.setPosition();
|
165
|
+
}
|
166
|
+
}.bind(this));
|
171
167
|
};
|
172
168
|
|
173
169
|
|
@@ -177,10 +173,10 @@ MichaelHintbuble.Bubble.prototype._attachObservers = function() {
|
|
177
173
|
MichaelHintbuble.Bubble.prototype._makeBubble = function() {
|
178
174
|
if (!this._element) {
|
179
175
|
this._container = new Element("DIV");
|
180
|
-
this._container.className =
|
176
|
+
this._container.className = "container";
|
181
177
|
|
182
178
|
this._element = new Element("DIV");
|
183
|
-
this._element.className =
|
179
|
+
this._element.className = this._class;
|
184
180
|
this._element.writeAttribute("style", this._style);
|
185
181
|
this._element.update(this._container);
|
186
182
|
this._element.hide();
|
@@ -195,7 +191,7 @@ MichaelHintbuble.Bubble.prototype._makeBubble = function() {
|
|
195
191
|
MichaelHintbuble.Bubble.prototype._makeFrame = function() {
|
196
192
|
if (!this._frame) {
|
197
193
|
this._frame = new Element("IFRAME");
|
198
|
-
this._frame.className = "
|
194
|
+
this._frame.className = this._class + "_frame";
|
199
195
|
this._frame.setAttribute("src", "about:blank");
|
200
196
|
this._frame.hide();
|
201
197
|
}
|
@@ -37,7 +37,7 @@ MichaelHintbuble.Bubble = function(target_id, content, options) {
|
|
37
37
|
|
38
38
|
this._class = options["class"] || "michael_hintbuble_bubble";
|
39
39
|
this._style = options["style"] || "";
|
40
|
-
this._eventNames = options["eventNames"] || ["mouseover"
|
40
|
+
this._eventNames = options["eventNames"] || ["mouseover"]
|
41
41
|
this._position = options["position"] || "right";
|
42
42
|
this._beforeShow = options["beforeShow"] || Prototype.emptyFunction
|
43
43
|
this._afterShow = options["afterShow"] || Prototype.emptyFunction
|
@@ -154,20 +154,16 @@ MichaelHintbuble.Bubble.prototype._attachObservers = function() {
|
|
154
154
|
this.hide();
|
155
155
|
}.bind(this));
|
156
156
|
}
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
this.setPosition();
|
168
|
-
}
|
169
|
-
}.bind(this));
|
170
|
-
}
|
157
|
+
Event.observe(window, "resize", function() {
|
158
|
+
if (this.isShowing()) {
|
159
|
+
this.setPosition();
|
160
|
+
}
|
161
|
+
}.bind(this));
|
162
|
+
Event.observe(window, "scroll", function() {
|
163
|
+
if (this.isShowing()) {
|
164
|
+
this.setPosition();
|
165
|
+
}
|
166
|
+
}.bind(this));
|
171
167
|
};
|
172
168
|
|
173
169
|
|
@@ -152,8 +152,6 @@ module Coroutine #:nodoc:
|
|
152
152
|
js_options[:class] = js_options[:class].to_s
|
153
153
|
js_options[:event_names] = js_options[:event_names].uniq.map { |en| en.to_s }
|
154
154
|
js_options[:event_names] << "mouseover" if js_options[:event_names].empty?
|
155
|
-
js_options[:event_names] << "resize" unless js_options[:event_names].include?("resize")
|
156
|
-
js_options[:event_names] << "scroll" unless js_options[:event_names].include?("scroll")
|
157
155
|
|
158
156
|
js_options
|
159
157
|
end
|
data/michael_hintbuble.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{michael_hintbuble}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Coroutine", "Tim Lowrimore", "John Dugan"]
|
12
|
-
s.date = %q{2010-10-
|
12
|
+
s.date = %q{2010-10-13}
|
13
13
|
s.description = %q{Michael HintBuble allows you to generate hint bubbles and tooltips in Rails applications using the same syntax used for rendering templates.}
|
14
14
|
s.email = %q{gems@coroutine.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: michael_hintbuble
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Coroutine
|
@@ -17,7 +17,7 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-10-
|
20
|
+
date: 2010-10-13 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|