tipsy-rails-cc 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0ce5b1006413408edb664840594a550e9688c3ae
4
+ data.tar.gz: 46b613acb9e28d32a0d3aaa6bcb37ddfaa7c4480
5
+ SHA512:
6
+ metadata.gz: a49687f35bc2a6950a57a5c5f6e23e7140d7a82298f64158b54dcbc6a7239eef79339618afda115a713d84eb06360725e090fc6f081f2a701c3719e9248f2655
7
+ data.tar.gz: cbc548dd0d389f0ae9867f7aec0c89d868006fa07ffaa74612aa7e1e54ec938f332d1ce5cd0cb5188495b992d2939b60bd966d2e8f417d4827016167b5b1f8b8
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source :gemcutter
2
+
3
+ # Specify your gem's dependencies in jquery-rails.gemspec
4
+ gemspec
@@ -0,0 +1,99 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ tipsy-rails-cc (1.0.2)
5
+ railties (~> 3.0)
6
+ sass-rails
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionmailer (3.2.3)
12
+ actionpack (= 3.2.3)
13
+ mail (~> 2.4.4)
14
+ actionpack (3.2.3)
15
+ activemodel (= 3.2.3)
16
+ activesupport (= 3.2.3)
17
+ builder (~> 3.0.0)
18
+ erubis (~> 2.7.0)
19
+ journey (~> 1.0.1)
20
+ rack (~> 1.4.0)
21
+ rack-cache (~> 1.2)
22
+ rack-test (~> 0.6.1)
23
+ sprockets (~> 2.1.2)
24
+ activemodel (3.2.3)
25
+ activesupport (= 3.2.3)
26
+ builder (~> 3.0.0)
27
+ activerecord (3.2.3)
28
+ activemodel (= 3.2.3)
29
+ activesupport (= 3.2.3)
30
+ arel (~> 3.0.2)
31
+ tzinfo (~> 0.3.29)
32
+ activeresource (3.2.3)
33
+ activemodel (= 3.2.3)
34
+ activesupport (= 3.2.3)
35
+ activesupport (3.2.3)
36
+ i18n (~> 0.6)
37
+ multi_json (~> 1.0)
38
+ arel (3.0.2)
39
+ builder (3.0.0)
40
+ erubis (2.7.0)
41
+ hike (1.2.1)
42
+ i18n (0.6.0)
43
+ journey (1.0.3)
44
+ json (1.7.3)
45
+ mail (2.4.4)
46
+ i18n (>= 0.4.0)
47
+ mime-types (~> 1.16)
48
+ treetop (~> 1.4.8)
49
+ mime-types (1.18)
50
+ multi_json (1.3.5)
51
+ polyglot (0.3.3)
52
+ rack (1.4.1)
53
+ rack-cache (1.2)
54
+ rack (>= 0.4)
55
+ rack-ssl (1.3.2)
56
+ rack
57
+ rack-test (0.6.1)
58
+ rack (>= 1.0)
59
+ rails (3.2.3)
60
+ actionmailer (= 3.2.3)
61
+ actionpack (= 3.2.3)
62
+ activerecord (= 3.2.3)
63
+ activeresource (= 3.2.3)
64
+ activesupport (= 3.2.3)
65
+ bundler (~> 1.0)
66
+ railties (= 3.2.3)
67
+ railties (3.2.3)
68
+ actionpack (= 3.2.3)
69
+ activesupport (= 3.2.3)
70
+ rack-ssl (~> 1.3.2)
71
+ rake (>= 0.8.7)
72
+ rdoc (~> 3.4)
73
+ thor (~> 0.14.6)
74
+ rake (0.9.2.2)
75
+ rdoc (3.12)
76
+ json (~> 1.4)
77
+ sass (3.1.18)
78
+ sass-rails (3.2.5)
79
+ railties (~> 3.2.0)
80
+ sass (>= 3.1.10)
81
+ tilt (~> 1.3)
82
+ sprockets (2.1.3)
83
+ hike (~> 1.2)
84
+ rack (~> 1.0)
85
+ tilt (~> 1.1, != 1.3.0)
86
+ thor (0.14.6)
87
+ tilt (1.3.3)
88
+ treetop (1.4.10)
89
+ polyglot
90
+ polyglot (>= 0.3.1)
91
+ tzinfo (0.3.33)
92
+
93
+ PLATFORMS
94
+ ruby
95
+
96
+ DEPENDENCIES
97
+ bundler (~> 1.1.0)
98
+ rails (~> 3.0)
99
+ tipsy-rails-cc!
@@ -0,0 +1 @@
1
+ # tipsy-rails-cc
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1 @@
1
+ require 'tipsy/rails.rb'
@@ -0,0 +1,6 @@
1
+ module Tipsy
2
+ module Rails
3
+ require 'tipsy/rails/engine.rb'
4
+ require 'tipsy/rails/version.rb'
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Tipsy
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module Tipsy
2
+ module Rails
3
+ VERSION = "1.0.3"
4
+ TIPSY_VERSION = "1.0.0a"
5
+ end
6
+ end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/tipsy/rails/version', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "tipsy-rails-cc"
6
+ s.version = Tipsy::Rails::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Nick Ragaz"]
9
+ s.email = ["nick.ragaz@gmail.com"]
10
+ s.homepage = "http://rubygems.org/gems/tipsy-rails-cc"
11
+ s.summary = "Use the Tipsy jQuery plugin with Rails 3.1"
12
+ s.description = "This gem provides the Tipsy jQuery plugin for your Rails 3.1 application."
13
+
14
+ s.required_rubygems_version = ">= 1.3.6"
15
+
16
+ s.add_dependency "railties", "~> 3.0"
17
+ s.add_dependency "sass-rails"
18
+ s.add_development_dependency "bundler", "~> 1.1.0"
19
+ s.add_development_dependency "rails", "~> 3.0"
20
+
21
+ s.files = `git ls-files`.split("\n")
22
+ s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/}
23
+ s.require_path = 'lib'
24
+ end
@@ -0,0 +1,202 @@
1
+ // tipsy, facebook style tooltips for jquery
2
+ // version 1.0.0a
3
+ // (c) 2008-2010 jason frame [jason@onehackoranother.com]
4
+ // released under the MIT license
5
+
6
+ (function($) {
7
+
8
+ function Tipsy(element, options) {
9
+ this.$element = $(element);
10
+ this.options = options;
11
+ this.enabled = true;
12
+ this.fixTitle();
13
+ }
14
+
15
+ Tipsy.prototype = {
16
+ show: function() {
17
+ var title = this.getTitle();
18
+ if (title && this.enabled) {
19
+ var $tip = this.tip();
20
+
21
+ $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title);
22
+ $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity
23
+ $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).appendTo(document.body);
24
+
25
+ var pos = $.extend({}, this.$element.offset(), {
26
+ width: this.$element[0].offsetWidth,
27
+ height: this.$element[0].offsetHeight
28
+ });
29
+
30
+ var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight;
31
+ var gravity = (typeof this.options.gravity == 'function')
32
+ ? this.options.gravity.call(this.$element[0])
33
+ : this.options.gravity;
34
+
35
+ var tp;
36
+ switch (gravity.charAt(0)) {
37
+ case 'n':
38
+ tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
39
+ break;
40
+ case 's':
41
+ tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2};
42
+ break;
43
+ case 'e':
44
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset};
45
+ break;
46
+ case 'w':
47
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset};
48
+ break;
49
+ }
50
+
51
+ if (gravity.length == 2) {
52
+ if (gravity.charAt(1) == 'w') {
53
+ tp.left = pos.left + pos.width / 2 - 15;
54
+ } else {
55
+ tp.left = pos.left + pos.width / 2 - actualWidth + 15;
56
+ }
57
+ }
58
+
59
+ $tip.css(tp).addClass('tipsy-' + gravity);
60
+
61
+ if (this.options.fade) {
62
+ $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity});
63
+ } else {
64
+ $tip.css({visibility: 'visible', opacity: this.options.opacity});
65
+ }
66
+ }
67
+ },
68
+
69
+ hide: function() {
70
+ if (this.options.fade) {
71
+ this.tip().stop().fadeOut(function() { $(this).remove(); });
72
+ } else {
73
+ this.tip().remove();
74
+ }
75
+ },
76
+
77
+ fixTitle: function() {
78
+ var $e = this.$element;
79
+ if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') {
80
+ $e.attr('original-title', $e.attr('title') || '').removeAttr('title');
81
+ }
82
+ },
83
+
84
+ getTitle: function() {
85
+ var title, $e = this.$element, o = this.options;
86
+ this.fixTitle();
87
+ var title, o = this.options;
88
+ if (typeof o.title == 'string') {
89
+ title = $e.attr(o.title == 'title' ? 'original-title' : o.title);
90
+ } else if (typeof o.title == 'function') {
91
+ title = o.title.call($e[0]);
92
+ }
93
+ title = ('' + title).replace(/(^\s*|\s*$)/, "");
94
+ return title || o.fallback;
95
+ },
96
+
97
+ tip: function() {
98
+ if (!this.$tip) {
99
+ this.$tip = $('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');
100
+ }
101
+ return this.$tip;
102
+ },
103
+
104
+ validate: function() {
105
+ if (!this.$element[0].parentNode) {
106
+ this.hide();
107
+ this.$element = null;
108
+ this.options = null;
109
+ }
110
+ },
111
+
112
+ enable: function() { this.enabled = true; },
113
+ disable: function() { this.enabled = false; },
114
+ toggleEnabled: function() { this.enabled = !this.enabled; }
115
+ };
116
+
117
+ $.fn.tipsy = function(options) {
118
+
119
+ if (options === true) {
120
+ return this.data('tipsy');
121
+ } else if (typeof options == 'string') {
122
+ var tipsy = this.data('tipsy');
123
+ if (tipsy) tipsy[options]();
124
+ return this;
125
+ }
126
+
127
+ options = $.extend({}, $.fn.tipsy.defaults, options);
128
+
129
+ function get(ele) {
130
+ var tipsy = $.data(ele, 'tipsy');
131
+ if (!tipsy) {
132
+ tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options));
133
+ $.data(ele, 'tipsy', tipsy);
134
+ }
135
+ return tipsy;
136
+ }
137
+
138
+ function enter() {
139
+ var tipsy = get(this);
140
+ tipsy.hoverState = 'in';
141
+ if (options.delayIn == 0) {
142
+ tipsy.show();
143
+ } else {
144
+ tipsy.fixTitle();
145
+ setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn);
146
+ }
147
+ };
148
+
149
+ function leave() {
150
+ var tipsy = get(this);
151
+ tipsy.hoverState = 'out';
152
+ if (options.delayOut == 0) {
153
+ tipsy.hide();
154
+ } else {
155
+ setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut);
156
+ }
157
+ };
158
+
159
+ if (!options.live) this.each(function() { get(this); });
160
+
161
+ if (options.trigger != 'manual') {
162
+ var binder = options.live ? 'live' : 'bind',
163
+ eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus',
164
+ eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur';
165
+ this[binder](eventIn, enter)[binder](eventOut, leave);
166
+ }
167
+
168
+ return this;
169
+
170
+ };
171
+
172
+ $.fn.tipsy.defaults = {
173
+ delayIn: 0,
174
+ delayOut: 0,
175
+ fade: false,
176
+ fallback: '',
177
+ gravity: 'n',
178
+ html: false,
179
+ live: false,
180
+ offset: 0,
181
+ opacity: 0.8,
182
+ title: 'title',
183
+ trigger: 'hover'
184
+ };
185
+
186
+ // Overwrite this method to provide options on a per-element basis.
187
+ // For example, you could store the gravity in a 'tipsy-gravity' attribute:
188
+ // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' });
189
+ // (remember - do not modify 'options' in place!)
190
+ $.fn.tipsy.elementOptions = function(ele, options) {
191
+ return $.metadata ? $.extend({}, options, $(ele).metadata()) : options;
192
+ };
193
+
194
+ $.fn.tipsy.autoNS = function() {
195
+ return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n';
196
+ };
197
+
198
+ $.fn.tipsy.autoWE = function() {
199
+ return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w';
200
+ };
201
+
202
+ })(jQuery);
@@ -0,0 +1,69 @@
1
+ .tipsy {
2
+ padding: 5px;
3
+ font-size: 12px;
4
+ line-height: 15px;
5
+ position: absolute;
6
+ z-index: 100000;
7
+ }
8
+ .tipsy-inner {
9
+ padding: 5px 8px 4px 8px;
10
+ background-color: black;
11
+ color: white;
12
+ max-width: 200px;
13
+ text-align: center;
14
+ }
15
+ .tipsy-inner {
16
+ border-radius: 3px;
17
+ -moz-border-radius: 3px;
18
+ -webkit-border-radius: 3px;
19
+ }
20
+ .tipsy-arrow {
21
+ position: absolute;
22
+ background: url(image-path('tipsy/tipsy.gif')) no-repeat top left;
23
+ width: 9px;
24
+ height: 5px;
25
+ }
26
+ .tipsy-n .tipsy-arrow {
27
+ top: 0;
28
+ left: 50%;
29
+ margin-left: -4px;
30
+ }
31
+ .tipsy-nw .tipsy-arrow {
32
+ top: 0;
33
+ left: 10px;
34
+ }
35
+ .tipsy-ne .tipsy-arrow {
36
+ top: 0;
37
+ right: 10px;
38
+ }
39
+ .tipsy-s .tipsy-arrow {
40
+ bottom: 0;
41
+ left: 50%;
42
+ margin-left: -4px;
43
+ background-position: bottom left;
44
+ }
45
+ .tipsy-sw .tipsy-arrow {
46
+ bottom: 0;
47
+ left: 10px;
48
+ background-position: bottom left;
49
+ }
50
+ .tipsy-se .tipsy-arrow {
51
+ bottom: 0;
52
+ right: 10px;
53
+ background-position: bottom left;
54
+ }
55
+ .tipsy-e .tipsy-arrow {
56
+ top: 50%;
57
+ margin-top: -4px;
58
+ right: 0;
59
+ width: 5px;
60
+ height: 9px;
61
+ background-position: top right;
62
+ }
63
+ .tipsy-w .tipsy-arrow {
64
+ top: 50%;
65
+ margin-top: -4px;
66
+ left: 0;
67
+ width: 5px;
68
+ height: 9px;
69
+ }
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tipsy-rails-cc
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Nick Ragaz
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: sass-rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bundler
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 1.1.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 1.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: rails
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ description: This gem provides the Tipsy jQuery plugin for your Rails 3.1 application.
70
+ email:
71
+ - nick.ragaz@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - Gemfile
77
+ - Gemfile.lock
78
+ - README.md
79
+ - Rakefile
80
+ - lib/tipsy-rails-cc.rb
81
+ - lib/tipsy/rails.rb
82
+ - lib/tipsy/rails/engine.rb
83
+ - lib/tipsy/rails/version.rb
84
+ - tipsy-rails-cc.gemspec
85
+ - vendor/assets/images/tipsy/tipsy.gif
86
+ - vendor/assets/javascripts/tipsy.js
87
+ - vendor/assets/stylesheets/tipsy.css.scss
88
+ homepage: http://rubygems.org/gems/tipsy-rails-cc
89
+ licenses: []
90
+ metadata: {}
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 1.3.6
105
+ requirements: []
106
+ rubyforge_project:
107
+ rubygems_version: 2.4.6
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Use the Tipsy jQuery plugin with Rails 3.1
111
+ test_files: []