├── .github
└── workflows
│ └── stale.yml
├── .gitignore
├── .travis.yml
├── CHANGELOG.md
├── Gemfile
├── MIT-LICENSE
├── README.md
├── Rakefile
├── app
└── assets
│ └── images
│ ├── blank.gif
│ ├── fancy_close.png
│ ├── fancy_loading.png
│ ├── fancy_nav_left.png
│ ├── fancy_nav_right.png
│ ├── fancy_shadow_e.png
│ ├── fancy_shadow_n.png
│ ├── fancy_shadow_ne.png
│ ├── fancy_shadow_nw.png
│ ├── fancy_shadow_s.png
│ ├── fancy_shadow_se.png
│ ├── fancy_shadow_sw.png
│ ├── fancy_shadow_w.png
│ ├── fancy_title_left.png
│ ├── fancy_title_main.png
│ ├── fancy_title_over.png
│ ├── fancy_title_right.png
│ ├── fancybox-x.png
│ ├── fancybox-y.png
│ └── fancybox.png
├── fancybox-rails.gemspec
├── lib
├── fancybox-rails.rb
├── fancybox-rails
│ └── engine.rb
└── generators
│ └── fancybox_rails_generator.rb
├── test
├── dummy
│ ├── README.rdoc
│ ├── Rakefile
│ ├── app
│ │ ├── assets
│ │ │ ├── images
│ │ │ │ └── .keep
│ │ │ ├── javascripts
│ │ │ │ ├── application.js
│ │ │ │ └── fancybox-test.js.coffee
│ │ │ └── stylesheets
│ │ │ │ └── application.css
│ │ ├── controllers
│ │ │ ├── application_controller.rb
│ │ │ ├── concerns
│ │ │ │ └── .keep
│ │ │ └── fancybox_controller.rb
│ │ ├── helpers
│ │ │ └── application_helper.rb
│ │ ├── mailers
│ │ │ └── .keep
│ │ ├── models
│ │ │ ├── .keep
│ │ │ └── concerns
│ │ │ │ └── .keep
│ │ └── views
│ │ │ ├── fancybox
│ │ │ └── index.html.erb
│ │ │ └── layouts
│ │ │ └── application.html.erb
│ ├── bin
│ │ ├── bundle
│ │ ├── rails
│ │ ├── rake
│ │ └── setup
│ ├── config.ru
│ ├── config
│ │ ├── application.rb
│ │ ├── boot.rb
│ │ ├── database.yml
│ │ ├── environment.rb
│ │ ├── environments
│ │ │ ├── development.rb
│ │ │ ├── production.rb
│ │ │ └── test.rb
│ │ ├── initializers
│ │ │ ├── assets.rb
│ │ │ ├── backtrace_silencers.rb
│ │ │ ├── cookies_serializer.rb
│ │ │ ├── filter_parameter_logging.rb
│ │ │ ├── inflections.rb
│ │ │ ├── mime_types.rb
│ │ │ ├── session_store.rb
│ │ │ └── wrap_parameters.rb
│ │ ├── locales
│ │ │ └── en.yml
│ │ ├── routes.rb
│ │ └── secrets.yml
│ ├── lib
│ │ └── assets
│ │ │ └── .keep
│ ├── log
│ │ └── .keep
│ └── public
│ │ ├── 404.html
│ │ ├── 422.html
│ │ ├── 500.html
│ │ └── favicon.ico
├── fancybox_rails_test.rb
├── integration
│ └── fancybox_test.rb
└── test_helper.rb
└── vendor
└── assets
├── javascripts
├── fancybox.js
├── jquery.browser.js
└── jquery.fancybox.js
└── stylesheets
├── fancybox.css
└── jquery.fancybox.css.erb
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: Mark stale issues and pull requests
2 |
3 | on:
4 | schedule:
5 | - cron: "30 1 * * *"
6 |
7 | jobs:
8 | stale:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/stale@v1
14 | with:
15 | repo-token: ${{ secrets.GITHUB_TOKEN }}
16 | stale-issue-message: 'There has been no activity on this issue for more than 60 days. If there is no further activity in the next 7 days then it will be closed.'
17 | stale-pr-message: 'There has been no activity on this pull request for more than 60 days. If there is no further activity in the next 7 days then it will be closed.'
18 | stale-issue-label: 'no-issue-activity'
19 | stale-pr-label: 'no-pr-activity'
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .bundle/
2 | log/*.log
3 | pkg/
4 | test/dummy/db/*.sqlite3
5 | test/dummy/log/*.log
6 | test/dummy/tmp/
7 | Gemfile.lock
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: ruby
2 | sudo: false
3 | before_install:
4 | - "export DISPLAY=:99.0"
5 | - "sh -e /etc/init.d/xvfb start"
6 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 0.2.1 / 2013-03-09
2 |
3 | * Add generator for copying FancyBox assets for customization.
4 |
5 | # 0.2.0 / 2013-03-09
6 |
7 | * Shim `$.browser` if it's missing for jQuery 1.9 compatibility
8 |
9 | # 0.1.3 / 2011-08-11
10 |
11 | * Fixed asset paths for use in production environment
12 |
13 | # 0.1.0 / 2011-05-24
14 |
15 | * Added support for `require fancybox`, which is just an alias for
16 | `require jquery.fancybox`.
17 |
18 | # 0.0.1 / 2011-05-19
19 |
20 | * Initial release
21 |
--------------------------------------------------------------------------------
/Gemfile:
--------------------------------------------------------------------------------
1 | source 'http://rubygems.org'
2 |
3 | gem 'rails', '>= 3.1.0'
4 |
5 | gem 'sqlite3'
6 |
7 | # Gems used only for assets and not required
8 | # in production environments by default.
9 | group :assets do
10 | gem 'sass-rails', ">= 3.1.0"
11 | gem 'coffee-rails', ">= 3.1.0"
12 | gem 'uglifier'
13 | end
14 |
15 | gem 'jquery-rails'
16 |
17 | group :test do
18 | # Pretty printed test output
19 | gem 'turn', :require => false
20 | gem 'minitest'
21 | gem 'capybara'
22 | gem 'poltergeist'
23 | end
24 |
--------------------------------------------------------------------------------
/MIT-LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2011 Chris Mytton
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # fancybox-rails
2 |
3 | Use [fancybox 1.3.4](http://fancybox.net/) with rails 3.1+ asset pipeline.
4 |
5 | ## Installation
6 |
7 | This gem vendors jquery fancybox for Rails 3.1 and greater. The files
8 | will be added to the asset pipeline and available for you to use.
9 |
10 | First add the following lines to your applications `Gemfile`:
11 |
12 | ``` ruby
13 | gem 'jquery-rails'
14 | gem 'fancybox-rails'
15 | ```
16 |
17 | Then run `bundle install` to update your application's bundle.
18 |
19 | Now you need to edit your `app/assets/javascripts/application.js`
20 | file and add the following line:
21 |
22 | ``` javascript
23 | //= require jquery
24 | //= require fancybox
25 | ```
26 |
27 | And then edit your `app/assets/stylesheets/application.css` file to
28 | look something like:
29 |
30 | ``` css
31 | /*
32 | *= require_self
33 | *= require fancybox
34 | *= require_tree .
35 | */
36 | ```
37 |
38 | ## Usage
39 |
40 | With the gem installed and included in your asset manifests, you can now
41 | use fancybox as you normally would.
42 |
43 | ``` javascript
44 | jQuery(function() {
45 | $("a.fancybox").fancybox();
46 | });
47 | ```
48 |
49 | If you're using [CoffeeScript](http://coffeescript.org/) you can use the
50 | plugin in the same way.
51 |
52 | ```coffeescript
53 | jQuery ->
54 | $('a.fancybox').fancybox()
55 | ```
56 |
57 | ## Customization
58 |
59 | If you want to customize the fancybox assets you can copy the assets
60 | from the gem into your application's `lib/assets/` directory.
61 |
62 | $ rails generate fancybox_rails
63 |
64 | If you want to see what files will be created without actually creating
65 | them, run the generator with the `--pretend` option.
66 |
67 | ## fancyBox 2.0
68 |
69 | If you want to use [fancyBox 2.0](http://fancyapps.com/fancybox/) then
70 | check out [fancybox2-rails](https://github.com/kyparn/fancybox2-rails).
71 |
72 | Please be aware that the [license](http://fancyapps.com/fancybox/#license) has changed in the new version and
73 | you'll need to purchase one if you intend to use *that fork* for
74 | commercial purposes.
75 |
76 | ## Contributing
77 |
78 | 1. Fork it
79 | 2. Create your feature branch (`git checkout -b my-new-feature`)
80 | 3. Commit your changes (`git commit -am 'Added some feature'`)
81 | 4. Push to the branch (`git push origin my-new-feature`)
82 | 5. Create new Pull Request
83 |
84 | ## More information
85 |
86 | ### Build status
87 |
88 | [](https://travis-ci.org/chrismytton/fancybox-rails)
89 |
90 | ### Useful links
91 |
92 | * [Contributors](https://github.com/chrismytton/fancybox-rails/contributors)
93 | * [DHH's RailsConf 2011 talk on the rails 3.1 asset pipeline](http://www.youtube.com/watch?v=cGdCI2HhfAU)
94 |
95 | Copyright (c) Chris Mytton
96 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | # encoding: UTF-8
2 | begin
3 | require 'bundler/setup'
4 | rescue LoadError
5 | puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6 | end
7 |
8 | # For checking remote fancybox version.
9 | require 'nokogiri'
10 | require 'open-uri'
11 |
12 | # Path to atom feed with fancybox updates.
13 | $fancybox_feed = "http://code.google.com/feeds/p/fancybox/downloads/basic"
14 |
15 | Bundler::GemHelper.install_tasks
16 |
17 | require 'rake/testtask'
18 |
19 | Rake::TestTask.new(:test) do |t|
20 | t.libs << 'lib'
21 | t.libs << 'test'
22 | t.pattern = 'test/**/*_test.rb'
23 | t.verbose = false
24 | end
25 |
26 | task :default => :test
27 |
28 | namespace :fancybox do
29 | desc "Get the local and remote fancybox versions."
30 | task :version do
31 | local = local_version
32 | remote = remote_version
33 |
34 | puts "local: v#{local}"
35 | puts "remote: v#{remote}"
36 |
37 | if local != remote
38 | warn "\nthere is a newer remote version available"
39 | end
40 | end
41 | end
42 |
43 | # Get the current local version of the vendored fancybox library.
44 | #
45 | # Returns the String representing the local version.
46 | def local_version
47 | `grep ' * Version' vendor/assets/javascripts/jquery.fancybox.js | \
48 | cut -d ' ' -f 4`.chomp
49 | end
50 |
51 | # Get the current version of the remote version of the library. Uses
52 | # nokogiri and open-uri to grab the atom feed from google code, then
53 | # parses the version out of the title.
54 | #
55 | # Returns the String representing the remote version.
56 | def remote_version
57 | doc = Nokogiri::HTML(open($fancybox_feed))
58 | doc.css('entry:first title').text.match(/\d\.\d\.\d/)[0]
59 | end
60 |
--------------------------------------------------------------------------------
/app/assets/images/blank.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/blank.gif
--------------------------------------------------------------------------------
/app/assets/images/fancy_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_close.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_loading.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_nav_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_nav_left.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_nav_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_nav_right.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_e.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_e.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_n.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_n.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_ne.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_ne.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_nw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_nw.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_s.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_se.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_se.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_sw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_sw.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_shadow_w.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_shadow_w.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_title_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_title_left.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_title_main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_title_main.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_title_over.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_title_over.png
--------------------------------------------------------------------------------
/app/assets/images/fancy_title_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancy_title_right.png
--------------------------------------------------------------------------------
/app/assets/images/fancybox-x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancybox-x.png
--------------------------------------------------------------------------------
/app/assets/images/fancybox-y.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancybox-y.png
--------------------------------------------------------------------------------
/app/assets/images/fancybox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/app/assets/images/fancybox.png
--------------------------------------------------------------------------------
/fancybox-rails.gemspec:
--------------------------------------------------------------------------------
1 | # -*- encoding: utf-8 -*-
2 |
3 | Gem::Specification.new do |s|
4 | s.name = "fancybox-rails"
5 | s.authors = ["Chris Mytton", "Les Hill", "Dennis Reimann", "Mattias Svedhem", "Greg Reinacker"]
6 | s.email = ["chrismytton@gmail.com"]
7 | s.homepage = "https://github.com/chrismytton/fancybox-rails"
8 |
9 | s.summary = "Use FancyBox with the Rails asset pipeline"
10 | s.description = "This gem provides jQuery FancyBox for your Rails application."
11 | s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
12 | s.version = "0.3.1"
13 |
14 | s.add_dependency "railties", ">= 3.1.0"
15 | end
16 |
--------------------------------------------------------------------------------
/lib/fancybox-rails.rb:
--------------------------------------------------------------------------------
1 | if defined? Rails && Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR >= 1
2 | require 'fancybox-rails/engine'
3 | end
4 |
--------------------------------------------------------------------------------
/lib/fancybox-rails/engine.rb:
--------------------------------------------------------------------------------
1 | module Fancybox
2 | module Rails
3 | class Engine < ::Rails::Engine
4 | end
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/lib/generators/fancybox_rails_generator.rb:
--------------------------------------------------------------------------------
1 | class FancyboxRailsGenerator < Rails::Generators::Base
2 | source_root File.expand_path("../../../vendor/assets", __FILE__)
3 |
4 | desc "Copy FancyBox into lib/ for customization"
5 | def copy_assets
6 | dir = Pathname.new(self.class.source_root)
7 | Dir[self.class.source_root + '/**/*'].each do |entry|
8 | next if File.directory?(entry)
9 | file = Pathname.new(entry).relative_path_from(dir)
10 | copy_file file, "lib/assets/#{file}"
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/test/dummy/README.rdoc:
--------------------------------------------------------------------------------
1 | == README
2 |
3 | This README would normally document whatever steps are necessary to get the
4 | application up and running.
5 |
6 | Things you may want to cover:
7 |
8 | * Ruby version
9 |
10 | * System dependencies
11 |
12 | * Configuration
13 |
14 | * Database creation
15 |
16 | * Database initialization
17 |
18 | * How to run the test suite
19 |
20 | * Services (job queues, cache servers, search engines, etc.)
21 |
22 | * Deployment instructions
23 |
24 | * ...
25 |
26 |
27 | Please feel free to use a different markup language if you do not plan to run
28 | rake doc:app .
29 |
--------------------------------------------------------------------------------
/test/dummy/Rakefile:
--------------------------------------------------------------------------------
1 | # Add your own tasks in files placed in lib/tasks ending in .rake,
2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 |
4 | require File.expand_path('../config/application', __FILE__)
5 |
6 | Rails.application.load_tasks
7 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/images/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/app/assets/images/.keep
--------------------------------------------------------------------------------
/test/dummy/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | // This is a manifest file that'll be compiled into application.js, which will include all the files
2 | // listed below.
3 | //
4 | // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5 | // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6 | //
7 | // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8 | // compiled file.
9 | //
10 | // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11 | // about supported directives.
12 | //
13 | //= require jquery
14 | //= require jquery_ujs
15 | //= require fancybox
16 | //= require_tree .
17 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/javascripts/fancybox-test.js.coffee:
--------------------------------------------------------------------------------
1 | $ ->
2 | $("a.fancybox").fancybox()
3 |
--------------------------------------------------------------------------------
/test/dummy/app/assets/stylesheets/application.css:
--------------------------------------------------------------------------------
1 | /*
2 | * This is a manifest file that'll be compiled into application.css, which will include all the files
3 | * listed below.
4 | *
5 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7 | *
8 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 | * compiled file so the styles you add here take precedence over styles defined in any styles
10 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11 | * file per style scope.
12 | *
13 | *= require fancybox
14 | *= require_tree .
15 | *= require_self
16 | */
17 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | # Prevent CSRF attacks by raising an exception.
3 | # For APIs, you may want to use :null_session instead.
4 | protect_from_forgery with: :exception
5 | end
6 |
--------------------------------------------------------------------------------
/test/dummy/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/app/controllers/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/controllers/fancybox_controller.rb:
--------------------------------------------------------------------------------
1 | class FancyboxController < ApplicationController
2 | end
3 |
--------------------------------------------------------------------------------
/test/dummy/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/test/dummy/app/mailers/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/app/mailers/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/app/models/.keep
--------------------------------------------------------------------------------
/test/dummy/app/models/concerns/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/app/models/concerns/.keep
--------------------------------------------------------------------------------
/test/dummy/app/views/fancybox/index.html.erb:
--------------------------------------------------------------------------------
1 |
Fancybox test
2 |
3 | Check it out
4 |
5 |
10 |
--------------------------------------------------------------------------------
/test/dummy/app/views/layouts/application.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Dummy
5 | <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6 | <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7 | <%= csrf_meta_tags %>
8 |
9 |
10 |
11 | <%= yield %>
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/test/dummy/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/test/dummy/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/test/dummy/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/test/dummy/bin/setup:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require 'pathname'
3 |
4 | # path to your application root.
5 | APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6 |
7 | Dir.chdir APP_ROOT do
8 | # This script is a starting point to setup your application.
9 | # Add necessary setup steps to this file:
10 |
11 | puts "== Installing dependencies =="
12 | system "gem install bundler --conservative"
13 | system "bundle check || bundle install"
14 |
15 | # puts "\n== Copying sample files =="
16 | # unless File.exist?("config/database.yml")
17 | # system "cp config/database.yml.sample config/database.yml"
18 | # end
19 |
20 | puts "\n== Preparing database =="
21 | system "bin/rake db:setup"
22 |
23 | puts "\n== Removing old logs and tempfiles =="
24 | system "rm -f log/*"
25 | system "rm -rf tmp/cache"
26 |
27 | puts "\n== Restarting application server =="
28 | system "touch tmp/restart.txt"
29 | end
30 |
--------------------------------------------------------------------------------
/test/dummy/config.ru:
--------------------------------------------------------------------------------
1 | # This file is used by Rack-based servers to start the application.
2 |
3 | require ::File.expand_path('../config/environment', __FILE__)
4 | run Rails.application
5 |
--------------------------------------------------------------------------------
/test/dummy/config/application.rb:
--------------------------------------------------------------------------------
1 | require File.expand_path('../boot', __FILE__)
2 |
3 | require 'rails/all'
4 |
5 | Bundler.require(*Rails.groups)
6 | require "fancybox-rails"
7 |
8 | module Dummy
9 | class Application < Rails::Application
10 | # Settings in config/environments/* take precedence over those specified here.
11 | # Application configuration should go into files in config/initializers
12 | # -- all .rb files in that directory are automatically loaded.
13 |
14 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16 | # config.time_zone = 'Central Time (US & Canada)'
17 |
18 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20 | # config.i18n.default_locale = :de
21 |
22 | # Do not swallow errors in after_commit/after_rollback callbacks.
23 | config.active_record.raise_in_transactional_callbacks = true
24 | end
25 | end
26 |
27 |
--------------------------------------------------------------------------------
/test/dummy/config/boot.rb:
--------------------------------------------------------------------------------
1 | # Set up gems listed in the Gemfile.
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3 |
4 | require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5 | $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
6 |
--------------------------------------------------------------------------------
/test/dummy/config/database.yml:
--------------------------------------------------------------------------------
1 | # SQLite version 3.x
2 | # gem install sqlite3
3 | #
4 | # Ensure the SQLite 3 gem is defined in your Gemfile
5 | # gem 'sqlite3'
6 | #
7 | default: &default
8 | adapter: sqlite3
9 | pool: 5
10 | timeout: 5000
11 |
12 | development:
13 | <<: *default
14 | database: db/development.sqlite3
15 |
16 | # Warning: The database defined as "test" will be erased and
17 | # re-generated from your development database when you run "rake".
18 | # Do not set this db to the same as development or production.
19 | test:
20 | <<: *default
21 | database: db/test.sqlite3
22 |
23 | production:
24 | <<: *default
25 | database: db/production.sqlite3
26 |
--------------------------------------------------------------------------------
/test/dummy/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # In the development environment your application's code is reloaded on
5 | # every request. This slows down response time but is perfect for development
6 | # since you don't have to restart the web server when you make code changes.
7 | config.cache_classes = false
8 |
9 | # Do not eager load code on boot.
10 | config.eager_load = false
11 |
12 | # Show full error reports and disable caching.
13 | config.consider_all_requests_local = true
14 | config.action_controller.perform_caching = false
15 |
16 | # Don't care if the mailer can't send.
17 | config.action_mailer.raise_delivery_errors = false
18 |
19 | # Print deprecation notices to the Rails logger.
20 | config.active_support.deprecation = :log
21 |
22 | # Raise an error on page load if there are pending migrations.
23 | config.active_record.migration_error = :page_load
24 |
25 | # Debug mode disables concatenation and preprocessing of assets.
26 | # This option may cause significant delays in view rendering with a large
27 | # number of complex assets.
28 | config.assets.debug = true
29 |
30 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31 | # yet still be able to expire them through the digest params.
32 | config.assets.digest = true
33 |
34 | # Adds additional error checking when serving assets at runtime.
35 | # Checks for improperly declared sprockets dependencies.
36 | # Raises helpful error messages.
37 | config.assets.raise_runtime_errors = true
38 |
39 | # Raises error for missing translations
40 | # config.action_view.raise_on_missing_translations = true
41 | end
42 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/production.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # Code is not reloaded between requests.
5 | config.cache_classes = true
6 |
7 | # Eager load code on boot. This eager loads most of Rails and
8 | # your application in memory, allowing both threaded web servers
9 | # and those relying on copy on write to perform better.
10 | # Rake tasks automatically ignore this option for performance.
11 | config.eager_load = true
12 |
13 | # Full error reports are disabled and caching is turned on.
14 | config.consider_all_requests_local = false
15 | config.action_controller.perform_caching = true
16 |
17 | # Enable Rack::Cache to put a simple HTTP cache in front of your application
18 | # Add `rack-cache` to your Gemfile before enabling this.
19 | # For large-scale production use, consider using a caching reverse proxy like
20 | # NGINX, varnish or squid.
21 | # config.action_dispatch.rack_cache = true
22 |
23 | # Disable serving static files from the `/public` folder by default since
24 | # Apache or NGINX already handles this.
25 | config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26 |
27 | # Compress JavaScripts and CSS.
28 | config.assets.js_compressor = :uglifier
29 | # config.assets.css_compressor = :sass
30 |
31 | # Do not fallback to assets pipeline if a precompiled asset is missed.
32 | config.assets.compile = false
33 |
34 | # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35 | # yet still be able to expire them through the digest params.
36 | config.assets.digest = true
37 |
38 | # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39 |
40 | # Specifies the header that your server uses for sending files.
41 | # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43 |
44 | # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45 | # config.force_ssl = true
46 |
47 | # Use the lowest log level to ensure availability of diagnostic information
48 | # when problems arise.
49 | config.log_level = :debug
50 |
51 | # Prepend all log lines with the following tags.
52 | # config.log_tags = [ :subdomain, :uuid ]
53 |
54 | # Use a different logger for distributed setups.
55 | # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56 |
57 | # Use a different cache store in production.
58 | # config.cache_store = :mem_cache_store
59 |
60 | # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61 | # config.action_controller.asset_host = 'http://assets.example.com'
62 |
63 | # Ignore bad email addresses and do not raise email delivery errors.
64 | # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65 | # config.action_mailer.raise_delivery_errors = false
66 |
67 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68 | # the I18n.default_locale when a translation cannot be found).
69 | config.i18n.fallbacks = true
70 |
71 | # Send deprecation notices to registered listeners.
72 | config.active_support.deprecation = :notify
73 |
74 | # Use default logging formatter so that PID and timestamp are not suppressed.
75 | config.log_formatter = ::Logger::Formatter.new
76 |
77 | # Do not dump schema after migrations.
78 | config.active_record.dump_schema_after_migration = false
79 | end
80 |
--------------------------------------------------------------------------------
/test/dummy/config/environments/test.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 | # Settings specified here will take precedence over those in config/application.rb.
3 |
4 | # The test environment is used exclusively to run your application's
5 | # test suite. You never need to work with it otherwise. Remember that
6 | # your test database is "scratch space" for the test suite and is wiped
7 | # and recreated between test runs. Don't rely on the data there!
8 | config.cache_classes = true
9 |
10 | # Do not eager load code on boot. This avoids loading your whole application
11 | # just for the purpose of running a single test. If you are using a tool that
12 | # preloads Rails for running tests, you may have to set it to true.
13 | config.eager_load = false
14 |
15 | # Configure static file server for tests with Cache-Control for performance.
16 | config.serve_static_files = true
17 | config.static_cache_control = 'public, max-age=3600'
18 |
19 | # Show full error reports and disable caching.
20 | config.consider_all_requests_local = true
21 | config.action_controller.perform_caching = false
22 |
23 | # Raise exceptions instead of rendering exception templates.
24 | config.action_dispatch.show_exceptions = false
25 |
26 | # Disable request forgery protection in test environment.
27 | config.action_controller.allow_forgery_protection = false
28 |
29 | # Tell Action Mailer not to deliver emails to the real world.
30 | # The :test delivery method accumulates sent emails in the
31 | # ActionMailer::Base.deliveries array.
32 | config.action_mailer.delivery_method = :test
33 |
34 | # Randomize the order test cases are executed.
35 | config.active_support.test_order = :random
36 |
37 | # Print deprecation notices to the stderr.
38 | config.active_support.deprecation = :stderr
39 |
40 | # Raises error for missing translations
41 | # config.action_view.raise_on_missing_translations = true
42 | end
43 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Version of your assets, change this if you want to expire all your assets.
4 | Rails.application.config.assets.version = '1.0'
5 |
6 | # Add additional assets to the asset load path
7 | # Rails.application.config.assets.paths << Emoji.images_path
8 |
9 | # Precompile additional assets.
10 | # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11 | # Rails.application.config.assets.precompile += %w( search.js )
12 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5 |
6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7 | # Rails.backtrace_cleaner.remove_silencers!
8 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.action_dispatch.cookies_serializer = :json
4 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Configure sensitive parameters which will be filtered from the log file.
4 | Rails.application.config.filter_parameters += [:password]
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/inflections.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new inflection rules using the following format. Inflections
4 | # are locale specific, and you may define rules for as many different
5 | # locales as you wish. All of these examples are active by default:
6 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 | # inflect.plural /^(ox)$/i, '\1en'
8 | # inflect.singular /^(ox)en/i, '\1'
9 | # inflect.irregular 'person', 'people'
10 | # inflect.uncountable %w( fish sheep )
11 | # end
12 |
13 | # These inflection rules are supported but not enabled by default:
14 | # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 | # inflect.acronym 'RESTful'
16 | # end
17 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_dummy_session'
4 |
--------------------------------------------------------------------------------
/test/dummy/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/test/dummy/config/locales/en.yml:
--------------------------------------------------------------------------------
1 | # Files in the config/locales directory are used for internationalization
2 | # and are automatically loaded by Rails. If you want to use locales other
3 | # than English, add the necessary files in this directory.
4 | #
5 | # To use the locales, use `I18n.t`:
6 | #
7 | # I18n.t 'hello'
8 | #
9 | # In views, this is aliased to just `t`:
10 | #
11 | # <%= t('hello') %>
12 | #
13 | # To use a different locale, set it with `I18n.locale`:
14 | #
15 | # I18n.locale = :es
16 | #
17 | # This would use the information in config/locales/es.yml.
18 | #
19 | # To learn more, please read the Rails Internationalization guide
20 | # available at http://guides.rubyonrails.org/i18n.html.
21 |
22 | en:
23 | hello: "Hello world"
24 |
--------------------------------------------------------------------------------
/test/dummy/config/routes.rb:
--------------------------------------------------------------------------------
1 | Rails.application.routes.draw do
2 | root to: 'fancybox#index'
3 | # The priority is based upon order of creation: first created -> highest priority.
4 | # See how all your routes lay out with "rake routes".
5 |
6 | # You can have the root of your site routed with "root"
7 | # root 'welcome#index'
8 |
9 | # Example of regular route:
10 | # get 'products/:id' => 'catalog#view'
11 |
12 | # Example of named route that can be invoked with purchase_url(id: product.id)
13 | # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
14 |
15 | # Example resource route (maps HTTP verbs to controller actions automatically):
16 | # resources :products
17 |
18 | # Example resource route with options:
19 | # resources :products do
20 | # member do
21 | # get 'short'
22 | # post 'toggle'
23 | # end
24 | #
25 | # collection do
26 | # get 'sold'
27 | # end
28 | # end
29 |
30 | # Example resource route with sub-resources:
31 | # resources :products do
32 | # resources :comments, :sales
33 | # resource :seller
34 | # end
35 |
36 | # Example resource route with more complex sub-resources:
37 | # resources :products do
38 | # resources :comments
39 | # resources :sales do
40 | # get 'recent', on: :collection
41 | # end
42 | # end
43 |
44 | # Example resource route with concerns:
45 | # concern :toggleable do
46 | # post 'toggle'
47 | # end
48 | # resources :posts, concerns: :toggleable
49 | # resources :photos, concerns: :toggleable
50 |
51 | # Example resource route within a namespace:
52 | # namespace :admin do
53 | # # Directs /admin/products/* to Admin::ProductsController
54 | # # (app/controllers/admin/products_controller.rb)
55 | # resources :products
56 | # end
57 | end
58 |
--------------------------------------------------------------------------------
/test/dummy/config/secrets.yml:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Your secret key is used for verifying the integrity of signed cookies.
4 | # If you change this key, all old signed cookies will become invalid!
5 |
6 | # Make sure the secret is at least 30 characters and all random,
7 | # no regular words or you'll be exposed to dictionary attacks.
8 | # You can use `rake secret` to generate a secure secret key.
9 |
10 | # Make sure the secrets in this file are kept private
11 | # if you're sharing your code publicly.
12 |
13 | development:
14 | secret_key_base: d111ee791c8b4c07fe7d8210e4f22e96d00940bd4c20eb26bfc4cf074d0ea39dd6d31fa1ab51b2bca81fe1e33481aab2c21e81c59de2c7bf2cfb759d61e9b702
15 |
16 | test:
17 | secret_key_base: aad8aeff6c6e7d6b9c368cdfd95fec870225fd0bdf6baa2adb8a69349f90a60ee7d82c12e659bada269816ed1f11bca822c5517cb31be3f2dd7ec840220a2d2d
18 |
19 | # Do not keep production secrets in the repository,
20 | # instead read values from the environment.
21 | production:
22 | secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23 |
--------------------------------------------------------------------------------
/test/dummy/lib/assets/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/lib/assets/.keep
--------------------------------------------------------------------------------
/test/dummy/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/log/.keep
--------------------------------------------------------------------------------
/test/dummy/public/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The page you were looking for doesn't exist (404)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The page you were looking for doesn't exist.
62 |
You may have mistyped the address or the page may have moved.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/dummy/public/422.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | The change you wanted was rejected (422)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
The change you wanted was rejected.
62 |
Maybe you tried to change something you didn't have access to.
63 |
64 |
If you are the application owner check the logs for more information.
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/test/dummy/public/500.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | We're sorry, but something went wrong (500)
5 |
6 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
We're sorry, but something went wrong.
62 |
63 |
If you are the application owner check the logs for more information.
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/test/dummy/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrismytton/fancybox-rails/e908caa2dfe4a3cb8219446603592565f5b02b4e/test/dummy/public/favicon.ico
--------------------------------------------------------------------------------
/test/fancybox_rails_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class FancyboxRailsTest < ActiveSupport::TestCase
4 | include Rack::Test::Methods
5 |
6 | def app
7 | Dummy::Application
8 | end
9 |
10 | test "jquery.fancybox.js is found as an asset" do
11 | assert_not_nil app.assets['jquery.fancybox.js']
12 | assert_not_nil app.assets['fancybox.js']
13 | end
14 |
15 | test "jquery.fancybox.css is found as an asset" do
16 | assert_not_nil app.assets['jquery.fancybox.css']
17 | assert_not_nil app.assets['fancybox.css']
18 | end
19 |
20 | test "fancybox is included in application.js" do
21 | get "/assets/application.js"
22 | assert last_response.body.include?('FancyBox - jQuery Plugin')
23 | end
24 |
25 | test "fancybox css in included in application.css" do
26 | get "/assets/application.css"
27 | assert last_response.body.include?('FancyBox - jQuery Plugin')
28 | end
29 |
30 | test "fancybox assets are loaded" do
31 | get "/assets/blank.gif"
32 | assert_equal 200, last_response.status
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/test/integration/fancybox_test.rb:
--------------------------------------------------------------------------------
1 | require 'test_helper'
2 |
3 | class FancyboxTest < ActionDispatch::IntegrationTest
4 | test "fancybox is loaded and works" do
5 | visit root_path
6 |
7 | fancybox = find('#fancybox-content', visible: false)
8 |
9 | assert !fancybox.visible?
10 |
11 | click_link 'Check it out'
12 | assert fancybox.visible?
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # Configure Rails Environment
2 | ENV["RAILS_ENV"] = "test"
3 |
4 | require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5 | ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6 | require "rails/test_help"
7 |
8 | # Filter out Minitest backtrace while allowing backtrace from other libraries
9 | # to be shown.
10 | Minitest.backtrace_filter = Minitest::BacktraceFilter.new
11 |
12 | # Load support files
13 | Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
14 |
15 | # Load fixtures from the engine
16 | if ActiveSupport::TestCase.respond_to?(:fixture_path=)
17 | ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
18 | ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
19 | ActiveSupport::TestCase.fixtures :all
20 | end
21 |
22 | # Configure capybara for integration testing
23 | require 'capybara/rails'
24 | require 'capybara/poltergeist'
25 |
26 | class ActionDispatch::IntegrationTest
27 | # Make the Capybara DSL available in all integration tests
28 | include Capybara::DSL
29 |
30 | def setup
31 | Capybara.current_driver = :poltergeist
32 | end
33 |
34 | def teardown
35 | Capybara.use_default_driver
36 | end
37 | end
38 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/fancybox.js:
--------------------------------------------------------------------------------
1 | //= require jquery.browser
2 | //= require jquery.fancybox
3 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/jquery.browser.js:
--------------------------------------------------------------------------------
1 | // jQuery 1.9 has removed the `$.browser` property, fancybox relies on
2 | // it, so we patch it here if it's missing.
3 | // This has been copied from jQuery migrate 1.1.1.
4 | if ( !jQuery.browser ) {
5 | var uaMatch = function( ua ) {
6 | ua = ua.toLowerCase();
7 |
8 | var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
9 | /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
10 | /(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
11 | /(msie) ([\w.]+)/.exec( ua ) ||
12 | ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
13 | [];
14 |
15 | return {
16 | browser: match[ 1 ] || "",
17 | version: match[ 2 ] || "0"
18 | };
19 | };
20 |
21 | matched = uaMatch( navigator.userAgent );
22 | browser = {};
23 |
24 | if ( matched.browser ) {
25 | browser[ matched.browser ] = true;
26 | browser.version = matched.version;
27 | }
28 |
29 | // Chrome is Webkit, but Webkit is also Safari.
30 | if ( browser.chrome ) {
31 | browser.webkit = true;
32 | } else if ( browser.webkit ) {
33 | browser.safari = true;
34 | }
35 |
36 | jQuery.browser = browser;
37 | }
38 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/jquery.fancybox.js:
--------------------------------------------------------------------------------
1 | /*
2 | * FancyBox - jQuery Plugin
3 | * Simple and fancy lightbox alternative
4 | *
5 | * Examples and documentation at: http://fancybox.net
6 | *
7 | * Copyright (c) 2008 - 2010 Janis Skarnelis
8 | * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9 | *
10 | * Version: 1.3.4 (11/11/2010)
11 | * Requires: jQuery v1.3+
12 | *
13 | * Dual licensed under the MIT and GPL licenses:
14 | * http://www.opensource.org/licenses/mit-license.php
15 | * http://www.gnu.org/licenses/gpl.html
16 | */
17 |
18 | ;(function($) {
19 | var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
20 |
21 | selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
22 |
23 | ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
24 |
25 | loadingTimer, loadingFrame = 1,
26 |
27 | titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('
')[0], { prop: 0 }),
28 |
29 | isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
30 |
31 | /*
32 | * Private methods
33 | */
34 |
35 | _abort = function() {
36 | loading.hide();
37 |
38 | imgPreloader.onerror = imgPreloader.onload = null;
39 |
40 | if (ajaxLoader) {
41 | ajaxLoader.abort();
42 | }
43 |
44 | tmp.empty();
45 | },
46 |
47 | _error = function() {
48 | if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
49 | loading.hide();
50 | busy = false;
51 | return;
52 | }
53 |
54 | selectedOpts.titleShow = false;
55 |
56 | selectedOpts.width = 'auto';
57 | selectedOpts.height = 'auto';
58 |
59 | tmp.html( 'The requested content cannot be loaded. Please try again later.
' );
60 |
61 | _process_inline();
62 | },
63 |
64 | _start = function() {
65 | var obj = selectedArray[ selectedIndex ],
66 | href,
67 | type,
68 | title,
69 | str,
70 | emb,
71 | ret;
72 |
73 | _abort();
74 |
75 | selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
76 |
77 | ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
78 |
79 | if (ret === false) {
80 | busy = false;
81 | return;
82 | } else if (typeof ret == 'object') {
83 | selectedOpts = $.extend(selectedOpts, ret);
84 | }
85 |
86 | title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
87 |
88 | if (obj.nodeName && !selectedOpts.orig) {
89 | selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
90 | }
91 |
92 | if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
93 | title = selectedOpts.orig.attr('alt');
94 | }
95 |
96 | href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
97 |
98 | if ((/^(?:javascript)/i).test(href) || href == '#') {
99 | href = null;
100 | }
101 |
102 | if (selectedOpts.type) {
103 | type = selectedOpts.type;
104 |
105 | if (!href) {
106 | href = selectedOpts.content;
107 | }
108 |
109 | } else if (selectedOpts.content) {
110 | type = 'html';
111 |
112 | } else if (href) {
113 | if (href.match(imgRegExp)) {
114 | type = 'image';
115 |
116 | } else if (href.match(swfRegExp)) {
117 | type = 'swf';
118 |
119 | } else if ($(obj).hasClass("iframe")) {
120 | type = 'iframe';
121 |
122 | } else if (href.indexOf("#") === 0) {
123 | type = 'inline';
124 |
125 | } else {
126 | type = 'ajax';
127 | }
128 | }
129 |
130 | if (!type) {
131 | _error();
132 | return;
133 | }
134 |
135 | if (type == 'inline') {
136 | obj = href.substr(href.indexOf("#"));
137 | type = $(obj).length > 0 ? 'inline' : 'ajax';
138 | }
139 |
140 | selectedOpts.type = type;
141 | selectedOpts.href = href;
142 | selectedOpts.title = title;
143 |
144 | if (selectedOpts.autoDimensions) {
145 | if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
146 | selectedOpts.width = 'auto';
147 | selectedOpts.height = 'auto';
148 | } else {
149 | selectedOpts.autoDimensions = false;
150 | }
151 | }
152 |
153 | if (selectedOpts.modal) {
154 | selectedOpts.overlayShow = true;
155 | selectedOpts.hideOnOverlayClick = false;
156 | selectedOpts.hideOnContentClick = false;
157 | selectedOpts.enableEscapeButton = false;
158 | selectedOpts.showCloseButton = false;
159 | }
160 |
161 | selectedOpts.padding = parseInt(selectedOpts.padding, 10);
162 | selectedOpts.margin = parseInt(selectedOpts.margin, 10);
163 |
164 | tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
165 |
166 | $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
167 | $(this).replaceWith(content.children());
168 | });
169 |
170 | switch (type) {
171 | case 'html' :
172 | tmp.html( selectedOpts.content );
173 | _process_inline();
174 | break;
175 |
176 | case 'inline' :
177 | if ( $(obj).parent().is('#fancybox-content') === true) {
178 | busy = false;
179 | return;
180 | }
181 |
182 | $('
')
183 | .hide()
184 | .insertBefore( $(obj) )
185 | .bind('fancybox-cleanup', function() {
186 | $(this).replaceWith(content.children());
187 | }).bind('fancybox-cancel', function() {
188 | $(this).replaceWith(tmp.children());
189 | });
190 |
191 | $(obj).appendTo(tmp);
192 |
193 | _process_inline();
194 | break;
195 |
196 | case 'image':
197 | busy = false;
198 |
199 | $.fancybox.showActivity();
200 |
201 | imgPreloader = new Image();
202 |
203 | imgPreloader.onerror = function() {
204 | _error();
205 | };
206 |
207 | imgPreloader.onload = function() {
208 | busy = true;
209 |
210 | imgPreloader.onerror = imgPreloader.onload = null;
211 |
212 | _process_image();
213 | };
214 |
215 | imgPreloader.src = href;
216 | break;
217 |
218 | case 'swf':
219 | selectedOpts.scrolling = 'no';
220 |
221 | str = ' ';
222 | emb = '';
223 |
224 | $.each(selectedOpts.swf, function(name, val) {
225 | str += ' ';
226 | emb += ' ' + name + '="' + val + '"';
227 | });
228 |
229 | str += ' ';
230 |
231 | tmp.html(str);
232 |
233 | _process_inline();
234 | break;
235 |
236 | case 'ajax':
237 | busy = false;
238 |
239 | $.fancybox.showActivity();
240 |
241 | selectedOpts.ajax.win = selectedOpts.ajax.success;
242 |
243 | ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
244 | url : href,
245 | data : selectedOpts.ajax.data || {},
246 | error : function(XMLHttpRequest, textStatus, errorThrown) {
247 | if ( XMLHttpRequest.status > 0 ) {
248 | _error();
249 | }
250 | },
251 | success : function(data, textStatus, XMLHttpRequest) {
252 | var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
253 | if (o.status == 200) {
254 | if ( typeof selectedOpts.ajax.win == 'function' ) {
255 | ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
256 |
257 | if (ret === false) {
258 | loading.hide();
259 | return;
260 | } else if (typeof ret == 'string' || typeof ret == 'object') {
261 | data = ret;
262 | }
263 | }
264 |
265 | tmp.html( data );
266 | _process_inline();
267 | }
268 | }
269 | }));
270 |
271 | break;
272 |
273 | case 'iframe':
274 | _show();
275 | break;
276 | }
277 | },
278 |
279 | _process_inline = function() {
280 | var
281 | w = selectedOpts.width,
282 | h = selectedOpts.height;
283 |
284 | if (w.toString().indexOf('%') > -1) {
285 | w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
286 |
287 | } else {
288 | w = w == 'auto' ? 'auto' : w + 'px';
289 | }
290 |
291 | if (h.toString().indexOf('%') > -1) {
292 | h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
293 |
294 | } else {
295 | h = h == 'auto' ? 'auto' : h + 'px';
296 | }
297 |
298 | tmp.wrapInner('
');
299 |
300 | selectedOpts.width = tmp.width();
301 | selectedOpts.height = tmp.height();
302 |
303 | _show();
304 | },
305 |
306 | _process_image = function() {
307 | selectedOpts.width = imgPreloader.width;
308 | selectedOpts.height = imgPreloader.height;
309 |
310 | $(" ").attr({
311 | 'id' : 'fancybox-img',
312 | 'src' : imgPreloader.src,
313 | 'alt' : selectedOpts.title
314 | }).appendTo( tmp );
315 |
316 | _show();
317 | },
318 |
319 | _show = function() {
320 | var pos, equal;
321 |
322 | loading.hide();
323 |
324 | if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
325 | $.event.trigger('fancybox-cancel');
326 |
327 | busy = false;
328 | return;
329 | }
330 |
331 | busy = true;
332 |
333 | $(content.add( overlay )).unbind();
334 |
335 | $(window).unbind("resize.fb scroll.fb");
336 | $(document).unbind('keydown.fb');
337 |
338 | if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
339 | wrap.css('height', wrap.height());
340 | }
341 |
342 | currentArray = selectedArray;
343 | currentIndex = selectedIndex;
344 | currentOpts = selectedOpts;
345 |
346 | if (currentOpts.overlayShow) {
347 | overlay.css({
348 | 'background-color' : currentOpts.overlayColor,
349 | 'opacity' : currentOpts.overlayOpacity,
350 | 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
351 | 'height' : $(document).height()
352 | });
353 |
354 | if (!overlay.is(':visible')) {
355 | if (isIE6) {
356 | $('select:not(#fancybox-tmp select)').filter(function() {
357 | return this.style.visibility !== 'hidden';
358 | }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
359 | this.style.visibility = 'inherit';
360 | });
361 | }
362 |
363 | overlay.show();
364 | }
365 | } else {
366 | overlay.hide();
367 | }
368 |
369 | final_pos = _get_zoom_to();
370 |
371 | _process_title();
372 |
373 | if (wrap.is(":visible")) {
374 | $( close.add( nav_left ).add( nav_right ) ).hide();
375 |
376 | pos = wrap.position(),
377 |
378 | start_pos = {
379 | top : pos.top,
380 | left : pos.left,
381 | width : wrap.width(),
382 | height : wrap.height()
383 | };
384 |
385 | equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
386 |
387 | content.fadeTo(currentOpts.changeFade, 0.3, function() {
388 | var finish_resizing = function() {
389 | content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
390 | };
391 |
392 | $.event.trigger('fancybox-change');
393 |
394 | content
395 | .empty()
396 | .removeAttr('filter')
397 | .css({
398 | 'border-width' : currentOpts.padding,
399 | 'width' : final_pos.width - currentOpts.padding * 2,
400 | 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
401 | });
402 |
403 | if (equal) {
404 | finish_resizing();
405 |
406 | } else {
407 | fx.prop = 0;
408 |
409 | $(fx).animate({prop: 1}, {
410 | duration : currentOpts.changeSpeed,
411 | easing : currentOpts.easingChange,
412 | step : _draw,
413 | complete : finish_resizing
414 | });
415 | }
416 | });
417 |
418 | return;
419 | }
420 |
421 | wrap.removeAttr("style");
422 |
423 | content.css('border-width', currentOpts.padding);
424 |
425 | if (currentOpts.transitionIn == 'elastic') {
426 | start_pos = _get_zoom_from();
427 |
428 | content.html( tmp.contents() );
429 |
430 | wrap.show();
431 |
432 | if (currentOpts.opacity) {
433 | final_pos.opacity = 0;
434 | }
435 |
436 | fx.prop = 0;
437 |
438 | $(fx).animate({prop: 1}, {
439 | duration : currentOpts.speedIn,
440 | easing : currentOpts.easingIn,
441 | step : _draw,
442 | complete : _finish
443 | });
444 |
445 | return;
446 | }
447 |
448 | if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
449 | title.show();
450 | }
451 |
452 | content
453 | .css({
454 | 'width' : final_pos.width - currentOpts.padding * 2,
455 | 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
456 | })
457 | .html( tmp.contents() );
458 |
459 | wrap
460 | .css(final_pos)
461 | .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
462 | },
463 |
464 | _format_title = function(title) {
465 | if (title && title.length) {
466 | if (currentOpts.titlePosition == 'float') {
467 | return '';
468 | }
469 |
470 | return '' + title + '
';
471 | }
472 |
473 | return false;
474 | },
475 |
476 | _process_title = function() {
477 | titleStr = currentOpts.title || '';
478 | titleHeight = 0;
479 |
480 | title
481 | .empty()
482 | .removeAttr('style')
483 | .removeClass();
484 |
485 | if (currentOpts.titleShow === false) {
486 | title.hide();
487 | return;
488 | }
489 |
490 | titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
491 |
492 | if (!titleStr || titleStr === '') {
493 | title.hide();
494 | return;
495 | }
496 |
497 | title
498 | .addClass('fancybox-title-' + currentOpts.titlePosition)
499 | .html( titleStr )
500 | .appendTo( 'body' )
501 | .show();
502 |
503 | switch (currentOpts.titlePosition) {
504 | case 'inside':
505 | title
506 | .css({
507 | 'width' : final_pos.width - (currentOpts.padding * 2),
508 | 'marginLeft' : currentOpts.padding,
509 | 'marginRight' : currentOpts.padding
510 | });
511 |
512 | titleHeight = title.outerHeight(true);
513 |
514 | title.appendTo( outer );
515 |
516 | final_pos.height += titleHeight;
517 | break;
518 |
519 | case 'over':
520 | title
521 | .css({
522 | 'marginLeft' : currentOpts.padding,
523 | 'width' : final_pos.width - (currentOpts.padding * 2),
524 | 'bottom' : currentOpts.padding
525 | })
526 | .appendTo( outer );
527 | break;
528 |
529 | case 'float':
530 | title
531 | .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
532 | .appendTo( wrap );
533 | break;
534 |
535 | default:
536 | title
537 | .css({
538 | 'width' : final_pos.width - (currentOpts.padding * 2),
539 | 'paddingLeft' : currentOpts.padding,
540 | 'paddingRight' : currentOpts.padding
541 | })
542 | .appendTo( wrap );
543 | break;
544 | }
545 |
546 | title.hide();
547 | },
548 |
549 | _set_navigation = function() {
550 | if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
551 | $(document).bind('keydown.fb', function(e) {
552 | if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
553 | e.preventDefault();
554 | $.fancybox.close();
555 |
556 | } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
557 | e.preventDefault();
558 | $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
559 | }
560 | });
561 | }
562 |
563 | if (!currentOpts.showNavArrows) {
564 | nav_left.hide();
565 | nav_right.hide();
566 | return;
567 | }
568 |
569 | if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
570 | nav_left.show();
571 | }
572 |
573 | if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
574 | nav_right.show();
575 | }
576 | },
577 |
578 | _finish = function () {
579 | if (!$.support.opacity) {
580 | content.get(0).style.removeAttribute('filter');
581 | wrap.get(0).style.removeAttribute('filter');
582 | }
583 |
584 | if (selectedOpts.autoDimensions) {
585 | content.css('height', 'auto');
586 | }
587 |
588 | wrap.css('height', 'auto');
589 |
590 | if (titleStr && titleStr.length) {
591 | title.show();
592 | }
593 |
594 | if (currentOpts.showCloseButton) {
595 | close.show();
596 | }
597 |
598 | _set_navigation();
599 |
600 | if (currentOpts.hideOnContentClick) {
601 | content.bind('click', $.fancybox.close);
602 | }
603 |
604 | if (currentOpts.hideOnOverlayClick) {
605 | overlay.bind('click', $.fancybox.close);
606 | }
607 |
608 | $(window).bind("resize.fb", $.fancybox.resize);
609 |
610 | if (currentOpts.centerOnScroll) {
611 | $(window).bind("scroll.fb", $.fancybox.center);
612 | }
613 |
614 | if (currentOpts.type == 'iframe') {
615 | $('').appendTo(content);
616 | }
617 |
618 | wrap.show();
619 |
620 | busy = false;
621 |
622 | $.fancybox.center();
623 |
624 | currentOpts.onComplete(currentArray, currentIndex, currentOpts);
625 |
626 | _preload_images();
627 | },
628 |
629 | _preload_images = function() {
630 | var href,
631 | objNext;
632 |
633 | if ((currentArray.length -1) > currentIndex) {
634 | href = currentArray[ currentIndex + 1 ].href;
635 |
636 | if (typeof href !== 'undefined' && href.match(imgRegExp)) {
637 | objNext = new Image();
638 | objNext.src = href;
639 | }
640 | }
641 |
642 | if (currentIndex > 0) {
643 | href = currentArray[ currentIndex - 1 ].href;
644 |
645 | if (typeof href !== 'undefined' && href.match(imgRegExp)) {
646 | objNext = new Image();
647 | objNext.src = href;
648 | }
649 | }
650 | },
651 |
652 | _draw = function(pos) {
653 | var dim = {
654 | width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
655 | height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
656 |
657 | top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
658 | left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
659 | };
660 |
661 | if (typeof final_pos.opacity !== 'undefined') {
662 | dim.opacity = pos < 0.5 ? 0.5 : pos;
663 | }
664 |
665 | wrap.css(dim);
666 |
667 | content.css({
668 | 'width' : dim.width - currentOpts.padding * 2,
669 | 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
670 | });
671 | },
672 |
673 | _get_viewport = function() {
674 | return [
675 | $(window).width() - (currentOpts.margin * 2),
676 | $(window).height() - (currentOpts.margin * 2),
677 | $(document).scrollLeft() + currentOpts.margin,
678 | $(document).scrollTop() + currentOpts.margin
679 | ];
680 | },
681 |
682 | _get_zoom_to = function () {
683 | var view = _get_viewport(),
684 | to = {},
685 | resize = currentOpts.autoScale,
686 | double_padding = currentOpts.padding * 2,
687 | ratio;
688 |
689 | if (currentOpts.width.toString().indexOf('%') > -1) {
690 | to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
691 | } else {
692 | to.width = currentOpts.width + double_padding;
693 | }
694 |
695 | if (currentOpts.height.toString().indexOf('%') > -1) {
696 | to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
697 | } else {
698 | to.height = currentOpts.height + double_padding;
699 | }
700 |
701 | if (resize && (to.width > view[0] || to.height > view[1])) {
702 | if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
703 | ratio = (currentOpts.width ) / (currentOpts.height );
704 |
705 | if ((to.width ) > view[0]) {
706 | to.width = view[0];
707 | to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
708 | }
709 |
710 | if ((to.height) > view[1]) {
711 | to.height = view[1];
712 | to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
713 | }
714 |
715 | } else {
716 | to.width = Math.min(to.width, view[0]);
717 | to.height = Math.min(to.height, view[1]);
718 | }
719 | }
720 |
721 | to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
722 | to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
723 |
724 | return to;
725 | },
726 |
727 | _get_obj_pos = function(obj) {
728 | var pos = obj.offset();
729 |
730 | pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
731 | pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
732 |
733 | pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
734 | pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
735 |
736 | pos.width = obj.width();
737 | pos.height = obj.height();
738 |
739 | return pos;
740 | },
741 |
742 | _get_zoom_from = function() {
743 | var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
744 | from = {},
745 | pos,
746 | view;
747 |
748 | if (orig && orig.length) {
749 | pos = _get_obj_pos(orig);
750 |
751 | from = {
752 | width : pos.width + (currentOpts.padding * 2),
753 | height : pos.height + (currentOpts.padding * 2),
754 | top : pos.top - currentOpts.padding - 20,
755 | left : pos.left - currentOpts.padding - 20
756 | };
757 |
758 | } else {
759 | view = _get_viewport();
760 |
761 | from = {
762 | width : currentOpts.padding * 2,
763 | height : currentOpts.padding * 2,
764 | top : parseInt(view[3] + view[1] * 0.5, 10),
765 | left : parseInt(view[2] + view[0] * 0.5, 10)
766 | };
767 | }
768 |
769 | return from;
770 | },
771 |
772 | _animate_loading = function() {
773 | if (!loading.is(':visible')){
774 | clearInterval(loadingTimer);
775 | return;
776 | }
777 |
778 | $('div', loading).css('top', (loadingFrame * -40) + 'px');
779 |
780 | loadingFrame = (loadingFrame + 1) % 12;
781 | };
782 |
783 | /*
784 | * Public methods
785 | */
786 |
787 | $.fn.fancybox = function(options) {
788 | if (!$(this).length) {
789 | return this;
790 | }
791 |
792 | $(this)
793 | .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
794 | .unbind('click.fb')
795 | .bind('click.fb', function(e) {
796 | e.preventDefault();
797 |
798 | if (busy) {
799 | return;
800 | }
801 |
802 | busy = true;
803 |
804 | $(this).blur();
805 |
806 | selectedArray = [];
807 | selectedIndex = 0;
808 |
809 | var rel = $(this).attr('rel') || '';
810 |
811 | if (!rel || rel == '' || rel === 'nofollow') {
812 | selectedArray.push(this);
813 |
814 | } else {
815 | selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
816 | selectedIndex = selectedArray.index( this );
817 | }
818 |
819 | _start();
820 |
821 | return;
822 | });
823 |
824 | return this;
825 | };
826 |
827 | $.fancybox = function(obj) {
828 | var opts;
829 |
830 | if (busy) {
831 | return;
832 | }
833 |
834 | busy = true;
835 | opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
836 |
837 | selectedArray = [];
838 | selectedIndex = parseInt(opts.index, 10) || 0;
839 |
840 | if ($.isArray(obj)) {
841 | for (var i = 0, j = obj.length; i < j; i++) {
842 | if (typeof obj[i] == 'object') {
843 | $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
844 | } else {
845 | obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
846 | }
847 | }
848 |
849 | selectedArray = jQuery.merge(selectedArray, obj);
850 |
851 | } else {
852 | if (typeof obj == 'object') {
853 | $(obj).data('fancybox', $.extend({}, opts, obj));
854 | } else {
855 | obj = $({}).data('fancybox', $.extend({content : obj}, opts));
856 | }
857 |
858 | selectedArray.push(obj);
859 | }
860 |
861 | if (selectedIndex > selectedArray.length || selectedIndex < 0) {
862 | selectedIndex = 0;
863 | }
864 |
865 | _start();
866 | };
867 |
868 | $.fancybox.showActivity = function() {
869 | clearInterval(loadingTimer);
870 |
871 | loading.show();
872 | loadingTimer = setInterval(_animate_loading, 66);
873 | };
874 |
875 | $.fancybox.hideActivity = function() {
876 | loading.hide();
877 | };
878 |
879 | $.fancybox.next = function() {
880 | return $.fancybox.pos( currentIndex + 1);
881 | };
882 |
883 | $.fancybox.prev = function() {
884 | return $.fancybox.pos( currentIndex - 1);
885 | };
886 |
887 | $.fancybox.pos = function(pos) {
888 | if (busy) {
889 | return;
890 | }
891 |
892 | pos = parseInt(pos);
893 |
894 | selectedArray = currentArray;
895 |
896 | if (pos > -1 && pos < currentArray.length) {
897 | selectedIndex = pos;
898 | _start();
899 |
900 | } else if (currentOpts.cyclic && currentArray.length > 1) {
901 | selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
902 | _start();
903 | }
904 |
905 | return;
906 | };
907 |
908 | $.fancybox.cancel = function() {
909 | if (busy) {
910 | return;
911 | }
912 |
913 | busy = true;
914 |
915 | $.event.trigger('fancybox-cancel');
916 |
917 | _abort();
918 |
919 | selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
920 |
921 | busy = false;
922 | };
923 |
924 | // Note: within an iframe use - parent.$.fancybox.close();
925 | $.fancybox.close = function() {
926 | if (busy || wrap.is(':hidden')) {
927 | return;
928 | }
929 |
930 | busy = true;
931 |
932 | if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
933 | busy = false;
934 | return;
935 | }
936 |
937 | _abort();
938 |
939 | $(close.add( nav_left ).add( nav_right )).hide();
940 |
941 | $(content.add( overlay )).unbind();
942 |
943 | $(window).unbind("resize.fb scroll.fb");
944 | $(document).unbind('keydown.fb');
945 |
946 | content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
947 |
948 | if (currentOpts.titlePosition !== 'inside') {
949 | title.empty();
950 | }
951 |
952 | wrap.stop();
953 |
954 | function _cleanup() {
955 | overlay.fadeOut('fast');
956 |
957 | title.empty().hide();
958 | wrap.hide();
959 |
960 | $.event.trigger('fancybox-cleanup');
961 |
962 | content.empty();
963 |
964 | currentOpts.onClosed(currentArray, currentIndex, currentOpts);
965 |
966 | currentArray = selectedOpts = [];
967 | currentIndex = selectedIndex = 0;
968 | currentOpts = selectedOpts = {};
969 |
970 | busy = false;
971 | }
972 |
973 | if (currentOpts.transitionOut == 'elastic') {
974 | start_pos = _get_zoom_from();
975 |
976 | var pos = wrap.position();
977 |
978 | final_pos = {
979 | top : pos.top ,
980 | left : pos.left,
981 | width : wrap.width(),
982 | height : wrap.height()
983 | };
984 |
985 | if (currentOpts.opacity) {
986 | final_pos.opacity = 1;
987 | }
988 |
989 | title.empty().hide();
990 |
991 | fx.prop = 1;
992 |
993 | $(fx).animate({ prop: 0 }, {
994 | duration : currentOpts.speedOut,
995 | easing : currentOpts.easingOut,
996 | step : _draw,
997 | complete : _cleanup
998 | });
999 |
1000 | } else {
1001 | wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1002 | }
1003 | };
1004 |
1005 | $.fancybox.resize = function() {
1006 | if (overlay.is(':visible')) {
1007 | overlay.css('height', $(document).height());
1008 | }
1009 |
1010 | $.fancybox.center(true);
1011 | };
1012 |
1013 | $.fancybox.center = function() {
1014 | var view, align;
1015 |
1016 | if (busy) {
1017 | return;
1018 | }
1019 |
1020 | align = arguments[0] === true ? 1 : 0;
1021 | view = _get_viewport();
1022 |
1023 | if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
1024 | return;
1025 | }
1026 |
1027 | wrap
1028 | .stop()
1029 | .animate({
1030 | 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1031 | 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1032 | }, typeof arguments[0] == 'number' ? arguments[0] : 200);
1033 | };
1034 |
1035 | $.fancybox.init = function() {
1036 | if ($("#fancybox-wrap").length) {
1037 | return;
1038 | }
1039 |
1040 | $('body').append(
1041 | tmp = $('
'),
1042 | loading = $(''),
1043 | overlay = $('
'),
1044 | wrap = $('
')
1045 | );
1046 |
1047 | outer = $('
')
1048 | .append('
')
1049 | .appendTo( wrap );
1050 |
1051 | outer.append(
1052 | content = $('
'),
1053 | close = $(' '),
1054 | title = $('
'),
1055 |
1056 | nav_left = $(' '),
1057 | nav_right = $(' ')
1058 | );
1059 |
1060 | close.click($.fancybox.close);
1061 | loading.click($.fancybox.cancel);
1062 |
1063 | nav_left.click(function(e) {
1064 | e.preventDefault();
1065 | $.fancybox.prev();
1066 | });
1067 |
1068 | nav_right.click(function(e) {
1069 | e.preventDefault();
1070 | $.fancybox.next();
1071 | });
1072 |
1073 | if ($.fn.mousewheel) {
1074 | wrap.bind('mousewheel.fb', function(e, delta) {
1075 | if (busy) {
1076 | e.preventDefault();
1077 |
1078 | } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1079 | e.preventDefault();
1080 | $.fancybox[ delta > 0 ? 'prev' : 'next']();
1081 | }
1082 | });
1083 | }
1084 |
1085 | if (!$.support.opacity) {
1086 | wrap.addClass('fancybox-ie');
1087 | }
1088 |
1089 | if (isIE6) {
1090 | loading.addClass('fancybox-ie6');
1091 | wrap.addClass('fancybox-ie6');
1092 |
1093 | $('').prependTo(outer);
1094 | }
1095 | };
1096 |
1097 | $.fn.fancybox.defaults = {
1098 | padding : 10,
1099 | margin : 40,
1100 | opacity : false,
1101 | modal : false,
1102 | cyclic : false,
1103 | scrolling : 'auto', // 'auto', 'yes' or 'no'
1104 |
1105 | width : 560,
1106 | height : 340,
1107 |
1108 | autoScale : true,
1109 | autoDimensions : true,
1110 | centerOnScroll : false,
1111 |
1112 | ajax : {},
1113 | swf : { wmode: 'transparent' },
1114 |
1115 | hideOnOverlayClick : true,
1116 | hideOnContentClick : false,
1117 |
1118 | overlayShow : true,
1119 | overlayOpacity : 0.7,
1120 | overlayColor : '#777',
1121 |
1122 | titleShow : true,
1123 | titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1124 | titleFormat : null,
1125 | titleFromAlt : false,
1126 |
1127 | transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1128 | transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1129 |
1130 | speedIn : 300,
1131 | speedOut : 300,
1132 |
1133 | changeSpeed : 300,
1134 | changeFade : 'fast',
1135 |
1136 | easingIn : 'swing',
1137 | easingOut : 'swing',
1138 |
1139 | showCloseButton : true,
1140 | showNavArrows : true,
1141 | enableEscapeButton : true,
1142 | enableKeyboardNav : true,
1143 |
1144 | onStart : function(){},
1145 | onCancel : function(){},
1146 | onComplete : function(){},
1147 | onCleanup : function(){},
1148 | onClosed : function(){},
1149 | onError : function(){}
1150 | };
1151 |
1152 | $(document).ready(function() {
1153 | $.fancybox.init();
1154 | });
1155 |
1156 | })(jQuery);
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/fancybox.css:
--------------------------------------------------------------------------------
1 | /*
2 | *= require jquery.fancybox
3 | */
4 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/jquery.fancybox.css.erb:
--------------------------------------------------------------------------------
1 | /*
2 | * FancyBox - jQuery Plugin
3 | * Simple and fancy lightbox alternative
4 | *
5 | * Examples and documentation at: http://fancybox.net
6 | *
7 | * Copyright (c) 2008 - 2010 Janis Skarnelis
8 | * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
9 | *
10 | * Version: 1.3.4 (11/11/2010)
11 | * Requires: jQuery v1.3+
12 | *
13 | * Dual licensed under the MIT and GPL licenses:
14 | * http://www.opensource.org/licenses/mit-license.php
15 | * http://www.gnu.org/licenses/gpl.html
16 | */
17 |
18 | #fancybox-loading {
19 | position: fixed;
20 | top: 50%;
21 | left: 50%;
22 | width: 40px;
23 | height: 40px;
24 | margin-top: -20px;
25 | margin-left: -20px;
26 | cursor: pointer;
27 | overflow: hidden;
28 | z-index: 1104;
29 | display: none;
30 | }
31 |
32 | #fancybox-loading div {
33 | position: absolute;
34 | top: 0;
35 | left: 0;
36 | width: 40px;
37 | height: 480px;
38 | background-image: url(<%= asset_path 'fancybox.png' %>);
39 | }
40 |
41 | #fancybox-overlay {
42 | position: absolute;
43 | top: 0;
44 | left: 0;
45 | width: 100%;
46 | z-index: 1100;
47 | display: none;
48 | }
49 |
50 | #fancybox-tmp {
51 | padding: 0;
52 | margin: 0;
53 | border: 0;
54 | overflow: auto;
55 | display: none;
56 | }
57 |
58 | #fancybox-wrap {
59 | position: absolute;
60 | top: 0;
61 | left: 0;
62 | padding: 20px;
63 | z-index: 1101;
64 | outline: none;
65 | display: none;
66 | }
67 |
68 | #fancybox-outer {
69 | position: relative;
70 | width: 100%;
71 | height: 100%;
72 | background: #fff;
73 | }
74 |
75 | #fancybox-content {
76 | width: 0;
77 | height: 0;
78 | padding: 0;
79 | outline: none;
80 | position: relative;
81 | overflow: hidden;
82 | z-index: 1102;
83 | border: 0px solid #fff;
84 | }
85 |
86 | #fancybox-hide-sel-frame {
87 | position: absolute;
88 | top: 0;
89 | left: 0;
90 | width: 100%;
91 | height: 100%;
92 | background: transparent;
93 | z-index: 1101;
94 | }
95 |
96 | #fancybox-close {
97 | position: absolute;
98 | top: -15px;
99 | right: -15px;
100 | width: 30px;
101 | height: 30px;
102 | background: transparent url(<%= asset_path 'fancybox.png' %>) -40px 0px;
103 | cursor: pointer;
104 | z-index: 1103;
105 | display: none;
106 | }
107 |
108 | #fancybox-error {
109 | color: #444;
110 | font: normal 12px/20px Arial;
111 | padding: 14px;
112 | margin: 0;
113 | }
114 |
115 | #fancybox-img {
116 | width: 100%;
117 | height: 100%;
118 | padding: 0;
119 | margin: 0;
120 | border: none;
121 | outline: none;
122 | line-height: 0;
123 | vertical-align: top;
124 | }
125 |
126 | #fancybox-frame {
127 | width: 100%;
128 | height: 100%;
129 | border: none;
130 | display: block;
131 | }
132 |
133 | #fancybox-left, #fancybox-right {
134 | position: absolute;
135 | bottom: 0px;
136 | height: 100%;
137 | width: 35%;
138 | cursor: pointer;
139 | outline: none;
140 | background: transparent url(<%= asset_path 'blank.gif' %>);
141 | z-index: 1102;
142 | display: none;
143 | }
144 |
145 | #fancybox-left {
146 | left: 0px;
147 | }
148 |
149 | #fancybox-right {
150 | right: 0px;
151 | }
152 |
153 | #fancybox-left-ico, #fancybox-right-ico {
154 | position: absolute;
155 | top: 50%;
156 | left: -9999px;
157 | width: 30px;
158 | height: 30px;
159 | margin-top: -15px;
160 | cursor: pointer;
161 | z-index: 1102;
162 | display: block;
163 | }
164 |
165 | #fancybox-left-ico {
166 | background-image: url(<%= asset_path 'fancybox.png' %>);
167 | background-position: -40px -30px;
168 | }
169 |
170 | #fancybox-right-ico {
171 | background-image: url(<%= asset_path 'fancybox.png' %>);
172 | background-position: -40px -60px;
173 | }
174 |
175 | #fancybox-left:hover, #fancybox-right:hover {
176 | visibility: visible; /* IE6 */
177 | }
178 |
179 | #fancybox-left:hover span {
180 | left: 20px;
181 | }
182 |
183 | #fancybox-right:hover span {
184 | left: auto;
185 | right: 20px;
186 | }
187 |
188 | .fancybox-bg {
189 | position: absolute;
190 | padding: 0;
191 | margin: 0;
192 | border: 0;
193 | width: 20px;
194 | height: 20px;
195 | z-index: 1001;
196 | }
197 |
198 | #fancybox-bg-n {
199 | top: -20px;
200 | left: 0;
201 | width: 100%;
202 | background-image: url(<%= asset_path 'fancybox-x.png' %>);
203 | }
204 |
205 | #fancybox-bg-ne {
206 | top: -20px;
207 | right: -20px;
208 | background-image: url(<%= asset_path 'fancybox.png' %>);
209 | background-position: -40px -162px;
210 | }
211 |
212 | #fancybox-bg-e {
213 | top: 0;
214 | right: -20px;
215 | height: 100%;
216 | background-image: url(<%= asset_path 'fancybox-y.png' %>);
217 | background-position: -20px 0px;
218 | }
219 |
220 | #fancybox-bg-se {
221 | bottom: -20px;
222 | right: -20px;
223 | background-image: url(<%= asset_path 'fancybox.png' %>);
224 | background-position: -40px -182px;
225 | }
226 |
227 | #fancybox-bg-s {
228 | bottom: -20px;
229 | left: 0;
230 | width: 100%;
231 | background-image: url(<%= asset_path 'fancybox-x.png' %>);
232 | background-position: 0px -20px;
233 | }
234 |
235 | #fancybox-bg-sw {
236 | bottom: -20px;
237 | left: -20px;
238 | background-image: url(<%= asset_path 'fancybox.png' %>);
239 | background-position: -40px -142px;
240 | }
241 |
242 | #fancybox-bg-w {
243 | top: 0;
244 | left: -20px;
245 | height: 100%;
246 | background-image: url(<%= asset_path 'fancybox-y.png' %>);
247 | }
248 |
249 | #fancybox-bg-nw {
250 | top: -20px;
251 | left: -20px;
252 | background-image: url(<%= asset_path 'fancybox.png' %>);
253 | background-position: -40px -122px;
254 | }
255 |
256 | #fancybox-title {
257 | font-family: Helvetica;
258 | font-size: 12px;
259 | z-index: 1102;
260 | }
261 |
262 | .fancybox-title-inside {
263 | padding-bottom: 10px;
264 | text-align: center;
265 | color: #333;
266 | background: #fff;
267 | position: relative;
268 | }
269 |
270 | .fancybox-title-outside {
271 | padding-top: 10px;
272 | color: #fff;
273 | }
274 |
275 | .fancybox-title-over {
276 | position: absolute;
277 | bottom: 0;
278 | left: 0;
279 | color: #FFF;
280 | text-align: left;
281 | }
282 |
283 | #fancybox-title-over {
284 | padding: 10px;
285 | background-image: url(<%= asset_path 'fancy_title_over.png' %>);
286 | display: block;
287 | }
288 |
289 | .fancybox-title-float {
290 | position: absolute;
291 | left: 0;
292 | bottom: -20px;
293 | height: 32px;
294 | }
295 |
296 | #fancybox-title-float-wrap {
297 | border: none;
298 | border-collapse: collapse;
299 | width: auto;
300 | }
301 |
302 | #fancybox-title-float-wrap td {
303 | border: none;
304 | white-space: nowrap;
305 | }
306 |
307 | #fancybox-title-float-left {
308 | padding: 0 0 0 15px;
309 | background: url(<%= asset_path 'fancybox.png' %>) -40px -90px no-repeat;
310 | }
311 |
312 | #fancybox-title-float-main {
313 | color: #FFF;
314 | line-height: 29px;
315 | font-weight: bold;
316 | padding: 0 0 3px 0;
317 | background: url(<%= asset_path 'fancybox-x.png' %>) 0px -40px;
318 | }
319 |
320 | #fancybox-title-float-right {
321 | padding: 0 0 0 15px;
322 | background: url(<%= asset_path 'fancybox.png' %>) -55px -90px no-repeat;
323 | }
324 |
325 | /* IE6 */
326 |
327 | .fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_close.png' %>", sizingMethod='scale'); }
328 |
329 | .fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_nav_left.png' %>", sizingMethod='scale'); }
330 | .fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_nav_right.png' %>", sizingMethod='scale'); }
331 |
332 | .fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_title_over.png' %>", sizingMethod='scale'); zoom: 1; }
333 | .fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_title_left.png' %>", sizingMethod='scale'); }
334 | .fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_title_main.png' %>", sizingMethod='scale'); }
335 | .fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_title_right.png' %>", sizingMethod='scale'); }
336 |
337 | .fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
338 | height: expression(this.parentNode.clientHeight + "px");
339 | }
340 |
341 | #fancybox-loading.fancybox-ie6 {
342 | position: absolute; margin-top: 0;
343 | top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
344 | }
345 |
346 | #fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_loading.png' %>", sizingMethod='scale'); }
347 |
348 | /* IE6, IE7, IE8 */
349 |
350 | .fancybox-ie .fancybox-bg { background: transparent !important; }
351 |
352 | .fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_n.png' %>", sizingMethod='scale'); }
353 | .fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_ne.png' %>", sizingMethod='scale'); }
354 | .fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_e.png' %>", sizingMethod='scale'); }
355 | .fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_se.png' %>", sizingMethod='scale'); }
356 | .fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_s.png' %>", sizingMethod='scale'); }
357 | .fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_sw.png' %>", sizingMethod='scale'); }
358 | .fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_w.png' %>", sizingMethod='scale'); }
359 | .fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="<%= asset_path 'fancy_shadow_nw.png' %>", sizingMethod='scale'); }
360 |
--------------------------------------------------------------------------------