rails-protip 0.1.1 → 1.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 1f7cb24a40d3fe2262f21822a792c4e1fb4d0f0a
4
- data.tar.gz: 0ccf2a4b33cd666bbdabe0a3ec0a22424e2af9cc
2
+ SHA256:
3
+ metadata.gz: 1b53065159a121a21a9b1d768a4f1f94a988d5630dab6a986bfdb14902d36719
4
+ data.tar.gz: 3d7098d92dce8177cb09bd59782e915bb9b7e8d5dea6a52c2d2a603958309a4a
5
5
  SHA512:
6
- metadata.gz: daf9bc7fdb91132d2bc8414f0374a44e0f5a4aa47ad16879d24f71ae73cffbbd11c70bc4e9eabb9c9875e9f708209749e46af8b7c6cb0eb53093a1123df05cd1
7
- data.tar.gz: d6b6c48d1c2dda2fe89e3708959a43300b621b1f2a51961ea0d25f480c63d860420d758fababb8ef534d654287042ab8889dc9143c43ea6394e238b96528af3a
6
+ metadata.gz: 4439c34dc3a5e0cfdc09ff4b1e8e54dcdb230cce3b42acc9bf8d289998be42379f3016fe6defc44327f3821d294a59d197f5b04c8eb4d0a94276c40f6ed8db4d
7
+ data.tar.gz: eb32e3eefea582442ef703babfcc038d27ddeaf8edd56a94d2fb8513ddb10d274c5d04185cea44742ad46fed8d137321698312d9cfcd49ea84646ab7ad812da8
@@ -0,0 +1,55 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, master ]
6
+ pull_request:
7
+ branches: [ main, master ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ ruby: ['3.0', '3.1', '3.2', '3.3']
16
+ rails: ['6.0', '6.1', '7.0', '7.1', '7.2', '8.0']
17
+ exclude:
18
+ # Rails 7.2+ requires Ruby 3.1+
19
+ - ruby: '3.0'
20
+ rails: '7.2'
21
+ - ruby: '3.0'
22
+ rails: '8.0'
23
+
24
+ env:
25
+ RAILS_VERSION: ${{ matrix.rails }}
26
+
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+
30
+ - name: Set up Ruby
31
+ uses: ruby/setup-ruby@v1
32
+ with:
33
+ ruby-version: ${{ matrix.ruby }}
34
+ bundler-cache: true
35
+
36
+ - name: Run tests
37
+ run: bundle exec rake
38
+
39
+ - name: Run RuboCop
40
+ run: bundle exec rubocop
41
+
42
+ security:
43
+ runs-on: ubuntu-latest
44
+
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+
48
+ - name: Set up Ruby
49
+ uses: ruby/setup-ruby@v1
50
+ with:
51
+ ruby-version: '3.3'
52
+ bundler-cache: true
53
+
54
+ - name: Security audit
55
+ run: bundle exec bundle-audit --update
data/.gitignore CHANGED
@@ -1,9 +1,38 @@
1
+ ## Ruby/Bundler
1
2
  /.bundle/
2
- /.yardoc
3
+ /vendor/bundle/
3
4
  /Gemfile.lock
5
+
6
+ ## Documentation
7
+ /.yardoc/
4
8
  /_yardoc/
5
- /coverage/
6
9
  /doc/
7
- /pkg/
10
+ /rdoc/
11
+
12
+ ## Testing
13
+ /coverage/
8
14
  /spec/reports/
15
+ /test/tmp/
16
+ /test/version_tmp/
17
+
18
+ ## Build artifacts
19
+ /pkg/
9
20
  /tmp/
21
+ *.gem
22
+
23
+ ## IDE and OS files
24
+ .DS_Store
25
+ .idea/
26
+ .vscode/
27
+ *.swp
28
+ *.swo
29
+ *~
30
+ .ruby-version
31
+ .ruby-gemset
32
+
33
+ ## Environment
34
+ .env
35
+ .env.local
36
+
37
+ ## Logs
38
+ npm-debug.log
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,34 @@
1
+ AllCops:
2
+ TargetRubyVersion: 3.0
3
+ NewCops: enable
4
+ SuggestExtensions: false
5
+ Exclude:
6
+ - 'vendor/**/*'
7
+ - 'bin/**/*'
8
+
9
+ Style/Documentation:
10
+ Enabled: false
11
+
12
+ Style/StringLiterals:
13
+ Enabled: true
14
+ EnforcedStyle: double_quotes
15
+
16
+ Style/FrozenStringLiteralComment:
17
+ Enabled: true
18
+ EnforcedStyle: always
19
+
20
+ Layout/LineLength:
21
+ Max: 120
22
+ Exclude:
23
+ - '*.gemspec'
24
+
25
+ Metrics/BlockLength:
26
+ Exclude:
27
+ - 'spec/**/*'
28
+ - '*.gemspec'
29
+
30
+ Gemspec/DevelopmentDependencies:
31
+ Enabled: false
32
+
33
+ Gemspec/AddRuntimeDependency:
34
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,69 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.0] - 2026-05-30
9
+
10
+ ### ⚠️ Breaking Changes
11
+
12
+ - **BREAKING**: Updated minimum Ruby version from 1.9.3 to 3.0
13
+ - Ruby 2.7 reached EOL in March 2023
14
+ - **BREAKING**: Updated minimum Rails version to 6.0
15
+ - Now supports Rails 6.0, 6.1, 7.0, 7.1, 7.2, and 8.0
16
+
17
+ ### Added
18
+
19
+ - Added explicit `railties` runtime dependency (>= 6.0, < 9.0)
20
+ - Added comprehensive CHANGELOG file
21
+ - Added detailed UPGRADE_GUIDE.md for migration assistance
22
+ - Added GitHub Actions CI workflow (.github/workflows/ci.yml) replacing Travis CI
23
+ - Added RuboCop configuration and linting in CI
24
+ - Added bundler-audit security scanning in CI
25
+ - Added RSpec test suite
26
+ - Added gem metadata for better RubyGems.org integration:
27
+ - Changelog URI
28
+ - Bug tracker URI
29
+ - Documentation URI
30
+ - Source code URI
31
+ - MFA requirement
32
+
33
+ ### Changed
34
+
35
+ - Updated development dependencies to use semantic versioning:
36
+ - bundler ~> 2.4
37
+ - rake ~> 13.0
38
+ - rspec ~> 3.12
39
+ - Updated README.md with modern Rails asset pipeline instructions:
40
+ - Sprockets configuration
41
+ - Import Maps setup (Rails 7+)
42
+ - Webpacker/Shakapacker notes
43
+ - Removed .travis.yml (Travis CI no longer supports free open source)
44
+ - Improved .gitignore with additional patterns
45
+
46
+ ### Documentation
47
+
48
+ - Comprehensive upgrade guide for migrating from 0.x to 1.0
49
+ - Modern asset pipeline setup instructions
50
+ - jQuery dependency documentation
51
+
52
+ ### Notes
53
+
54
+ - All existing functionality preserved
55
+ - Configuration files (config/protip.yml) remain unchanged
56
+ - JavaScript API unchanged
57
+
58
+ ## [0.1.2] - Previous Release
59
+
60
+ ### Features
61
+
62
+ - jQuery Protip tooltip integration for Rails
63
+ - Configurable via protip.yml
64
+ - Animation support via animate.css
65
+ - Integration with Rails asset pipeline
66
+
67
+ ---
68
+
69
+ For upgrade instructions, see [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md)
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile CHANGED
@@ -1,4 +1,9 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
 
3
- # Specify your gem's dependencies in rails-protip.gemspec
4
5
  gemspec
6
+
7
+ if (rails_version = ENV.fetch("RAILS_VERSION", nil))
8
+ gem "railties", "~> #{rails_version}.0"
9
+ end
data/README.md CHANGED
@@ -1,12 +1,14 @@
1
1
  # Rails::Protip
2
2
 
3
- [![Build Status](https://travis-ci.org/ethirajsrinivasan/rails-protip.svg?branch=master)](https://travis-ci.org/ethirajsrinivasan/rails-protip)
4
- [![Code Climate](https://codeclimate.com/github/ethirajsrinivasan/rails-protip/badges/gpa.svg)](https://codeclimate.com/github/ethirajsrinivasan/rails-protip)
5
- [![security](https://hakiri.io/github/ethirajsrinivasan/rails-protip/master.svg)](https://hakiri.io/github/ethirajsrinivasan/rails-protip/master)
3
+ [![CI](https://github.com/ethirajsrinivasan/rails-protip/actions/workflows/ci.yml/badge.svg)](https://github.com/ethirajsrinivasan/rails-protip/actions/workflows/ci.yml)
4
+ [![Gem Version](https://badge.fury.io/rb/rails-protip.svg)](https://badge.fury.io/rb/rails-protip)
6
5
 
6
+ Tooltip gem based on the jQuery Protip plugin
7
7
 
8
- rails-protip is tooltip gem based on jquery protip plugin
8
+ ## Requirements
9
9
 
10
+ - Ruby >= 3.0
11
+ - Rails >= 6.0
10
12
 
11
13
  ## Installation
12
14
 
@@ -24,35 +26,90 @@ Or install it yourself as:
24
26
 
25
27
  $ gem install rails-protip
26
28
 
27
- To use this gem add this require statement to your application.js file:
29
+ ### Asset Pipeline Setup
28
30
 
29
- //= require protip
31
+ **For Rails 6.x / 7.x with Sprockets:**
30
32
 
31
- and in application.css file as follows
33
+ Add this require statement to your `application.js` file:
32
34
 
33
- *= require protip
35
+ ```javascript
36
+ //= require protip
37
+ ```
38
+
39
+ And in your `application.css` file:
40
+
41
+ ```css
42
+ *= require protip
43
+ ```
44
+
45
+ **For Rails 7+ with Import Maps:**
46
+
47
+ Add to your `config/importmap.rb`:
48
+
49
+ ```ruby
50
+ pin "protip", to: "protip.js"
51
+ ```
52
+
53
+ Then import in your `application.js`:
54
+
55
+ ```javascript
56
+ import "protip"
57
+ ```
58
+
59
+ **For Rails with Webpacker/Shakapacker:**
60
+
61
+ The gem works with the asset pipeline. If using Webpacker, you may need to configure it to load from the gem's assets directory.
62
+
63
+ **Note:** This gem requires jQuery. Make sure jQuery is loaded before protip.
34
64
 
35
65
  ## Usage
36
66
 
37
- <%= link_to "Go to the bar!","#bar", class: "protip", "data-pt-title"=> "You must be at least 18!"%>
67
+ ```erb
68
+ <%= link_to "Go to the bar!", "#bar", class: "protip", "data-pt-title" => "You must be at least 18!" %>
69
+ ```
38
70
 
39
- You can also set default configuration in protip.yml under config folder, example
71
+ You can also set default configuration in `protip.yml` under the config folder, example:
40
72
 
41
- scheme: "orange"
42
- skin: "square"
73
+ ```yaml
74
+ scheme: "orange"
75
+ skin: "square"
76
+ ```
43
77
 
44
- Support for animation is also provided, example
78
+ Support for animation is also provided, example:
45
79
 
46
- <div class="protip" data-pt-animate="infinite bounce" data-pt-title="You must be at least 18!">Go to the bar!</div>
80
+ ```html
81
+ <div class="protip" data-pt-animate="infinite bounce" data-pt-title="You must be at least 18!">Go to the bar!</div>
82
+ ```
47
83
 
48
84
  For further usage check http://protip.rocks
49
85
 
86
+ ## Upgrading from 0.x to 1.0
87
+
88
+ Version 1.0.0 introduces breaking changes to support modern Ruby and Rails versions:
89
+
90
+ ### Breaking Changes
91
+
92
+ - **Ruby**: Minimum version increased from 1.9.3 to 3.0
93
+ - **Rails**: Minimum version increased to 6.0
94
+
95
+ ### Migration Steps
96
+
97
+ 1. Ensure your application is running Ruby 3.0+ and Rails 6.0+
98
+ 2. Update your Gemfile: `gem 'rails-protip', '~> 1.0'`
99
+ 3. Run `bundle update rails-protip`
100
+ 4. If using Rails 7+ with Import Maps, follow the new installation instructions above
101
+ 5. Test your tooltips to ensure they still work as expected
102
+
103
+ See [UPGRADE_GUIDE.md](UPGRADE_GUIDE.md) for detailed migration instructions.
104
+
50
105
  ## Contributing
51
106
 
52
- Bug reports and pull requests are welcome on GitHub at https://github.com/ethirajsrinivasan/rails-protip.
107
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ethirajsrinivasan/rails-protip. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](CODE_OF_CONDUCT.md) code of conduct.
108
+
109
+ ## Thanks
53
110
 
111
+ Thanks to the [Protip](http://protip.rocks) project for the original jQuery tooltip plugin.
54
112
 
55
113
  ## License
56
114
 
57
115
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
58
-
data/Rakefile CHANGED
@@ -1,4 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
3
- RSpec::Core::RakeTask.new
4
- task :default => :spec
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
data/UPGRADE_GUIDE.md ADDED
@@ -0,0 +1,171 @@
1
+ # Upgrade Guide: Rails-Protip 0.x to 1.0
2
+
3
+ ## Overview
4
+
5
+ Rails-Protip 1.0 modernizes the gem to work with current Ruby and Rails versions. This guide will help you upgrade smoothly.
6
+
7
+ ## What Changed
8
+
9
+ ### Version Requirements
10
+
11
+ | Component | Old Version | New Version | Reason |
12
+ |-----------|-------------|-------------|--------|
13
+ | Ruby | >= 1.9.3 | >= 3.0 | Ruby 2.7 EOL (March 2023) |
14
+ | Rails | (implicit) | >= 6.0 | Modern Rails support |
15
+
16
+ ### New Features
17
+
18
+ - Support for Rails 6.x, 7.x, and 8.x
19
+ - GitHub Actions CI workflow
20
+ - Updated documentation for modern asset pipelines
21
+ - Import Maps support documentation
22
+ - Explicit railties dependency
23
+
24
+ ## Pre-Upgrade Checklist
25
+
26
+ Before upgrading, ensure:
27
+
28
+ - [ ] Your application runs Ruby 3.0 or higher
29
+ - [ ] Your application runs Rails 6.0 or higher
30
+ - [ ] You have a backup or version control
31
+ - [ ] Your test suite passes
32
+
33
+ ## Upgrade Steps
34
+
35
+ ### 1. Update Your Gemfile
36
+
37
+ ```ruby
38
+ # Old
39
+ gem 'rails-protip'
40
+
41
+ # New
42
+ gem 'rails-protip', '~> 1.0'
43
+ ```
44
+
45
+ ### 2. Install the Updated Gem
46
+
47
+ ```bash
48
+ bundle update rails-protip
49
+ ```
50
+
51
+ ### 3. Update Asset Configuration (if needed)
52
+
53
+ #### For Sprockets (Rails 6.x / 7.x)
54
+
55
+ No changes needed if you already have:
56
+
57
+ ```javascript
58
+ //= require protip
59
+ ```
60
+
61
+ And in your CSS manifest:
62
+
63
+ ```css
64
+ *= require protip
65
+ ```
66
+
67
+ #### For Import Maps (Rails 7+)
68
+
69
+ Add to `config/importmap.rb`:
70
+
71
+ ```ruby
72
+ pin "protip", to: "protip.js"
73
+ ```
74
+
75
+ Import in your `application.js`:
76
+
77
+ ```javascript
78
+ import "protip"
79
+ ```
80
+
81
+ ### 4. Verify jQuery is Loaded
82
+
83
+ Rails-Protip requires jQuery. Ensure it's loaded before protip:
84
+
85
+ **Sprockets:**
86
+ ```javascript
87
+ //= require jquery
88
+ //= require protip
89
+ ```
90
+
91
+ **Import Maps:**
92
+ ```ruby
93
+ # config/importmap.rb
94
+ pin "jquery", to: "https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"
95
+ pin "protip", to: "protip.js"
96
+ ```
97
+
98
+ ### 5. Test Your Tooltips
99
+
100
+ 1. Start your Rails server
101
+ 2. Navigate to pages with protip elements
102
+ 3. Verify tooltips appear and behave correctly
103
+ 4. Test custom configurations if you use protip.yml
104
+
105
+ ## Configuration
106
+
107
+ Your existing `config/protip.yml` configuration file continues to work without changes:
108
+
109
+ ```yaml
110
+ scheme: "orange"
111
+ skin: "square"
112
+ ```
113
+
114
+ ## Troubleshooting
115
+
116
+ ### Tooltips Not Appearing
117
+
118
+ **Issue**: Tooltips don't show up on elements.
119
+
120
+ **Solutions**:
121
+ 1. Check browser console for JavaScript errors
122
+ 2. Verify jQuery is loaded before protip
123
+ 3. Ensure assets are properly included in your asset pipeline
124
+ 4. Confirm elements have the `protip` class and `data-pt-title` attribute
125
+
126
+ ### Asset Not Found
127
+
128
+ **Issue**: `protip.js` not found error.
129
+
130
+ **Solutions**:
131
+ 1. Run `bundle exec rails assets:precompile` in production
132
+ 2. Restart your Rails server in development
133
+ 3. Clear your browser cache
134
+ 4. Verify the gem is properly installed: `bundle list | grep rails-protip`
135
+
136
+ ### Import Maps Issues (Rails 7+)
137
+
138
+ **Issue**: Module not found when using Import Maps.
139
+
140
+ **Solutions**:
141
+ 1. Ensure you've added the pin to `config/importmap.rb`
142
+ 2. Run `bin/importmap pin protip`
143
+ 3. Check that jQuery is also pinned and imported first
144
+
145
+ ## Rolling Back
146
+
147
+ If you need to roll back to the previous version:
148
+
149
+ ```ruby
150
+ # Gemfile
151
+ gem 'rails-protip', '~> 0.1.2'
152
+ ```
153
+
154
+ Then run:
155
+ ```bash
156
+ bundle update rails-protip
157
+ ```
158
+
159
+ **Note**: Version 0.1.2 only supports older Ruby and Rails versions, which are no longer maintained.
160
+
161
+ ## Getting Help
162
+
163
+ - **Issues**: [GitHub Issues](https://github.com/ethirajsrinivasan/rails-protip/issues)
164
+ - **Security**: Email ethirajsrinivasan@gmail.com for security concerns
165
+
166
+ ## Additional Resources
167
+
168
+ - [CHANGELOG.md](CHANGELOG.md) - Detailed list of changes
169
+ - [README.md](README.md) - Full documentation
170
+ - [Ruby Upgrade Guide](https://www.ruby-lang.org/en/downloads/)
171
+ - [Rails Upgrade Guide](https://guides.rubyonrails.org/upgrading_ruby_on_rails.html)
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Rails
2
4
  module Protip
3
- VERSION = "0.1.1"
5
+ VERSION = "1.0.0"
4
6
  end
5
7
  end
data/lib/rails/protip.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "rails/protip/version"
2
4
 
3
5
  module Rails
data/rails-protip.gemspec CHANGED
@@ -1,7 +1,6 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'rails/protip/version'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/rails/protip/version"
5
4
 
6
5
  Gem::Specification.new do |spec|
7
6
  spec.name = "rails-protip"
@@ -10,24 +9,35 @@ Gem::Specification.new do |spec|
10
9
  spec.email = ["ethirajsrinivasan@gmail.com"]
11
10
 
12
11
  spec.summary = "Tooltip gem based on jquery protip"
13
- spec.description = "Tooltip gem based on jquery protip"
12
+ spec.description = "A Rails asset gem that integrates the jQuery Protip tooltip plugin for creating beautiful, customizable tooltips"
14
13
  spec.homepage = "https://github.com/ethirajsrinivasan/rails-protip"
15
14
  spec.license = "MIT"
16
15
 
17
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
18
- # delete this section to allow pushing this gem to any host.
19
- if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
21
- else
22
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
16
+ spec.metadata = {
17
+ "allowed_push_host" => "https://rubygems.org",
18
+ "homepage_uri" => spec.homepage,
19
+ "source_code_uri" => "https://github.com/ethirajsrinivasan/rails-protip",
20
+ "bug_tracker_uri" => "https://github.com/ethirajsrinivasan/rails-protip/issues",
21
+ "changelog_uri" => "https://github.com/ethirajsrinivasan/rails-protip/blob/master/CHANGELOG.md",
22
+ "documentation_uri" => "https://github.com/ethirajsrinivasan/rails-protip/blob/master/README.md",
23
+ "rubygems_mfa_required" => "true"
24
+ }
25
+
26
+ spec.files = Dir.chdir(__dir__) do
27
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
23
28
  end
24
29
 
25
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
30
  spec.bindir = "exe"
27
31
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
32
  spec.require_paths = ["lib"]
29
- spec.required_ruby_version = '>= 1.9.3'
30
- spec.add_development_dependency "bundler", "~> 1.10"
31
- spec.add_development_dependency "rake", "~> 10.0"
32
- spec.add_development_dependency 'rspec'
33
+
34
+ spec.required_ruby_version = ">= 3.0"
35
+
36
+ spec.add_runtime_dependency "railties", ">= 6.0", "< 9.0"
37
+
38
+ spec.add_development_dependency "bundler", "~> 2.4"
39
+ spec.add_development_dependency "bundler-audit", "~> 0.9"
40
+ spec.add_development_dependency "rake", "~> 13.0"
41
+ spec.add_development_dependency "rspec", "~> 3.12"
42
+ spec.add_development_dependency "rubocop", "~> 1.50"
33
43
  end
@@ -1,96 +1,2 @@
1
- !function t(e,i,s){function o(h,r){if(!i[h]){if(!e[h]){var a="function"==typeof require&&require
2
- if(!r&&a)return a(h,!0)
3
- if(n)return n(h,!0)
4
- throw new Error("Cannot find module '"+h+"'")}var _=i[h]={exports:{}}
5
- e[h][0].call(_.exports,function(t){var i=e[h][1][t]
6
- return o(i?i:t)},_,_.exports,t,e,i,s)}return i[h].exports}for(var n="function"==typeof require&&require,h=0;h<s.length;h++)o(s[h])
7
- return o}({1:[function(t,e,i){t("./src/Plugin")},{"./src/Plugin":7}],2:[function(t,e,i){(function(s){!function(o,n){"use strict"
8
- "function"==typeof define&&define.amd?define(["jquery","./Constants","./Item"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants"),t("./Item")):o.ProtipClass=n(o.jQuery,o.ProtipConstants,o.ProtipItemClass)}(this,function(t,e,i){"use strict"
9
- try{window.MutationObserver._period=100}catch(s){console.error("Protip: MutationObserver polyfill haven't been loaded!"),window.MutationObserver=window.MutationObserver||function(){this.disconnect=this.observe=function(){}}}var o=function(t){return this._Construct(t)}
10
- return t.extend(!0,o.prototype,{_defaults:{selector:e.DEFAULT_SELECTOR,namespace:e.DEFAULT_NAMESPACE,protipTemplate:e.TEMPLATE_PROTIP,arrowTemplate:e.TEMPLATE_ARROW,iconTemplate:e.TEMPLATE_ICON,observer:!0,skin:e.SKIN_DEFAULT,size:e.SIZE_DEFAULT,scheme:e.SCHEME_DEFAULT,animate:!1,offset:0,forceMinWidth:!0,delayResize:100},_Construct:function(e){return this.settings=t.extend({},this._defaults,e),this._itemInstances={},this._observerInstance=void 0,this._visibleBeforeResize=[],this._task={delayIn:void 0,delayOut:void 0,resize:void 0},this._fetchElements(),this._bind(),this},destroy:function(){this._unbind(),t.each(this._itemInstances,t.proxy(function(t){this.destroyItemInstance(t)},this)),this._itemInstances=void 0,this.settings=void 0,t._protipClassInstance=void 0},namespaced:function(t){return this.settings.namespace+t.charAt(0).toUpperCase()+t.slice(1)},destroyItemInstance:function(t){this._itemInstances[t].destroy()},onItemDestoryed:function(t){delete this._itemInstances[t]},createItemInstance:function(t,s){var o=this._generateId()
11
- return this._itemInstances[o]=new i(o,t,this,s),t.data(this.namespaced(e.PROP_IDENTIFIER),o),this._itemInstances[o]},reloadItemInstance:function(t){var i=t.data(this.namespaced(e.PROP_IDENTIFIER))
12
- this.destroyItemInstance(i),this.createItemInstance(t)},getItemInstance:function(t,i){var s=t.data(this.namespaced(e.PROP_IDENTIFIER))
13
- return this._isInited(t)?this._itemInstances[s]:this.createItemInstance(t,i)},_fetchElements:function(){t(this.settings.selector).each(t.proxy(function(e,i){this.getItemInstance(t(i))},this))},_generateId:function(){return(new Date).valueOf()+Math.floor(1e4*Math.random()).toString()},_isInited:function(t){return!!t.data(this.namespaced(e.PROP_INITED))},_hideAll:function(e,i){t.each(this._itemInstances,t.proxy(function(t,s){s.isVisible()&&this._visibleBeforeResize.push(s)&&s.hide(e,i)},this))},_showAll:function(t,e){this._visibleBeforeResize.forEach(function(i){i.show(t,e)})},_onAction:function(i){var s=t(i.currentTarget),o=this.getItemInstance(s)
14
- i.type===e.EVENT_CLICK&&o.data.trigger===e.TRIGGER_CLICK&&i.preventDefault(),o.actionHandler(i.type)},_onResize:function(){!this._task.resize&&this._hideAll(!0,!0),this._task.resize&&clearTimeout(this._task.resize),this._task.resize=setTimeout(function(){this._showAll(!0,!0),this._task.resize=void 0,this._visibleBeforeResize=[]}.bind(this),this.settings.delayResize)},_onBodyClick:function(i){var s=t(i.target),o=s.closest("."+e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER)||!1,n=s.closest(e.DEFAULT_SELECTOR),h=(this._isInited(n)?this.getItemInstance(n):!1,this._isInited(o)?this.getItemInstance(o):!1);(!h||h&&h.data.trigger!==e.TRIGGER_CLICK)&&t.each(this._itemInstances,function(t,i){i.isVisible()&&i.data.trigger===e.TRIGGER_CLICK&&(!o||i.el.protip.get(0)!==o.get(0))&&(!n||i.el.source.get(0)!==n.get(0))&&i.hide()})},_onCloseClick:function(i){var s=t(i.currentTarget).parents("."+e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER).data(this.namespaced(e.PROP_IDENTIFIER))
15
- this._itemInstances[s]&&this._itemInstances[s].hide()},_mutationObserverCallback:function(i){i.forEach(function(i){for(var s,o=0;o<i.addedNodes.length;o++)if(s=t(i.addedNodes[o]),!s.hasClass(e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER)){var n=s.parent().find(this.settings.selector)
16
- n.each(function(i,s){if(s=t(s),!this._isInited(s)){var o=this.getItemInstance(s)
17
- o.data.trigger===e.TRIGGER_STICKY&&this.getItemInstance(s).show()}}.bind(this))}for(var o=0;o<i.removedNodes.length;o++){var h=t(i.removedNodes[o])
18
- h.find(this.settings.selector).each(function(e,i){this.getItemInstance(t(i)).destroy()}.bind(this)),h.hasClass(this.settings.selector.replace(".",""))&&this.getItemInstance(h).destroy()}}.bind(this))},_bind:function(){var i=t(e.SELECTOR_BODY)
19
- i.on(e.EVENT_CLICK,t.proxy(this._onBodyClick,this)).on(e.EVENT_MOUSEOVER,this.settings.selector,t.proxy(this._onAction,this)).on(e.EVENT_MOUSEOUT,this.settings.selector,t.proxy(this._onAction,this)).on(e.EVENT_CLICK,this.settings.selector,t.proxy(this._onAction,this)).on(e.EVENT_CLICK,e.SELECTOR_CLOSE,t.proxy(this._onCloseClick,this)),t(window).on(e.EVENT_RESIZE,t.proxy(this._onResize,this)),this.settings.observer&&(this._observerInstance=new MutationObserver(this._mutationObserverCallback.bind(this)),this._observerInstance.observe(i.get(0),{attributes:!1,childList:!0,characterData:!1,subtree:!0}))},_unbind:function(){t(e.SELECTOR_BODY).off(e.EVENT_CLICK,t.proxy(this._onBodyClick,this)).off(e.EVENT_MOUSEOVER,this.settings.selector,t.proxy(this._onAction,this)).off(e.EVENT_MOUSEOUT,this.settings.selector,t.proxy(this._onAction,this)).off(e.EVENT_CLICK,this.settings.selector,t.proxy(this._onAction,this)).off(e.EVENT_CLICK,e.SELECTOR_CLOSE,t.proxy(this._onCloseClick,this)),t(window).off(e.EVENT_RESIZE,t.proxy(this._onResize,this)),this.settings.observer&&this._observerInstance.disconnect()}}),o})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":3,"./Item":6}],3:[function(t,e,i){!function(t,s){"function"==typeof define&&define.amd?define([],s):"object"==typeof i?e.exports=s():t.ProtipConstants=s()}(this,function(){"use strict"
20
- var t={PLACEMENT_CENTER:"center",PLACEMENT_INSIDE:"inside",PLACEMENT_OUTSIDE:"outside",PLACEMENT_BORDER:"border",POSITION_TOP_LEFT:"top-left",POSITION_TOP:"top",POSITION_TOP_RIGHT:"top-right",POSITION_RIGHT_TOP:"right-top",POSITION_RIGHT:"right",POSITION_RIGHT_BOTTOM:"right-bottom",POSITION_BOTTOM_LEFT:"bottom-left",POSITION_BOTTOM:"bottom",POSITION_BOTTOM_RIGHT:"bottom-right",POSITION_LEFT_TOP:"left-top",POSITION_LEFT:"left",POSITION_LEFT_BOTTOM:"left-bottom",POSITION_CORNER_LEFT_TOP:"top-left-corner",POSITION_CORNER_RIGHT_TOP:"top-right-corner",POSITION_CORNER_LEFT_BOTTOM:"bottom-left-corner",POSITION_CORNER_RIGHT_BOTTOM:"bottom-right-corner",TRIGGER_CLICK:"click",TRIGGER_HOVER:"hover",TRIGGER_STICKY:"sticky",PROP_TRIGGER:"trigger",PROP_TITLE:"title",PROP_STICKY:"sticky",PROP_INITED:"inited",PROP_DELAY_IN:"delayIn",PROP_DELAY_OUT:"delayOut",PROP_GRAVITY:"gravity",PROP_OFFSET:"offset",PROP_OFFSET_TOP:"offsetTop",PROP_OFFSET_LEFT:"offsetLeft",PROP_POSITION:"position",PROP_CLASS:"class",PROP_ARROW:"arrow",PROP_WIDTH:"width",PROP_IDENTIFIER:"identifier",PROP_ICON:"icon",PROP_AUTO:"auto",PROP_TARGET:"target",EVENT_MOUSEOVER:"mouseover",EVENT_MOUSEOUT:"mouseout",EVENT_MOUSEENTER:"mouseenter",EVENT_MOUSELEAVE:"mouseleave",EVENT_CLICK:"click",EVENT_RESIZE:"resize",EVENT_PROTIP_SHOW:"protipshow",EVENT_PROTIP_HIDE:"protiphide",DEFAULT_SELECTOR:".protip",DEFAULT_NAMESPACE:"pt",DEFAULT_DELAY_OUT:100,SELECTOR_PREFIX:"protip-",SELECTOR_BODY:"body",SELECTOR_ARROW:"arrow",SELECTOR_CONTAINER:"container",SELECTOR_SHOW:"protip-show",SELECTOR_CLOSE:".protip-close",SELECTOR_SKIN_PREFIX:"protip-skin-",SELECTOR_SIZE_PREFIX:"--size-",SELECTOR_SCHEME_PREFIX:"--scheme-",SELECTOR_ANIMATE:"animated",SELECTOR_TARGET:".protip-target",SELECTOR_MIXIN_PREFIX:"protip-mixin--",SELECTOR_OPEN:"protip-open",TEMPLATE_PROTIP:'<div class="{classes}" data-pt-identifier="{identifier}" style="{widthType}:{width}px">{arrow}{icon}<div class="protip-content">{content}</div></div>',TEMPLATE_ICON:'<i class="icon-{icon}"></i>',ATTR_WIDTH:"width",ATTR_MAX_WIDTH:"max-width",SKIN_DEFAULT:"default",SIZE_DEFAULT:"normal",SCHEME_DEFAULT:"pro",PSEUDO_NEXT:"next",PSEUDO_PREV:"prev"}
21
- return t.TEMPLATE_ARROW='<span class="'+t.SELECTOR_PREFIX+t.SELECTOR_ARROW+'"></span>',t})},{}],4:[function(t,e,i){(function(s){!function(o,n){"use strict"
22
- "function"==typeof define&&define.amd?define(["jquery","./Constants"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants")):o.ProtipGravityParser=n(o.jQuery,o.ProtipConstants)}(this,function(t,e){"use strict"
23
- var i=function(t,e){return this._Construct(t,e)}
24
- return t.extend(!0,i.prototype,{_Construct:function(t,i){return this._positionsList=[{lvl:1,key:i,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_LEFT_TOP,top:0,left:0},{lvl:2,key:e.POSITION_TOP_LEFT,top:0,left:0},{lvl:1,key:e.POSITION_TOP,top:0,left:0},{lvl:2,key:e.POSITION_TOP_RIGHT,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_RIGHT_TOP,top:0,left:0},{lvl:2,key:e.POSITION_RIGHT_TOP,top:0,left:0},{lvl:1,key:e.POSITION_RIGHT,top:0,left:0},{lvl:2,key:e.POSITION_RIGHT_BOTTOM,top:0,left:0},{lvl:2,key:e.POSITION_BOTTOM_LEFT,top:0,left:0},{lvl:1,key:e.POSITION_BOTTOM,top:0,left:0},{lvl:2,key:e.POSITION_BOTTOM_RIGHT,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_RIGHT_BOTTOM,top:0,left:0},{lvl:2,key:e.POSITION_LEFT_TOP,top:0,left:0},{lvl:1,key:e.POSITION_LEFT,top:0,left:0},{lvl:2,key:e.POSITION_LEFT_BOTTOM,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_LEFT_BOTTOM,top:0,left:0}],this._input=t,this._finals=[],this._parse(),this._finals},_parse:function(){if(this._input===!0||3===this._input)this._finals=this._positionsList
25
- else if(isNaN(this._input)){var t=[],e=!1
26
- this._finals=this._input.split(";").map(function(i){if(i=i.trim(),"..."===i)e=!0
27
- else if(i){var s=i.split(" ").map(function(t){return t.trim()})
28
- return t.push(s[0]),{lvl:1,key:s[0],left:parseInt(s[1],10)||0,top:parseInt(s[2],10)||0}}}).filter(function(t){return!!t}),e&&this._positionsList.forEach(function(e){-1===t.indexOf(e.key)&&this._finals.push(e)}.bind(this))}else this._finals=this._positionsList.filter(function(t){return t.lvl<=this._input}.bind(this))}}),i})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":3}],5:[function(t,e,i){(function(s){!function(o,n){"use strict"
29
- "function"==typeof define&&define.amd?define(["jquery","./Constants","./GravityParser","./PositionCalculator"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants"),t("./GravityParser"),t("./PositionCalculator")):o.ProtipGravityTester=n(o.jQuery,o.ProtipConstants,o.ProtipGravityParser,o.ProtipPositionCalculator)}(this,function(t,e,i,s){"use strict"
30
- var o=function(t){return this._Construct(t)}
31
- return t.extend(!0,o.prototype,{_Construct:function(t){this._item=t,this._result=void 0,this._setWindowDimensions(),this._positionList=new i(this._item.data.gravity,this._item.data.position)
32
- var e
33
- for(e=0;e<this._positionList.length&&!this._test(this._positionList[e]);e++);return this._item.data.position=this._positionList[0].key,this._result||new s(this._item)},_test:function(t){this._setProtipMinWidth()
34
- var e=new s(this._item,t.key,t)
35
- return this._item.el.protip.css(e),this._setProtipDimensions(),this._topOk()&&this._rightOk()&&this._bottomOk()&&this._leftOk()?(e.position=t.key,this._result=e,!0):!1},_topOk:function(){return this._dimensions.offset.top-this._windowDimensions.scrollTop>0},_rightOk:function(){return this._dimensions.offset.left+this._dimensions.width<this._windowDimensions.width},_bottomOk:function(){return this._dimensions.offset.top-this._windowDimensions.scrollTop+this._dimensions.height<this._windowDimensions.height},_leftOk:function(){return this._dimensions.offset.left>0},_setProtipMinWidth:function(){if(this._item.classInstance.settings.forceMinWidth){this._item.el.protip.css({position:"fixed",left:0,top:0,minWidth:0})
36
- var t=this._item.el.protip.outerWidth()+1
37
- this._item.el.protip.css({position:"",left:"",top:"",minWidth:t+"px"})}},_setProtipDimensions:function(){this._dimensions={width:this._item.el.protip.outerWidth(),height:this._item.el.protip.outerHeight(),offset:this._item.el.protip.offset()}},_setWindowDimensions:function(){var t=window,e=document,i=e.documentElement,s=e.getElementsByTagName("body")[0],o=t.innerWidth||i.clientWidth||s.clientWidth,n=t.innerHeight||i.clientHeight||s.clientHeight
38
- this._windowDimensions={width:parseInt(o),height:parseInt(n),scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.getElementsByTagName("body")[0].scrollTop||0}}}),o})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":3,"./GravityParser":4,"./PositionCalculator":8}],6:[function(t,e,i){(function(s){!function(o,n){"use strict"
39
- "function"==typeof define&&define.amd?define(["jquery","./Constants","./GravityTester","./PositionCalculator"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants"),t("./GravityTester"),t("./PositionCalculator")):o.ProtipItemClass=n(o.jQuery,o.ProtipConstants,o.ProtipGravityTester,o.ProtipPositionCalculator)}(this,function(t,e,i,s){"use strict"
40
- function o(t,e){return t.replace(/\{([\w\.]*)}/g,function(t,i){for(var s=i.split("."),o=e[s.shift()],n=0,h=s.length;h>n;n++)o=o[s[n]]
41
- return"undefined"!=typeof o&&null!==o?o:""})}var n=function(t,e,i,s){return this._Construct(t,e,i,s)}
42
- return t.extend(!0,n.prototype,{_Construct:function(t,i,s,o){return this._override=o||{},this._override.identifier=t,this._prop={trigger:e.TRIGGER_HOVER,title:null,inited:!1,delayIn:0,delayOut:0,interactive:!1,gravity:!0,offsetTop:0,offsetLeft:0,position:e.POSITION_RIGHT,placement:e.PLACEMENT_OUTSIDE,classes:null,arrow:!0,width:300,identifier:!1,icon:!1,observer:!1,target:e.SELECTOR_BODY,skin:void 0,size:void 0,scheme:void 0,animate:void 0,autoHide:!1,mixin:void 0},this.el={},this.el.source=i,this.data={},this.classInstance=s,this._isVisible=!1,this._task={delayIn:void 0,delayOut:void 0},this._fetchData(),this._prepareInternals(),this._appendProtip(),this._initSticky(),this._bind(),this.el.source.addClass(this.classInstance.settings.selector.replace(".","")).data(this._namespaced(e.PROP_INITED),!0),this},actionHandler:function(t){if(this.data.trigger===e.TRIGGER_STICKY);else if(t===e.EVENT_CLICK&&this.data.trigger===e.TRIGGER_CLICK)this.toggle()
43
- else if(this.data.trigger!==e.TRIGGER_CLICK)switch(t){case e.EVENT_MOUSEOUT:this.hide()
44
- break
45
- case e.EVENT_MOUSEOVER:this.show()}},destroy:function(){this.hide(!0),this._unbind(),this.el.protip.remove(),this.el.source.data(this._namespaced(e.PROP_INITED),!1).data(this._namespaced(e.PROP_IDENTIFIER),!1).removeData(),this.classInstance.onItemDestoryed(this.data.identifier),t.each(this._task,function(t,e){clearTimeout(e)})},isVisible:function(){return this._isVisible},toggle:function(){this._isVisible?this.hide():this.show()},show:function(t,o){if(this.data.title){if(this._task.delayOut&&clearTimeout(this._task.delayOut),this._task.delayIn&&clearTimeout(this._task.delayIn),this._task.autoHide&&clearTimeout(this._task.autoHide),!t&&this.data.delayIn)return void(this._task.delayIn=setTimeout(function(){this.show(!0)}.bind(this),this.data.delayIn))
46
- this.data.autoHide!==!1&&(this._task.autoHide=setTimeout(function(){this.hide(!0)}.bind(this),this.data.autoHide))
47
- var n
48
- this.data.gravity?(n=new i(this),delete n.position):n=new s(this),this.el.source.addClass(e.SELECTOR_OPEN),!o&&this.el.source.trigger(e.EVENT_PROTIP_SHOW,this),this.el.protip.css(n).addClass(e.SELECTOR_SHOW),(this.data.animate||this.classInstance.settings.animate&&!this.data.animate)&&this.el.protip.addClass(e.SELECTOR_ANIMATE).addClass(this.data.animate||this.classInstance.settings.animate),this._isVisible=!0}},applyPosition:function(t){this.el.protip.attr("data-"+e.DEFAULT_NAMESPACE+"-"+e.PROP_POSITION,t)},hide:function(t,i){return this._task.delayOut&&clearTimeout(this._task.delayOut),this._task.delayIn&&clearTimeout(this._task.delayIn),this._task.autoHide&&clearTimeout(this._task.autoHide),!t&&this.data.delayOut?void(this._task.delayOut=setTimeout(function(){this.hide(!0)}.bind(this),this.data.delayOut)):(this.el.source.removeClass(e.SELECTOR_OPEN),!i&&this.el.source.trigger(e.EVENT_PROTIP_HIDE,this),this.el.protip.removeClass(e.SELECTOR_SHOW).removeClass(e.SELECTOR_ANIMATE).removeClass(this.data.animate||this.classInstance.settings.animate),void(this._isVisible=!1))},getArrowOffset:function(){return{width:this.el.protipArrow.outerWidth(),height:this.el.protipArrow.outerHeight()}},_fetchData:function(){t.each(this._prop,t.proxy(function(t){this.data[t]=this.el.source.data(this._namespaced(t))},this)),this.data=t.extend({},this._prop,this.data),this.data=t.extend({},this.data,this._override),t.each(this.data,t.proxy(function(t,e){this.el.source.data(this._namespaced(t),e)},this))},_prepareInternals:function(){this._setTarget(),this._detectTitle(),this._checkInteractive()},_checkInteractive:function(){this.data.interactive&&(this.data.delayOut=this.data.delayOut||e.DEFAULT_DELAY_OUT)},_initSticky:function(){this.data.trigger===e.TRIGGER_STICKY&&this.show()},_appendProtip:function(){this.el.protip=o(this.classInstance.settings.protipTemplate,{classes:this._getClassList(),widthType:this._getWidthType(),width:this._getWidth(),content:this.data.title,icon:this._getIconTemplate(),arrow:this.data.arrow?e.TEMPLATE_ARROW:"",identifier:this.data.identifier}),this.el.protip=t(this.el.protip),this.el.protipArrow=this.el.protip.find("."+e.SELECTOR_PREFIX+e.SELECTOR_ARROW),this.el.target.append(this.el.protip)},_getClassList:function(){var t=[],i=this.data.skin||this.classInstance.settings.skin,s=this.data.size||this.classInstance.settings.size,o=this.data.scheme||this.classInstance.settings.scheme
49
- return t.push(e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER),t.push(e.SELECTOR_SKIN_PREFIX+i),t.push(e.SELECTOR_SKIN_PREFIX+i+e.SELECTOR_SIZE_PREFIX+s),t.push(e.SELECTOR_SKIN_PREFIX+i+e.SELECTOR_SCHEME_PREFIX+o),this.data.classes&&t.push(this.data.classes),this.data.mixin&&t.push(this._parseMixins()),t.join(" ")},_parseMixins:function(){var t=[]
50
- return this.data.mixin&&this.data.mixin.split(" ").forEach(function(i){i&&t.push(e.SELECTOR_MIXIN_PREFIX+i)},this),t.join(" ")},_getWidthType:function(){return isNaN(this.data.width)?e.ATTR_WIDTH:e.ATTR_MAX_WIDTH},_getWidth:function(){return parseInt(this.data.width,10)},_getIconTemplate:function(){return this.data.icon?o(this.classInstance.settings.iconTemplate,{icon:this.data.icon}):""},_detectTitle:function(){if(!this.data.title||"#"!==this.data.title.charAt(0)&&"."!==this.data.title.charAt(0)){if(this.data.title&&":"===this.data.title.charAt(0)){var i=this.data.title.substring(1)
51
- switch(i){case e.PSEUDO_NEXT:this.data.title=this.el.source.next().html()
52
- break
53
- case e.PSEUDO_PREV:this.data.title=this.el.source.prev().html()}}}else this.data.titleSource=this.data.titleSource||this.data.title,this.data.title=t(this.data.title).html()
54
- this.data.title&&this.data.title.indexOf("<a ")+1&&(this.data.interactive=!0)},_setTarget:function(){var i=this._getData(e.PROP_TARGET)
55
- i=i===!0?this.el.source:i===e.SELECTOR_BODY&&this.el.source.closest(e.SELECTOR_TARGET).length?this.el.source.closest(e.SELECTOR_TARGET):t(i?i:e.SELECTOR_BODY),"static"===i.css("position")&&i.css({position:"relative"}),this.el.target=i},_getData:function(t){return this.el.source.data(this._namespaced(t))},_namespaced:function(t){return this.classInstance.namespaced(t)},_onProtipMouseenter:function(){clearTimeout(this._task.delayOut)},_onProtipMouseleave:function(){this.data.trigger===e.TRIGGER_HOVER&&this.hide()},_bind:function(){this.data.interactive&&this.el.protip.on(e.EVENT_MOUSEENTER,t.proxy(this._onProtipMouseenter,this)).on(e.EVENT_MOUSELEAVE,t.proxy(this._onProtipMouseleave,this)),this.data.observer&&(this._observerInstance=new MutationObserver(function(){this.classInstance.reloadItemInstance(this.el.source)}.bind(this)),this._observerInstance.observe(this.el.source.get(0),{attributes:!0,childList:!1,characterData:!1,subtree:!1}))},_unbind:function(){this.data.interactive&&this.el.protip.off(e.EVENT_MOUSEENTER,t.proxy(this._onProtipMouseenter,this)).off(e.EVENT_MOUSELEAVE,t.proxy(this._onProtipMouseleave,this)),this.data.observer&&this._observerInstance.disconnect()}}),n})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":3,"./GravityTester":5,"./PositionCalculator":8}],7:[function(t,e,i){(function(s){!function(o,n){"use strict"
56
- "function"==typeof define&&define.amd?define(["jquery","./Class","./Constants"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Class"),t("./Constants")):n(o.jQuery,o.ProtipClass,o.ProtipContants)}(this,function(t,e,i){"use strict"
57
- t=t.extend(t,{_protipClassInstance:void 0,protip:function(t){return this._protipClassInstance||(this._protipClassInstance=new e(t),this.protip.C=i),this._protipClassInstance}}),t.fn.extend({protipSet:function(e){return this.each(function(i,s){s=t(s),t._protipClassInstance.getItemInstance(s).destroy(),t._protipClassInstance.getItemInstance(s,e)})},protipShow:function(e){return this.each(function(i,s){s=t(s),t._protipClassInstance.getItemInstance(s).destroy(),t._protipClassInstance.getItemInstance(s,e).show(!0)})},protipHide:function(){return this.each(function(e,i){t._protipClassInstance.getItemInstance(t(i)).hide(!0)})},protipToggle:function(){var e
58
- return this.each(function(i,s){e=t._protipClassInstance.getItemInstance(t(s)),e=e.isVisible()?e.hide(!0):e.show(!0)}.bind(this))},protipHideInside:function(){return this.each(function(e,i){t(i).find(t._protipClassInstance.settings.selector).each(function(e,i){t._protipClassInstance.getItemInstance(t(i)).hide(!0)})})},protipShowInside:function(){return this.each(function(e,i){t(i).find(t._protipClassInstance.settings.selector).each(function(e,i){t._protipClassInstance.getItemInstance(t(i)).show(!0)})})},protipToggleInside:function(){var e
59
- return this.each(function(i,s){t(s).find(t._protipClassInstance.settings.selector).each(function(i,s){e=t._protipClassInstance.getItemInstance(t(s)),e=e.isVisible()?e.hide(!0):e.show(!0)})})}})})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Class":2,"./Constants":3}],8:[function(t,e,i){(function(s){!function(o,n){"use strict"
60
- "function"==typeof define&&define.amd?define(["jquery","./Constants"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants")):o.ProtipPositionCalculator=n(o.jQuery,o.ProtipConstants)}(this,function(t,e){"use strict"
61
- var i=function(t,e,i){return this._Construct(t,e,i)}
62
- return t.extend(!0,i.prototype,{_Construct:function(t,e,i){return this._itemInstance=t,this._protip=this._getProto(this._itemInstance.el.protip),this._source=this._getProto(this._itemInstance.el.source),this._target=this._getProto(this._itemInstance.el.target),this._position=e||this._itemInstance.data.position,this._placement=this._itemInstance.data.placement,this._offset=i||{top:this._itemInstance.data.offsetTop,left:this._itemInstance.data.offsetLeft},this._getPosition()},_getProto:function(t){var e={el:void 0,width:void 0,height:void 0,offset:void 0}
63
- return e.el=t,e.width=t.outerWidth(),e.height=t.outerHeight(),e.offset=t.offset(),e},_getPosition:function(){this._itemInstance.applyPosition(this._position)
64
- var t={left:0,top:0},i=this._itemInstance.getArrowOffset(),s=this._itemInstance.classInstance.settings.offset
65
- if(this._placement!==e.PLACEMENT_CENTER)switch(this._position){case e.POSITION_TOP:this._offset.top+=-1*(s+i.height),t.left=this._source.offset.left+this._source.width/2-this._protip.width/2-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2)
66
- break
67
- case e.POSITION_TOP_LEFT:this._offset.top+=-1*(s+i.height),t.left=this._source.offset.left-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2)
68
- break
69
- case e.POSITION_TOP_RIGHT:this._offset.top+=-1*(s+i.height),t.left=this._source.offset.left+this._source.width-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2)
70
- break
71
- case e.POSITION_RIGHT:this._offset.left+=s+i.width,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height/2-this._protip.height/2-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2)
72
- break
73
- case e.POSITION_RIGHT_TOP:this._offset.left+=s+i.width,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2)
74
- break
75
- case e.POSITION_RIGHT_BOTTOM:this._offset.left+=s+i.width,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2)
76
- break
77
- case e.POSITION_BOTTOM:this._offset.top+=s+i.height,t.left=this._source.offset.left+this._source.width/2-this._protip.width/2-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2)
78
- break
79
- case e.POSITION_BOTTOM_LEFT:this._offset.top+=s+i.height,t.left=this._source.offset.left-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2)
80
- break
81
- case e.POSITION_BOTTOM_RIGHT:this._offset.top+=s+i.height,t.left=this._source.offset.left+this._source.width-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2)
82
- break
83
- case e.POSITION_LEFT:this._offset.left+=-1*(s+i.width),t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height/2-this._protip.height/2-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2)
84
- break
85
- case e.POSITION_LEFT_TOP:this._offset.left+=-1*(s+i.width),t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2)
86
- break
87
- case e.POSITION_LEFT_BOTTOM:this._offset.left+=-1*(s+i.width),t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2)
88
- break
89
- case e.POSITION_CORNER_LEFT_TOP:this._offset.top+=-1*(s+i.height),t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2)
90
- break
91
- case e.POSITION_CORNER_LEFT_BOTTOM:this._offset.top+=s+i.height,t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2)
92
- break
93
- case e.POSITION_CORNER_RIGHT_BOTTOM:this._offset.top+=s+i.height,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2)
94
- break
95
- case e.POSITION_CORNER_RIGHT_TOP:this._offset.top+=-1*(s+i.height),t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2)}else t.left=this._source.offset.left+this._source.width/2-this._protip.width/2-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height/2-this._protip.height/2-this._target.offset.top+this._offset.top
96
- return t.left=t.left+"px",t.top=t.top+"px",t}}),i})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":3}]},{},[1])
1
+ !function t(e,i,s){function o(h,r){if(!i[h]){if(!e[h]){var a="function"==typeof require&&require;if(!r&&a)return a(h,!0);if(n)return n(h,!0);var _=new Error("Cannot find module '"+h+"'");throw _.code="MODULE_NOT_FOUND",_}var f=i[h]={exports:{}};e[h][0].call(f.exports,function(t){var i=e[h][1][t];return o(i?i:t)},f,f.exports,t,e,i,s)}return i[h].exports}for(var n="function"==typeof require&&require,h=0;h<s.length;h++)o(s[h]);return o}({1:[function(t,e,i){t("./src/Plugin")},{"./src/Plugin":8}],2:[function(t,e,i){(function(t){!function(s,o){"use strict";"function"==typeof define&&define.amd?define(["jquery"],o):"object"==typeof i?e.exports=o("undefined"!=typeof window?window.jQuery:"undefined"!=typeof t?t.jQuery:null):o(s.jQuery)}(this,function(t){"use strict";var e=function(){return this._Construct()};return e.prototype={_Construct:function(){return this._commandList=[],this._isReady=!1,this._timer=setInterval(this._check.bind(this),10),this},add:function(t,e,i){this._commandList.push({cmd:t,el:e,cmdArgs:i})},isReady:function(){return this._isReady},_check:function(){t._protipClassInstance&&(this._isReady=!0)&&(!this._commandList.length||this._run())&&clearInterval(this._timer)},_run:function(){var t=this._commandList.shift();return t.el[t.cmd].apply(t.el,t.cmdArgs),this._commandList.length&&this._run(),!0}},e})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(t,e,i){(function(s){!function(o,n){"use strict";"function"==typeof define&&define.amd?define(["jquery","./Constants","./Item"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants"),t("./Item")):o.ProtipClass=n(o.jQuery,o.ProtipConstants,o.ProtipItemClass)}(this,function(t,e,i){"use strict";try{window.MutationObserver._period=100}catch(s){console.warn("Protip: MutationObserver polyfill haven't been loaded!"),window.MutationObserver=window.MutationObserver||function(){this.disconnect=this.observe=function(){}}}var o=function(t){return this._Construct(t)};return t.extend(!0,o.prototype,{_defaults:{selector:e.DEFAULT_SELECTOR,namespace:e.DEFAULT_NAMESPACE,protipTemplate:e.TEMPLATE_PROTIP,arrowTemplate:e.TEMPLATE_ARROW,iconTemplate:e.TEMPLATE_ICON,observer:!0,offset:0,forceMinWidth:!0,delayResize:100,defaults:{trigger:e.TRIGGER_HOVER,title:null,inited:!1,delayIn:0,delayOut:0,interactive:!1,gravity:!0,offsetTop:0,offsetLeft:0,position:e.POSITION_RIGHT,placement:e.PLACEMENT_OUTSIDE,classes:null,arrow:!0,width:300,identifier:!1,icon:!1,observer:!1,target:e.SELECTOR_BODY,skin:e.SKIN_DEFAULT,size:e.SIZE_DEFAULT,scheme:e.SCHEME_DEFAULT,animate:!1,autoHide:!1,autoShow:!1,mixin:null}},_Construct:function(e){return this.settings=t.extend(!0,{},this._defaults,e),this._itemInstances={},this._observerInstance=void 0,this._visibleBeforeResize=[],this._task={delayIn:void 0,delayOut:void 0,resize:void 0},this._fetchElements(),this._bind(),this},destroy:function(){this._unbind(),t.each(this._itemInstances,t.proxy(function(t){this.destroyItemInstance(t)},this)),this._itemInstances=void 0,this.settings=void 0,t._protipClassInstance=void 0},namespaced:function(t){return this.settings.namespace+t.charAt(0).toUpperCase()+t.slice(1)},destroyItemInstance:function(t){this._itemInstances[t].destroy()},onItemDestoryed:function(t){delete this._itemInstances[t]},createItemInstance:function(t,s){var o=this._generateId();return this._itemInstances[o]=new i(o,t,this,s),t.data(this.namespaced(e.PROP_IDENTIFIER),o),this._itemInstances[o]},reloadItemInstance:function(t){var i=t.data(this.namespaced(e.PROP_IDENTIFIER));this.destroyItemInstance(i),this.createItemInstance(t)},getItemInstance:function(t,i){var s=t.data(this.namespaced(e.PROP_IDENTIFIER));return this._isInited(t)?this._itemInstances[s]:this.createItemInstance(t,i)},_fetchElements:function(){setTimeout(function(){t(this.settings.selector).each(t.proxy(function(e,i){this.getItemInstance(t(i))},this))}.bind(this))},_generateId:function(){return(new Date).valueOf()+Math.floor(1e4*Math.random()).toString()},_isInited:function(t){return!!t.data(this.namespaced(e.PROP_INITED))},_hideAll:function(e,i){t.each(this._itemInstances,t.proxy(function(t,s){s.isVisible()&&this._visibleBeforeResize.push(s)&&s.hide(e,i)},this))},_showAll:function(t,e){this._visibleBeforeResize.forEach(function(i){i.show(t,e)})},_onAction:function(i){var s=t(i.currentTarget),o=this.getItemInstance(s);i.type===e.EVENT_CLICK&&o.data.trigger===e.TRIGGER_CLICK&&i.preventDefault(),o.actionHandler(i.type)},_onResize:function(){!this._task.resize&&this._hideAll(!0,!0),this._task.resize&&clearTimeout(this._task.resize),this._task.resize=setTimeout(function(){this._showAll(!0,!0),this._task.resize=void 0,this._visibleBeforeResize=[]}.bind(this),this.settings.delayResize)},_onBodyClick:function(i){var s=t(i.target),o=s.closest("."+e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER)||!1,n=s.closest(e.DEFAULT_SELECTOR),h=(!!this._isInited(n)&&this.getItemInstance(n),!!this._isInited(o)&&this.getItemInstance(o));(!h||h&&h.data.trigger!==e.TRIGGER_CLICK)&&t.each(this._itemInstances,function(t,i){i.isVisible()&&i.data.trigger===e.TRIGGER_CLICK&&(!o||i.el.protip.get(0)!==o.get(0))&&(!n||i.el.source.get(0)!==n.get(0))&&i.hide()})},_onCloseClick:function(i){var s=t(i.currentTarget).parents("."+e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER).data(this.namespaced(e.PROP_IDENTIFIER));this._itemInstances[s]&&this._itemInstances[s].hide()},_mutationObserverCallback:function(i){i.forEach(function(i){for(var s,o=0;o<i.addedNodes.length;o++)if(s=t(i.addedNodes[o]),!s.hasClass(e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER)){var n=s.parent().find(this.settings.selector);n.each(function(i,s){if(s=t(s),!this._isInited(s)){var o=this.getItemInstance(s);o.data.trigger===e.TRIGGER_STICKY&&this.getItemInstance(s).show()}}.bind(this))}for(var o=0;o<i.removedNodes.length;o++){var h=t(i.removedNodes[o]);h.find(this.settings.selector).each(function(e,i){this.getItemInstance(t(i)).destroy()}.bind(this)),h.hasClass(this.settings.selector.replace(".",""))&&this.getItemInstance(h).destroy()}}.bind(this))},_bind:function(){var i=t(e.SELECTOR_BODY);i.on(e.EVENT_CLICK,t.proxy(this._onBodyClick,this)).on(e.EVENT_MOUSEOVER,this.settings.selector,t.proxy(this._onAction,this)).on(e.EVENT_MOUSEOUT,this.settings.selector,t.proxy(this._onAction,this)).on(e.EVENT_CLICK,this.settings.selector,t.proxy(this._onAction,this)).on(e.EVENT_CLICK,e.SELECTOR_CLOSE,t.proxy(this._onCloseClick,this)),t(window).on(e.EVENT_RESIZE,t.proxy(this._onResize,this)),this.settings.observer&&(this._observerInstance=new MutationObserver(this._mutationObserverCallback.bind(this)),this._observerInstance.observe(i.get(0),{attributes:!1,childList:!0,characterData:!1,subtree:!0}))},_unbind:function(){t(e.SELECTOR_BODY).off(e.EVENT_CLICK,t.proxy(this._onBodyClick,this)).off(e.EVENT_MOUSEOVER,this.settings.selector,t.proxy(this._onAction,this)).off(e.EVENT_MOUSEOUT,this.settings.selector,t.proxy(this._onAction,this)).off(e.EVENT_CLICK,this.settings.selector,t.proxy(this._onAction,this)).off(e.EVENT_CLICK,e.SELECTOR_CLOSE,t.proxy(this._onCloseClick,this)),t(window).off(e.EVENT_RESIZE,t.proxy(this._onResize,this)),this.settings.observer&&this._observerInstance.disconnect()}}),o})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":4,"./Item":7}],4:[function(t,e,i){!function(t,s){"function"==typeof define&&define.amd?define([],s):"object"==typeof i?e.exports=s():t.ProtipConstants=s()}(this,function(){"use strict";var t={PLACEMENT_CENTER:"center",PLACEMENT_INSIDE:"inside",PLACEMENT_OUTSIDE:"outside",PLACEMENT_BORDER:"border",POSITION_TOP_LEFT:"top-left",POSITION_TOP:"top",POSITION_TOP_RIGHT:"top-right",POSITION_RIGHT_TOP:"right-top",POSITION_RIGHT:"right",POSITION_RIGHT_BOTTOM:"right-bottom",POSITION_BOTTOM_LEFT:"bottom-left",POSITION_BOTTOM:"bottom",POSITION_BOTTOM_RIGHT:"bottom-right",POSITION_LEFT_TOP:"left-top",POSITION_LEFT:"left",POSITION_LEFT_BOTTOM:"left-bottom",POSITION_CORNER_LEFT_TOP:"top-left-corner",POSITION_CORNER_RIGHT_TOP:"top-right-corner",POSITION_CORNER_LEFT_BOTTOM:"bottom-left-corner",POSITION_CORNER_RIGHT_BOTTOM:"bottom-right-corner",TRIGGER_CLICK:"click",TRIGGER_CLICK2:"click2",TRIGGER_HOVER:"hover",TRIGGER_STICKY:"sticky",PROP_TRIGGER:"trigger",PROP_TITLE:"title",PROP_STICKY:"sticky",PROP_INITED:"inited",PROP_DELAY_IN:"delayIn",PROP_DELAY_OUT:"delayOut",PROP_GRAVITY:"gravity",PROP_OFFSET:"offset",PROP_OFFSET_TOP:"offsetTop",PROP_OFFSET_LEFT:"offsetLeft",PROP_POSITION:"position",PROP_CLASS:"class",PROP_ARROW:"arrow",PROP_WIDTH:"width",PROP_IDENTIFIER:"identifier",PROP_ICON:"icon",PROP_AUTOSHOW:"autoShow",PROP_TARGET:"target",EVENT_MOUSEOVER:"mouseover",EVENT_MOUSEOUT:"mouseout",EVENT_MOUSEENTER:"mouseenter",EVENT_MOUSELEAVE:"mouseleave",EVENT_CLICK:"click",EVENT_RESIZE:"resize",EVENT_PROTIP_SHOW:"protipshow",EVENT_PROTIP_HIDE:"protiphide",EVENT_PROTIP_READY:"protipready",DEFAULT_SELECTOR:".protip",DEFAULT_NAMESPACE:"pt",DEFAULT_DELAY_OUT:100,SELECTOR_PREFIX:"protip-",SELECTOR_BODY:"body",SELECTOR_ARROW:"arrow",SELECTOR_CONTAINER:"container",SELECTOR_SHOW:"protip-show",SELECTOR_CLOSE:".protip-close",SELECTOR_SKIN_PREFIX:"protip-skin-",SELECTOR_SIZE_PREFIX:"--size-",SELECTOR_SCHEME_PREFIX:"--scheme-",SELECTOR_ANIMATE:"animated",SELECTOR_TARGET:".protip-target",SELECTOR_MIXIN_PREFIX:"protip-mixin--",SELECTOR_OPEN:"protip-open",TEMPLATE_PROTIP:'<div class="{classes}" data-pt-identifier="{identifier}" style="{widthType}:{width}px">{arrow}{icon}<div class="protip-content">{content}</div></div>',TEMPLATE_ICON:'<i class="icon-{icon}"></i>',ATTR_WIDTH:"width",ATTR_MAX_WIDTH:"max-width",SKIN_DEFAULT:"default",SIZE_DEFAULT:"normal",SCHEME_DEFAULT:"pro",PSEUDO_NEXT:"next",PSEUDO_PREV:"prev",PSEUDO_THIS:"this"};return t.TEMPLATE_ARROW='<span class="'+t.SELECTOR_PREFIX+t.SELECTOR_ARROW+'"></span>',t})},{}],5:[function(t,e,i){(function(s){!function(o,n){"use strict";"function"==typeof define&&define.amd?define(["jquery","./Constants"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants")):o.ProtipGravityParser=n(o.jQuery,o.ProtipConstants)}(this,function(t,e){"use strict";var i=function(t,e){return this._Construct(t,e)};return t.extend(!0,i.prototype,{_Construct:function(t,i){return this._positionsList=[{lvl:1,key:i,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_LEFT_TOP,top:0,left:0},{lvl:2,key:e.POSITION_TOP_LEFT,top:0,left:0},{lvl:1,key:e.POSITION_TOP,top:0,left:0},{lvl:2,key:e.POSITION_TOP_RIGHT,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_RIGHT_TOP,top:0,left:0},{lvl:2,key:e.POSITION_RIGHT_TOP,top:0,left:0},{lvl:1,key:e.POSITION_RIGHT,top:0,left:0},{lvl:2,key:e.POSITION_RIGHT_BOTTOM,top:0,left:0},{lvl:2,key:e.POSITION_BOTTOM_LEFT,top:0,left:0},{lvl:1,key:e.POSITION_BOTTOM,top:0,left:0},{lvl:2,key:e.POSITION_BOTTOM_RIGHT,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_RIGHT_BOTTOM,top:0,left:0},{lvl:2,key:e.POSITION_LEFT_TOP,top:0,left:0},{lvl:1,key:e.POSITION_LEFT,top:0,left:0},{lvl:2,key:e.POSITION_LEFT_BOTTOM,top:0,left:0},{lvl:3,key:e.POSITION_CORNER_LEFT_BOTTOM,top:0,left:0}],this._input=t,this._finals=[],this._parse(),this._finals},_parse:function(){if(this._input===!0||3===this._input)this._finals=this._positionsList;else if(isNaN(this._input)){var t=[],e=!1;this._finals=this._input.split(";").map(function(i){if(i=i.trim(),"..."===i)e=!0;else if(i){var s=i.split(" ").map(function(t){return t.trim()});return t.push(s[0]),{lvl:1,key:s[0],left:parseInt(s[1],10)||0,top:parseInt(s[2],10)||0}}}).filter(function(t){return!!t}),e&&this._positionsList.forEach(function(e){t.indexOf(e.key)===-1&&this._finals.push(e)}.bind(this))}else this._finals=this._positionsList.filter(function(t){return t.lvl<=this._input}.bind(this))}}),i})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":4}],6:[function(t,e,i){(function(s){!function(o,n){"use strict";"function"==typeof define&&define.amd?define(["jquery","./Constants","./GravityParser","./PositionCalculator"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants"),t("./GravityParser"),t("./PositionCalculator")):o.ProtipGravityTester=n(o.jQuery,o.ProtipConstants,o.ProtipGravityParser,o.ProtipPositionCalculator)}(this,function(t,e,i,s){"use strict";var o=function(t){return this._Construct(t)};return t.extend(!0,o.prototype,{_Construct:function(t){this._item=t,this._result=void 0,this._setWindowDimensions(),this._positionList=new i(this._item.data.gravity,this._item.data.position);var e;for(e=0;e<this._positionList.length&&!this._test(this._positionList[e]);e++);return this._item.data.position=this._positionList[0].key,this._result||new s(this._item)},_test:function(t){this._setProtipMinWidth();var e=new s(this._item,t.key,t);return this._item.el.protip.css(e),this._setProtipDimensions(),!!(this._topOk()&&this._rightOk()&&this._bottomOk()&&this._leftOk())&&(e.position=t.key,this._result=e,!0)},_topOk:function(){return this._dimensions.offset.top-this._windowDimensions.scrollTop>0},_rightOk:function(){return this._dimensions.offset.left+this._dimensions.width<this._windowDimensions.width},_bottomOk:function(){return this._dimensions.offset.top-this._windowDimensions.scrollTop+this._dimensions.height<this._windowDimensions.height},_leftOk:function(){return this._dimensions.offset.left>0},_setProtipMinWidth:function(){if(this._item.classInstance.settings.forceMinWidth){this._item.el.protip.css({position:"fixed",left:0,top:0,minWidth:0});var t=this._item.el.protip.outerWidth()+1;this._item.el.protip.css({position:"",left:"",top:"",minWidth:t+"px"})}},_setProtipDimensions:function(){this._dimensions={width:this._item.el.protip.outerWidth()||0,height:this._item.el.protip.outerHeight()||0,offset:this._item.el.protip.offset()}},_setWindowDimensions:function(){var t=window,e=document,i=e.documentElement,s=e.getElementsByTagName("body")[0],o=t.innerWidth||i.clientWidth||s.clientWidth,n=t.innerHeight||i.clientHeight||s.clientHeight;this._windowDimensions={width:parseInt(o),height:parseInt(n),scrollTop:window.pageYOffset||document.documentElement.scrollTop||document.getElementsByTagName("body")[0].scrollTop||0}}}),o})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":4,"./GravityParser":5,"./PositionCalculator":9}],7:[function(t,e,i){(function(s){!function(o,n){"use strict";"function"==typeof define&&define.amd?define(["jquery","./Constants","./GravityTester","./PositionCalculator"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants"),t("./GravityTester"),t("./PositionCalculator")):o.ProtipItemClass=n(o.jQuery,o.ProtipConstants,o.ProtipGravityTester,o.ProtipPositionCalculator)}(this,function(t,e,i,s){"use strict";function o(t,e){return t.replace(/\{([\w\.]*)}/g,function(t,i){for(var s=i.split("."),o=e[s.shift()],n=0,h=s.length;n<h;n++)o=o[s[n]];return"undefined"!=typeof o&&null!==o?o:""})}var n=function(t,e,i,s){return this._Construct(t,e,i,s)};return t.extend(!0,n.prototype,{_Construct:function(t,i,s,o){return this._override=o||{},this._override.identifier=t,this.el={},this.el.source=i,this.data={},this.classInstance=s,this._isVisible=!1,this._task={delayIn:void 0,delayOut:void 0},this._fetchData(),this._prepareInternals(),this._appendProtip(),this._initSticky(),this._initAutoShow(),this._bind(),this.el.source.addClass(this.classInstance.settings.selector.replace(".","")).data(this._namespaced(e.PROP_INITED),!0),setTimeout(function(){this.el.source.trigger(e.EVENT_PROTIP_READY,this)}.bind(this),10),this},actionHandler:function(t){if(this.data.trigger===e.TRIGGER_STICKY);else if(t!==e.EVENT_CLICK||this.data.trigger!==e.TRIGGER_CLICK&&this.data.trigger!==e.TRIGGER_CLICK2){if(this.data.trigger!==e.TRIGGER_CLICK&&this.data.trigger!==e.TRIGGER_CLICK2)switch(t){case e.EVENT_MOUSEOUT:this.hide();break;case e.EVENT_MOUSEOVER:this.show()}}else this.toggle()},destroy:function(){this.hide(!0),this._unbind(),this.el.protip.remove(),this.el.source.data(this._namespaced(e.PROP_INITED),!1).data(this._namespaced(e.PROP_IDENTIFIER),!1).removeData(),this.classInstance.onItemDestoryed(this.data.identifier),t.each(this._task,function(t,e){clearTimeout(e)})},isVisible:function(){return this._isVisible},toggle:function(){this._isVisible?this.hide():this.show()},show:function(t,o){if(this.data.title){if(this._task.delayOut&&clearTimeout(this._task.delayOut),this._task.delayIn&&clearTimeout(this._task.delayIn),this._task.autoHide&&clearTimeout(this._task.autoHide),!t&&this.data.delayIn)return void(this._task.delayIn=setTimeout(function(){this.show(!0)}.bind(this),this.data.delayIn));this.data.autoHide!==!1&&(this._task.autoHide=setTimeout(function(){this.hide(!0)}.bind(this),this.data.autoHide));var n;this.data.gravity?(n=new i(this),delete n.position):n=new s(this),this.el.source.addClass(e.SELECTOR_OPEN),!o&&this.el.source.trigger(e.EVENT_PROTIP_SHOW,this),this.el.protip.css(n).addClass(e.SELECTOR_SHOW),this.data.animate&&this.el.protip.addClass(e.SELECTOR_ANIMATE).addClass(this.data.animate||this.classInstance.settings.animate),this._isVisible=!0}},applyPosition:function(t){this.el.protip.attr("data-"+e.DEFAULT_NAMESPACE+"-"+e.PROP_POSITION,t)},hide:function(t,i){return this._task.delayOut&&clearTimeout(this._task.delayOut),this._task.delayIn&&clearTimeout(this._task.delayIn),this._task.autoHide&&clearTimeout(this._task.autoHide),!t&&this.data.delayOut?void(this._task.delayOut=setTimeout(function(){this.hide(!0)}.bind(this),this.data.delayOut)):(this.el.source.removeClass(e.SELECTOR_OPEN),!i&&this.el.source.trigger(e.EVENT_PROTIP_HIDE,this),this.el.protip.removeClass(e.SELECTOR_SHOW).removeClass(e.SELECTOR_ANIMATE).removeClass(this.data.animate),void(this._isVisible=!1))},getArrowOffset:function(){return{width:this.el.protipArrow.outerWidth()||0,height:this.el.protipArrow.outerHeight()||0}},_fetchData:function(){t.each(this.classInstance.settings.defaults,t.proxy(function(t){this.data[t]=this.el.source.data(this._namespaced(t))},this)),this.data=t.extend({},this.classInstance.settings.defaults,this.data),this.data=t.extend({},this.data,this._override),t.each(this.data,t.proxy(function(t,e){this.el.source.data(this._namespaced(t),e)},this))},_prepareInternals:function(){this._setTarget(),this._detectTitle(),this._checkInteractive()},_checkInteractive:function(){this.data.interactive&&(this.data.delayOut=this.data.delayOut||e.DEFAULT_DELAY_OUT)},_initSticky:function(){this.data.trigger===e.TRIGGER_STICKY&&this.show()},_initAutoShow:function(){this.data.autoShow&&this.show()},_appendProtip:function(){this.el.protip=o(this.classInstance.settings.protipTemplate,{classes:this._getClassList(),widthType:this._getWidthType(),width:this._getWidth(),content:this.data.title,icon:this._getIconTemplate(),arrow:this.data.arrow?e.TEMPLATE_ARROW:"",identifier:this.data.identifier}),this.el.protip=t(this.el.protip),this.el.protipArrow=this.el.protip.find("."+e.SELECTOR_PREFIX+e.SELECTOR_ARROW),this.el.target.append(this.el.protip)},_getClassList:function(){var t=[],i=this.data.skin,s=this.data.size,o=this.data.scheme;return t.push(e.SELECTOR_PREFIX+e.SELECTOR_CONTAINER),t.push(e.SELECTOR_SKIN_PREFIX+i),t.push(e.SELECTOR_SKIN_PREFIX+i+e.SELECTOR_SIZE_PREFIX+s),t.push(e.SELECTOR_SKIN_PREFIX+i+e.SELECTOR_SCHEME_PREFIX+o),this.data.classes&&t.push(this.data.classes),this.data.mixin&&t.push(this._parseMixins()),t.join(" ")},_parseMixins:function(){var t=[];return this.data.mixin&&this.data.mixin.split(" ").forEach(function(i){i&&t.push(e.SELECTOR_MIXIN_PREFIX+i)},this),t.join(" ")},_getWidthType:function(){return isNaN(this.data.width)?e.ATTR_WIDTH:e.ATTR_MAX_WIDTH},_getWidth:function(){return parseInt(this.data.width,10)},_getIconTemplate:function(){return this.data.icon?o(this.classInstance.settings.iconTemplate,{icon:this.data.icon}):""},_detectTitle:function(){if(!this.data.title||"#"!==this.data.title.charAt(0)&&"."!==this.data.title.charAt(0)){if(this.data.title&&":"===this.data.title.charAt(0)){var i=this.data.title.substring(1);switch(i){case e.PSEUDO_NEXT:this.data.title=this.el.source.next().html();break;case e.PSEUDO_PREV:this.data.title=this.el.source.prev().html();break;case e.PSEUDO_THIS:this.data.title=this.el.source.html()}}}else this.data.titleSource=this.data.titleSource||this.data.title,this.data.title=t(this.data.title).html();this.data.title&&this.data.title.indexOf("<a ")+1&&(this.data.interactive=!0)},_setTarget:function(){var i=this._getData(e.PROP_TARGET);i=i===!0?this.el.source:i===e.SELECTOR_BODY&&this.el.source.closest(e.SELECTOR_TARGET).length?this.el.source.closest(e.SELECTOR_TARGET):t(i?i:e.SELECTOR_BODY),"static"===i.css("position")&&i.css({position:"relative"}),this.el.target=i},_getData:function(t){return this.el.source.data(this._namespaced(t))},_namespaced:function(t){return this.classInstance.namespaced(t)},_onProtipMouseenter:function(){clearTimeout(this._task.delayOut)},_onProtipMouseleave:function(){this.data.trigger===e.TRIGGER_HOVER&&this.hide()},_bind:function(){this.data.interactive&&this.el.protip.on(e.EVENT_MOUSEENTER,t.proxy(this._onProtipMouseenter,this)).on(e.EVENT_MOUSELEAVE,t.proxy(this._onProtipMouseleave,this)),this.data.observer&&(this._observerInstance=new MutationObserver(function(){this.classInstance.reloadItemInstance(this.el.source)}.bind(this)),this._observerInstance.observe(this.el.source.get(0),{attributes:!0,childList:!1,characterData:!1,subtree:!1}))},_unbind:function(){this.data.interactive&&this.el.protip.off(e.EVENT_MOUSEENTER,t.proxy(this._onProtipMouseenter,this)).off(e.EVENT_MOUSELEAVE,t.proxy(this._onProtipMouseleave,this)),this.data.observer&&this._observerInstance.disconnect()}}),n})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":4,"./GravityTester":6,"./PositionCalculator":9}],8:[function(t,e,i){(function(s){!function(o,n){"use strict";"function"==typeof define&&define.amd?define(["jquery","./Class","./Buffer","./Constants"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Class"),t("./Buffer"),t("./Constants")):n(o.jQuery,o.ProtipClass,o.ProtipBuffer,o.ProtipContants)}(this,function(t,e,i,s){"use strict";t=t.extend(t,{_protipClassInstance:void 0,_protipBuffer:new i,protip:function(t){return this._protipClassInstance||(this._protipClassInstance=new e(t),this.protip.C=s),this._protipClassInstance}}),t.fn.extend({protipSet:function(e){return t._protipBuffer.isReady()?this.each(function(i,s){s=t(s),t._protipClassInstance.getItemInstance(s).destroy(),t._protipClassInstance.getItemInstance(s,e)}):(t._protipBuffer.add("protipSet",this,arguments),this)},protipShow:function(e){return t._protipBuffer.isReady()?this.each(function(i,s){s=t(s),t._protipClassInstance.getItemInstance(s).destroy(),t._protipClassInstance.getItemInstance(s,e).show(!0)}):(t._protipBuffer.add("protipShow",this,arguments),this)},protipHide:function(){return t._protipBuffer.isReady()?this.each(function(e,i){t._protipClassInstance.getItemInstance(t(i)).hide(!0)}):(t._protipBuffer.add("protipHide",this,arguments),this)},protipToggle:function(){if(t._protipBuffer.isReady()){var e;return this.each(function(i,s){e=t._protipClassInstance.getItemInstance(t(s)),e=e.isVisible()?e.hide(!0):e.show(!0)}.bind(this))}return t._protipBuffer.add("protipToggle",this,arguments),this},protipHideInside:function(){return t._protipBuffer.isReady()?this.each(function(e,i){t(i).find(t._protipClassInstance.settings.selector).each(function(e,i){t._protipClassInstance.getItemInstance(t(i)).hide(!0)})}):(t._protipBuffer.add("protipHideInside",this,arguments),this)},protipShowInside:function(){return t._protipBuffer.isReady()?this.each(function(e,i){t(i).find(t._protipClassInstance.settings.selector).each(function(e,i){t._protipClassInstance.getItemInstance(t(i)).show(!0)})}):(t._protipBuffer.add("protipShowInside",this,arguments),this)},protipToggleInside:function(){if(t._protipBuffer.isReady()){var e;return this.each(function(i,s){t(s).find(t._protipClassInstance.settings.selector).each(function(i,s){e=t._protipClassInstance.getItemInstance(t(s)),e=e.isVisible()?e.hide(!0):e.show(!0)})})}return t._protipBuffer.add("protipToggleInside",this,arguments),this}})})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Buffer":2,"./Class":3,"./Constants":4}],9:[function(t,e,i){(function(s){!function(o,n){"use strict";"function"==typeof define&&define.amd?define(["jquery","./Constants"],n):"object"==typeof i?e.exports=n("undefined"!=typeof window?window.jQuery:"undefined"!=typeof s?s.jQuery:null,t("./Constants")):o.ProtipPositionCalculator=n(o.jQuery,o.ProtipConstants)}(this,function(t,e){"use strict";var i=function(t,e,i){return this._Construct(t,e,i)};return t.extend(!0,i.prototype,{_Construct:function(t,e,i){return this._itemInstance=t,this._protip=this._getProto(this._itemInstance.el.protip),this._source=this._getProto(this._itemInstance.el.source),this._target=this._getProto(this._itemInstance.el.target),this._position=e||this._itemInstance.data.position,this._placement=this._itemInstance.data.placement,this._offset=i||{top:this._itemInstance.data.offsetTop,left:this._itemInstance.data.offsetLeft},this._getPosition()},_getProto:function(t){var e={el:void 0,width:void 0,height:void 0,offset:void 0};return e.el=t,e.width=t.outerWidth()||0,e.height=t.outerHeight()||0,e.offset=t.offset(),e},_getPosition:function(){this._itemInstance.applyPosition(this._position);var t={left:0,top:0},i=this._itemInstance.getArrowOffset(),s=this._itemInstance.classInstance.settings.offset;if(this._placement!==e.PLACEMENT_CENTER)switch(this._position){case e.POSITION_TOP:this._offset.top+=(s+i.height)*-1,t.left=this._source.offset.left+this._source.width/2-this._protip.width/2-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2);break;case e.POSITION_TOP_LEFT:this._offset.top+=(s+i.height)*-1,t.left=this._source.offset.left-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2);break;case e.POSITION_TOP_RIGHT:this._offset.top+=(s+i.height)*-1,t.left=this._source.offset.left+this._source.width-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2);break;case e.POSITION_RIGHT:this._offset.left+=s+i.width,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height/2-this._protip.height/2-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2);break;case e.POSITION_RIGHT_TOP:this._offset.left+=s+i.width,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2);break;case e.POSITION_RIGHT_BOTTOM:this._offset.left+=s+i.width,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2);break;case e.POSITION_BOTTOM:this._offset.top+=s+i.height,t.left=this._source.offset.left+this._source.width/2-this._protip.width/2-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2);break;case e.POSITION_BOTTOM_LEFT:this._offset.top+=s+i.height,t.left=this._source.offset.left-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2);break;case e.POSITION_BOTTOM_RIGHT:this._offset.top+=s+i.height,t.left=this._source.offset.left+this._source.width-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2);break;case e.POSITION_LEFT:this._offset.left+=(s+i.width)*-1,t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height/2-this._protip.height/2-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2);break;case e.POSITION_LEFT_TOP:this._offset.left+=(s+i.width)*-1,t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2);break;case e.POSITION_LEFT_BOTTOM:this._offset.left+=(s+i.width)*-1,t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2);break;case e.POSITION_CORNER_LEFT_TOP:this._offset.top+=(s+i.height)*-1,t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2);break;case e.POSITION_CORNER_LEFT_BOTTOM:this._offset.top+=s+i.height,t.left=this._source.offset.left-this._protip.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left+=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left+=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2);break;case e.POSITION_CORNER_RIGHT_BOTTOM:this._offset.top+=s+i.height,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height-this._target.offset.top+this._offset.top,
2
+ this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top-=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top-=this._protip.height/2);break;case e.POSITION_CORNER_RIGHT_TOP:this._offset.top+=(s+i.height)*-1,t.left=this._source.offset.left+this._source.width-this._target.offset.left+this._offset.left,t.top=this._source.offset.top-this._protip.height-this._target.offset.top+this._offset.top,this._placement===e.PLACEMENT_INSIDE&&(t.left-=this._protip.width),this._placement===e.PLACEMENT_INSIDE&&(t.top+=this._protip.height),this._placement===e.PLACEMENT_BORDER&&(t.left-=this._protip.width/2),this._placement===e.PLACEMENT_BORDER&&(t.top+=this._protip.height/2)}else t.left=this._source.offset.left+this._source.width/2-this._protip.width/2-this._target.offset.left+this._offset.left,t.top=this._source.offset.top+this._source.height/2-this._protip.height/2-this._target.offset.top+this._offset.top;return t.left=t.left+"px",t.top=t.top+"px",t}}),i})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./Constants":4}]},{},[1]);
metadata CHANGED
@@ -1,70 +1,123 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-protip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ethi
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2015-12-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: railties
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '6.0'
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: '9.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: '6.0'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '9.0'
13
32
  - !ruby/object:Gem::Dependency
14
33
  name: bundler
15
34
  requirement: !ruby/object:Gem::Requirement
16
35
  requirements:
17
36
  - - "~>"
18
37
  - !ruby/object:Gem::Version
19
- version: '1.10'
38
+ version: '2.4'
39
+ type: :development
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - "~>"
44
+ - !ruby/object:Gem::Version
45
+ version: '2.4'
46
+ - !ruby/object:Gem::Dependency
47
+ name: bundler-audit
48
+ requirement: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '0.9'
20
53
  type: :development
21
54
  prerelease: false
22
55
  version_requirements: !ruby/object:Gem::Requirement
23
56
  requirements:
24
57
  - - "~>"
25
58
  - !ruby/object:Gem::Version
26
- version: '1.10'
59
+ version: '0.9'
27
60
  - !ruby/object:Gem::Dependency
28
61
  name: rake
29
62
  requirement: !ruby/object:Gem::Requirement
30
63
  requirements:
31
64
  - - "~>"
32
65
  - !ruby/object:Gem::Version
33
- version: '10.0'
66
+ version: '13.0'
34
67
  type: :development
35
68
  prerelease: false
36
69
  version_requirements: !ruby/object:Gem::Requirement
37
70
  requirements:
38
71
  - - "~>"
39
72
  - !ruby/object:Gem::Version
40
- version: '10.0'
73
+ version: '13.0'
41
74
  - !ruby/object:Gem::Dependency
42
75
  name: rspec
43
76
  requirement: !ruby/object:Gem::Requirement
44
77
  requirements:
45
- - - ">="
78
+ - - "~>"
46
79
  - !ruby/object:Gem::Version
47
- version: '0'
80
+ version: '3.12'
48
81
  type: :development
49
82
  prerelease: false
50
83
  version_requirements: !ruby/object:Gem::Requirement
51
84
  requirements:
52
- - - ">="
85
+ - - "~>"
86
+ - !ruby/object:Gem::Version
87
+ version: '3.12'
88
+ - !ruby/object:Gem::Dependency
89
+ name: rubocop
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - "~>"
93
+ - !ruby/object:Gem::Version
94
+ version: '1.50'
95
+ type: :development
96
+ prerelease: false
97
+ version_requirements: !ruby/object:Gem::Requirement
98
+ requirements:
99
+ - - "~>"
53
100
  - !ruby/object:Gem::Version
54
- version: '0'
55
- description: Tooltip gem based on jquery protip
101
+ version: '1.50'
102
+ description: A Rails asset gem that integrates the jQuery Protip tooltip plugin for
103
+ creating beautiful, customizable tooltips
56
104
  email:
57
105
  - ethirajsrinivasan@gmail.com
58
106
  executables: []
59
107
  extensions: []
60
108
  extra_rdoc_files: []
61
109
  files:
110
+ - ".github/workflows/ci.yml"
62
111
  - ".gitignore"
63
- - ".travis.yml"
112
+ - ".rspec"
113
+ - ".rubocop.yml"
114
+ - CHANGELOG.md
115
+ - CODE_OF_CONDUCT.md
64
116
  - Gemfile
65
117
  - LICENSE.txt
66
118
  - README.md
67
119
  - Rakefile
120
+ - UPGRADE_GUIDE.md
68
121
  - app/assets/javascripts/protip.js.erb
69
122
  - app/assets/stylesheets/protip.css
70
123
  - bin/console
@@ -80,7 +133,12 @@ licenses:
80
133
  - MIT
81
134
  metadata:
82
135
  allowed_push_host: https://rubygems.org
83
- post_install_message:
136
+ homepage_uri: https://github.com/ethirajsrinivasan/rails-protip
137
+ source_code_uri: https://github.com/ethirajsrinivasan/rails-protip
138
+ bug_tracker_uri: https://github.com/ethirajsrinivasan/rails-protip/issues
139
+ changelog_uri: https://github.com/ethirajsrinivasan/rails-protip/blob/master/CHANGELOG.md
140
+ documentation_uri: https://github.com/ethirajsrinivasan/rails-protip/blob/master/README.md
141
+ rubygems_mfa_required: 'true'
84
142
  rdoc_options: []
85
143
  require_paths:
86
144
  - lib
@@ -88,16 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
88
146
  requirements:
89
147
  - - ">="
90
148
  - !ruby/object:Gem::Version
91
- version: 1.9.3
149
+ version: '3.0'
92
150
  required_rubygems_version: !ruby/object:Gem::Requirement
93
151
  requirements:
94
152
  - - ">="
95
153
  - !ruby/object:Gem::Version
96
154
  version: '0'
97
155
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.4.8
100
- signing_key:
156
+ rubygems_version: 3.6.7
101
157
  specification_version: 4
102
158
  summary: Tooltip gem based on jquery protip
103
159
  test_files: []
data/.travis.yml DELETED
@@ -1,8 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.0.0
5
- - 2.1.4
6
- - 2.1.5
7
- - 2.2.1
8
- before_install: gem install bundler -v 1.10.6