nouvelle version
74
Gemfile
@ -1,73 +1,41 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
|
gem 'rails', '4.1.4'
|
||||||
gem 'rails', '4.0.0'
|
gem 'bcrypt', '~> 3.1.7'
|
||||||
|
|
||||||
|
|
||||||
gem 'bcrypt-ruby', '~> 3.0.0'
|
|
||||||
# Use sqlite3 as the database for Active Record
|
|
||||||
gem 'sqlite3'
|
gem 'sqlite3'
|
||||||
gem 'mysql2'
|
gem 'sass-rails', '~> 4.0.3'
|
||||||
|
|
||||||
# Use Uglifier as compressor for JavaScript assets
|
|
||||||
gem 'uglifier', '>= 1.3.0'
|
gem 'uglifier', '>= 1.3.0'
|
||||||
|
|
||||||
# Use CoffeeScript for .js.coffee assets and views
|
|
||||||
gem 'coffee-rails', '~> 4.0.0'
|
gem 'coffee-rails', '~> 4.0.0'
|
||||||
|
|
||||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
|
||||||
# gem 'therubyracer', platforms: :ruby
|
|
||||||
|
|
||||||
# Use jquery as the JavaScript library
|
|
||||||
gem 'jquery-rails'
|
gem 'jquery-rails'
|
||||||
|
|
||||||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
|
|
||||||
gem 'turbolinks'
|
gem 'turbolinks'
|
||||||
|
gem 'jbuilder', '~> 2.0'
|
||||||
|
|
||||||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
gem 'sdoc', '~> 0.4.0', group: :doc
|
||||||
gem 'jbuilder', '~> 1.0.1'
|
|
||||||
|
|
||||||
gem "therubyracer"
|
gem 'spring', group: :development
|
||||||
gem "less-rails" , "2.3.3"
|
|
||||||
gem "twitter-bootstrap-rails"
|
|
||||||
|
|
||||||
gem 'haml-rails'
|
gem 'haml-rails'
|
||||||
|
|
||||||
gem 'nokogiri'
|
|
||||||
gem 'acts_as_tree'
|
|
||||||
gem 'formtastic', :git => 'git://github.com/justinfrench/formtastic.git'
|
|
||||||
|
|
||||||
|
|
||||||
gem 'kaminari-bootstrap'
|
|
||||||
|
|
||||||
|
|
||||||
gem "htmlentities"
|
|
||||||
|
|
||||||
gem 'carrierwave'
|
|
||||||
gem 'rmagick'
|
|
||||||
|
|
||||||
group :doc do
|
|
||||||
# bundle exec rake doc:rails generates the API under doc/api.
|
|
||||||
gem 'sdoc', require: false
|
|
||||||
end
|
|
||||||
|
|
||||||
gem "capistrano", group: :development
|
|
||||||
gem "rvm-capistrano", group: :development
|
|
||||||
|
|
||||||
# Use ActiveModel has_secure_password
|
|
||||||
# gem 'bcrypt-ruby', '~> 3.0.0'
|
|
||||||
|
|
||||||
# Use unicorn as the app server
|
|
||||||
gem 'unicorn'
|
gem 'unicorn'
|
||||||
|
|
||||||
gem "nokogiri"
|
gem "capistrano", '2.15.5', group: :development
|
||||||
|
gem "rvm-capistrano",'1.4.1', group: :development
|
||||||
|
gem 'net-ssh', '~>2.7.0'
|
||||||
|
|
||||||
|
gem "therubyracer"
|
||||||
|
|
||||||
|
|
||||||
|
gem 'carrierwave'
|
||||||
|
gem 'rmagick', :require => 'RMagick'
|
||||||
|
gem 'acts_as_tree'
|
||||||
|
gem 'formtastic', "2.3.0"
|
||||||
|
|
||||||
|
gem "twitter-bootstrap-rails"
|
||||||
|
gem 'formtastic-bootstrap'
|
||||||
|
|
||||||
gem 'kaminari-bootstrap'
|
gem 'kaminari-bootstrap'
|
||||||
|
|
||||||
gem 'acts_as_commentable'
|
gem 'acts_as_commentable'
|
||||||
|
gem "mysql2"
|
||||||
# Use debugger
|
|
||||||
# gem 'debugger', group: [:development, :test]
|
|
||||||
|
|
||||||
|
|
||||||
gem 'net-ssh', '2.7.0'
|
|
204
Gemfile.lock
@ -1,43 +1,38 @@
|
|||||||
GIT
|
|
||||||
remote: git://github.com/justinfrench/formtastic.git
|
|
||||||
revision: c79e46560d1516c6c3c0ef85fb29bed8e36068ac
|
|
||||||
specs:
|
|
||||||
formtastic (2.3.0.rc3)
|
|
||||||
actionpack (>= 3.2.13)
|
|
||||||
|
|
||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actionmailer (4.0.0)
|
actionmailer (4.1.4)
|
||||||
actionpack (= 4.0.0)
|
actionpack (= 4.1.4)
|
||||||
mail (~> 2.5.3)
|
actionview (= 4.1.4)
|
||||||
actionpack (4.0.0)
|
mail (~> 2.5.4)
|
||||||
activesupport (= 4.0.0)
|
actionpack (4.1.4)
|
||||||
builder (~> 3.1.0)
|
actionview (= 4.1.4)
|
||||||
erubis (~> 2.7.0)
|
activesupport (= 4.1.4)
|
||||||
rack (~> 1.5.2)
|
rack (~> 1.5.2)
|
||||||
rack-test (~> 0.6.2)
|
rack-test (~> 0.6.2)
|
||||||
activemodel (4.0.0)
|
actionview (4.1.4)
|
||||||
activesupport (= 4.0.0)
|
activesupport (= 4.1.4)
|
||||||
builder (~> 3.1.0)
|
builder (~> 3.1)
|
||||||
activerecord (4.0.0)
|
erubis (~> 2.7.0)
|
||||||
activemodel (= 4.0.0)
|
activemodel (4.1.4)
|
||||||
activerecord-deprecated_finders (~> 1.0.2)
|
activesupport (= 4.1.4)
|
||||||
activesupport (= 4.0.0)
|
builder (~> 3.1)
|
||||||
arel (~> 4.0.0)
|
activerecord (4.1.4)
|
||||||
activerecord-deprecated_finders (1.0.3)
|
activemodel (= 4.1.4)
|
||||||
activesupport (4.0.0)
|
activesupport (= 4.1.4)
|
||||||
i18n (~> 0.6, >= 0.6.4)
|
arel (~> 5.0.0)
|
||||||
minitest (~> 4.2)
|
activesupport (4.1.4)
|
||||||
multi_json (~> 1.3)
|
i18n (~> 0.6, >= 0.6.9)
|
||||||
|
json (~> 1.7, >= 1.7.7)
|
||||||
|
minitest (~> 5.1)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
tzinfo (~> 0.3.37)
|
tzinfo (~> 1.1)
|
||||||
acts_as_commentable (4.0.1)
|
acts_as_commentable (4.0.2)
|
||||||
acts_as_tree (1.5.1)
|
acts_as_tree (2.1.0)
|
||||||
activerecord (>= 3.0.0)
|
activerecord (>= 3.0.0)
|
||||||
arel (4.0.2)
|
arel (5.0.1.20140414130214)
|
||||||
bcrypt-ruby (3.0.1)
|
bcrypt (3.1.7)
|
||||||
builder (3.1.4)
|
builder (3.2.2)
|
||||||
capistrano (2.15.5)
|
capistrano (2.15.5)
|
||||||
highline
|
highline
|
||||||
net-scp (>= 1.0.0)
|
net-scp (>= 1.0.0)
|
||||||
@ -52,94 +47,98 @@ GEM
|
|||||||
coffee-rails (4.0.1)
|
coffee-rails (4.0.1)
|
||||||
coffee-script (>= 2.2.0)
|
coffee-script (>= 2.2.0)
|
||||||
railties (>= 4.0.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
coffee-script (2.2.0)
|
coffee-script (2.3.0)
|
||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.7.0)
|
coffee-script-source (1.8.0)
|
||||||
commonjs (0.2.7)
|
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
execjs (2.0.2)
|
execjs (2.2.1)
|
||||||
|
formtastic (2.3.0)
|
||||||
|
actionpack (>= 3.0)
|
||||||
|
formtastic-bootstrap (3.0.0)
|
||||||
|
formtastic (>= 2.2)
|
||||||
haml (4.0.5)
|
haml (4.0.5)
|
||||||
tilt
|
tilt
|
||||||
haml-rails (0.5.1)
|
haml-rails (0.5.3)
|
||||||
actionpack (~> 4.0.0)
|
actionpack (>= 4.0.1)
|
||||||
activesupport (~> 4.0.0)
|
activesupport (>= 4.0.1)
|
||||||
haml (>= 3.1, < 5.0)
|
haml (>= 3.1, < 5.0)
|
||||||
railties (~> 4.0.0)
|
railties (>= 4.0.1)
|
||||||
highline (1.6.21)
|
highline (1.6.21)
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
htmlentities (4.3.1)
|
i18n (0.6.11)
|
||||||
i18n (0.6.9)
|
jbuilder (2.1.3)
|
||||||
jbuilder (1.0.2)
|
activesupport (>= 3.0.0, < 5)
|
||||||
activesupport (>= 3.0.0)
|
multi_json (~> 1.2)
|
||||||
jquery-rails (3.1.0)
|
jquery-rails (3.1.2)
|
||||||
railties (>= 3.0, < 5.0)
|
railties (>= 3.0, < 5.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (1.8.1)
|
json (1.8.1)
|
||||||
kaminari (0.15.1)
|
kaminari (0.16.1)
|
||||||
actionpack (>= 3.0.0)
|
actionpack (>= 3.0.0)
|
||||||
activesupport (>= 3.0.0)
|
activesupport (>= 3.0.0)
|
||||||
kaminari-bootstrap (3.0.1)
|
kaminari-bootstrap (3.0.1)
|
||||||
kaminari (>= 0.13.0)
|
kaminari (>= 0.13.0)
|
||||||
rails
|
rails
|
||||||
kgio (2.9.2)
|
kgio (2.9.2)
|
||||||
less (2.3.3)
|
libv8 (3.16.14.7)
|
||||||
commonjs (~> 0.2.6)
|
|
||||||
less-rails (2.3.3)
|
|
||||||
actionpack (>= 3.1)
|
|
||||||
less (~> 2.3.1)
|
|
||||||
libv8 (3.16.14.3)
|
|
||||||
mail (2.5.4)
|
mail (2.5.4)
|
||||||
mime-types (~> 1.16)
|
mime-types (~> 1.16)
|
||||||
treetop (~> 1.4.8)
|
treetop (~> 1.4.8)
|
||||||
mime-types (1.25.1)
|
mime-types (1.25.1)
|
||||||
mini_portile (0.5.3)
|
minitest (5.4.2)
|
||||||
minitest (4.7.5)
|
multi_json (1.10.1)
|
||||||
multi_json (1.9.2)
|
mysql2 (0.3.16)
|
||||||
mysql2 (0.3.15)
|
net-scp (1.2.1)
|
||||||
net-scp (1.2.0)
|
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
net-sftp (2.1.2)
|
net-sftp (2.1.2)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
net-ssh (2.7.0)
|
net-ssh (2.7.0)
|
||||||
net-ssh-gateway (1.2.0)
|
net-ssh-gateway (1.2.0)
|
||||||
net-ssh (>= 2.6.5)
|
net-ssh (>= 2.6.5)
|
||||||
nokogiri (1.6.1)
|
polyglot (0.3.5)
|
||||||
mini_portile (~> 0.5.0)
|
|
||||||
polyglot (0.3.4)
|
|
||||||
rack (1.5.2)
|
rack (1.5.2)
|
||||||
rack-test (0.6.2)
|
rack-test (0.6.2)
|
||||||
rack (>= 1.0)
|
rack (>= 1.0)
|
||||||
rails (4.0.0)
|
rails (4.1.4)
|
||||||
actionmailer (= 4.0.0)
|
actionmailer (= 4.1.4)
|
||||||
actionpack (= 4.0.0)
|
actionpack (= 4.1.4)
|
||||||
activerecord (= 4.0.0)
|
actionview (= 4.1.4)
|
||||||
activesupport (= 4.0.0)
|
activemodel (= 4.1.4)
|
||||||
|
activerecord (= 4.1.4)
|
||||||
|
activesupport (= 4.1.4)
|
||||||
bundler (>= 1.3.0, < 2.0)
|
bundler (>= 1.3.0, < 2.0)
|
||||||
railties (= 4.0.0)
|
railties (= 4.1.4)
|
||||||
sprockets-rails (~> 2.0.0)
|
sprockets-rails (~> 2.0)
|
||||||
railties (4.0.0)
|
railties (4.1.4)
|
||||||
actionpack (= 4.0.0)
|
actionpack (= 4.1.4)
|
||||||
activesupport (= 4.0.0)
|
activesupport (= 4.1.4)
|
||||||
rake (>= 0.8.7)
|
rake (>= 0.8.7)
|
||||||
thor (>= 0.18.1, < 2.0)
|
thor (>= 0.18.1, < 2.0)
|
||||||
raindrops (0.13.0)
|
raindrops (0.13.0)
|
||||||
rake (10.3.0)
|
rake (10.3.2)
|
||||||
rdoc (4.1.1)
|
rdoc (4.1.2)
|
||||||
json (~> 1.4)
|
json (~> 1.4)
|
||||||
ref (1.0.5)
|
ref (1.0.5)
|
||||||
rmagick (2.13.2)
|
rmagick (2.13.3)
|
||||||
rvm-capistrano (1.5.1)
|
rvm-capistrano (1.4.1)
|
||||||
capistrano (~> 2.15.4)
|
capistrano (>= 2.0.0)
|
||||||
sdoc (0.4.0)
|
sass (3.2.19)
|
||||||
json (~> 1.8)
|
sass-rails (4.0.3)
|
||||||
rdoc (~> 4.0, < 5.0)
|
railties (>= 4.0.0, < 5.0)
|
||||||
sprockets (2.12.0)
|
sass (~> 3.2.0)
|
||||||
|
sprockets (~> 2.8, <= 2.11.0)
|
||||||
|
sprockets-rails (~> 2.0)
|
||||||
|
sdoc (0.4.1)
|
||||||
|
json (~> 1.7, >= 1.7.7)
|
||||||
|
rdoc (~> 4.0)
|
||||||
|
spring (1.1.3)
|
||||||
|
sprockets (2.11.0)
|
||||||
hike (~> 1.2)
|
hike (~> 1.2)
|
||||||
multi_json (~> 1.0)
|
multi_json (~> 1.0)
|
||||||
rack (~> 1.0)
|
rack (~> 1.0)
|
||||||
tilt (~> 1.1, != 1.3.0)
|
tilt (~> 1.1, != 1.3.0)
|
||||||
sprockets-rails (2.0.1)
|
sprockets-rails (2.1.4)
|
||||||
actionpack (>= 3.0)
|
actionpack (>= 3.0)
|
||||||
activesupport (>= 3.0)
|
activesupport (>= 3.0)
|
||||||
sprockets (~> 2.8)
|
sprockets (~> 2.8)
|
||||||
@ -148,23 +147,24 @@ GEM
|
|||||||
libv8 (~> 3.16.14.0)
|
libv8 (~> 3.16.14.0)
|
||||||
ref
|
ref
|
||||||
thor (0.19.1)
|
thor (0.19.1)
|
||||||
thread_safe (0.3.3)
|
thread_safe (0.3.4)
|
||||||
tilt (1.4.1)
|
tilt (1.4.1)
|
||||||
treetop (1.4.15)
|
treetop (1.4.15)
|
||||||
polyglot
|
polyglot
|
||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
turbolinks (2.2.2)
|
turbolinks (2.4.0)
|
||||||
coffee-rails
|
coffee-rails
|
||||||
twitter-bootstrap-rails (2.2.8)
|
twitter-bootstrap-rails (3.2.0)
|
||||||
actionpack (>= 3.1)
|
actionpack (~> 4.1)
|
||||||
execjs
|
execjs (~> 2.2)
|
||||||
rails (>= 3.1)
|
rails (~> 4.1)
|
||||||
railties (>= 3.1)
|
railties (~> 4.1)
|
||||||
tzinfo (0.3.39)
|
tzinfo (1.2.2)
|
||||||
uglifier (2.5.0)
|
thread_safe (~> 0.1)
|
||||||
|
uglifier (2.5.3)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
json (>= 1.8.0)
|
json (>= 1.8.0)
|
||||||
unicorn (4.8.2)
|
unicorn (4.8.3)
|
||||||
kgio (~> 2.6)
|
kgio (~> 2.6)
|
||||||
rack
|
rack
|
||||||
raindrops (~> 0.7)
|
raindrops (~> 0.7)
|
||||||
@ -175,24 +175,24 @@ PLATFORMS
|
|||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
acts_as_commentable
|
acts_as_commentable
|
||||||
acts_as_tree
|
acts_as_tree
|
||||||
bcrypt-ruby (~> 3.0.0)
|
bcrypt (~> 3.1.7)
|
||||||
capistrano
|
capistrano (= 2.15.5)
|
||||||
carrierwave
|
carrierwave
|
||||||
coffee-rails (~> 4.0.0)
|
coffee-rails (~> 4.0.0)
|
||||||
formtastic!
|
formtastic (= 2.3.0)
|
||||||
|
formtastic-bootstrap
|
||||||
haml-rails
|
haml-rails
|
||||||
htmlentities
|
jbuilder (~> 2.0)
|
||||||
jbuilder (~> 1.0.1)
|
|
||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari-bootstrap
|
kaminari-bootstrap
|
||||||
less-rails (= 2.3.3)
|
|
||||||
mysql2
|
mysql2
|
||||||
net-ssh (= 2.7.0)
|
net-ssh (~> 2.7.0)
|
||||||
nokogiri
|
rails (= 4.1.4)
|
||||||
rails (= 4.0.0)
|
|
||||||
rmagick
|
rmagick
|
||||||
rvm-capistrano
|
rvm-capistrano (= 1.4.1)
|
||||||
sdoc
|
sass-rails (~> 4.0.3)
|
||||||
|
sdoc (~> 0.4.0)
|
||||||
|
spring
|
||||||
sqlite3
|
sqlite3
|
||||||
therubyracer
|
therubyracer
|
||||||
turbolinks
|
turbolinks
|
||||||
|
2
Rakefile
@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
require File.expand_path('../config/application', __FILE__)
|
require File.expand_path('../config/application', __FILE__)
|
||||||
|
|
||||||
CMSnb::Application.load_tasks
|
Rails.application.load_tasks
|
||||||
|
Before Width: | Height: | Size: 434 B |
Before Width: | Height: | Size: 737 B |
Before Width: | Height: | Size: 6.4 KiB |
Before Width: | Height: | Size: 26 KiB |
BIN
app/assets/images/fond.jpg
Normal file
After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 6.5 KiB |
BIN
app/assets/images/images/bx_loader.gif
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
app/assets/images/images/controls.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 5.4 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2.4 KiB |
@ -1,21 +1,14 @@
|
|||||||
|
|
||||||
#= require jquery
|
#= require jquery
|
||||||
#= require jquery_ujs
|
#= require jquery_ujs
|
||||||
|
|
||||||
#= require shared/forms
|
|
||||||
#= require event_form
|
|
||||||
|
|
||||||
#= require twitter/bootstrap
|
|
||||||
#= require vendor/jquery-sortable
|
|
||||||
|
|
||||||
#= require vendor/jquery.event.drag.js
|
|
||||||
|
|
||||||
# require turbolinks
|
# require turbolinks
|
||||||
|
|
||||||
#= require vendor/bootstrap-slider
|
#= require event_form
|
||||||
#= require vendor/bootstrap-datepicker
|
#= require bootstrap
|
||||||
#= require vendor/bootstrap-timepicker
|
|
||||||
|
|
||||||
|
#= require vendor/jquery-sortable
|
||||||
|
#= require vendor/jquery.event.drag.js
|
||||||
|
#= require vendor/bootstrap-slider
|
||||||
#= require vendor/jquery.ui.widget
|
#= require vendor/jquery.ui.widget
|
||||||
#= require vendor/tmpl.min
|
#= require vendor/tmpl.min
|
||||||
#= require vendor/jquery.iframe-transport
|
#= require vendor/jquery.iframe-transport
|
||||||
@ -31,97 +24,159 @@
|
|||||||
|
|
||||||
|
|
||||||
#= require redactor
|
#= require redactor
|
||||||
|
#= require redactor_plugins/fontsize
|
||||||
|
#= require redactor_plugins/fontfamily
|
||||||
|
#= require redactor_plugins/fontcolor
|
||||||
|
|
||||||
#= require nested_fields
|
#= require nested_fields
|
||||||
|
|
||||||
|
portlet_to_move = false
|
||||||
@init_categories_list = ->
|
content_type_to_move =false
|
||||||
|
@open_collapse3 = ->
|
||||||
|
$("#collapse3 .panel").show()
|
||||||
|
$("#collapse3").show()
|
||||||
|
|
||||||
if $(".prevv_folder").length > 0
|
@reset_edit_pane = ->
|
||||||
|
$("#element_form").html()
|
||||||
|
$("#collapse3").hide()
|
||||||
|
|
||||||
|
@unselect_portlet = ->
|
||||||
|
$(".portlet.active").removeClass("active")
|
||||||
|
reset_edit_pane()
|
||||||
|
|
||||||
|
@cancel_move_portlet = ->
|
||||||
|
$(".move_message").show()
|
||||||
|
$(".cancel_message").hide()
|
||||||
|
|
||||||
|
$(".move").removeClass("move")
|
||||||
|
$(".portlet_placeholder").remove()
|
||||||
|
portlet_to_move = false
|
||||||
|
|
||||||
|
$(document).ready ->
|
||||||
|
|
||||||
|
$(document).on 'click', 'input.datepicker', ->
|
||||||
|
$(this).datetimepicker(
|
||||||
|
language: 'fr'
|
||||||
|
pickTime: false
|
||||||
|
).focus();
|
||||||
|
|
||||||
|
$(document).on 'click', 'input.datetimepicker', ->
|
||||||
|
$(this).datetimepicker(
|
||||||
|
use24hours: true
|
||||||
|
format: 'DD/MM/YYYY hh:mm'
|
||||||
|
minuteStepping:15
|
||||||
|
language: 'fr'
|
||||||
|
).focus();
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on 'click', 'input.timepicker', ->
|
||||||
|
$(this).datetimepicker(
|
||||||
|
use24hours: true
|
||||||
|
format: 'DD/MM/YYYY hh:mm'
|
||||||
|
minuteStepping:15
|
||||||
|
pickDate: false
|
||||||
|
language: 'fr'
|
||||||
|
).focus();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(".prevv_folder").sortable({
|
|
||||||
group:"categories",
|
|
||||||
containerSelector :".receptable",
|
|
||||||
itemSelector:".category_row",
|
|
||||||
handle: ".handle",
|
|
||||||
nested:false,
|
|
||||||
placeholder:"<div class='placeholder'></div>",
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on "click", ".portlet", (event) ->
|
||||||
|
if !$(this).hasClass("active") and portlet_to_move == false
|
||||||
|
|
||||||
|
$(".portlet.active").removeClass("active")
|
||||||
|
$(this).addClass("active")
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({url : $(this).data("edit-link"), type: "GET"});
|
||||||
|
$("#collapse3 .trash").attr("href", $(this).data("show-link"));
|
||||||
|
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
$(document).on "click", ".block_portlets", (event) ->
|
||||||
|
portlet_to_move = false
|
||||||
|
content_type_to_move = false
|
||||||
|
$("#element_form").html("")
|
||||||
|
|
||||||
|
$(".portlet.active").removeClass("active")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on "click", "#content_types .content_type", ->
|
||||||
|
cancel_move_portlet()
|
||||||
|
unselect_portlet()
|
||||||
|
reset_edit_pane()
|
||||||
|
|
||||||
|
|
||||||
|
type = $(this).data("type")
|
||||||
|
content_type_to_move = type
|
||||||
|
init_portlets_place_holder()
|
||||||
|
$(this).addClass("move")
|
||||||
|
false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$(document).on "click", ".portlet_handle", ->
|
||||||
|
if portlet_to_move == false
|
||||||
|
|
||||||
|
$(".move_message").hide()
|
||||||
|
$(".cancel_message").show()
|
||||||
|
|
||||||
|
|
||||||
|
id = $(this).data("portlet-id")
|
||||||
|
portlet_to_move = $("#portlet_"+id)
|
||||||
|
init_portlets_place_holder()
|
||||||
|
portlet_to_move.addClass("move")
|
||||||
|
false
|
||||||
|
else
|
||||||
|
cancel_move_portlet()
|
||||||
|
|
||||||
|
false
|
||||||
|
|
||||||
|
$(document).on "click", ".portlet_placeholder", ->
|
||||||
|
if portlet_to_move != false
|
||||||
|
$(this).after portlet_to_move
|
||||||
|
$(".move").removeClass("move")
|
||||||
|
$(".portlet_placeholder").remove()
|
||||||
|
update_block_portlet_order(portlet_to_move.closest(".block_portlets").data("block_id"))
|
||||||
|
cancel_move_portlet()
|
||||||
|
else
|
||||||
|
|
||||||
|
block_id = $(this).closest(".block_portlets").data("block_id")
|
||||||
|
|
||||||
|
|
||||||
|
$(this).replaceWith('<div id="new_portlet_form_inline" class="portlet"><div id="new_portlet_content_form"></div></div>');
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url:"/portlet/portlets/new.js",
|
||||||
|
type: "GET",
|
||||||
|
data: {
|
||||||
|
block_id : block_id,
|
||||||
|
position : $(this).attr("data_position"),
|
||||||
|
content_type : content_type_to_move
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
oldContainer = ""
|
content_type_to_move = false
|
||||||
$("#sortable_category").sortable({
|
$(".portlet_placeholder").remove()
|
||||||
group:"categories",
|
|
||||||
containerSelector :".receptable",
|
|
||||||
itemSelector:".category_row",
|
|
||||||
handle: ".handle",
|
|
||||||
nested:true,
|
|
||||||
placeholder:"<div class='placeholder'></div>",
|
|
||||||
afterMove: (placeholder, container) ->
|
|
||||||
if oldContainer != container and container.el.hasClass("prevv_folder")
|
|
||||||
if oldContainer
|
|
||||||
oldContainer.el.removeClass("active")
|
|
||||||
container.el.addClass("active")
|
|
||||||
oldContainer = container
|
|
||||||
onDrop: (item, Container, _super) ->
|
|
||||||
|
|
||||||
|
|
||||||
if Container
|
|
||||||
|
|
||||||
parent_id = Container.el.data("parent-id")
|
@init_portlets_place_holder = ->
|
||||||
menu_id = Container.el.data("menu-id")
|
placeholder = '<div class="portlet_placeholder"><i class="fa fa-angle-right place"></i></div>'
|
||||||
id = item.data("menu-item-id")
|
$(".block_portlets").each ->
|
||||||
$.ajax({
|
$(this).find(".portlet_placeholder").remove()
|
||||||
url:"/admin/categories/"+id+".js",
|
$(this).prepend(placeholder)
|
||||||
type: "PUT",
|
$(this).find(".portlet").each ->
|
||||||
data: {
|
$(this).after(placeholder)
|
||||||
reorder : true,
|
|
||||||
category : {
|
|
||||||
parent_id : parent_id,
|
|
||||||
menu_id : menu_id
|
|
||||||
}
|
|
||||||
},
|
|
||||||
success : ->
|
|
||||||
|
|
||||||
|
|
||||||
_super(item)
|
|
||||||
item.remove()
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_super(item)
|
|
||||||
|
|
||||||
sortable_data = {parent_id :$("#sortable_category").data("parent-id"), menu_id :$("#sortable_category").data("menu-id") , categories_ids : []}
|
|
||||||
|
|
||||||
$("#sortable_category").find(".category_row").each ->
|
|
||||||
sortable_data.categories_ids.push $(this).data("menu-item-id")
|
|
||||||
|
|
||||||
|
|
||||||
$.ajax({url : "/admin/categories/reorder", data : sortable_data, type: "POST"});
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@flash_delay = ->
|
@flash_delay = ->
|
||||||
$("#flashs").find(".alert").each ->
|
$("#flashs").find(".alert").each ->
|
||||||
@ -226,6 +281,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$.ajax({url : "/portlet/portlets/reorder", data : {blocks:return_order}, type: "POST"})
|
$.ajax({url : "/portlet/portlets/reorder", data : {blocks:return_order}, type: "POST"})
|
||||||
|
|
||||||
|
|
||||||
jQuery ->
|
jQuery ->
|
||||||
|
|
||||||
@ -273,68 +329,7 @@ jQuery ->
|
|||||||
|
|
||||||
|
|
||||||
item_catched = ""
|
item_catched = ""
|
||||||
$(".block_portlets_sortable").sortable({
|
|
||||||
nested:true,
|
|
||||||
handle: ".handle",
|
|
||||||
group : "block_portlets",
|
|
||||||
containerSelector :".block_portlets",
|
|
||||||
itemSelector:".portlet",
|
|
||||||
placeholder:"<div class='placeholder'></div>",
|
|
||||||
onDrop: ($item, container, _super) ->
|
|
||||||
|
|
||||||
$item.removeClass("dragged").removeAttr("style")
|
|
||||||
$("body").removeClass("dragging")
|
|
||||||
|
|
||||||
|
|
||||||
if $item.data("portlet_id")
|
|
||||||
|
|
||||||
block_portlet_id = $item.closest(".block_portlets").data('block_id')
|
|
||||||
|
|
||||||
update_block_portlet_order block_portlet_id
|
|
||||||
|
|
||||||
|
|
||||||
else
|
|
||||||
$("#content_types").html item_catched
|
|
||||||
|
|
||||||
block_id = container.el.data("block_id")
|
|
||||||
|
|
||||||
|
|
||||||
$item.replaceWith('<div id="new_portlet_form_inline" class="portlet"><div id="new_portlet_content_form"></div></div>');
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
url:"/portlet/portlets/new.js",
|
|
||||||
type: "GET",
|
|
||||||
data: {
|
|
||||||
block_id : $(this).attr("data_block_id"),
|
|
||||||
position : $(this).attr("data_position"),
|
|
||||||
content_type : $item.attr("data_type")
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
isValidTarget: ($item, container) ->
|
|
||||||
|
|
||||||
if container.el.attr("id") != "content_types"
|
|
||||||
return true
|
|
||||||
|
|
||||||
onDragStart: ($item, container, _super) ->
|
|
||||||
item_catched = $("#content_types").html()
|
|
||||||
|
|
||||||
|
|
||||||
$item.css({
|
|
||||||
height: $item.height(),
|
|
||||||
width: $item.width()
|
|
||||||
})
|
|
||||||
$item.addClass("dragged")
|
|
||||||
$("body").addClass("dragging")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
adjustment = ""
|
adjustment = ""
|
||||||
|
|
||||||
@ -379,15 +374,27 @@ jQuery ->
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).on "scroll", () ->
|
$(document).on "scroll", () ->
|
||||||
|
|
||||||
if( $(this).scrollTop() <= 40 )
|
if( $(this).scrollTop() <= 52 )
|
||||||
top = 40 - $(this).scrollTop()
|
top = 52 - $(this).scrollTop()
|
||||||
else
|
else
|
||||||
top = 0
|
top = 0
|
||||||
|
|
||||||
$("#toolbar-text, #menu_item_informations").css
|
$("#toolbar-text, #menu_item_informations").css
|
||||||
top : top
|
top : top
|
||||||
|
|
||||||
|
$(document).on "click", "#menu_item_informations .save", ->
|
||||||
|
$(this).closest(".panel").find("form").submit()
|
||||||
|
return false
|
||||||
|
|
||||||
|
$(document).on "click", "#menu_item_informations h4", ->
|
||||||
|
$(this).next(".panel").toggle()
|
||||||
|
return false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
13
app/assets/javascripts/bootstrap.js
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
//= require bootstrap/affix
|
||||||
|
//= require bootstrap/alert
|
||||||
|
//= require bootstrap/button
|
||||||
|
//= require bootstrap/carousel
|
||||||
|
|
||||||
|
//= require bootstrap/dropdown
|
||||||
|
//= require bootstrap/tab
|
||||||
|
//= require bootstrap/transition
|
||||||
|
//= require bootstrap/scrollspy
|
||||||
|
//= require bootstrap/modal
|
||||||
|
//= require bootstrap/tooltip
|
||||||
|
//= require bootstrap/popover
|
||||||
|
//= require bootstrap/datetimepicker
|
137
app/assets/javascripts/bootstrap/affix.js
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: affix.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#affix
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// AFFIX CLASS DEFINITION
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
var Affix = function (element, options) {
|
||||||
|
this.options = $.extend({}, Affix.DEFAULTS, options)
|
||||||
|
this.$window = $(window)
|
||||||
|
.on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this))
|
||||||
|
.on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this))
|
||||||
|
|
||||||
|
this.$element = $(element)
|
||||||
|
this.affixed =
|
||||||
|
this.unpin =
|
||||||
|
this.pinnedOffset = null
|
||||||
|
|
||||||
|
this.checkPosition()
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.RESET = 'affix affix-top affix-bottom'
|
||||||
|
|
||||||
|
Affix.DEFAULTS = {
|
||||||
|
offset: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.prototype.getPinnedOffset = function () {
|
||||||
|
if (this.pinnedOffset) return this.pinnedOffset
|
||||||
|
this.$element.removeClass(Affix.RESET).addClass('affix')
|
||||||
|
var scrollTop = this.$window.scrollTop()
|
||||||
|
var position = this.$element.offset()
|
||||||
|
return (this.pinnedOffset = position.top - scrollTop)
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.prototype.checkPositionWithEventLoop = function () {
|
||||||
|
setTimeout($.proxy(this.checkPosition, this), 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
Affix.prototype.checkPosition = function () {
|
||||||
|
if (!this.$element.is(':visible')) return
|
||||||
|
|
||||||
|
var scrollHeight = $(document).height()
|
||||||
|
var scrollTop = this.$window.scrollTop()
|
||||||
|
var position = this.$element.offset()
|
||||||
|
var offset = this.options.offset
|
||||||
|
var offsetTop = offset.top
|
||||||
|
var offsetBottom = offset.bottom
|
||||||
|
|
||||||
|
if (this.affixed == 'top') position.top += scrollTop
|
||||||
|
|
||||||
|
if (typeof offset != 'object') offsetBottom = offsetTop = offset
|
||||||
|
if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element)
|
||||||
|
if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element)
|
||||||
|
|
||||||
|
var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false :
|
||||||
|
offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' :
|
||||||
|
offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false
|
||||||
|
|
||||||
|
if (this.affixed === affix) return
|
||||||
|
if (this.unpin) this.$element.css('top', '')
|
||||||
|
|
||||||
|
var affixType = 'affix' + (affix ? '-' + affix : '')
|
||||||
|
var e = $.Event(affixType + '.bs.affix')
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.affixed = affix
|
||||||
|
this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.removeClass(Affix.RESET)
|
||||||
|
.addClass(affixType)
|
||||||
|
.trigger($.Event(affixType.replace('affix', 'affixed')))
|
||||||
|
|
||||||
|
if (affix == 'bottom') {
|
||||||
|
this.$element.offset({ top: scrollHeight - offsetBottom - this.$element.height() })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
var old = $.fn.affix
|
||||||
|
|
||||||
|
$.fn.affix = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.affix')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.affix', (data = new Affix(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.affix.Constructor = Affix
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.affix.noConflict = function () {
|
||||||
|
$.fn.affix = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// AFFIX DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-spy="affix"]').each(function () {
|
||||||
|
var $spy = $(this)
|
||||||
|
var data = $spy.data()
|
||||||
|
|
||||||
|
data.offset = data.offset || {}
|
||||||
|
|
||||||
|
if (data.offsetBottom) data.offset.bottom = data.offsetBottom
|
||||||
|
if (data.offsetTop) data.offset.top = data.offsetTop
|
||||||
|
|
||||||
|
$spy.affix(data)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
88
app/assets/javascripts/bootstrap/alert.js
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: alert.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#alerts
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// ALERT CLASS DEFINITION
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
var dismiss = '[data-dismiss="alert"]'
|
||||||
|
var Alert = function (el) {
|
||||||
|
$(el).on('click', dismiss, this.close)
|
||||||
|
}
|
||||||
|
|
||||||
|
Alert.prototype.close = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
var selector = $this.attr('data-target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
var $parent = $(selector)
|
||||||
|
|
||||||
|
if (e) e.preventDefault()
|
||||||
|
|
||||||
|
if (!$parent.length) {
|
||||||
|
$parent = $this.hasClass('alert') ? $this : $this.parent()
|
||||||
|
}
|
||||||
|
|
||||||
|
$parent.trigger(e = $.Event('close.bs.alert'))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$parent.removeClass('in')
|
||||||
|
|
||||||
|
function removeElement() {
|
||||||
|
$parent.trigger('closed.bs.alert').remove()
|
||||||
|
}
|
||||||
|
|
||||||
|
$.support.transition && $parent.hasClass('fade') ?
|
||||||
|
$parent
|
||||||
|
.one($.support.transition.end, removeElement)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
removeElement()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ALERT PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
var old = $.fn.alert
|
||||||
|
|
||||||
|
$.fn.alert = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.alert')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.alert', (data = new Alert(this)))
|
||||||
|
if (typeof option == 'string') data[option].call($this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.alert.Constructor = Alert
|
||||||
|
|
||||||
|
|
||||||
|
// ALERT NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.alert.noConflict = function () {
|
||||||
|
$.fn.alert = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ALERT DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
|
||||||
|
|
||||||
|
}(jQuery);
|
107
app/assets/javascripts/bootstrap/button.js
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: button.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#buttons
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// BUTTON PUBLIC CLASS DEFINITION
|
||||||
|
// ==============================
|
||||||
|
|
||||||
|
var Button = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = $.extend({}, Button.DEFAULTS, options)
|
||||||
|
this.isLoading = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.DEFAULTS = {
|
||||||
|
loadingText: 'loading...'
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.prototype.setState = function (state) {
|
||||||
|
var d = 'disabled'
|
||||||
|
var $el = this.$element
|
||||||
|
var val = $el.is('input') ? 'val' : 'html'
|
||||||
|
var data = $el.data()
|
||||||
|
|
||||||
|
state = state + 'Text'
|
||||||
|
|
||||||
|
if (!data.resetText) $el.data('resetText', $el[val]())
|
||||||
|
|
||||||
|
$el[val](data[state] || this.options[state])
|
||||||
|
|
||||||
|
// push to event loop to allow forms to submit
|
||||||
|
setTimeout($.proxy(function () {
|
||||||
|
if (state == 'loadingText') {
|
||||||
|
this.isLoading = true
|
||||||
|
$el.addClass(d).attr(d, d)
|
||||||
|
} else if (this.isLoading) {
|
||||||
|
this.isLoading = false
|
||||||
|
$el.removeClass(d).removeAttr(d)
|
||||||
|
}
|
||||||
|
}, this), 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
Button.prototype.toggle = function () {
|
||||||
|
var changed = true
|
||||||
|
var $parent = this.$element.closest('[data-toggle="buttons"]')
|
||||||
|
|
||||||
|
if ($parent.length) {
|
||||||
|
var $input = this.$element.find('input')
|
||||||
|
if ($input.prop('type') == 'radio') {
|
||||||
|
if ($input.prop('checked') && this.$element.hasClass('active')) changed = false
|
||||||
|
else $parent.find('.active').removeClass('active')
|
||||||
|
}
|
||||||
|
if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (changed) this.$element.toggleClass('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON PLUGIN DEFINITION
|
||||||
|
// ========================
|
||||||
|
|
||||||
|
var old = $.fn.button
|
||||||
|
|
||||||
|
$.fn.button = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.button')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.button', (data = new Button(this, options)))
|
||||||
|
|
||||||
|
if (option == 'toggle') data.toggle()
|
||||||
|
else if (option) data.setState(option)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.button.Constructor = Button
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON NO CONFLICT
|
||||||
|
// ==================
|
||||||
|
|
||||||
|
$.fn.button.noConflict = function () {
|
||||||
|
$.fn.button = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// BUTTON DATA-API
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
$(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) {
|
||||||
|
var $btn = $(e.target)
|
||||||
|
if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
|
||||||
|
$btn.button('toggle')
|
||||||
|
e.preventDefault()
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
205
app/assets/javascripts/bootstrap/carousel.js
Normal file
@ -0,0 +1,205 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: carousel.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#carousel
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// CAROUSEL CLASS DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var Carousel = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
|
this.$indicators = this.$element.find('.carousel-indicators')
|
||||||
|
this.options = options
|
||||||
|
this.paused =
|
||||||
|
this.sliding =
|
||||||
|
this.interval =
|
||||||
|
this.$active =
|
||||||
|
this.$items = null
|
||||||
|
|
||||||
|
this.options.pause == 'hover' && this.$element
|
||||||
|
.on('mouseenter', $.proxy(this.pause, this))
|
||||||
|
.on('mouseleave', $.proxy(this.cycle, this))
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.DEFAULTS = {
|
||||||
|
interval: 5000,
|
||||||
|
pause: 'hover',
|
||||||
|
wrap: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.cycle = function (e) {
|
||||||
|
e || (this.paused = false)
|
||||||
|
|
||||||
|
this.interval && clearInterval(this.interval)
|
||||||
|
|
||||||
|
this.options.interval
|
||||||
|
&& !this.paused
|
||||||
|
&& (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.getActiveIndex = function () {
|
||||||
|
this.$active = this.$element.find('.item.active')
|
||||||
|
this.$items = this.$active.parent().children()
|
||||||
|
|
||||||
|
return this.$items.index(this.$active)
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.to = function (pos) {
|
||||||
|
var that = this
|
||||||
|
var activeIndex = this.getActiveIndex()
|
||||||
|
|
||||||
|
if (pos > (this.$items.length - 1) || pos < 0) return
|
||||||
|
|
||||||
|
if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) })
|
||||||
|
if (activeIndex == pos) return this.pause().cycle()
|
||||||
|
|
||||||
|
return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos]))
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.pause = function (e) {
|
||||||
|
e || (this.paused = true)
|
||||||
|
|
||||||
|
if (this.$element.find('.next, .prev').length && $.support.transition) {
|
||||||
|
this.$element.trigger($.support.transition.end)
|
||||||
|
this.cycle(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.interval = clearInterval(this.interval)
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.next = function () {
|
||||||
|
if (this.sliding) return
|
||||||
|
return this.slide('next')
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.prev = function () {
|
||||||
|
if (this.sliding) return
|
||||||
|
return this.slide('prev')
|
||||||
|
}
|
||||||
|
|
||||||
|
Carousel.prototype.slide = function (type, next) {
|
||||||
|
var $active = this.$element.find('.item.active')
|
||||||
|
var $next = next || $active[type]()
|
||||||
|
var isCycling = this.interval
|
||||||
|
var direction = type == 'next' ? 'left' : 'right'
|
||||||
|
var fallback = type == 'next' ? 'first' : 'last'
|
||||||
|
var that = this
|
||||||
|
|
||||||
|
if (!$next.length) {
|
||||||
|
if (!this.options.wrap) return
|
||||||
|
$next = this.$element.find('.item')[fallback]()
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($next.hasClass('active')) return this.sliding = false
|
||||||
|
|
||||||
|
var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction })
|
||||||
|
this.$element.trigger(e)
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.sliding = true
|
||||||
|
|
||||||
|
isCycling && this.pause()
|
||||||
|
|
||||||
|
if (this.$indicators.length) {
|
||||||
|
this.$indicators.find('.active').removeClass('active')
|
||||||
|
this.$element.one('slid.bs.carousel', function () {
|
||||||
|
var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()])
|
||||||
|
$nextIndicator && $nextIndicator.addClass('active')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($.support.transition && this.$element.hasClass('slide')) {
|
||||||
|
$next.addClass(type)
|
||||||
|
$next[0].offsetWidth // force reflow
|
||||||
|
$active.addClass(direction)
|
||||||
|
$next.addClass(direction)
|
||||||
|
$active
|
||||||
|
.one($.support.transition.end, function () {
|
||||||
|
$next.removeClass([type, direction].join(' ')).addClass('active')
|
||||||
|
$active.removeClass(['active', direction].join(' '))
|
||||||
|
that.sliding = false
|
||||||
|
setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0)
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd($active.css('transition-duration').slice(0, -1) * 1000)
|
||||||
|
} else {
|
||||||
|
$active.removeClass('active')
|
||||||
|
$next.addClass('active')
|
||||||
|
this.sliding = false
|
||||||
|
this.$element.trigger('slid.bs.carousel')
|
||||||
|
}
|
||||||
|
|
||||||
|
isCycling && this.cycle()
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CAROUSEL PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
var old = $.fn.carousel
|
||||||
|
|
||||||
|
$.fn.carousel = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.carousel')
|
||||||
|
var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
var action = typeof option == 'string' ? option : options.slide
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.carousel', (data = new Carousel(this, options)))
|
||||||
|
if (typeof option == 'number') data.to(option)
|
||||||
|
else if (action) data[action]()
|
||||||
|
else if (options.interval) data.pause().cycle()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.carousel.Constructor = Carousel
|
||||||
|
|
||||||
|
|
||||||
|
// CAROUSEL NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.carousel.noConflict = function () {
|
||||||
|
$.fn.carousel = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CAROUSEL DATA-API
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) {
|
||||||
|
var $this = $(this), href
|
||||||
|
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||||
|
var options = $.extend({}, $target.data(), $this.data())
|
||||||
|
var slideIndex = $this.attr('data-slide-to')
|
||||||
|
if (slideIndex) options.interval = false
|
||||||
|
|
||||||
|
$target.carousel(options)
|
||||||
|
|
||||||
|
if (slideIndex = $this.attr('data-slide-to')) {
|
||||||
|
$target.data('bs.carousel').to(slideIndex)
|
||||||
|
}
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
|
})
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-ride="carousel"]').each(function () {
|
||||||
|
var $carousel = $(this)
|
||||||
|
$carousel.carousel($carousel.data())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
170
app/assets/javascripts/bootstrap/collapse.js
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: collapse.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#collapse
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// COLLAPSE PUBLIC CLASS DEFINITION
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
var Collapse = function (element, options) {
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = $.extend({}, Collapse.DEFAULTS, options)
|
||||||
|
this.transitioning = null
|
||||||
|
|
||||||
|
if (this.options.parent) this.$parent = $(this.options.parent)
|
||||||
|
if (this.options.toggle) this.toggle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.DEFAULTS = {
|
||||||
|
toggle: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.dimension = function () {
|
||||||
|
var hasWidth = this.$element.hasClass('width')
|
||||||
|
return hasWidth ? 'width' : 'height'
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.show = function () {
|
||||||
|
if (this.transitioning || this.$element.hasClass('in')) return
|
||||||
|
|
||||||
|
var startEvent = $.Event('show.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var actives = this.$parent && this.$parent.find('> .panel > .in')
|
||||||
|
|
||||||
|
if (actives && actives.length) {
|
||||||
|
var hasData = actives.data('bs.collapse')
|
||||||
|
if (hasData && hasData.transitioning) return
|
||||||
|
actives.collapse('hide')
|
||||||
|
hasData || actives.data('bs.collapse', null)
|
||||||
|
}
|
||||||
|
|
||||||
|
var dimension = this.dimension()
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.removeClass('collapse')
|
||||||
|
.addClass('collapsing')
|
||||||
|
[dimension](0)
|
||||||
|
|
||||||
|
this.transitioning = 1
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
|
this.$element
|
||||||
|
.removeClass('collapsing')
|
||||||
|
.addClass('collapse in')
|
||||||
|
[dimension]('auto')
|
||||||
|
this.transitioning = 0
|
||||||
|
this.$element.trigger('shown.bs.collapse')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$.support.transition) return complete.call(this)
|
||||||
|
|
||||||
|
var scrollSize = $.camelCase(['scroll', dimension].join('-'))
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.one($.support.transition.end, $.proxy(complete, this))
|
||||||
|
.emulateTransitionEnd(350)
|
||||||
|
[dimension](this.$element[0][scrollSize])
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.hide = function () {
|
||||||
|
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||||
|
|
||||||
|
var startEvent = $.Event('hide.bs.collapse')
|
||||||
|
this.$element.trigger(startEvent)
|
||||||
|
if (startEvent.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var dimension = this.dimension()
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
[dimension](this.$element[dimension]())
|
||||||
|
[0].offsetHeight
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.addClass('collapsing')
|
||||||
|
.removeClass('collapse')
|
||||||
|
.removeClass('in')
|
||||||
|
|
||||||
|
this.transitioning = 1
|
||||||
|
|
||||||
|
var complete = function () {
|
||||||
|
this.transitioning = 0
|
||||||
|
this.$element
|
||||||
|
.trigger('hidden.bs.collapse')
|
||||||
|
.removeClass('collapsing')
|
||||||
|
.addClass('collapse')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$.support.transition) return complete.call(this)
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
[dimension](0)
|
||||||
|
.one($.support.transition.end, $.proxy(complete, this))
|
||||||
|
.emulateTransitionEnd(350)
|
||||||
|
}
|
||||||
|
|
||||||
|
Collapse.prototype.toggle = function () {
|
||||||
|
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
var old = $.fn.collapse
|
||||||
|
|
||||||
|
$.fn.collapse = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.collapse')
|
||||||
|
var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
|
||||||
|
if (!data && options.toggle && option == 'show') option = !option
|
||||||
|
if (!data) $this.data('bs.collapse', (data = new Collapse(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.collapse.Constructor = Collapse
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.collapse.noConflict = function () {
|
||||||
|
$.fn.collapse = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// COLLAPSE DATA-API
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||||
|
var $this = $(this), href
|
||||||
|
var target = $this.attr('data-target')
|
||||||
|
|| e.preventDefault()
|
||||||
|
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||||
|
var $target = $(target)
|
||||||
|
var data = $target.data('bs.collapse')
|
||||||
|
var option = data ? 'toggle' : $this.data()
|
||||||
|
var parent = $this.attr('data-parent')
|
||||||
|
var $parent = parent && $(parent)
|
||||||
|
|
||||||
|
if (!data || !data.transitioning) {
|
||||||
|
if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed')
|
||||||
|
$this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||||
|
}
|
||||||
|
|
||||||
|
$target.collapse(option)
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
3652
app/assets/javascripts/bootstrap/datetimepicker.js
Executable file
147
app/assets/javascripts/bootstrap/dropdown.js
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: dropdown.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#dropdowns
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// DROPDOWN CLASS DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var backdrop = '.dropdown-backdrop'
|
||||||
|
var toggle = '[data-toggle=dropdown]'
|
||||||
|
var Dropdown = function (element) {
|
||||||
|
$(element).on('click.bs.dropdown', this.toggle)
|
||||||
|
}
|
||||||
|
|
||||||
|
Dropdown.prototype.toggle = function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
if ($this.is('.disabled, :disabled')) return
|
||||||
|
|
||||||
|
var $parent = getParent($this)
|
||||||
|
var isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
|
clearMenus()
|
||||||
|
|
||||||
|
if (!isActive) {
|
||||||
|
if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
|
||||||
|
// if mobile we use a backdrop because click events don't delegate
|
||||||
|
$('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
|
||||||
|
}
|
||||||
|
|
||||||
|
var relatedTarget = { relatedTarget: this }
|
||||||
|
$parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$parent
|
||||||
|
.toggleClass('open')
|
||||||
|
.trigger('shown.bs.dropdown', relatedTarget)
|
||||||
|
|
||||||
|
$this.focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
Dropdown.prototype.keydown = function (e) {
|
||||||
|
if (!/(38|40|27)/.test(e.keyCode)) return
|
||||||
|
|
||||||
|
var $this = $(this)
|
||||||
|
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
|
||||||
|
if ($this.is('.disabled, :disabled')) return
|
||||||
|
|
||||||
|
var $parent = getParent($this)
|
||||||
|
var isActive = $parent.hasClass('open')
|
||||||
|
|
||||||
|
if (!isActive || (isActive && e.keyCode == 27)) {
|
||||||
|
if (e.which == 27) $parent.find(toggle).focus()
|
||||||
|
return $this.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
var desc = ' li:not(.divider):visible a'
|
||||||
|
var $items = $parent.find('[role=menu]' + desc + ', [role=listbox]' + desc)
|
||||||
|
|
||||||
|
if (!$items.length) return
|
||||||
|
|
||||||
|
var index = $items.index($items.filter(':focus'))
|
||||||
|
|
||||||
|
if (e.keyCode == 38 && index > 0) index-- // up
|
||||||
|
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
|
||||||
|
if (!~index) index = 0
|
||||||
|
|
||||||
|
$items.eq(index).focus()
|
||||||
|
}
|
||||||
|
|
||||||
|
function clearMenus(e) {
|
||||||
|
$(backdrop).remove()
|
||||||
|
$(toggle).each(function () {
|
||||||
|
var $parent = getParent($(this))
|
||||||
|
var relatedTarget = { relatedTarget: this }
|
||||||
|
if (!$parent.hasClass('open')) return
|
||||||
|
$parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
$parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getParent($this) {
|
||||||
|
var selector = $this.attr('data-target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
var $parent = selector && $(selector)
|
||||||
|
|
||||||
|
return $parent && $parent.length ? $parent : $this.parent()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DROPDOWN PLUGIN DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
var old = $.fn.dropdown
|
||||||
|
|
||||||
|
$.fn.dropdown = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.dropdown')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
|
||||||
|
if (typeof option == 'string') data[option].call($this)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.dropdown.Constructor = Dropdown
|
||||||
|
|
||||||
|
|
||||||
|
// DROPDOWN NO CONFLICT
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
$.fn.dropdown.noConflict = function () {
|
||||||
|
$.fn.dropdown = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// APPLY TO STANDARD DROPDOWN ELEMENTS
|
||||||
|
// ===================================
|
||||||
|
|
||||||
|
$(document)
|
||||||
|
.on('click.bs.dropdown.data-api', clearMenus)
|
||||||
|
.on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
|
||||||
|
.on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
|
||||||
|
.on('keydown.bs.dropdown.data-api', toggle + ', [role=menu], [role=listbox]', Dropdown.prototype.keydown)
|
||||||
|
|
||||||
|
}(jQuery);
|
243
app/assets/javascripts/bootstrap/modal.js
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: modal.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#modals
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// MODAL CLASS DEFINITION
|
||||||
|
// ======================
|
||||||
|
|
||||||
|
var Modal = function (element, options) {
|
||||||
|
this.options = options
|
||||||
|
this.$element = $(element)
|
||||||
|
this.$backdrop =
|
||||||
|
this.isShown = null
|
||||||
|
|
||||||
|
if (this.options.remote) {
|
||||||
|
this.$element
|
||||||
|
.find('.modal-content')
|
||||||
|
.load(this.options.remote, $.proxy(function () {
|
||||||
|
this.$element.trigger('loaded.bs.modal')
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.DEFAULTS = {
|
||||||
|
backdrop: true,
|
||||||
|
keyboard: true,
|
||||||
|
show: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.toggle = function (_relatedTarget) {
|
||||||
|
return this[!this.isShown ? 'show' : 'hide'](_relatedTarget)
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.show = function (_relatedTarget) {
|
||||||
|
var that = this
|
||||||
|
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (this.isShown || e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.isShown = true
|
||||||
|
|
||||||
|
this.escape()
|
||||||
|
|
||||||
|
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
||||||
|
|
||||||
|
this.backdrop(function () {
|
||||||
|
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||||
|
|
||||||
|
if (!that.$element.parent().length) {
|
||||||
|
that.$element.appendTo(document.body) // don't move modals dom position
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$element
|
||||||
|
.show()
|
||||||
|
.scrollTop(0)
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
that.$element[0].offsetWidth // force reflow
|
||||||
|
}
|
||||||
|
|
||||||
|
that.$element
|
||||||
|
.addClass('in')
|
||||||
|
.attr('aria-hidden', false)
|
||||||
|
|
||||||
|
that.enforceFocus()
|
||||||
|
|
||||||
|
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
||||||
|
|
||||||
|
transition ?
|
||||||
|
that.$element.find('.modal-dialog') // wait for modal to slide in
|
||||||
|
.one($.support.transition.end, function () {
|
||||||
|
that.$element.focus().trigger(e)
|
||||||
|
})
|
||||||
|
.emulateTransitionEnd(300) :
|
||||||
|
that.$element.focus().trigger(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.hide = function (e) {
|
||||||
|
if (e) e.preventDefault()
|
||||||
|
|
||||||
|
e = $.Event('hide.bs.modal')
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (!this.isShown || e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
this.isShown = false
|
||||||
|
|
||||||
|
this.escape()
|
||||||
|
|
||||||
|
$(document).off('focusin.bs.modal')
|
||||||
|
|
||||||
|
this.$element
|
||||||
|
.removeClass('in')
|
||||||
|
.attr('aria-hidden', true)
|
||||||
|
.off('click.dismiss.bs.modal')
|
||||||
|
|
||||||
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
|
this.$element
|
||||||
|
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
||||||
|
.emulateTransitionEnd(300) :
|
||||||
|
this.hideModal()
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.enforceFocus = function () {
|
||||||
|
$(document)
|
||||||
|
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||||
|
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||||
|
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||||
|
this.$element.focus()
|
||||||
|
}
|
||||||
|
}, this))
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.escape = function () {
|
||||||
|
if (this.isShown && this.options.keyboard) {
|
||||||
|
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
|
e.which == 27 && this.hide()
|
||||||
|
}, this))
|
||||||
|
} else if (!this.isShown) {
|
||||||
|
this.$element.off('keyup.dismiss.bs.modal')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.hideModal = function () {
|
||||||
|
var that = this
|
||||||
|
this.$element.hide()
|
||||||
|
this.backdrop(function () {
|
||||||
|
that.removeBackdrop()
|
||||||
|
that.$element.trigger('hidden.bs.modal')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.removeBackdrop = function () {
|
||||||
|
this.$backdrop && this.$backdrop.remove()
|
||||||
|
this.$backdrop = null
|
||||||
|
}
|
||||||
|
|
||||||
|
Modal.prototype.backdrop = function (callback) {
|
||||||
|
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||||
|
|
||||||
|
if (this.isShown && this.options.backdrop) {
|
||||||
|
var doAnimate = $.support.transition && animate
|
||||||
|
|
||||||
|
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||||
|
.appendTo(document.body)
|
||||||
|
|
||||||
|
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||||
|
if (e.target !== e.currentTarget) return
|
||||||
|
this.options.backdrop == 'static'
|
||||||
|
? this.$element[0].focus.call(this.$element[0])
|
||||||
|
: this.hide.call(this)
|
||||||
|
}, this))
|
||||||
|
|
||||||
|
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||||
|
|
||||||
|
this.$backdrop.addClass('in')
|
||||||
|
|
||||||
|
if (!callback) return
|
||||||
|
|
||||||
|
doAnimate ?
|
||||||
|
this.$backdrop
|
||||||
|
.one($.support.transition.end, callback)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
callback()
|
||||||
|
|
||||||
|
} else if (!this.isShown && this.$backdrop) {
|
||||||
|
this.$backdrop.removeClass('in')
|
||||||
|
|
||||||
|
$.support.transition && this.$element.hasClass('fade') ?
|
||||||
|
this.$backdrop
|
||||||
|
.one($.support.transition.end, callback)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
callback()
|
||||||
|
|
||||||
|
} else if (callback) {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL PLUGIN DEFINITION
|
||||||
|
// =======================
|
||||||
|
|
||||||
|
var old = $.fn.modal
|
||||||
|
|
||||||
|
$.fn.modal = function (option, _relatedTarget) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.modal')
|
||||||
|
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||||
|
if (typeof option == 'string') data[option](_relatedTarget)
|
||||||
|
else if (options.show) data.show(_relatedTarget)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.modal.Constructor = Modal
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL NO CONFLICT
|
||||||
|
// =================
|
||||||
|
|
||||||
|
$.fn.modal.noConflict = function () {
|
||||||
|
$.fn.modal = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// MODAL DATA-API
|
||||||
|
// ==============
|
||||||
|
|
||||||
|
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||||
|
var $this = $(this)
|
||||||
|
var href = $this.attr('href')
|
||||||
|
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||||
|
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||||
|
|
||||||
|
if ($this.is('a')) e.preventDefault()
|
||||||
|
|
||||||
|
$target
|
||||||
|
.modal(option, this)
|
||||||
|
.one('hide', function () {
|
||||||
|
$this.is(':visible') && $this.focus()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
$(document)
|
||||||
|
.on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') })
|
||||||
|
.on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') })
|
||||||
|
|
||||||
|
}(jQuery);
|
110
app/assets/javascripts/bootstrap/popover.js
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: popover.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#popovers
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// POPOVER PUBLIC CLASS DEFINITION
|
||||||
|
// ===============================
|
||||||
|
|
||||||
|
var Popover = function (element, options) {
|
||||||
|
this.init('popover', element, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
|
||||||
|
|
||||||
|
Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
|
||||||
|
placement: 'right',
|
||||||
|
trigger: 'click',
|
||||||
|
content: '',
|
||||||
|
template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
// NOTE: POPOVER EXTENDS tooltip.js
|
||||||
|
// ================================
|
||||||
|
|
||||||
|
Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
|
||||||
|
|
||||||
|
Popover.prototype.constructor = Popover
|
||||||
|
|
||||||
|
Popover.prototype.getDefaults = function () {
|
||||||
|
return Popover.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.setContent = function () {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var title = this.getTitle()
|
||||||
|
var content = this.getContent()
|
||||||
|
|
||||||
|
$tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
|
||||||
|
$tip.find('.popover-content')[ // we use append for html objects to maintain js events
|
||||||
|
this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text'
|
||||||
|
](content)
|
||||||
|
|
||||||
|
$tip.removeClass('fade top bottom left right in')
|
||||||
|
|
||||||
|
// IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do
|
||||||
|
// this manually by checking the contents.
|
||||||
|
if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide()
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.hasContent = function () {
|
||||||
|
return this.getTitle() || this.getContent()
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.getContent = function () {
|
||||||
|
var $e = this.$element
|
||||||
|
var o = this.options
|
||||||
|
|
||||||
|
return $e.attr('data-content')
|
||||||
|
|| (typeof o.content == 'function' ?
|
||||||
|
o.content.call($e[0]) :
|
||||||
|
o.content)
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.arrow = function () {
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find('.arrow')
|
||||||
|
}
|
||||||
|
|
||||||
|
Popover.prototype.tip = function () {
|
||||||
|
if (!this.$tip) this.$tip = $(this.options.template)
|
||||||
|
return this.$tip
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// POPOVER PLUGIN DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var old = $.fn.popover
|
||||||
|
|
||||||
|
$.fn.popover = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.popover')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data && option == 'destroy') return
|
||||||
|
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.popover.Constructor = Popover
|
||||||
|
|
||||||
|
|
||||||
|
// POPOVER NO CONFLICT
|
||||||
|
// ===================
|
||||||
|
|
||||||
|
$.fn.popover.noConflict = function () {
|
||||||
|
$.fn.popover = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}(jQuery);
|
153
app/assets/javascripts/bootstrap/scrollspy.js
Normal file
@ -0,0 +1,153 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: scrollspy.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#scrollspy
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// SCROLLSPY CLASS DEFINITION
|
||||||
|
// ==========================
|
||||||
|
|
||||||
|
function ScrollSpy(element, options) {
|
||||||
|
var href
|
||||||
|
var process = $.proxy(this.process, this)
|
||||||
|
|
||||||
|
this.$element = $(element).is('body') ? $(window) : $(element)
|
||||||
|
this.$body = $('body')
|
||||||
|
this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process)
|
||||||
|
this.options = $.extend({}, ScrollSpy.DEFAULTS, options)
|
||||||
|
this.selector = (this.options.target
|
||||||
|
|| ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
|
||||||
|
|| '') + ' .nav li > a'
|
||||||
|
this.offsets = $([])
|
||||||
|
this.targets = $([])
|
||||||
|
this.activeTarget = null
|
||||||
|
|
||||||
|
this.refresh()
|
||||||
|
this.process()
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.DEFAULTS = {
|
||||||
|
offset: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.refresh = function () {
|
||||||
|
var offsetMethod = this.$element[0] == window ? 'offset' : 'position'
|
||||||
|
|
||||||
|
this.offsets = $([])
|
||||||
|
this.targets = $([])
|
||||||
|
|
||||||
|
var self = this
|
||||||
|
var $targets = this.$body
|
||||||
|
.find(this.selector)
|
||||||
|
.map(function () {
|
||||||
|
var $el = $(this)
|
||||||
|
var href = $el.data('target') || $el.attr('href')
|
||||||
|
var $href = /^#./.test(href) && $(href)
|
||||||
|
|
||||||
|
return ($href
|
||||||
|
&& $href.length
|
||||||
|
&& $href.is(':visible')
|
||||||
|
&& [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null
|
||||||
|
})
|
||||||
|
.sort(function (a, b) { return a[0] - b[0] })
|
||||||
|
.each(function () {
|
||||||
|
self.offsets.push(this[0])
|
||||||
|
self.targets.push(this[1])
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.process = function () {
|
||||||
|
var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
|
||||||
|
var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
|
||||||
|
var maxScroll = scrollHeight - this.$scrollElement.height()
|
||||||
|
var offsets = this.offsets
|
||||||
|
var targets = this.targets
|
||||||
|
var activeTarget = this.activeTarget
|
||||||
|
var i
|
||||||
|
|
||||||
|
if (scrollTop >= maxScroll) {
|
||||||
|
return activeTarget != (i = targets.last()[0]) && this.activate(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (activeTarget && scrollTop <= offsets[0]) {
|
||||||
|
return activeTarget != (i = targets[0]) && this.activate(i)
|
||||||
|
}
|
||||||
|
|
||||||
|
for (i = offsets.length; i--;) {
|
||||||
|
activeTarget != targets[i]
|
||||||
|
&& scrollTop >= offsets[i]
|
||||||
|
&& (!offsets[i + 1] || scrollTop <= offsets[i + 1])
|
||||||
|
&& this.activate( targets[i] )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollSpy.prototype.activate = function (target) {
|
||||||
|
this.activeTarget = target
|
||||||
|
|
||||||
|
$(this.selector)
|
||||||
|
.parentsUntil(this.options.target, '.active')
|
||||||
|
.removeClass('active')
|
||||||
|
|
||||||
|
var selector = this.selector +
|
||||||
|
'[data-target="' + target + '"],' +
|
||||||
|
this.selector + '[href="' + target + '"]'
|
||||||
|
|
||||||
|
var active = $(selector)
|
||||||
|
.parents('li')
|
||||||
|
.addClass('active')
|
||||||
|
|
||||||
|
if (active.parent('.dropdown-menu').length) {
|
||||||
|
active = active
|
||||||
|
.closest('li.dropdown')
|
||||||
|
.addClass('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
active.trigger('activate.bs.scrollspy')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY PLUGIN DEFINITION
|
||||||
|
// ===========================
|
||||||
|
|
||||||
|
var old = $.fn.scrollspy
|
||||||
|
|
||||||
|
$.fn.scrollspy = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.scrollspy')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.scrollspy.Constructor = ScrollSpy
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY NO CONFLICT
|
||||||
|
// =====================
|
||||||
|
|
||||||
|
$.fn.scrollspy.noConflict = function () {
|
||||||
|
$.fn.scrollspy = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// SCROLLSPY DATA-API
|
||||||
|
// ==================
|
||||||
|
|
||||||
|
$(window).on('load', function () {
|
||||||
|
$('[data-spy="scroll"]').each(function () {
|
||||||
|
var $spy = $(this)
|
||||||
|
$spy.scrollspy($spy.data())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
125
app/assets/javascripts/bootstrap/tab.js
Normal file
@ -0,0 +1,125 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: tab.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#tabs
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// TAB CLASS DEFINITION
|
||||||
|
// ====================
|
||||||
|
|
||||||
|
var Tab = function (element) {
|
||||||
|
this.element = $(element)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tab.prototype.show = function () {
|
||||||
|
var $this = this.element
|
||||||
|
var $ul = $this.closest('ul:not(.dropdown-menu)')
|
||||||
|
var selector = $this.data('target')
|
||||||
|
|
||||||
|
if (!selector) {
|
||||||
|
selector = $this.attr('href')
|
||||||
|
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this.parent('li').hasClass('active')) return
|
||||||
|
|
||||||
|
var previous = $ul.find('.active:last a')[0]
|
||||||
|
var e = $.Event('show.bs.tab', {
|
||||||
|
relatedTarget: previous
|
||||||
|
})
|
||||||
|
|
||||||
|
$this.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
var $target = $(selector)
|
||||||
|
|
||||||
|
this.activate($this.parent('li'), $ul)
|
||||||
|
this.activate($target, $target.parent(), function () {
|
||||||
|
$this.trigger({
|
||||||
|
type: 'shown.bs.tab',
|
||||||
|
relatedTarget: previous
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Tab.prototype.activate = function (element, container, callback) {
|
||||||
|
var $active = container.find('> .active')
|
||||||
|
var transition = callback
|
||||||
|
&& $.support.transition
|
||||||
|
&& $active.hasClass('fade')
|
||||||
|
|
||||||
|
function next() {
|
||||||
|
$active
|
||||||
|
.removeClass('active')
|
||||||
|
.find('> .dropdown-menu > .active')
|
||||||
|
.removeClass('active')
|
||||||
|
|
||||||
|
element.addClass('active')
|
||||||
|
|
||||||
|
if (transition) {
|
||||||
|
element[0].offsetWidth // reflow for transition
|
||||||
|
element.addClass('in')
|
||||||
|
} else {
|
||||||
|
element.removeClass('fade')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (element.parent('.dropdown-menu')) {
|
||||||
|
element.closest('li.dropdown').addClass('active')
|
||||||
|
}
|
||||||
|
|
||||||
|
callback && callback()
|
||||||
|
}
|
||||||
|
|
||||||
|
transition ?
|
||||||
|
$active
|
||||||
|
.one($.support.transition.end, next)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
next()
|
||||||
|
|
||||||
|
$active.removeClass('in')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TAB PLUGIN DEFINITION
|
||||||
|
// =====================
|
||||||
|
|
||||||
|
var old = $.fn.tab
|
||||||
|
|
||||||
|
$.fn.tab = function ( option ) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.tab')
|
||||||
|
|
||||||
|
if (!data) $this.data('bs.tab', (data = new Tab(this)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.tab.Constructor = Tab
|
||||||
|
|
||||||
|
|
||||||
|
// TAB NO CONFLICT
|
||||||
|
// ===============
|
||||||
|
|
||||||
|
$.fn.tab.noConflict = function () {
|
||||||
|
$.fn.tab = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TAB DATA-API
|
||||||
|
// ============
|
||||||
|
|
||||||
|
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
|
||||||
|
e.preventDefault()
|
||||||
|
$(this).tab('show')
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
399
app/assets/javascripts/bootstrap/tooltip.js
Normal file
@ -0,0 +1,399 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: tooltip.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#tooltip
|
||||||
|
* Inspired by the original jQuery.tipsy by Jason Frame
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// TOOLTIP PUBLIC CLASS DEFINITION
|
||||||
|
// ===============================
|
||||||
|
|
||||||
|
var Tooltip = function (element, options) {
|
||||||
|
this.type =
|
||||||
|
this.options =
|
||||||
|
this.enabled =
|
||||||
|
this.timeout =
|
||||||
|
this.hoverState =
|
||||||
|
this.$element = null
|
||||||
|
|
||||||
|
this.init('tooltip', element, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.DEFAULTS = {
|
||||||
|
animation: true,
|
||||||
|
placement: 'top',
|
||||||
|
selector: false,
|
||||||
|
template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
|
||||||
|
trigger: 'hover focus',
|
||||||
|
title: '',
|
||||||
|
delay: 0,
|
||||||
|
html: false,
|
||||||
|
container: false
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.init = function (type, element, options) {
|
||||||
|
this.enabled = true
|
||||||
|
this.type = type
|
||||||
|
this.$element = $(element)
|
||||||
|
this.options = this.getOptions(options)
|
||||||
|
|
||||||
|
var triggers = this.options.trigger.split(' ')
|
||||||
|
|
||||||
|
for (var i = triggers.length; i--;) {
|
||||||
|
var trigger = triggers[i]
|
||||||
|
|
||||||
|
if (trigger == 'click') {
|
||||||
|
this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
|
||||||
|
} else if (trigger != 'manual') {
|
||||||
|
var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'
|
||||||
|
var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'
|
||||||
|
|
||||||
|
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
|
||||||
|
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.options.selector ?
|
||||||
|
(this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
|
||||||
|
this.fixTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getDefaults = function () {
|
||||||
|
return Tooltip.DEFAULTS
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getOptions = function (options) {
|
||||||
|
options = $.extend({}, this.getDefaults(), this.$element.data(), options)
|
||||||
|
|
||||||
|
if (options.delay && typeof options.delay == 'number') {
|
||||||
|
options.delay = {
|
||||||
|
show: options.delay,
|
||||||
|
hide: options.delay
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getDelegateOptions = function () {
|
||||||
|
var options = {}
|
||||||
|
var defaults = this.getDefaults()
|
||||||
|
|
||||||
|
this._options && $.each(this._options, function (key, value) {
|
||||||
|
if (defaults[key] != value) options[key] = value
|
||||||
|
})
|
||||||
|
|
||||||
|
return options
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enter = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'in'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.show) return self.show()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'in') self.show()
|
||||||
|
}, self.options.delay.show)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.leave = function (obj) {
|
||||||
|
var self = obj instanceof this.constructor ?
|
||||||
|
obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
|
||||||
|
|
||||||
|
clearTimeout(self.timeout)
|
||||||
|
|
||||||
|
self.hoverState = 'out'
|
||||||
|
|
||||||
|
if (!self.options.delay || !self.options.delay.hide) return self.hide()
|
||||||
|
|
||||||
|
self.timeout = setTimeout(function () {
|
||||||
|
if (self.hoverState == 'out') self.hide()
|
||||||
|
}, self.options.delay.hide)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.show = function () {
|
||||||
|
var e = $.Event('show.bs.' + this.type)
|
||||||
|
|
||||||
|
if (this.hasContent() && this.enabled) {
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
var that = this;
|
||||||
|
|
||||||
|
var $tip = this.tip()
|
||||||
|
|
||||||
|
this.setContent()
|
||||||
|
|
||||||
|
if (this.options.animation) $tip.addClass('fade')
|
||||||
|
|
||||||
|
var placement = typeof this.options.placement == 'function' ?
|
||||||
|
this.options.placement.call(this, $tip[0], this.$element[0]) :
|
||||||
|
this.options.placement
|
||||||
|
|
||||||
|
var autoToken = /\s?auto?\s?/i
|
||||||
|
var autoPlace = autoToken.test(placement)
|
||||||
|
if (autoPlace) placement = placement.replace(autoToken, '') || 'top'
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.detach()
|
||||||
|
.css({ top: 0, left: 0, display: 'block' })
|
||||||
|
.addClass(placement)
|
||||||
|
|
||||||
|
this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element)
|
||||||
|
|
||||||
|
var pos = this.getPosition()
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (autoPlace) {
|
||||||
|
var $parent = this.$element.parent()
|
||||||
|
|
||||||
|
var orgPlacement = placement
|
||||||
|
var docScroll = document.documentElement.scrollTop || document.body.scrollTop
|
||||||
|
var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth()
|
||||||
|
var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight()
|
||||||
|
var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left
|
||||||
|
|
||||||
|
placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' :
|
||||||
|
placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' :
|
||||||
|
placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' :
|
||||||
|
placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' :
|
||||||
|
placement
|
||||||
|
|
||||||
|
$tip
|
||||||
|
.removeClass(orgPlacement)
|
||||||
|
.addClass(placement)
|
||||||
|
}
|
||||||
|
|
||||||
|
var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight)
|
||||||
|
|
||||||
|
this.applyPlacement(calculatedOffset, placement)
|
||||||
|
this.hoverState = null
|
||||||
|
|
||||||
|
var complete = function() {
|
||||||
|
that.$element.trigger('shown.bs.' + that.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
|
$tip
|
||||||
|
.one($.support.transition.end, complete)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
complete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.applyPlacement = function (offset, placement) {
|
||||||
|
var replace
|
||||||
|
var $tip = this.tip()
|
||||||
|
var width = $tip[0].offsetWidth
|
||||||
|
var height = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
// manually read margins because getBoundingClientRect includes difference
|
||||||
|
var marginTop = parseInt($tip.css('margin-top'), 10)
|
||||||
|
var marginLeft = parseInt($tip.css('margin-left'), 10)
|
||||||
|
|
||||||
|
// we must check for NaN for ie 8/9
|
||||||
|
if (isNaN(marginTop)) marginTop = 0
|
||||||
|
if (isNaN(marginLeft)) marginLeft = 0
|
||||||
|
|
||||||
|
offset.top = offset.top + marginTop
|
||||||
|
offset.left = offset.left + marginLeft
|
||||||
|
|
||||||
|
// $.fn.offset doesn't round pixel values
|
||||||
|
// so we use setOffset directly with our own function B-0
|
||||||
|
$.offset.setOffset($tip[0], $.extend({
|
||||||
|
using: function (props) {
|
||||||
|
$tip.css({
|
||||||
|
top: Math.round(props.top),
|
||||||
|
left: Math.round(props.left)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, offset), 0)
|
||||||
|
|
||||||
|
$tip.addClass('in')
|
||||||
|
|
||||||
|
// check to see if placing tip in new offset caused the tip to resize itself
|
||||||
|
var actualWidth = $tip[0].offsetWidth
|
||||||
|
var actualHeight = $tip[0].offsetHeight
|
||||||
|
|
||||||
|
if (placement == 'top' && actualHeight != height) {
|
||||||
|
replace = true
|
||||||
|
offset.top = offset.top + height - actualHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/bottom|top/.test(placement)) {
|
||||||
|
var delta = 0
|
||||||
|
|
||||||
|
if (offset.left < 0) {
|
||||||
|
delta = offset.left * -2
|
||||||
|
offset.left = 0
|
||||||
|
|
||||||
|
$tip.offset(offset)
|
||||||
|
|
||||||
|
actualWidth = $tip[0].offsetWidth
|
||||||
|
actualHeight = $tip[0].offsetHeight
|
||||||
|
}
|
||||||
|
|
||||||
|
this.replaceArrow(delta - width + actualWidth, actualWidth, 'left')
|
||||||
|
} else {
|
||||||
|
this.replaceArrow(actualHeight - height, actualHeight, 'top')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (replace) $tip.offset(offset)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.replaceArrow = function (delta, dimension, position) {
|
||||||
|
this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + '%') : '')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.setContent = function () {
|
||||||
|
var $tip = this.tip()
|
||||||
|
var title = this.getTitle()
|
||||||
|
|
||||||
|
$tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
|
||||||
|
$tip.removeClass('fade in top bottom left right')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.hide = function () {
|
||||||
|
var that = this
|
||||||
|
var $tip = this.tip()
|
||||||
|
var e = $.Event('hide.bs.' + this.type)
|
||||||
|
|
||||||
|
function complete() {
|
||||||
|
if (that.hoverState != 'in') $tip.detach()
|
||||||
|
that.$element.trigger('hidden.bs.' + that.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$element.trigger(e)
|
||||||
|
|
||||||
|
if (e.isDefaultPrevented()) return
|
||||||
|
|
||||||
|
$tip.removeClass('in')
|
||||||
|
|
||||||
|
$.support.transition && this.$tip.hasClass('fade') ?
|
||||||
|
$tip
|
||||||
|
.one($.support.transition.end, complete)
|
||||||
|
.emulateTransitionEnd(150) :
|
||||||
|
complete()
|
||||||
|
|
||||||
|
this.hoverState = null
|
||||||
|
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.fixTitle = function () {
|
||||||
|
var $e = this.$element
|
||||||
|
if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
|
||||||
|
$e.attr('data-original-title', $e.attr('title') || '').attr('title', '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.hasContent = function () {
|
||||||
|
return this.getTitle()
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getPosition = function () {
|
||||||
|
var el = this.$element[0]
|
||||||
|
return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : {
|
||||||
|
width: el.offsetWidth,
|
||||||
|
height: el.offsetHeight
|
||||||
|
}, this.$element.offset())
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) {
|
||||||
|
return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } :
|
||||||
|
placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } :
|
||||||
|
/* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width }
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.getTitle = function () {
|
||||||
|
var title
|
||||||
|
var $e = this.$element
|
||||||
|
var o = this.options
|
||||||
|
|
||||||
|
title = $e.attr('data-original-title')
|
||||||
|
|| (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
|
||||||
|
|
||||||
|
return title
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.tip = function () {
|
||||||
|
return this.$tip = this.$tip || $(this.options.template)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.arrow = function () {
|
||||||
|
return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.validate = function () {
|
||||||
|
if (!this.$element[0].parentNode) {
|
||||||
|
this.hide()
|
||||||
|
this.$element = null
|
||||||
|
this.options = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.enable = function () {
|
||||||
|
this.enabled = true
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.disable = function () {
|
||||||
|
this.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.toggleEnabled = function () {
|
||||||
|
this.enabled = !this.enabled
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.toggle = function (e) {
|
||||||
|
var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this
|
||||||
|
self.tip().hasClass('in') ? self.leave(self) : self.enter(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
Tooltip.prototype.destroy = function () {
|
||||||
|
clearTimeout(this.timeout)
|
||||||
|
this.hide().$element.off('.' + this.type).removeData('bs.' + this.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TOOLTIP PLUGIN DEFINITION
|
||||||
|
// =========================
|
||||||
|
|
||||||
|
var old = $.fn.tooltip
|
||||||
|
|
||||||
|
$.fn.tooltip = function (option) {
|
||||||
|
return this.each(function () {
|
||||||
|
var $this = $(this)
|
||||||
|
var data = $this.data('bs.tooltip')
|
||||||
|
var options = typeof option == 'object' && option
|
||||||
|
|
||||||
|
if (!data && option == 'destroy') return
|
||||||
|
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
|
||||||
|
if (typeof option == 'string') data[option]()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
$.fn.tooltip.Constructor = Tooltip
|
||||||
|
|
||||||
|
|
||||||
|
// TOOLTIP NO CONFLICT
|
||||||
|
// ===================
|
||||||
|
|
||||||
|
$.fn.tooltip.noConflict = function () {
|
||||||
|
$.fn.tooltip = old
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
}(jQuery);
|
48
app/assets/javascripts/bootstrap/transition.js
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/* ========================================================================
|
||||||
|
* Bootstrap: transition.js v3.1.1
|
||||||
|
* http://getbootstrap.com/javascript/#transitions
|
||||||
|
* ========================================================================
|
||||||
|
* Copyright 2011-2014 Twitter, Inc.
|
||||||
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||||
|
* ======================================================================== */
|
||||||
|
|
||||||
|
|
||||||
|
+function ($) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
function transitionEnd() {
|
||||||
|
var el = document.createElement('bootstrap')
|
||||||
|
|
||||||
|
var transEndEventNames = {
|
||||||
|
'WebkitTransition' : 'webkitTransitionEnd',
|
||||||
|
'MozTransition' : 'transitionend',
|
||||||
|
'OTransition' : 'oTransitionEnd otransitionend',
|
||||||
|
'transition' : 'transitionend'
|
||||||
|
}
|
||||||
|
|
||||||
|
for (var name in transEndEventNames) {
|
||||||
|
if (el.style[name] !== undefined) {
|
||||||
|
return { end: transEndEventNames[name] }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false // explicit for ie8 ( ._.)
|
||||||
|
}
|
||||||
|
|
||||||
|
// http://blog.alexmaccaw.com/css-transitions
|
||||||
|
$.fn.emulateTransitionEnd = function (duration) {
|
||||||
|
var called = false, $el = this
|
||||||
|
$(this).one($.support.transition.end, function () { called = true })
|
||||||
|
var callback = function () { if (!called) $($el).trigger($.support.transition.end) }
|
||||||
|
setTimeout(callback, duration)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$.support.transition = transitionEnd()
|
||||||
|
})
|
||||||
|
|
||||||
|
}(jQuery);
|
18
app/assets/javascripts/connexion.coffee
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#= require jquery
|
||||||
|
#= require shared/jquery-ui
|
||||||
|
#= require bootstrap
|
||||||
|
|
||||||
|
#= require ./shared/jquery.backstretch.js
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
resize = () ->
|
||||||
|
|
||||||
|
$(".content").css("margin-top", ($(window).height() - $(".content").outerHeight(false))/ 2)
|
||||||
|
|
||||||
|
|
||||||
|
$ ->
|
||||||
|
resize()
|
||||||
|
$(window).bind "resize", ->
|
||||||
|
resize()
|
||||||
|
|
@ -2,189 +2,190 @@ var slider_value = 160;
|
|||||||
|
|
||||||
function image_files_load()
|
function image_files_load()
|
||||||
{
|
{
|
||||||
|
|
||||||
update_multiple_selection_text();
|
update_multiple_selection_text();
|
||||||
|
|
||||||
set_image_files_img_size();
|
set_image_files_img_size();
|
||||||
|
|
||||||
initialize_slider();
|
initialize_slider();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_image_files_img_size(){
|
function set_image_files_img_size(){
|
||||||
$('.image_file .img').css('width',slider_value+"px");
|
$('.image_file .img').css('width',slider_value+"px");
|
||||||
$('.image_file .img').css('height',slider_value+"px");
|
$('.image_file .img').css('height',slider_value+"px");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_multiple_selection_text()
|
function update_multiple_selection_text()
|
||||||
{
|
{
|
||||||
|
|
||||||
var multiple_ids = multiple_selection_ids()
|
var multiple_ids = multiple_selection_ids()
|
||||||
var text = ""
|
var text = ""
|
||||||
if (multiple_ids.length == 0)
|
if (multiple_ids.length == 0)
|
||||||
{
|
{
|
||||||
text = "Aucune image séléctionnée";
|
text = "Aucune image séléctionnée";
|
||||||
}
|
}
|
||||||
else if(multiple_ids.length == 1)
|
else if(multiple_ids.length == 1)
|
||||||
{
|
{
|
||||||
text= "Une image séléctionnée";
|
text= "Une image séléctionnée";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
text= multiple_ids.length+" images séléctionnées";
|
text= multiple_ids.length+" images séléctionnées";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$('#multiple_selection_text').html(text);
|
$('#multiple_selection_text').html(text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function multiple_selection_ids()
|
function multiple_selection_ids()
|
||||||
{
|
{
|
||||||
var multiple_selection_ids = []
|
var multiple_selection_ids = []
|
||||||
|
|
||||||
$('#image_files .active').each(function ()
|
$('#image_files .active').each(function ()
|
||||||
{
|
{
|
||||||
multiple_selection_ids.push($(this).attr("data_id"))
|
multiple_selection_ids.push($(this).attr("data_id"))
|
||||||
});
|
});
|
||||||
|
|
||||||
return multiple_selection_ids
|
return multiple_selection_ids
|
||||||
}
|
}
|
||||||
|
|
||||||
function close_image_file_container(image_file_id)
|
function close_image_file_container(image_file_id)
|
||||||
{
|
{
|
||||||
$('#image_file_container').removeClass("image_file_container_active");
|
$('#image_file_container').removeClass("image_file_container_active");
|
||||||
$('#image_files_container').css("overflow", "");
|
$('#image_files_container').css("overflow", "");
|
||||||
$('#right_bar').show();
|
$('#right_bar').show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function delete_multiple_images(){
|
function delete_multiple_images(){
|
||||||
if(confirm("Voulez-vous vraiment supprimer ces images ?"))
|
if(confirm("Voulez-vous vraiment supprimer ces images ?"))
|
||||||
{
|
{
|
||||||
|
|
||||||
var multiple_ids = multiple_selection_ids();
|
var multiple_ids = multiple_selection_ids();
|
||||||
$.each(multiple_ids, function(index, value)
|
$.each(multiple_ids, function(index, value)
|
||||||
{
|
{
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"/admin/image_files/"+value+".js",
|
url:"/admin/image_files/"+value+".js",
|
||||||
type : "DELETE",
|
type : "DELETE",
|
||||||
success : function (){
|
success : function (){
|
||||||
update_multiple_selection_text();
|
update_multiple_selection_text();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_all_image(){
|
function select_all_image(){
|
||||||
$('#image_files .image_file').each(function (){
|
$('#image_files .image_file').each(function (){
|
||||||
|
|
||||||
|
|
||||||
$(this).addClass("active");
|
$(this).addClass("active");
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
update_multiple_selection_text();
|
update_multiple_selection_text();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function unselect_all_image(){
|
function unselect_all_image(){
|
||||||
|
|
||||||
$('#image_files .image_file').each(function (){
|
$('#image_files .image_file').each(function (){
|
||||||
|
|
||||||
|
|
||||||
$(this).removeClass("active");
|
$(this).removeClass("active");
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
update_multiple_selection_text();
|
update_multiple_selection_text();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function initialize_slider(){
|
function initialize_slider(){
|
||||||
|
|
||||||
$("#grid_slider").slider({
|
$("#grid_slider").slider({
|
||||||
value: slider_value,
|
value: slider_value,
|
||||||
max: 250,
|
max: 250,
|
||||||
min: 80,
|
min: 80,
|
||||||
tooltip:"hide"
|
tooltip:"hide"
|
||||||
}).on("slide", function(ev)
|
}).on("slide", function(ev)
|
||||||
{
|
{
|
||||||
slider_value = ev.value
|
slider_value = ev.value
|
||||||
set_image_files_img_size();
|
set_image_files_img_size();
|
||||||
});
|
});
|
||||||
set_image_files_img_size();
|
set_image_files_img_size();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on("dblclick",".image_file", function (event){
|
$(document).on("dblclick",".image_file", function (event){
|
||||||
|
|
||||||
|
|
||||||
$.ajax({url : $(this).attr('data_show_url'), success: function (){
|
$.ajax({url : $(this).attr('data_show_url'), success: function (){
|
||||||
$('#image_file_container').addClass("image_file_container_active");
|
$('#image_file_container').addClass("image_file_container_active");
|
||||||
$('#right_bar').hide();
|
$('#right_bar').hide();
|
||||||
|
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click","#image_files_container", function (e){
|
$(document).on("click","#image_files_container", function (e){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($(e.target).parents(".image_file").length == 0){
|
if ($(e.target).parents(".image_file").length == 0){
|
||||||
unselect_all_image();
|
unselect_all_image();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("dblclick","#image_file_container .img", function (){
|
$(document).on("dblclick","#image_file_container .img", function (){
|
||||||
close_image_file_container();
|
close_image_file_container();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).on("click",".image_file", function (){
|
$(document).on("click",".image_file", function (){
|
||||||
|
|
||||||
if ($(this).hasClass('active')){
|
if ($(this).hasClass('active')){
|
||||||
$(this).removeClass('active');
|
$(this).removeClass('active');
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$(this).addClass('active');
|
$(this).addClass('active');
|
||||||
}
|
}
|
||||||
update_multiple_selection_text();
|
update_multiple_selection_text();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function ($) {
|
$(document).ready(function ($) {
|
||||||
|
|
||||||
$("#left_buttons").on("click", function() {
|
$("#left_buttons").on("click", function() {
|
||||||
multiple_selection_ids();
|
multiple_selection_ids();
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#image_files_big_container #main_workspace_view #image_file_container .form input').on('keydown', function(){
|
$('#image_files_big_container #main_workspace_view #image_file_container .form input').on('keydown', function(){
|
||||||
$('#image_files_big_container #main_workspace_view #image_file_container .form .submit_tr').show();
|
$('#image_files_big_container #main_workspace_view #image_file_container .form .submit_tr').show();
|
||||||
})
|
})
|
||||||
$('#image_files_big_container #main_workspace_view #image_file_container .form textarea').on('keydown', function(){
|
$('#image_files_big_container #main_workspace_view #image_file_container .form textarea').on('keydown', function(){
|
||||||
$('#image_files_big_container #main_workspace_view #image_file_container .form .submit_tr').show();
|
$('#image_files_big_container #main_workspace_view #image_file_container .form .submit_tr').show();
|
||||||
})
|
})
|
||||||
|
|
||||||
initialize_slider();
|
initialize_slider();
|
||||||
|
|
||||||
image_files_load();
|
image_files_load();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
1343
app/assets/javascripts/jquery.bxslider.js
Normal file
205
app/assets/javascripts/jquery.easing.1.3.js
Executable file
@ -0,0 +1,205 @@
|
|||||||
|
/*
|
||||||
|
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||||
|
*
|
||||||
|
* Uses the built in easing capabilities added In jQuery 1.1
|
||||||
|
* to offer multiple easing options
|
||||||
|
*
|
||||||
|
* TERMS OF USE - jQuery Easing
|
||||||
|
*
|
||||||
|
* Open source under the BSD License.
|
||||||
|
*
|
||||||
|
* Copyright © 2008 George McGinley Smith
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||||
|
* or promote products derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||||
|
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||||
|
|
||||||
|
jQuery.extend( jQuery.easing,
|
||||||
|
{
|
||||||
|
def: 'easeOutQuad',
|
||||||
|
swing: function (x, t, b, c, d) {
|
||||||
|
//alert(jQuery.easing.default);
|
||||||
|
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||||
|
},
|
||||||
|
easeInQuad: function (x, t, b, c, d) {
|
||||||
|
return c*(t/=d)*t + b;
|
||||||
|
},
|
||||||
|
easeOutQuad: function (x, t, b, c, d) {
|
||||||
|
return -c *(t/=d)*(t-2) + b;
|
||||||
|
},
|
||||||
|
easeInOutQuad: function (x, t, b, c, d) {
|
||||||
|
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||||
|
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||||
|
},
|
||||||
|
easeInCubic: function (x, t, b, c, d) {
|
||||||
|
return c*(t/=d)*t*t + b;
|
||||||
|
},
|
||||||
|
easeOutCubic: function (x, t, b, c, d) {
|
||||||
|
return c*((t=t/d-1)*t*t + 1) + b;
|
||||||
|
},
|
||||||
|
easeInOutCubic: function (x, t, b, c, d) {
|
||||||
|
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||||
|
return c/2*((t-=2)*t*t + 2) + b;
|
||||||
|
},
|
||||||
|
easeInQuart: function (x, t, b, c, d) {
|
||||||
|
return c*(t/=d)*t*t*t + b;
|
||||||
|
},
|
||||||
|
easeOutQuart: function (x, t, b, c, d) {
|
||||||
|
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||||
|
},
|
||||||
|
easeInOutQuart: function (x, t, b, c, d) {
|
||||||
|
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||||
|
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||||
|
},
|
||||||
|
easeInQuint: function (x, t, b, c, d) {
|
||||||
|
return c*(t/=d)*t*t*t*t + b;
|
||||||
|
},
|
||||||
|
easeOutQuint: function (x, t, b, c, d) {
|
||||||
|
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||||
|
},
|
||||||
|
easeInOutQuint: function (x, t, b, c, d) {
|
||||||
|
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||||
|
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||||
|
},
|
||||||
|
easeInSine: function (x, t, b, c, d) {
|
||||||
|
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||||
|
},
|
||||||
|
easeOutSine: function (x, t, b, c, d) {
|
||||||
|
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||||
|
},
|
||||||
|
easeInOutSine: function (x, t, b, c, d) {
|
||||||
|
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||||
|
},
|
||||||
|
easeInExpo: function (x, t, b, c, d) {
|
||||||
|
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||||
|
},
|
||||||
|
easeOutExpo: function (x, t, b, c, d) {
|
||||||
|
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||||
|
},
|
||||||
|
easeInOutExpo: function (x, t, b, c, d) {
|
||||||
|
if (t==0) return b;
|
||||||
|
if (t==d) return b+c;
|
||||||
|
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||||
|
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||||
|
},
|
||||||
|
easeInCirc: function (x, t, b, c, d) {
|
||||||
|
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||||
|
},
|
||||||
|
easeOutCirc: function (x, t, b, c, d) {
|
||||||
|
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||||
|
},
|
||||||
|
easeInOutCirc: function (x, t, b, c, d) {
|
||||||
|
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||||
|
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||||
|
},
|
||||||
|
easeInElastic: function (x, t, b, c, d) {
|
||||||
|
var s=1.70158;var p=0;var a=c;
|
||||||
|
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||||
|
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||||
|
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||||
|
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||||
|
},
|
||||||
|
easeOutElastic: function (x, t, b, c, d) {
|
||||||
|
var s=1.70158;var p=0;var a=c;
|
||||||
|
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||||
|
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||||
|
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||||
|
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||||
|
},
|
||||||
|
easeInOutElastic: function (x, t, b, c, d) {
|
||||||
|
var s=1.70158;var p=0;var a=c;
|
||||||
|
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||||
|
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||||
|
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||||
|
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||||
|
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||||
|
},
|
||||||
|
easeInBack: function (x, t, b, c, d, s) {
|
||||||
|
if (s == undefined) s = 1.70158;
|
||||||
|
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||||
|
},
|
||||||
|
easeOutBack: function (x, t, b, c, d, s) {
|
||||||
|
if (s == undefined) s = 1.70158;
|
||||||
|
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||||
|
},
|
||||||
|
easeInOutBack: function (x, t, b, c, d, s) {
|
||||||
|
if (s == undefined) s = 1.70158;
|
||||||
|
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||||
|
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||||
|
},
|
||||||
|
easeInBounce: function (x, t, b, c, d) {
|
||||||
|
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||||
|
},
|
||||||
|
easeOutBounce: function (x, t, b, c, d) {
|
||||||
|
if ((t/=d) < (1/2.75)) {
|
||||||
|
return c*(7.5625*t*t) + b;
|
||||||
|
} else if (t < (2/2.75)) {
|
||||||
|
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||||
|
} else if (t < (2.5/2.75)) {
|
||||||
|
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||||
|
} else {
|
||||||
|
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
easeInOutBounce: function (x, t, b, c, d) {
|
||||||
|
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||||
|
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* TERMS OF USE - EASING EQUATIONS
|
||||||
|
*
|
||||||
|
* Open source under the BSD License.
|
||||||
|
*
|
||||||
|
* Copyright © 2001 Robert Penner
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
* are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||||
|
* or promote products derived from this software without specific prior written permission.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||||
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||||
|
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||||
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||||
|
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||||
|
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||||
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
*/
|
@ -3,118 +3,118 @@ var manager_callback_function = null;
|
|||||||
|
|
||||||
function manager_load() {
|
function manager_load() {
|
||||||
|
|
||||||
|
|
||||||
$(document).bind("keydown",function(e) {
|
$(document).bind("keydown",function(e) {
|
||||||
if (e.keyCode == 27) {
|
if (e.keyCode == 27) {
|
||||||
manager_hide();
|
manager_hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function manager_show(url){
|
function manager_show(url){
|
||||||
|
|
||||||
initialize_manager();
|
initialize_manager();
|
||||||
|
|
||||||
manager_response = null;
|
manager_response = null;
|
||||||
$('#manager_box').html("");
|
$('#manager_box').html("");
|
||||||
|
|
||||||
$("#manager_box_place").show("fast", function (){
|
$("#manager_box_place").show("fast", function (){
|
||||||
$("#manager_box_place").addClass("manager_box_place_active");
|
$("#manager_box_place").addClass("manager_box_place_active");
|
||||||
$('#manager_box').load(url, function (){
|
$('#manager_box').load(url, function (){
|
||||||
image_files_load();
|
image_files_load();
|
||||||
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function manager_hide(){
|
function manager_hide(){
|
||||||
$("#manager_box_place").removeClass("manager_box_place_active");
|
$("#manager_box_place").removeClass("manager_box_place_active");
|
||||||
|
|
||||||
$("body").css("overflow", "auto");
|
$("body").css("overflow", "auto");
|
||||||
slider_enabled = null;
|
slider_enabled = null;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
$(document).ready(function ($) {
|
$(document).ready(function ($) {
|
||||||
manager_load();
|
manager_load();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function manager_prompt(url, callback) {
|
function manager_prompt(url, callback) {
|
||||||
manager_callback_function = callback;
|
manager_callback_function = callback;
|
||||||
manager_show(url);
|
manager_show(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
function manager_send_response(send_value){
|
function manager_send_response(send_value){
|
||||||
|
|
||||||
manager_hide();
|
manager_hide();
|
||||||
manager_callback_function(send_value);
|
manager_callback_function(send_value);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_image_from_manager(input_id){
|
function select_image_from_manager(input_id){
|
||||||
|
|
||||||
manager_prompt("/admin/image_files/?manager=true",function(m_return){
|
manager_prompt("/admin/image_files/?manager=true",function(m_return){
|
||||||
|
|
||||||
$('#input_'+input_id).val(m_return.image_file_id);
|
$('#input_'+input_id).val(m_return.image_file_id);
|
||||||
$('#img_'+input_id).attr("src",m_return.thumb);
|
$('#img_'+input_id).attr("src",m_return.thumb);
|
||||||
$('#name_'+input_id).val(m_return.name);
|
$('#name_'+input_id).val(m_return.name);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_gallery_images_from_manager(gallery_content_id){
|
function select_gallery_images_from_manager(gallery_content_id){
|
||||||
|
|
||||||
manager_prompt("/admin/image_files/?manager=true&multiple=true",function(m_return){
|
manager_prompt("/admin/image_files/?manager=true&multiple=true",function(m_return){
|
||||||
|
|
||||||
$.ajax({url:"/portlet/gallery_images/", type: "POST", data : { image_file_ids : m_return, gallery_content_id : gallery_content_id }});
|
$.ajax({url:"/portlet/gallery_images/", type: "POST", data : { image_file_ids : m_return, gallery_content_id : gallery_content_id }});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function select_file_from_manager(input_id){
|
function select_file_from_manager(input_id){
|
||||||
manager_prompt("/admin/data_files/?manager=true",function(m_return){
|
manager_prompt("/admin/data_files/?manager=true",function(m_return){
|
||||||
|
|
||||||
$('#input_'+input_id).val(m_return.data_file_id);
|
$('#input_'+input_id).val(m_return.data_file_id);
|
||||||
|
|
||||||
$('#name_'+input_id).html(m_return.name);
|
$('#name_'+input_id).html(m_return.name);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function manager_send_multiple_image_files(){
|
function manager_send_multiple_image_files(){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
manager_send_response(multiple_selection_ids());
|
manager_send_response(multiple_selection_ids());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -122,36 +122,36 @@ function manager_send_multiple_image_files(){
|
|||||||
function manager_send_image_file(image_file_id){
|
function manager_send_image_file(image_file_id){
|
||||||
|
|
||||||
|
|
||||||
var image_file_div = $('#image_file_'+image_file_id);
|
var image_file_div = $('#image_file_'+image_file_id);
|
||||||
|
|
||||||
manager_send_response({thumb : image_file_div.attr("data_thumb"), image_file_id : image_file_div.attr("data_id"), name : image_file_div.attr("data_name")});
|
manager_send_response({thumb : image_file_div.attr("data_thumb"), image_file_id : image_file_div.attr("data_id"), name : image_file_div.attr("data_name")});
|
||||||
}
|
}
|
||||||
|
|
||||||
function manager_send_cible(cible_id, cible_type, cible_name){
|
function manager_send_cible(cible_id, cible_type, cible_name){
|
||||||
|
|
||||||
manager_send_response({cible_id : cible_id, cible_type : cible_type, cible_name : cible_name});
|
manager_send_response({cible_id : cible_id, cible_type : cible_type, cible_name : cible_name});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function manager_send_data_file(data_file_id){
|
function manager_send_data_file(data_file_id){
|
||||||
|
|
||||||
|
|
||||||
var data_file_div = $('#data_file_'+data_file_id);
|
var data_file_div = $('#data_file_'+data_file_id);
|
||||||
|
|
||||||
manager_send_response({data_file_id : data_file_div.data("id"), name : data_file_div.data("name")});
|
manager_send_response({data_file_id : data_file_div.data("id"), name : data_file_div.data("name")});
|
||||||
}
|
}
|
||||||
|
|
||||||
function select_cible_from_manager(input_id){
|
function select_cible_from_manager(input_id){
|
||||||
|
|
||||||
|
|
||||||
manager_prompt("/admin/cibles/?manager=true",function(m_return){
|
manager_prompt("/admin/cibles/?manager=true",function(m_return){
|
||||||
|
|
||||||
$('#input_id_'+input_id).val(m_return.cible_id);
|
$('#input_id_'+input_id).val(m_return.cible_id);
|
||||||
$('#input_type_'+input_id).val(m_return.cible_type);
|
$('#input_type_'+input_id).val(m_return.cible_type);
|
||||||
$('#name_'+input_id).val(m_return.cible_name);
|
$('#name_'+input_id).val(m_return.cible_name);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -160,15 +160,15 @@ function select_cible_from_manager(input_id){
|
|||||||
|
|
||||||
function initialize_manager(){
|
function initialize_manager(){
|
||||||
|
|
||||||
if($('#manager_box_place').length == 0){
|
if($('#manager_box_place').length == 0){
|
||||||
|
|
||||||
$('body').prepend('<div id="manager_box_place"><div id="manager_box"></div></div>');
|
$('body').prepend('<div id="manager_box_place"><div id="manager_box"></div></div>');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,54 +1,54 @@
|
|||||||
|
|
||||||
|
|
||||||
function show_pane_hover(content, width, height, zindex){
|
function show_pane_hover(content, width, height, zindex){
|
||||||
var width = width || 500;
|
var width = width || 500;
|
||||||
var height = height || 500;
|
var height = height || 500;
|
||||||
var zindex = zindex || 1000;
|
var zindex = zindex || 1000;
|
||||||
|
|
||||||
|
|
||||||
initialize_pane_hover();
|
initialize_pane_hover();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#qi_pane_hover_content').html(content);
|
|
||||||
|
|
||||||
$('#qi_pane_hover_content').data("height",height);
|
|
||||||
$('#qi_pane_hover_content').css({"width" : width+"px","height" : height+"px","z-index" : zindex, "margin-top":"-"+height+"px"});
|
|
||||||
|
|
||||||
|
|
||||||
$('#qi_pane_hover_content .actions').prepend('<a href="#" class="btn" onclick="close_pane_hover();return false;">Annuler</a>');
|
|
||||||
$('#qi_pane_hover_content').css("display","block").delay(1).css({"-webkit-transition-duration":"0.5s","-moz-transition-duration":"0.5s", "margin-top":"0px"});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#qi_pane_hover_content').html(content);
|
||||||
|
|
||||||
|
$('#qi_pane_hover_content').data("height",height);
|
||||||
|
$('#qi_pane_hover_content').css({"width" : width+"px","height" : height+"px","z-index" : zindex, "margin-top":"-"+height+"px"});
|
||||||
|
|
||||||
|
|
||||||
|
$('#qi_pane_hover_content .actions').prepend('<a href="#" class="btn btn-default" onclick="close_pane_hover();return false;">Annuler</a>');
|
||||||
|
$('#qi_pane_hover_content').css("display","block").delay(1).css({"-webkit-transition-duration":"0.5s","-moz-transition-duration":"0.5s", "margin-top":"0px"});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function close_pane_hover(){
|
function close_pane_hover(){
|
||||||
|
|
||||||
$('#qi_pane_hover_content').css("display","block").delay(1).css({"-webkit-transition-duration":"0.5s","-moz-transition-duration":"0.5s", "margin-top":"-"+$('#qi_pane_hover_content').data("height")+"px"}).delay(500).queue(function() {
|
$('#qi_pane_hover_content').css("display","block").delay(1).css({"-webkit-transition-duration":"0.5s","-moz-transition-duration":"0.5s", "margin-top":"-"+$('#qi_pane_hover_content').data("height")+"px"}).delay(500).queue(function() {
|
||||||
$('#qi_pane_hover').remove();
|
$('#qi_pane_hover').remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function initialize_pane_hover(){
|
function initialize_pane_hover(){
|
||||||
if($('#qi_pane_hover').length == 0){
|
if($('#qi_pane_hover').length == 0){
|
||||||
|
|
||||||
$('body').append('<div id="qi_pane_hover"><div id="qi_pane_hover_content"></div></div>');
|
$('body').append('<div id="qi_pane_hover"><div id="qi_pane_hover_content"></div></div>');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
73
app/assets/javascripts/redactor_plugins/fontcolor.js
Executable file
@ -0,0 +1,73 @@
|
|||||||
|
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||||
|
|
||||||
|
RedactorPlugins.fontcolor = function()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
|
var colors = [
|
||||||
|
'#ffffff', '#000000', '#eeece1', '#1f497d', '#4f81bd', '#c0504d', '#9bbb59', '#8064a2', '#4bacc6', '#f79646', '#ffff00',
|
||||||
|
'#f2f2f2', '#7f7f7f', '#ddd9c3', '#c6d9f0', '#dbe5f1', '#f2dcdb', '#ebf1dd', '#e5e0ec', '#dbeef3', '#fdeada', '#fff2ca',
|
||||||
|
'#d8d8d8', '#595959', '#c4bd97', '#8db3e2', '#b8cce4', '#e5b9b7', '#d7e3bc', '#ccc1d9', '#b7dde8', '#fbd5b5', '#ffe694',
|
||||||
|
'#bfbfbf', '#3f3f3f', '#938953', '#548dd4', '#95b3d7', '#d99694', '#c3d69b', '#b2a2c7', '#b7dde8', '#fac08f', '#f2c314',
|
||||||
|
'#a5a5a5', '#262626', '#494429', '#17365d', '#366092', '#953734', '#76923c', '#5f497a', '#92cddc', '#e36c09', '#c09100',
|
||||||
|
'#7f7f7f', '#0c0c0c', '#1d1b10', '#0f243e', '#244061', '#632423', '#4f6128', '#3f3151', '#31859b', '#974806', '#7f6000'
|
||||||
|
];
|
||||||
|
|
||||||
|
var buttons = ['fontcolor', 'backcolor'];
|
||||||
|
|
||||||
|
for (var i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
var name = buttons[i];
|
||||||
|
|
||||||
|
var button = this.button.add(name, this.lang.get(name));
|
||||||
|
var $dropdown = this.button.addDropdown(button);
|
||||||
|
|
||||||
|
$dropdown.width(242);
|
||||||
|
this.fontcolor.buildPicker($dropdown, name, colors);
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
buildPicker: function($dropdown, name, colors)
|
||||||
|
{
|
||||||
|
var rule = (name == 'backcolor') ? 'background-color' : 'color';
|
||||||
|
|
||||||
|
var len = colors.length;
|
||||||
|
var self = this;
|
||||||
|
var func = function(e)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
self.fontcolor.set($(this).data('rule'), $(this).attr('rel'));
|
||||||
|
};
|
||||||
|
|
||||||
|
for (var z = 0; z < len; z++)
|
||||||
|
{
|
||||||
|
var color = colors[z];
|
||||||
|
|
||||||
|
var $swatch = $('<a rel="' + color + '" data-rule="' + rule +'" href="#" style="float: left; font-size: 0; border: 2px solid #fff; padding: 0; margin: 0; width: 22px; height: 22px;"></a>');
|
||||||
|
$swatch.css('background-color', color);
|
||||||
|
$swatch.on('click', func);
|
||||||
|
|
||||||
|
$dropdown.append($swatch);
|
||||||
|
}
|
||||||
|
|
||||||
|
var $elNone = $('<a href="#" style="display: block; clear: both; padding: 5px; font-size: 12px; line-height: 1;"></a>').html(this.lang.get('none'));
|
||||||
|
$elNone.on('click', $.proxy(function(e)
|
||||||
|
{
|
||||||
|
e.preventDefault();
|
||||||
|
this.fontcolor.remove(rule);
|
||||||
|
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
$dropdown.append($elNone);
|
||||||
|
},
|
||||||
|
set: function(rule, type)
|
||||||
|
{
|
||||||
|
this.inline.format('span', 'style', rule + ': ' + type + ';');
|
||||||
|
},
|
||||||
|
remove: function(rule)
|
||||||
|
{
|
||||||
|
this.inline.removeStyleRule(rule);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
32
app/assets/javascripts/redactor_plugins/fontfamily.js
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||||
|
|
||||||
|
RedactorPlugins.fontfamily = function()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
init: function ()
|
||||||
|
{
|
||||||
|
var fonts = [ 'Lato', 'Stylograph','Arial', 'Helvetica', 'Georgia', 'Times New Roman', 'Monospace' ];
|
||||||
|
var that = this;
|
||||||
|
var dropdown = {};
|
||||||
|
|
||||||
|
$.each(fonts, function(i, s)
|
||||||
|
{
|
||||||
|
dropdown['s' + i] = { title: s, func: function() { that.fontfamily.set(s); }};
|
||||||
|
});
|
||||||
|
|
||||||
|
dropdown.remove = { title: 'Remove Font Family', func: that.fontfamily.reset };
|
||||||
|
|
||||||
|
var button = this.button.add('fontfamily', 'Change Font Family');
|
||||||
|
this.button.addDropdown(button, dropdown);
|
||||||
|
|
||||||
|
},
|
||||||
|
set: function (value)
|
||||||
|
{
|
||||||
|
this.inline.format('span', 'style', 'font-family:' + value + ';');
|
||||||
|
},
|
||||||
|
reset: function()
|
||||||
|
{
|
||||||
|
this.inline.removeStyleRule('font-family');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
75
app/assets/javascripts/redactor_plugins/fontsize.js
Executable file
@ -0,0 +1,75 @@
|
|||||||
|
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||||
|
|
||||||
|
RedactorPlugins.fontsize = function()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
|
var fonts = [10, 11, 12, 14, 16, 18, 20, 24, 28, 30];
|
||||||
|
var that = this;
|
||||||
|
var dropdown = {};
|
||||||
|
|
||||||
|
$.each(fonts, function(i, s)
|
||||||
|
{
|
||||||
|
dropdown['s' + i] = { title: s + 'px', func: function() { that.fontsize.set(s); } };
|
||||||
|
});
|
||||||
|
|
||||||
|
dropdown.remove = { title: 'Remove Font Size', func: that.fontsize.reset };
|
||||||
|
|
||||||
|
var button = this.button.add('fontsize', 'Change Font Size');
|
||||||
|
this.button.addDropdown(button, dropdown);
|
||||||
|
},
|
||||||
|
set: function(size)
|
||||||
|
{
|
||||||
|
this.inline.format('span', 'style', 'font-size: ' + size + 'px;');
|
||||||
|
},
|
||||||
|
reset: function()
|
||||||
|
{
|
||||||
|
this.inline.removeStyleRule('font-size');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||||
|
|
||||||
|
RedactorPlugins.scriptbuttons = function()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
|
var sup = this.button.add('superscript', 'Superscript');
|
||||||
|
var sub = this.button.add('subscript', 'Subscript');
|
||||||
|
|
||||||
|
// make your added buttons as Font Awesome's icon
|
||||||
|
this.button.setAwesome('superscript', 'fa-superscript');
|
||||||
|
this.button.setAwesome('subscript', 'fa-subscript');
|
||||||
|
|
||||||
|
this.button.addCallback(sup, this.scriptbuttons.formatSup);
|
||||||
|
this.button.addCallback(sub, this.scriptbuttons.formatSub);
|
||||||
|
},
|
||||||
|
formatSup: function()
|
||||||
|
{
|
||||||
|
this.inline.format('sup');
|
||||||
|
},
|
||||||
|
formatSub: function()
|
||||||
|
{
|
||||||
|
this.inline.format('sub');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!RedactorPlugins) var RedactorPlugins = {};
|
||||||
|
|
||||||
|
RedactorPlugins.bufferbuttons = function()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
init: function()
|
||||||
|
{
|
||||||
|
var undo = this.button.addFirst('undo', 'Undo');
|
||||||
|
var redo = this.button.addAfter('undo', 'redo', 'Redo');
|
||||||
|
|
||||||
|
this.button.addCallback(undo, this.buffer.undo);
|
||||||
|
this.button.addCallback(redo, this.buffer.redo);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
$(function(){
|
|
||||||
|
|
||||||
$(document).on('click', 'input.datepicker', function() {
|
|
||||||
$(this).datepicker().focus();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//hover states on the static widgets
|
|
||||||
$('#dialog_link, ul#icons li').hover(
|
|
||||||
function() { $(this).addClass('ui-state-hover'); },
|
|
||||||
function() { $(this).removeClass('ui-state-hover'); }
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$(document).on('click', 'input.timepicker', function() {
|
|
||||||
$(this).timepicker({
|
|
||||||
showMeridian: false,
|
|
||||||
minuteStep: 15
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
@ -1,114 +0,0 @@
|
|||||||
/**
|
|
||||||
* hoverIntent is similar to jQuery's built-in "hover" method except that
|
|
||||||
* instead of firing the handlerIn function immediately, hoverIntent checks
|
|
||||||
* to see if the user's mouse has slowed down (beneath the sensitivity
|
|
||||||
* threshold) before firing the event. The handlerOut function is only
|
|
||||||
* called after a matching handlerIn.
|
|
||||||
*
|
|
||||||
* hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+
|
|
||||||
* http://cherne.net/brian/resources/jquery.hoverIntent.html
|
|
||||||
*
|
|
||||||
* You may use hoverIntent under the terms of the MIT license. Basically that
|
|
||||||
* means you are free to use hoverIntent as long as this header is left intact.
|
|
||||||
* Copyright 2007, 2013 Brian Cherne
|
|
||||||
*
|
|
||||||
* // basic usage ... just like .hover()
|
|
||||||
* .hoverIntent( handlerIn, handlerOut )
|
|
||||||
* .hoverIntent( handlerInOut )
|
|
||||||
*
|
|
||||||
* // basic usage ... with event delegation!
|
|
||||||
* .hoverIntent( handlerIn, handlerOut, selector )
|
|
||||||
* .hoverIntent( handlerInOut, selector )
|
|
||||||
*
|
|
||||||
* // using a basic configuration object
|
|
||||||
* .hoverIntent( config )
|
|
||||||
*
|
|
||||||
* @param handlerIn function OR configuration object
|
|
||||||
* @param handlerOut function OR selector for delegation OR undefined
|
|
||||||
* @param selector selector OR undefined
|
|
||||||
* @author Brian Cherne <brian(at)cherne(dot)net>
|
|
||||||
**/
|
|
||||||
(function($) {
|
|
||||||
$.fn.hoverIntent = function(handlerIn,handlerOut,selector) {
|
|
||||||
|
|
||||||
// default configuration values
|
|
||||||
var cfg = {
|
|
||||||
interval: 100,
|
|
||||||
sensitivity: 7,
|
|
||||||
timeout: 0
|
|
||||||
};
|
|
||||||
|
|
||||||
if ( typeof handlerIn === "object" ) {
|
|
||||||
cfg = $.extend(cfg, handlerIn );
|
|
||||||
} else if ($.isFunction(handlerOut)) {
|
|
||||||
cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector } );
|
|
||||||
} else {
|
|
||||||
cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut } );
|
|
||||||
}
|
|
||||||
|
|
||||||
// instantiate variables
|
|
||||||
// cX, cY = current X and Y position of mouse, updated by mousemove event
|
|
||||||
// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
|
|
||||||
var cX, cY, pX, pY;
|
|
||||||
|
|
||||||
// A private function for getting mouse position
|
|
||||||
var track = function(ev) {
|
|
||||||
cX = ev.pageX;
|
|
||||||
cY = ev.pageY;
|
|
||||||
};
|
|
||||||
|
|
||||||
// A private function for comparing current and previous mouse position
|
|
||||||
var compare = function(ev,ob) {
|
|
||||||
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
|
|
||||||
// compare mouse positions to see if they've crossed the threshold
|
|
||||||
if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
|
|
||||||
$(ob).off("mousemove.hoverIntent",track);
|
|
||||||
// set hoverIntent state to true (so mouseOut can be called)
|
|
||||||
ob.hoverIntent_s = 1;
|
|
||||||
return cfg.over.apply(ob,[ev]);
|
|
||||||
} else {
|
|
||||||
// set previous coordinates for next time
|
|
||||||
pX = cX; pY = cY;
|
|
||||||
// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
|
|
||||||
ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// A private function for delaying the mouseOut function
|
|
||||||
var delay = function(ev,ob) {
|
|
||||||
ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
|
|
||||||
ob.hoverIntent_s = 0;
|
|
||||||
return cfg.out.apply(ob,[ev]);
|
|
||||||
};
|
|
||||||
|
|
||||||
// A private function for handling mouse 'hovering'
|
|
||||||
var handleHover = function(e) {
|
|
||||||
// copy objects to be passed into t (required for event object to be passed in IE)
|
|
||||||
var ev = jQuery.extend({},e);
|
|
||||||
var ob = this;
|
|
||||||
|
|
||||||
// cancel hoverIntent timer if it exists
|
|
||||||
if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
|
|
||||||
|
|
||||||
// if e.type == "mouseenter"
|
|
||||||
if (e.type == "mouseenter") {
|
|
||||||
// set "previous" X and Y position based on initial entry point
|
|
||||||
pX = ev.pageX; pY = ev.pageY;
|
|
||||||
// update "current" X and Y position based on mousemove
|
|
||||||
$(ob).on("mousemove.hoverIntent",track);
|
|
||||||
// start polling interval (self-calling timeout) to compare mouse coordinates over time
|
|
||||||
if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
|
|
||||||
|
|
||||||
// else e.type == "mouseleave"
|
|
||||||
} else {
|
|
||||||
// unbind expensive mousemove event
|
|
||||||
$(ob).off("mousemove.hoverIntent",track);
|
|
||||||
// if hoverIntent state is true, then call the mouseOut function after the specified delay
|
|
||||||
if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// listen for mouseenter and mouseleave
|
|
||||||
return this.on({'mouseenter.hoverIntent':handleHover,'mouseleave.hoverIntent':handleHover}, cfg.selector);
|
|
||||||
};
|
|
||||||
})(jQuery);
|
|
98
app/assets/javascripts/shared/jquery-ui.js
vendored
@ -41,7 +41,7 @@ c);return this},enable:function(){return this._setOption("disabled",false)},disa
|
|||||||
* http://docs.jquery.com/UI/Mouse
|
* http://docs.jquery.com/UI/Mouse
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
(function(b){var d=false;b(document).mouseup(function(){d=false});b.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var a=this;this.element.bind("mousedown."+this.widgetName,function(c){return a._mouseDown(c)}).bind("click."+this.widgetName,function(c){if(true===b.data(c.target,a.widgetName+".preventClickEvent")){b.removeData(c.target,a.widgetName+".preventClickEvent");c.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
|
||||||
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
|
this.widgetName)},_mouseDown:function(a){if(!d){this._mouseStarted&&this._mouseUp(a);this._mouseDownEvent=a;var c=this,f=a.which==1,g=typeof this.options.cancel=="string"&&a.target.nodeName?b(a.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(a))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){c.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a)){this._mouseStarted=
|
||||||
@ -74,9 +74,9 @@ g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"lef
|
|||||||
* http://docs.jquery.com/UI/Draggables
|
* http://docs.jquery.com/UI/Draggables
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
|
||||||
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b=
|
||||||
@ -124,10 +124,10 @@ p||q||r||s;if(f.snapMode!="outer"){p=Math.abs(k-n)<=e;q=Math.abs(m-o)<=e;r=Math.
|
|||||||
* http://docs.jquery.com/UI/Droppables
|
* http://docs.jquery.com/UI/Droppables
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.draggable.js
|
* jquery.ui.draggable.js
|
||||||
*/
|
*/
|
||||||
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
|
(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this);
|
||||||
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
|
a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b<a.length;b++)a[b]==this&&a.splice(b,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(a,b){if(a=="accept")this.accept=d.isFunction(b)?b:function(c){return c.is(b)};d.Widget.prototype._setOption.apply(this,arguments)},_activate:function(a){var b=d.ui.ddmanager.current;this.options.activeClass&&
|
||||||
@ -151,9 +151,9 @@ a.options.refreshPositions||d.ui.ddmanager.prepareOffsets(a,b)}}})(jQuery);
|
|||||||
* http://docs.jquery.com/UI/Resizables
|
* http://docs.jquery.com/UI/Resizables
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
|
(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element,
|
||||||
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
|
||||||
@ -200,9 +200,9 @@ d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f
|
|||||||
* http://docs.jquery.com/UI/Selectables
|
* http://docs.jquery.com/UI/Selectables
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
|
(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),
|
||||||
selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
|
selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX,
|
||||||
@ -222,9 +222,9 @@ e.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("
|
|||||||
* http://docs.jquery.com/UI/Sortables
|
* http://docs.jquery.com/UI/Sortables
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
|
(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable");
|
||||||
this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a===
|
this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a===
|
||||||
@ -282,8 +282,8 @@ _uiHash:function(a){var b=a||this;return{helper:b.helper,placeholder:b.placehold
|
|||||||
* http://docs.jquery.com/UI/Accordion
|
* http://docs.jquery.com/UI/Accordion
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
|
(function(c){c.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
|
||||||
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
|
||||||
@ -312,9 +312,9 @@ paddingTop:"hide",paddingBottom:"hide"},a);else a.toShow.animate({height:"show",
|
|||||||
* http://docs.jquery.com/UI/Autocomplete
|
* http://docs.jquery.com/UI/Autocomplete
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
* jquery.ui.position.js
|
* jquery.ui.position.js
|
||||||
*/
|
*/
|
||||||
(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g=
|
(function(d){var e=0;d.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:false,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var a=this,b=this.element[0].ownerDocument,g;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.propAttr("readOnly"))){g=
|
||||||
false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
|
false;var f=d.ui.keyCode;switch(c.keyCode){case f.PAGE_UP:a._move("previousPage",c);break;case f.PAGE_DOWN:a._move("nextPage",c);break;case f.UP:a._move("previous",c);c.preventDefault();break;case f.DOWN:a._move("next",c);c.preventDefault();break;case f.ENTER:case f.NUMPAD_ENTER:if(a.menu.active){g=true;c.preventDefault()}case f.TAB:if(!a.menu.active)return;a.menu.select(c);break;case f.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=
|
||||||
@ -344,8 +344,8 @@ this.first()?":last":":first"))},hasScroll:function(){return this.element.height
|
|||||||
* http://docs.jquery.com/UI/Button
|
* http://docs.jquery.com/UI/Button
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
|
(function(b){var h,i,j,g,l=function(){var a=b(this).find(":ui-button");setTimeout(function(){a.button("refresh")},1)},k=function(a){var c=a.name,e=a.form,f=b([]);if(c)f=e?b(e).find("[name='"+c+"']"):b("[name='"+c+"']",a.ownerDocument).filter(function(){return!this.form});return f};b.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",l);if(typeof this.options.disabled!==
|
||||||
"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
|
"boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var a=this,c=this.options,e=this.type==="checkbox"||this.type==="radio",f="ui-state-hover"+(!e?" ui-state-active":"");if(c.label===null)c.label=this.buttonElement.html();if(this.element.is(":disabled"))c.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!c.disabled){b(this).addClass("ui-state-hover");
|
||||||
@ -371,13 +371,13 @@ b.Widget.prototype.destroy.call(this)}})})(jQuery);
|
|||||||
* http://docs.jquery.com/UI/Dialog
|
* http://docs.jquery.com/UI/Dialog
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
* jquery.ui.button.js
|
* jquery.ui.button.js
|
||||||
* jquery.ui.draggable.js
|
* jquery.ui.draggable.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.position.js
|
* jquery.ui.position.js
|
||||||
* jquery.ui.resizable.js
|
* jquery.ui.resizable.js
|
||||||
*/
|
*/
|
||||||
(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
|
(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
|
||||||
position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
|
position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
|
||||||
@ -411,9 +411,9 @@ c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.b
|
|||||||
* http://docs.jquery.com/UI/Slider
|
* http://docs.jquery.com/UI/Slider
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.mouse.js
|
* jquery.ui.mouse.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
|
(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
|
||||||
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j<f;j+=1)e.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
|
||||||
@ -444,8 +444,8 @@ b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":
|
|||||||
* http://docs.jquery.com/UI/Tabs
|
* http://docs.jquery.com/UI/Tabs
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
* jquery.ui.widget.js
|
* jquery.ui.widget.js
|
||||||
*/
|
*/
|
||||||
(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
|
(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading…</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&&
|
||||||
e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
|
e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=
|
||||||
@ -479,7 +479,7 @@ a.rotate(null)}:function(){t=c.selected;h()});if(b){this.element.bind("tabsshow"
|
|||||||
* http://docs.jquery.com/UI/Datepicker
|
* http://docs.jquery.com/UI/Datepicker
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.ui.core.js
|
* jquery.ui.core.js
|
||||||
*/
|
*/
|
||||||
(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
(function(d,C){function M(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
|
||||||
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
|
"ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
|
||||||
@ -609,7 +609,7 @@ a*2-e,0,d,e)*0.5+d*0.5+b}})}(jQuery);
|
|||||||
* http://docs.jquery.com/UI/Effects/Blind
|
* http://docs.jquery.com/UI/Effects/Blind
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
|
(function(b){b.effects.blind=function(c){return this.queue(function(){var a=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(a,c.options.mode||"hide"),d=c.options.direction||"vertical";b.effects.save(a,g);a.show();var e=b.effects.createWrapper(a).css({overflow:"hidden"}),h=d=="vertical"?"height":"width";d=d=="vertical"?e.height():e.width();f=="show"&&e.css(h,0);var i={};i[h]=f=="show"?d:0;e.animate(i,c.duration,c.options.easing,function(){f=="hide"&&a.hide();b.effects.restore(a,
|
||||||
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
|
g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.dequeue()})})}})(jQuery);
|
||||||
@ -623,7 +623,7 @@ g);b.effects.removeWrapper(a);c.callback&&c.callback.apply(a[0],arguments);a.deq
|
|||||||
* http://docs.jquery.com/UI/Effects/Bounce
|
* http://docs.jquery.com/UI/Effects/Bounce
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
|
(function(e){e.effects.bounce=function(b){return this.queue(function(){var a=e(this),l=["position","top","bottom","left","right"],h=e.effects.setMode(a,b.options.mode||"effect"),d=b.options.direction||"up",c=b.options.distance||20,m=b.options.times||5,i=b.duration||250;/show|hide/.test(h)&&l.push("opacity");e.effects.save(a,l);a.show();e.effects.createWrapper(a);var f=d=="up"||d=="down"?"top":"left";d=d=="up"||d=="left"?"pos":"neg";c=b.options.distance||(f=="top"?a.outerHeight({margin:true})/3:a.outerWidth({margin:true})/
|
||||||
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
|
3);if(h=="show")a.css("opacity",0).css(f,d=="pos"?-c:c);if(h=="hide")c/=m*2;h!="hide"&&m--;if(h=="show"){var g={opacity:1};g[f]=(d=="pos"?"+=":"-=")+c;a.animate(g,i/2,b.options.easing);c/=2;m--}for(g=0;g<m;g++){var j={},k={};j[f]=(d=="pos"?"-=":"+=")+c;k[f]=(d=="pos"?"+=":"-=")+c;a.animate(j,i/2,b.options.easing).animate(k,i/2,b.options.easing);c=h=="hide"?c*2:c/2}if(h=="hide"){g={opacity:0};g[f]=(d=="pos"?"-=":"+=")+c;a.animate(g,i/2,b.options.easing,function(){a.hide();e.effects.restore(a,l);e.effects.removeWrapper(a);
|
||||||
@ -638,7 +638,7 @@ b.callback&&b.callback.apply(this,arguments)})}else{j={};k={};j[f]=(d=="pos"?"-=
|
|||||||
* http://docs.jquery.com/UI/Effects/Clip
|
* http://docs.jquery.com/UI/Effects/Clip
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
|
(function(b){b.effects.clip=function(e){return this.queue(function(){var a=b(this),i=["position","top","bottom","left","right","height","width"],f=b.effects.setMode(a,e.options.mode||"hide"),c=e.options.direction||"vertical";b.effects.save(a,i);a.show();var d=b.effects.createWrapper(a).css({overflow:"hidden"});d=a[0].tagName=="IMG"?d:a;var g={size:c=="vertical"?"height":"width",position:c=="vertical"?"top":"left"};c=c=="vertical"?d.height():d.width();if(f=="show"){d.css(g.size,0);d.css(g.position,
|
||||||
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
|
c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,{queue:false,duration:e.duration,easing:e.options.easing,complete:function(){f=="hide"&&a.hide();b.effects.restore(a,i);b.effects.removeWrapper(a);e.callback&&e.callback.apply(a[0],arguments);a.dequeue()}})})}})(jQuery);
|
||||||
@ -652,7 +652,7 @@ c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,
|
|||||||
* http://docs.jquery.com/UI/Effects/Drop
|
* http://docs.jquery.com/UI/Effects/Drop
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
|
(function(c){c.effects.drop=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right","opacity"],e=c.effects.setMode(a,d.options.mode||"hide"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a);var f=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var g=d.options.distance||(f=="top"?a.outerHeight({margin:true})/2:a.outerWidth({margin:true})/2);if(e=="show")a.css("opacity",0).css(f,b=="pos"?-g:g);var i={opacity:e==
|
||||||
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
"show"?1:0};i[f]=(e=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+g;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){e=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||||
@ -666,7 +666,7 @@ c/2)}var h={};h[g.size]=f=="show"?c:0;h[g.position]=f=="show"?0:c/2;d.animate(h,
|
|||||||
* http://docs.jquery.com/UI/Effects/Explode
|
* http://docs.jquery.com/UI/Effects/Explode
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
|
(function(j){j.effects.explode=function(a){return this.queue(function(){var c=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3,d=a.options.pieces?Math.round(Math.sqrt(a.options.pieces)):3;a.options.mode=a.options.mode=="toggle"?j(this).is(":visible")?"hide":"show":a.options.mode;var b=j(this).show().css("visibility","hidden"),g=b.offset();g.top-=parseInt(b.css("marginTop"),10)||0;g.left-=parseInt(b.css("marginLeft"),10)||0;for(var h=b.outerWidth(true),i=b.outerHeight(true),e=0;e<c;e++)for(var f=
|
||||||
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
|
0;f<d;f++)b.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+
|
||||||
@ -681,7 +681,7 @@ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m
|
|||||||
* http://docs.jquery.com/UI/Effects/Fade
|
* http://docs.jquery.com/UI/Effects/Fade
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery);
|
||||||
;/*
|
;/*
|
||||||
@ -694,7 +694,7 @@ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m
|
|||||||
* http://docs.jquery.com/UI/Effects/Fold
|
* http://docs.jquery.com/UI/Effects/Fold
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
|
(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","bottom","left","right"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],
|
||||||
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
|
10)/100*f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery);
|
||||||
@ -708,7 +708,7 @@ e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.m
|
|||||||
* http://docs.jquery.com/UI/Effects/Highlight
|
* http://docs.jquery.com/UI/Effects/Highlight
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
|
(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&&
|
||||||
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||||
@ -722,7 +722,7 @@ this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments
|
|||||||
* http://docs.jquery.com/UI/Effects/Pulsate
|
* http://docs.jquery.com/UI/Effects/Pulsate
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
|
(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c<times;c++){b.animate({opacity:animateTo},duration,a.options.easing);animateTo=(animateTo+1)%2}b.animate({opacity:animateTo},duration,
|
||||||
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
|
a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()}).dequeue()})}})(jQuery);
|
||||||
@ -736,7 +736,7 @@ a.options.easing,function(){animateTo==0&&b.hide();a.callback&&a.callback.apply(
|
|||||||
* http://docs.jquery.com/UI/Effects/Scale
|
* http://docs.jquery.com/UI/Effects/Scale
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
|
(function(c){c.effects.puff=function(b){return this.queue(function(){var a=c(this),e=c.effects.setMode(a,b.options.mode||"hide"),g=parseInt(b.options.percent,10)||150,h=g/100,i={height:a.height(),width:a.width()};c.extend(b.options,{fade:true,mode:e,percent:e=="hide"?g:100,from:e=="hide"?i:{height:i.height*h,width:i.width*h}});a.effect("scale",b.options,b.duration,b.callback);a.dequeue()})};c.effects.scale=function(b){return this.queue(function(){var a=c(this),e=c.extend(true,{},b.options),g=c.effects.setMode(a,
|
||||||
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
|
b.options.mode||"effect"),h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:g=="hide"?0:100),i=b.options.direction||"both",f=b.options.origin;if(g!="effect"){e.origin=f||["middle","center"];e.restore=true}f={height:a.height(),width:a.width()};a.from=b.options.from||(g=="show"?{height:0,width:0}:f);h={y:i!="horizontal"?h/100:1,x:i!="vertical"?h/100:1};a.to={height:f.height*h.y,width:f.width*h.x};if(b.options.fade){if(g=="show"){a.from.opacity=0;a.to.opacity=1}if(g=="hide"){a.from.opacity=
|
||||||
@ -756,7 +756,7 @@ n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a
|
|||||||
* http://docs.jquery.com/UI/Effects/Shake
|
* http://docs.jquery.com/UI/Effects/Shake
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
|
(function(d){d.effects.shake=function(a){return this.queue(function(){var b=d(this),j=["position","top","bottom","left","right"];d.effects.setMode(b,a.options.mode||"effect");var c=a.options.direction||"left",e=a.options.distance||20,l=a.options.times||3,f=a.duration||a.options.duration||140;d.effects.save(b,j);b.show();d.effects.createWrapper(b);var g=c=="up"||c=="down"?"top":"left",h=c=="up"||c=="left"?"pos":"neg";c={};var i={},k={};c[g]=(h=="pos"?"-=":"+=")+e;i[g]=(h=="pos"?"+=":"-=")+e*2;k[g]=
|
||||||
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
|
(h=="pos"?"-=":"+=")+e*2;b.animate(c,f,a.options.easing);for(e=1;e<l;e++)b.animate(i,f,a.options.easing).animate(k,f,a.options.easing);b.animate(i,f,a.options.easing).animate(c,f/2,a.options.easing,function(){d.effects.restore(b,j);d.effects.removeWrapper(b);a.callback&&a.callback.apply(this,arguments)});b.queue("fx",function(){b.dequeue()});b.dequeue()})}})(jQuery);
|
||||||
@ -770,7 +770,7 @@ n?e:g);c.effects.removeWrapper(a);b.callback&&b.callback.apply(this,arguments);a
|
|||||||
* http://docs.jquery.com/UI/Effects/Slide
|
* http://docs.jquery.com/UI/Effects/Slide
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
|
(function(c){c.effects.slide=function(d){return this.queue(function(){var a=c(this),h=["position","top","bottom","left","right"],f=c.effects.setMode(a,d.options.mode||"show"),b=d.options.direction||"left";c.effects.save(a,h);a.show();c.effects.createWrapper(a).css({overflow:"hidden"});var g=b=="up"||b=="down"?"top":"left";b=b=="up"||b=="left"?"pos":"neg";var e=d.options.distance||(g=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));if(f=="show")a.css(g,b=="pos"?isNaN(e)?"-"+e:-e:e);
|
||||||
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&a.hide();c.effects.restore(a,h);c.effects.removeWrapper(a);d.callback&&d.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery);
|
||||||
@ -784,7 +784,7 @@ var i={};i[g]=(f=="show"?b=="pos"?"+=":"-=":b=="pos"?"-=":"+=")+e;a.animate(i,{q
|
|||||||
* http://docs.jquery.com/UI/Effects/Transfer
|
* http://docs.jquery.com/UI/Effects/Transfer
|
||||||
*
|
*
|
||||||
* Depends:
|
* Depends:
|
||||||
* jquery.effects.core.js
|
* jquery.effects.core.js
|
||||||
*/
|
*/
|
||||||
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
|
(function(e){e.effects.transfer=function(a){return this.queue(function(){var b=e(this),c=e(a.options.to),d=c.offset();c={top:d.top,left:d.left,height:c.innerHeight(),width:c.innerWidth()};d=b.offset();var f=e('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments);
|
||||||
b.dequeue()})})}})(jQuery);
|
b.dequeue()})})}})(jQuery);
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
/*! Backstretch - v2.0.4 - 2013-06-19
|
|
||||||
* http://srobbin.com/jquery-plugins/backstretch/
|
|
||||||
* Copyright (c) 2013 Scott Robbin; Licensed MIT */
|
|
||||||
(function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("<img />")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('<div class="backstretch"></div>').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("<img />").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.index<this.images.length-1?this.index+1:0)},prev:function(){return this.show(0===this.index?this.images.length-1:this.index-1)},pause:function(){this.paused=!0;return this},resume:function(){this.paused=!1;this.next();return this},cycle:function(){1<this.images.length&&(clearInterval(this.interval),this.interval=setInterval(a.proxy(function(){this.paused||this.next()},this),this.options.duration));return this},destroy:function(c){a(d).off("resize.backstretch orientationchange.backstretch");clearInterval(this.interval);c||this.$wrap.remove();this.$container.removeData("backstretch")}};var l,f=navigator.userAgent,m=navigator.platform,e=f.match(/AppleWebKit\/([0-9]+)/),e=!!e&&e[1],h=f.match(/Fennec\/([0-9]+)/),h=!!h&&h[1],n=f.match(/Opera Mobi\/([0-9]+)/),t=!!n&&n[1],k=f.match(/MSIE ([0-9]+)/),k=!!k&&k[1];l=!((-1<m.indexOf("iPhone")||-1<m.indexOf("iPad")||-1<m.indexOf("iPod"))&&e&&534>e||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1<f.indexOf("Android")&&e&&533>e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1<f.indexOf("MeeGo")&&-1<f.indexOf("NokiaBrowser/8.5.0")||k&&6>=k)})(jQuery,window);
|
|
@ -1,205 +0,0 @@
|
|||||||
/*
|
|
||||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
|
||||||
*
|
|
||||||
* Uses the built in easing capabilities added In jQuery 1.1
|
|
||||||
* to offer multiple easing options
|
|
||||||
*
|
|
||||||
* TERMS OF USE - jQuery Easing
|
|
||||||
*
|
|
||||||
* Open source under the BSD License.
|
|
||||||
*
|
|
||||||
* Copyright © 2008 George McGinley Smith
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
|
||||||
* or promote products derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
||||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
|
||||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
|
||||||
|
|
||||||
jQuery.extend( jQuery.easing,
|
|
||||||
{
|
|
||||||
def: 'easeOutQuad',
|
|
||||||
swing: function (x, t, b, c, d) {
|
|
||||||
//alert(jQuery.easing.default);
|
|
||||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
|
||||||
},
|
|
||||||
easeInQuad: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t + b;
|
|
||||||
},
|
|
||||||
easeOutQuad: function (x, t, b, c, d) {
|
|
||||||
return -c *(t/=d)*(t-2) + b;
|
|
||||||
},
|
|
||||||
easeInOutQuad: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
|
||||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
|
||||||
},
|
|
||||||
easeInCubic: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t*t + b;
|
|
||||||
},
|
|
||||||
easeOutCubic: function (x, t, b, c, d) {
|
|
||||||
return c*((t=t/d-1)*t*t + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutCubic: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
|
||||||
return c/2*((t-=2)*t*t + 2) + b;
|
|
||||||
},
|
|
||||||
easeInQuart: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t*t*t + b;
|
|
||||||
},
|
|
||||||
easeOutQuart: function (x, t, b, c, d) {
|
|
||||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutQuart: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
|
||||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
|
||||||
},
|
|
||||||
easeInQuint: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t*t*t*t + b;
|
|
||||||
},
|
|
||||||
easeOutQuint: function (x, t, b, c, d) {
|
|
||||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutQuint: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
|
||||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
|
||||||
},
|
|
||||||
easeInSine: function (x, t, b, c, d) {
|
|
||||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
|
||||||
},
|
|
||||||
easeOutSine: function (x, t, b, c, d) {
|
|
||||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
|
||||||
},
|
|
||||||
easeInOutSine: function (x, t, b, c, d) {
|
|
||||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
|
||||||
},
|
|
||||||
easeInExpo: function (x, t, b, c, d) {
|
|
||||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
|
||||||
},
|
|
||||||
easeOutExpo: function (x, t, b, c, d) {
|
|
||||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutExpo: function (x, t, b, c, d) {
|
|
||||||
if (t==0) return b;
|
|
||||||
if (t==d) return b+c;
|
|
||||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
|
||||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
|
||||||
},
|
|
||||||
easeInCirc: function (x, t, b, c, d) {
|
|
||||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
|
||||||
},
|
|
||||||
easeOutCirc: function (x, t, b, c, d) {
|
|
||||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
|
||||||
},
|
|
||||||
easeInOutCirc: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
|
||||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
|
||||||
},
|
|
||||||
easeInElastic: function (x, t, b, c, d) {
|
|
||||||
var s=1.70158;var p=0;var a=c;
|
|
||||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
|
||||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
|
||||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
|
||||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
|
||||||
},
|
|
||||||
easeOutElastic: function (x, t, b, c, d) {
|
|
||||||
var s=1.70158;var p=0;var a=c;
|
|
||||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
|
||||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
|
||||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
|
||||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
|
||||||
},
|
|
||||||
easeInOutElastic: function (x, t, b, c, d) {
|
|
||||||
var s=1.70158;var p=0;var a=c;
|
|
||||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
|
||||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
|
||||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
|
||||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
|
||||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
|
||||||
},
|
|
||||||
easeInBack: function (x, t, b, c, d, s) {
|
|
||||||
if (s == undefined) s = 1.70158;
|
|
||||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
|
||||||
},
|
|
||||||
easeOutBack: function (x, t, b, c, d, s) {
|
|
||||||
if (s == undefined) s = 1.70158;
|
|
||||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutBack: function (x, t, b, c, d, s) {
|
|
||||||
if (s == undefined) s = 1.70158;
|
|
||||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
|
||||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
|
||||||
},
|
|
||||||
easeInBounce: function (x, t, b, c, d) {
|
|
||||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
|
||||||
},
|
|
||||||
easeOutBounce: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d) < (1/2.75)) {
|
|
||||||
return c*(7.5625*t*t) + b;
|
|
||||||
} else if (t < (2/2.75)) {
|
|
||||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
|
||||||
} else if (t < (2.5/2.75)) {
|
|
||||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
|
||||||
} else {
|
|
||||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
easeInOutBounce: function (x, t, b, c, d) {
|
|
||||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
|
||||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* TERMS OF USE - EASING EQUATIONS
|
|
||||||
*
|
|
||||||
* Open source under the BSD License.
|
|
||||||
*
|
|
||||||
* Copyright © 2001 Robert Penner
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
|
||||||
* or promote products derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
||||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*/
|
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* FancyBox - jQuery Plugin
|
|
||||||
* Simple and fancy lightbox alternative
|
|
||||||
*
|
|
||||||
* Examples and documentation at: http://fancybox.net
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* Version: 1.3.4 (11/11/2010)
|
|
||||||
* Requires: jQuery v1.3+
|
|
||||||
*
|
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
|
||||||
* http://www.gnu.org/licenses/gpl.html
|
|
||||||
*/
|
|
||||||
|
|
||||||
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
|
||||||
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
|
||||||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
|
||||||
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
|
||||||
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
|
||||||
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
|
||||||
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
|
||||||
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
|
||||||
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
|
||||||
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
|
||||||
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
|
||||||
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
|
||||||
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
|
||||||
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
|
||||||
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
|
||||||
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
|
||||||
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
|
||||||
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
|
||||||
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
|
||||||
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
|
||||||
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
|
||||||
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
|
||||||
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
|
||||||
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
|
||||||
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
|
||||||
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
|
||||||
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
|
||||||
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
|
||||||
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
|
14686
app/assets/javascripts/shared/jquery.js
vendored
@ -1,14 +0,0 @@
|
|||||||
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
|
||||||
* Licensed under the MIT License (LICENSE.txt).
|
|
||||||
*
|
|
||||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
|
||||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
|
||||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
|
||||||
*
|
|
||||||
* Version: 3.0.4
|
|
||||||
*
|
|
||||||
* Requires: 1.2.2+
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
|
|
||||||
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
|
@ -136,7 +136,7 @@
|
|||||||
G: function(input, args){
|
G: function(input, args){
|
||||||
return this.g(input, args);
|
return this.g(input, args);
|
||||||
},
|
},
|
||||||
// Single character (accepts integer or single character string).
|
// Single character (accepts integer or single character string).
|
||||||
c: function(input, args) {
|
c: function(input, args) {
|
||||||
var match = input.match(/\w|\d/);
|
var match = input.match(/\w|\d/);
|
||||||
return match && match[0] || '';
|
return match && match[0] || '';
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
jQuery.fn.limitMaxlength = function(options){
|
|
||||||
|
|
||||||
var settings = jQuery.extend({
|
|
||||||
attribute: "data_maxlength",
|
|
||||||
onLimit: function(){},
|
|
||||||
onEdit: function(){}
|
|
||||||
}, options);
|
|
||||||
|
|
||||||
// Event handler to limit the textarea
|
|
||||||
var onEdit = function(){
|
|
||||||
var textarea = jQuery(this);
|
|
||||||
var maxlength = parseInt(textarea.attr(settings.attribute));
|
|
||||||
|
|
||||||
if(textarea.val().length > maxlength){
|
|
||||||
textarea.val(textarea.val().substr(0, maxlength));
|
|
||||||
|
|
||||||
// Call the onlimit handler within the scope of the textarea
|
|
||||||
jQuery.proxy(settings.onLimit, this)();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Call the onEdit handler within the scope of the textarea
|
|
||||||
jQuery.proxy(settings.onEdit, this)(maxlength - textarea.val().length);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.each(onEdit);
|
|
||||||
|
|
||||||
return this.keyup(onEdit)
|
|
||||||
.keydown(onEdit)
|
|
||||||
.focus(onEdit)
|
|
||||||
.live('input paste', onEdit);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
|
||||||
|
|
||||||
var onEditCallback = function(remaining){
|
|
||||||
|
|
||||||
|
|
||||||
if(remaining == 0){
|
|
||||||
$(this).siblings('.charsRemaining').text("aucun caractère restant");
|
|
||||||
}else if(remaining == 1){
|
|
||||||
$(this).siblings('.charsRemaining').text(remaining+" caractère restant");
|
|
||||||
}else if(remaining > 1){
|
|
||||||
$(this).siblings('.charsRemaining').text(remaining+" caractères restants");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var onLimitCallback = function(){
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$('.obs_textarea').limitMaxlength({
|
|
||||||
onEdit: onEditCallback,
|
|
||||||
onLimit: onLimitCallback
|
|
||||||
});
|
|
||||||
});
|
|
@ -1,257 +0,0 @@
|
|||||||
/*
|
|
||||||
* jQuery Superfish Menu Plugin - v1.7.4
|
|
||||||
* Copyright (c) 2013 Joel Birch
|
|
||||||
*
|
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
|
||||||
* http://www.gnu.org/licenses/gpl.html
|
|
||||||
*/
|
|
||||||
|
|
||||||
;(function ($) {
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var methods = (function () {
|
|
||||||
// private properties and methods go here
|
|
||||||
var c = {
|
|
||||||
bcClass: 'sf-breadcrumb',
|
|
||||||
menuClass: 'sf-js-enabled',
|
|
||||||
anchorClass: 'sf-with-ul',
|
|
||||||
menuArrowClass: 'sf-arrows'
|
|
||||||
},
|
|
||||||
ios = (function () {
|
|
||||||
var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
|
||||||
if (ios) {
|
|
||||||
// iOS clicks only bubble as far as body children
|
|
||||||
$(window).load(function () {
|
|
||||||
$('body').children().on('click', $.noop);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return ios;
|
|
||||||
})(),
|
|
||||||
wp7 = (function () {
|
|
||||||
var style = document.documentElement.style;
|
|
||||||
return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent));
|
|
||||||
})(),
|
|
||||||
toggleMenuClasses = function ($menu, o) {
|
|
||||||
var classes = c.menuClass;
|
|
||||||
if (o.cssArrows) {
|
|
||||||
classes += ' ' + c.menuArrowClass;
|
|
||||||
}
|
|
||||||
$menu.toggleClass(classes);
|
|
||||||
},
|
|
||||||
setPathToCurrent = function ($menu, o) {
|
|
||||||
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
|
|
||||||
.addClass(o.hoverClass + ' ' + c.bcClass)
|
|
||||||
.filter(function () {
|
|
||||||
return ($(this).children(o.popUpSelector).hide().show().length);
|
|
||||||
}).removeClass(o.pathClass);
|
|
||||||
},
|
|
||||||
toggleAnchorClass = function ($li) {
|
|
||||||
$li.children('a').toggleClass(c.anchorClass);
|
|
||||||
},
|
|
||||||
toggleTouchAction = function ($menu) {
|
|
||||||
var touchAction = $menu.css('ms-touch-action');
|
|
||||||
touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y';
|
|
||||||
$menu.css('ms-touch-action', touchAction);
|
|
||||||
},
|
|
||||||
applyHandlers = function ($menu, o) {
|
|
||||||
var targets = 'li:has(' + o.popUpSelector + ')';
|
|
||||||
if ($.fn.hoverIntent && !o.disableHI) {
|
|
||||||
$menu.hoverIntent(over, out, targets);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$menu
|
|
||||||
.on('mouseenter.superfish', targets, over)
|
|
||||||
.on('mouseleave.superfish', targets, out);
|
|
||||||
}
|
|
||||||
var touchevent = 'MSPointerDown.superfish';
|
|
||||||
if (!ios) {
|
|
||||||
touchevent += ' touchend.superfish';
|
|
||||||
}
|
|
||||||
if (wp7) {
|
|
||||||
touchevent += ' mousedown.superfish';
|
|
||||||
}
|
|
||||||
$menu
|
|
||||||
.on('focusin.superfish', 'li', over)
|
|
||||||
.on('focusout.superfish', 'li', out)
|
|
||||||
.on(touchevent, 'a', o, touchHandler);
|
|
||||||
},
|
|
||||||
touchHandler = function (e) {
|
|
||||||
var $this = $(this),
|
|
||||||
$ul = $this.siblings(e.data.popUpSelector);
|
|
||||||
|
|
||||||
if ($ul.length > 0 && $ul.is(':hidden')) {
|
|
||||||
$this.one('click.superfish', false);
|
|
||||||
if (e.type === 'MSPointerDown') {
|
|
||||||
$this.trigger('focus');
|
|
||||||
} else {
|
|
||||||
$.proxy(over, $this.parent('li'))();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
over = function () {
|
|
||||||
var $this = $(this),
|
|
||||||
o = getOptions($this);
|
|
||||||
clearTimeout(o.sfTimer);
|
|
||||||
$this.siblings().superfish('hide').end().superfish('show');
|
|
||||||
},
|
|
||||||
out = function () {
|
|
||||||
var $this = $(this),
|
|
||||||
o = getOptions($this);
|
|
||||||
if (ios) {
|
|
||||||
$.proxy(close, $this, o)();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
clearTimeout(o.sfTimer);
|
|
||||||
o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
close = function (o) {
|
|
||||||
o.retainPath = ($.inArray(this[0], o.$path) > -1);
|
|
||||||
this.superfish('hide');
|
|
||||||
|
|
||||||
if (!this.parents('.' + o.hoverClass).length) {
|
|
||||||
o.onIdle.call(getMenu(this));
|
|
||||||
if (o.$path.length) {
|
|
||||||
$.proxy(over, o.$path)();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getMenu = function ($el) {
|
|
||||||
return $el.closest('.' + c.menuClass);
|
|
||||||
},
|
|
||||||
getOptions = function ($el) {
|
|
||||||
return getMenu($el).data('sf-options');
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
|
||||||
// public methods
|
|
||||||
hide: function (instant) {
|
|
||||||
if (this.length) {
|
|
||||||
var $this = this,
|
|
||||||
o = getOptions($this);
|
|
||||||
if (!o) {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
var not = (o.retainPath === true) ? o.$path : '',
|
|
||||||
$ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
|
|
||||||
speed = o.speedOut;
|
|
||||||
|
|
||||||
if (instant) {
|
|
||||||
$ul.show();
|
|
||||||
speed = 0;
|
|
||||||
}
|
|
||||||
o.retainPath = false;
|
|
||||||
o.onBeforeHide.call($ul);
|
|
||||||
$ul.stop(true, true).animate(o.animationOut, speed, function () {
|
|
||||||
var $this = $(this);
|
|
||||||
o.onHide.call($this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
show: function () {
|
|
||||||
var o = getOptions(this);
|
|
||||||
if (!o) {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
var $this = this.addClass(o.hoverClass),
|
|
||||||
$ul = $this.children(o.popUpSelector);
|
|
||||||
|
|
||||||
o.onBeforeShow.call($ul);
|
|
||||||
$ul.stop(true, true).animate(o.animation, o.speed, function () {
|
|
||||||
o.onShow.call($ul);
|
|
||||||
});
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
destroy: function () {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this),
|
|
||||||
o = $this.data('sf-options'),
|
|
||||||
$hasPopUp;
|
|
||||||
if (!o) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$hasPopUp = $this.find(o.popUpSelector).parent('li');
|
|
||||||
clearTimeout(o.sfTimer);
|
|
||||||
toggleMenuClasses($this, o);
|
|
||||||
toggleAnchorClass($hasPopUp);
|
|
||||||
toggleTouchAction($this);
|
|
||||||
// remove event handlers
|
|
||||||
$this.off('.superfish').off('.hoverIntent');
|
|
||||||
// clear animation's inline display style
|
|
||||||
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style) {
|
|
||||||
return style.replace(/display[^;]+;?/g, '');
|
|
||||||
});
|
|
||||||
// reset 'current' path classes
|
|
||||||
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
|
|
||||||
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
|
|
||||||
o.onDestroy.call($this);
|
|
||||||
$this.removeData('sf-options');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
init: function (op) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this);
|
|
||||||
if ($this.data('sf-options')) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
var o = $.extend({}, $.fn.superfish.defaults, op),
|
|
||||||
$hasPopUp = $this.find(o.popUpSelector).parent('li');
|
|
||||||
o.$path = setPathToCurrent($this, o);
|
|
||||||
|
|
||||||
$this.data('sf-options', o);
|
|
||||||
|
|
||||||
toggleMenuClasses($this, o);
|
|
||||||
toggleAnchorClass($hasPopUp);
|
|
||||||
toggleTouchAction($this);
|
|
||||||
applyHandlers($this, o);
|
|
||||||
|
|
||||||
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
|
|
||||||
|
|
||||||
o.onInit.call(this);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
})();
|
|
||||||
|
|
||||||
$.fn.superfish = function (method, args) {
|
|
||||||
if (methods[method]) {
|
|
||||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
|
||||||
}
|
|
||||||
else if (typeof method === 'object' || ! method) {
|
|
||||||
return methods.init.apply(this, arguments);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.superfish.defaults = {
|
|
||||||
popUpSelector: 'ul,.sf-mega', // within menu context
|
|
||||||
hoverClass: 'sfHover',
|
|
||||||
pathClass: 'overrideThisToUse',
|
|
||||||
pathLevels: 1,
|
|
||||||
delay: 800,
|
|
||||||
animation: {opacity: 'show'},
|
|
||||||
animationOut: {opacity: 'hide'},
|
|
||||||
speed: 'normal',
|
|
||||||
speedOut: 'fast',
|
|
||||||
cssArrows: true,
|
|
||||||
disableHI: false,
|
|
||||||
onInit: $.noop,
|
|
||||||
onBeforeShow: $.noop,
|
|
||||||
onShow: $.noop,
|
|
||||||
onBeforeHide: $.noop,
|
|
||||||
onHide: $.noop,
|
|
||||||
onIdle: $.noop,
|
|
||||||
onDestroy: $.noop
|
|
||||||
};
|
|
||||||
|
|
||||||
// soon to be deprecated
|
|
||||||
$.fn.extend({
|
|
||||||
hideSuperfishUl: methods.hide,
|
|
||||||
showSuperfishUl: methods.show
|
|
||||||
});
|
|
||||||
|
|
||||||
})(jQuery);
|
|
@ -1,386 +0,0 @@
|
|||||||
/*
|
|
||||||
jQuery ui.timepickr - @VERSION
|
|
||||||
http://code.google.com/p/jquery-utils/
|
|
||||||
|
|
||||||
(c) Maxime Haineault <haineault@gmail.com>
|
|
||||||
http://haineault.com
|
|
||||||
|
|
||||||
MIT License (http://www.opensource.org/licenses/mit-license.php
|
|
||||||
|
|
||||||
Note: if you want the original experimental plugin checkout the rev 224
|
|
||||||
|
|
||||||
Dependencies
|
|
||||||
------------
|
|
||||||
- jquery.utils.js
|
|
||||||
- jquery.strings.js
|
|
||||||
- jquery.ui.js
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function($) {
|
|
||||||
|
|
||||||
$.tpl('timepickr.menu', '<div class="ui-helper-reset ui-timepickr ui-widget" />');
|
|
||||||
$.tpl('timepickr.row', '<ol class="ui-timepickr-row ui-helper-clearfix" />');
|
|
||||||
$.tpl('timepickr.button', '<li class="{className:s}"><span class="ui-state-default">{label:s}</span></li>');
|
|
||||||
|
|
||||||
$.widget('ui.timepickr', {
|
|
||||||
plugins: {},
|
|
||||||
_create: function() {
|
|
||||||
this._dom = {
|
|
||||||
menu: $.tpl('timepickr.menu'),
|
|
||||||
row: $.tpl('timepickr.menu')
|
|
||||||
};
|
|
||||||
this._trigger('initialize');
|
|
||||||
this._trigger('initialized');
|
|
||||||
},
|
|
||||||
|
|
||||||
_trigger: function(type, e, ui) {
|
|
||||||
var ui = ui || this;
|
|
||||||
$.ui.plugin.call(this, type, [e, ui]);
|
|
||||||
return $.Widget.prototype._trigger.call(this, type, e, ui);
|
|
||||||
},
|
|
||||||
|
|
||||||
_createButton: function(i, format, className) {
|
|
||||||
var o = format && $.format(format, i) || i;
|
|
||||||
var cn = className && 'ui-timepickr-button '+ className || 'ui-timepickr-button';
|
|
||||||
return $.tpl('timepickr.button', {className: cn, label: o}).data('id', i)
|
|
||||||
.bind('mouseover', function(){
|
|
||||||
$(this).siblings().find('span')
|
|
||||||
.removeClass('ui-state-hover').end().end()
|
|
||||||
.find('span').addClass('ui-state-hover');
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
_addRow: function(range, format, className, insertAfter) {
|
|
||||||
var ui = this;
|
|
||||||
var btn = false;
|
|
||||||
var row = $.tpl('timepickr.row').bind('mouseover', function(){
|
|
||||||
$(this).next().show();
|
|
||||||
});
|
|
||||||
$.each(range, function(idx, val){
|
|
||||||
ui._createButton(val, format || false).appendTo(row);
|
|
||||||
});
|
|
||||||
if (className) {
|
|
||||||
$(row).addClass(className);
|
|
||||||
}
|
|
||||||
if (this.options.corners) {
|
|
||||||
row.find('span').addClass('ui-corner-'+ this.options.corners);
|
|
||||||
}
|
|
||||||
if (insertAfter) {
|
|
||||||
row.insertAfter(insertAfter);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui._dom.menu.append(row);
|
|
||||||
}
|
|
||||||
return row;
|
|
||||||
},
|
|
||||||
|
|
||||||
_setVal: function(val) {
|
|
||||||
val = val || this._getVal();
|
|
||||||
if (!(val.h==='' && val.m==='')) {
|
|
||||||
this.element.data('timepickr.initialValue', val);
|
|
||||||
this.element.val(this._formatVal(val));
|
|
||||||
}
|
|
||||||
if(this._dom.menu.is(':hidden')) {
|
|
||||||
this.element.trigger('change');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
_getVal: function() {
|
|
||||||
var ols = this._dom.menu.find('ol');
|
|
||||||
function get(unit) {
|
|
||||||
var u = ols.filter('.'+unit).find('.ui-state-hover:first').text();
|
|
||||||
return u || ols.filter('.'+unit+'li:first span').text();
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
h: get('hours'),
|
|
||||||
m: get('minutes'),
|
|
||||||
s: get('seconds'),
|
|
||||||
a: get('prefix'),
|
|
||||||
z: get('suffix'),
|
|
||||||
f: this.options['format'+ this.c],
|
|
||||||
c: this.c
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
_formatVal: function(ival) {
|
|
||||||
var val = ival || this._getVal();
|
|
||||||
val.c = this.options.convention;
|
|
||||||
val.f = val.c === 12 && this.options.format12 || this.options.format24;
|
|
||||||
return (new Time(val)).getTime();
|
|
||||||
},
|
|
||||||
|
|
||||||
blur: function() {
|
|
||||||
return this.element.blur();
|
|
||||||
},
|
|
||||||
|
|
||||||
focus: function() {
|
|
||||||
return this.element.focus();
|
|
||||||
},
|
|
||||||
show: function() {
|
|
||||||
this._trigger('show');
|
|
||||||
this.element.trigger(this.options.trigger);
|
|
||||||
},
|
|
||||||
hide: function() {
|
|
||||||
this._trigger('hide');
|
|
||||||
this._dom.menu.hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// These properties are shared accross every instances of timepickr
|
|
||||||
$.extend($.ui.timepickr.prototype, {
|
|
||||||
version: '@VERSION',
|
|
||||||
//eventPrefix: '',
|
|
||||||
//getter: '',
|
|
||||||
options: {
|
|
||||||
convention: 24, // 24, 12
|
|
||||||
trigger: 'click',
|
|
||||||
format12: '{h:02.d}:{m:02.d} {z:s}',
|
|
||||||
format24: '{h:02.d}:{m:02.d}',
|
|
||||||
hours: true,
|
|
||||||
prefix: ['matin', 'après midi'],
|
|
||||||
suffix: ['am', 'pm'],
|
|
||||||
prefixVal: false,
|
|
||||||
suffixVal: true,
|
|
||||||
rangeHour12: $.range(1, 13),
|
|
||||||
rangeHour24: [$.range(0, 12), $.range(12, 24)],
|
|
||||||
rangeMin: $.range(0, 60, 15),
|
|
||||||
rangeSec: $.range(0, 60, 15),
|
|
||||||
corners: 'all',
|
|
||||||
// plugins
|
|
||||||
core: true,
|
|
||||||
minutes: true,
|
|
||||||
seconds: false,
|
|
||||||
val: false,
|
|
||||||
updateLive: true,
|
|
||||||
resetOnBlur: true,
|
|
||||||
keyboardnav: true,
|
|
||||||
handle: false,
|
|
||||||
handleEvent: 'click'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'core', {
|
|
||||||
initialized: function(e, ui) {
|
|
||||||
var menu = ui._dom.menu;
|
|
||||||
var pos = ui.element.position();
|
|
||||||
|
|
||||||
menu.insertAfter(ui.element).css('left', pos.left);
|
|
||||||
|
|
||||||
if (!$.boxModel) { // IE alignement fix
|
|
||||||
menu.css('margin-top', ui.element.height() + 8);
|
|
||||||
}
|
|
||||||
|
|
||||||
ui.element
|
|
||||||
.bind(ui.options.trigger, function() {
|
|
||||||
ui._dom.menu.show();
|
|
||||||
ui._dom.menu.find('ol:first').show();
|
|
||||||
ui._trigger('focus');
|
|
||||||
if (ui.options.trigger != 'focus') {
|
|
||||||
ui.element.focus();
|
|
||||||
}
|
|
||||||
ui._trigger('focus');
|
|
||||||
})
|
|
||||||
.bind('blur', function() {
|
|
||||||
ui.hide();
|
|
||||||
ui._trigger('blur');
|
|
||||||
});
|
|
||||||
|
|
||||||
menu.find('li').bind('mouseover.timepickr', function() {
|
|
||||||
ui._trigger('refresh');
|
|
||||||
});
|
|
||||||
},
|
|
||||||
refresh: function(e, ui) {
|
|
||||||
// Realign each menu layers
|
|
||||||
ui._dom.menu.find('ol').each(function(){
|
|
||||||
var p = $(this).prev('ol');
|
|
||||||
try { // .. to not fuckup IE
|
|
||||||
$(this).css('left', p.position().left + p.find('.ui-state-hover').position().left);
|
|
||||||
} catch(e) {};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'hours', {
|
|
||||||
initialize: function(e, ui) {
|
|
||||||
if (ui.options.convention === 24) {
|
|
||||||
// prefix is required in 24h mode
|
|
||||||
ui._dom.prefix = ui._addRow(ui.options.prefix, false, 'prefix');
|
|
||||||
|
|
||||||
// split-range
|
|
||||||
if ($.isArray(ui.options.rangeHour24[0])) {
|
|
||||||
var range = [];
|
|
||||||
$.merge(range, ui.options.rangeHour24[0]);
|
|
||||||
$.merge(range, ui.options.rangeHour24[1]);
|
|
||||||
ui._dom.hours = ui._addRow(range, '{0:0.2d}', 'hours');
|
|
||||||
ui._dom.hours.find('li').slice(ui.options.rangeHour24[0].length, -1).hide();
|
|
||||||
var lis = ui._dom.hours.find('li');
|
|
||||||
|
|
||||||
var show = [
|
|
||||||
function() {
|
|
||||||
lis.slice(ui.options.rangeHour24[0].length).hide().end()
|
|
||||||
.slice(0, ui.options.rangeHour24[0].length).show()
|
|
||||||
.filter(':visible:first').trigger('mouseover');
|
|
||||||
|
|
||||||
},
|
|
||||||
function() {
|
|
||||||
lis.slice(0, ui.options.rangeHour24[0].length).hide().end()
|
|
||||||
.slice(ui.options.rangeHour24[0].length).show()
|
|
||||||
.filter(':visible:first').trigger('mouseover');
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
ui._dom.prefix.find('li').bind('mouseover.timepickr', function(){
|
|
||||||
var index = ui._dom.menu.find('.prefix li').index(this);
|
|
||||||
show[index].call();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui._dom.hours = ui._addRow(ui.options.rangeHour24, '{0:0.2d}', 'hours');
|
|
||||||
ui._dom.hours.find('li').slice(12, -1).hide();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ui._dom.hours = ui._addRow(ui.options.rangeHour12, '{0:0.2d}', 'hours');
|
|
||||||
// suffix is required in 12h mode
|
|
||||||
ui._dom.suffix = ui._addRow(ui.options.suffix, false, 'suffix');
|
|
||||||
}
|
|
||||||
}});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'minutes', {
|
|
||||||
initialize: function(e, ui) {
|
|
||||||
var p = ui._dom.hours && ui._dom.hours || false;
|
|
||||||
ui._dom.minutes = ui._addRow(ui.options.rangeMin, '{0:0.2d}', 'minutes', p);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'seconds', {
|
|
||||||
initialize: function(e, ui) {
|
|
||||||
var p = ui._dom.minutes && ui._dom.minutes || false;
|
|
||||||
ui._dom.seconds = ui._addRow(ui.options.rangeSec, '{0:0.2d}', 'seconds', p);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'val', {
|
|
||||||
initialized: function(e, ui) {
|
|
||||||
ui._setVal(ui.options.val);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'updateLive', {
|
|
||||||
refresh: function(e, ui) {
|
|
||||||
ui._setVal();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'resetOnBlur', {
|
|
||||||
initialized: function(e, ui) {
|
|
||||||
ui.element.data('timepickr.initialValue', ui._getVal());
|
|
||||||
ui._dom.menu.find('li > span').bind('mousedown.timepickr', function(){
|
|
||||||
ui.element.data('timepickr.initialValue', ui._getVal());
|
|
||||||
});
|
|
||||||
},
|
|
||||||
blur: function(e, ui) {
|
|
||||||
ui._setVal(ui.element.data('timepickr.initialValue'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'handle', {
|
|
||||||
initialized: function(e, ui) {
|
|
||||||
$(ui.options.handle).bind(ui.options.handleEvent + '.timepickr', function(){
|
|
||||||
ui.show();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$.ui.plugin.add('timepickr', 'keyboardnav', {
|
|
||||||
initialized: function(e, ui) {
|
|
||||||
ui.element
|
|
||||||
.bind('keydown', function(e) {
|
|
||||||
if ($.keyIs('enter', e)) {
|
|
||||||
ui._setVal();
|
|
||||||
ui.blur();
|
|
||||||
}
|
|
||||||
else if ($.keyIs('escape', e)) {
|
|
||||||
ui.blur();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var Time = function() { // arguments: h, m, s, c, z, f || time string
|
|
||||||
if (!(this instanceof arguments.callee)) {
|
|
||||||
throw Error("Constructor called as a function");
|
|
||||||
}
|
|
||||||
// arguments as literal object
|
|
||||||
if (arguments.length == 1 && $.isObject(arguments[0])) {
|
|
||||||
this.h = arguments[0].h || 0;
|
|
||||||
this.m = arguments[0].m || 0;
|
|
||||||
this.s = arguments[0].s || 0;
|
|
||||||
this.c = arguments[0].c && ($.inArray(arguments[0].c, [12, 24]) >= 0) && arguments[0].c || 24;
|
|
||||||
this.f = arguments[0].f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}');
|
|
||||||
this.z = arguments[0].z || 'am';
|
|
||||||
}
|
|
||||||
// arguments as string
|
|
||||||
else if (arguments.length < 4 && $.isString(arguments[1])) {
|
|
||||||
this.c = arguments[2] && ($.inArray(arguments[0], [12, 24]) >= 0) && arguments[0] || 24;
|
|
||||||
this.f = arguments[3] || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}');
|
|
||||||
this.z = arguments[4] || 'am';
|
|
||||||
|
|
||||||
this.h = arguments[1] || 0; // parse
|
|
||||||
this.m = arguments[1] || 0; // parse
|
|
||||||
this.s = arguments[1] || 0; // parse
|
|
||||||
}
|
|
||||||
// no arguments (now)
|
|
||||||
else if (arguments.length === 0) {
|
|
||||||
// now
|
|
||||||
}
|
|
||||||
// standards arguments
|
|
||||||
else {
|
|
||||||
this.h = arguments[0] || 0;
|
|
||||||
this.m = arguments[1] || 0;
|
|
||||||
this.s = arguments[2] || 0;
|
|
||||||
this.c = arguments[3] && ($.inArray(arguments[3], [12, 24]) >= 0) && arguments[3] || 24;
|
|
||||||
this.f = this.f || ((this.c == 12) && '{h:02.d}:{m:02.d} {z:02.d}' || '{h:02.d}:{m:02.d}');
|
|
||||||
this.z = 'am';
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
};
|
|
||||||
|
|
||||||
Time.prototype.get = function(p, f, u) { return u && this.h || $.format(f, this.h); };
|
|
||||||
Time.prototype.getHours = function(unformated) { return this.get('h', '{0:02.d}', unformated); };
|
|
||||||
Time.prototype.getMinutes = function(unformated) { return this.get('m', '{0:02.d}', unformated); };
|
|
||||||
Time.prototype.getSeconds = function(unformated) { return this.get('s', '{0:02.d}', unformated); };
|
|
||||||
Time.prototype.setFormat = function(format) { return this.f = format; };
|
|
||||||
Time.prototype.getObject = function() { return { h: this.h, m: this.m, s: this.s, c: this.c, f: this.f, z: this.z }; };
|
|
||||||
Time.prototype.getTime = function() { return $.format(this.f, {h: this.h, m: this.m, suffix: this.z}); }; // Thanks to Jackson for the fix.
|
|
||||||
Time.prototype.parse = function(str) {
|
|
||||||
// 12h formats
|
|
||||||
if (this.c === 12) {
|
|
||||||
// Supported formats: (can't find any *official* standards for 12h..)
|
|
||||||
// - [hh]:[mm]:[ss] [zz] | [hh]:[mm] [zz] | [hh] [zz]
|
|
||||||
// - [hh]:[mm]:[ss] [z.z.] | [hh]:[mm] [z.z.] | [hh] [z.z.]
|
|
||||||
this.tokens = str.split(/\s|:/);
|
|
||||||
this.h = this.tokens[0] || 0;
|
|
||||||
this.m = this.tokens[1] || 0;
|
|
||||||
this.s = this.tokens[2] || 0;
|
|
||||||
this.z = this.tokens[3] || '';
|
|
||||||
return this.getObject();
|
|
||||||
}
|
|
||||||
// 24h formats
|
|
||||||
else {
|
|
||||||
// Supported formats:
|
|
||||||
// - ISO 8601: [hh][mm][ss] | [hh][mm] | [hh]
|
|
||||||
// - ISO 8601 extended: [hh]:[mm]:[ss] | [hh]:[mm] | [hh]
|
|
||||||
this.tokens = /:/.test(str) && str.split(/:/) || str.match(/[0-9]{2}/g);
|
|
||||||
this.h = this.tokens[0] || 0;
|
|
||||||
this.m = this.tokens[1] || 0;
|
|
||||||
this.s = this.tokens[2] || 0;
|
|
||||||
this.z = this.tokens[3] || '';
|
|
||||||
return this.getObject();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
})(jQuery);
|
|
@ -1,476 +0,0 @@
|
|||||||
/* =========================================================
|
|
||||||
* bootstrap-datepicker.js
|
|
||||||
* http://www.eyecon.ro/bootstrap-datepicker
|
|
||||||
* =========================================================
|
|
||||||
* Copyright 2012 Stefan Petre
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
* ========================================================= */
|
|
||||||
|
|
||||||
!function( $ ) {
|
|
||||||
|
|
||||||
// Picker object
|
|
||||||
|
|
||||||
var Datepicker = function(element, options){
|
|
||||||
this.element = $(element);
|
|
||||||
this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'dd/mm/yyyy');
|
|
||||||
this.picker = $(DPGlobal.template)
|
|
||||||
.appendTo('body')
|
|
||||||
.on({
|
|
||||||
click: $.proxy(this.click, this)//,
|
|
||||||
//mousedown: $.proxy(this.mousedown, this)
|
|
||||||
});
|
|
||||||
this.isInput = this.element.is('input');
|
|
||||||
this.component = this.element.is('.date') ? this.element.find('.add-on') : false;
|
|
||||||
|
|
||||||
if (this.isInput) {
|
|
||||||
this.element.on({
|
|
||||||
focus: $.proxy(this.show, this),
|
|
||||||
//blur: $.proxy(this.hide, this),
|
|
||||||
keyup: $.proxy(this.update, this)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (this.component){
|
|
||||||
this.component.on('click', $.proxy(this.show, this));
|
|
||||||
} else {
|
|
||||||
this.element.on('click', $.proxy(this.show, this));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.minViewMode = options.minViewMode||this.element.data('date-minviewmode')||0;
|
|
||||||
if (typeof this.minViewMode === 'string') {
|
|
||||||
switch (this.minViewMode) {
|
|
||||||
case 'months':
|
|
||||||
this.minViewMode = 1;
|
|
||||||
break;
|
|
||||||
case 'years':
|
|
||||||
this.minViewMode = 2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.minViewMode = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.viewMode = options.viewMode||this.element.data('date-viewmode')||0;
|
|
||||||
if (typeof this.viewMode === 'string') {
|
|
||||||
switch (this.viewMode) {
|
|
||||||
case 'months':
|
|
||||||
this.viewMode = 1;
|
|
||||||
break;
|
|
||||||
case 'years':
|
|
||||||
this.viewMode = 2;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
this.viewMode = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.startViewMode = this.viewMode;
|
|
||||||
this.weekStart = options.weekStart||this.element.data('date-weekstart')||0;
|
|
||||||
this.weekEnd = this.weekStart === 0 ? 6 : this.weekStart - 1;
|
|
||||||
this.onRender = options.onRender;
|
|
||||||
this.fillDow();
|
|
||||||
this.fillMonths();
|
|
||||||
this.update();
|
|
||||||
this.showMode();
|
|
||||||
};
|
|
||||||
|
|
||||||
Datepicker.prototype = {
|
|
||||||
constructor: Datepicker,
|
|
||||||
|
|
||||||
show: function(e) {
|
|
||||||
this.picker.show();
|
|
||||||
this.height = this.component ? this.component.outerHeight() : this.element.outerHeight();
|
|
||||||
this.place();
|
|
||||||
$(window).on('resize', $.proxy(this.place, this));
|
|
||||||
if (e ) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
}
|
|
||||||
if (!this.isInput) {
|
|
||||||
}
|
|
||||||
var that = this;
|
|
||||||
$(document).on('mousedown', function(ev){
|
|
||||||
if ($(ev.target).closest('.datepicker').length == 0) {
|
|
||||||
that.hide();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.element.trigger({
|
|
||||||
type: 'show',
|
|
||||||
date: this.date
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
hide: function(){
|
|
||||||
this.picker.hide();
|
|
||||||
$(window).off('resize', this.place);
|
|
||||||
this.viewMode = this.startViewMode;
|
|
||||||
this.showMode();
|
|
||||||
if (!this.isInput) {
|
|
||||||
$(document).off('mousedown', this.hide);
|
|
||||||
}
|
|
||||||
//this.set();
|
|
||||||
this.element.trigger({
|
|
||||||
type: 'hide',
|
|
||||||
date: this.date
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
set: function() {
|
|
||||||
var formated = DPGlobal.formatDate(this.date, this.format);
|
|
||||||
if (!this.isInput) {
|
|
||||||
if (this.component){
|
|
||||||
this.element.find('input').prop('value', formated);
|
|
||||||
}
|
|
||||||
this.element.data('date', formated);
|
|
||||||
} else {
|
|
||||||
this.element.prop('value', formated);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setValue: function(newDate) {
|
|
||||||
if (typeof newDate === 'string') {
|
|
||||||
this.date = DPGlobal.parseDate(newDate, this.format);
|
|
||||||
} else {
|
|
||||||
this.date = new Date(newDate);
|
|
||||||
}
|
|
||||||
this.set();
|
|
||||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
|
||||||
this.fill();
|
|
||||||
},
|
|
||||||
|
|
||||||
place: function(){
|
|
||||||
var offset = this.component ? this.component.offset() : this.element.offset();
|
|
||||||
this.picker.css({
|
|
||||||
top: offset.top + this.height,
|
|
||||||
left: offset.left
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
update: function(newDate){
|
|
||||||
this.date = DPGlobal.parseDate(
|
|
||||||
typeof newDate === 'string' ? newDate : (this.isInput ? this.element.prop('value') : this.element.data('date')),
|
|
||||||
this.format
|
|
||||||
);
|
|
||||||
this.viewDate = new Date(this.date.getFullYear(), this.date.getMonth(), 1, 0, 0, 0, 0);
|
|
||||||
this.fill();
|
|
||||||
},
|
|
||||||
|
|
||||||
fillDow: function(){
|
|
||||||
var dowCnt = this.weekStart;
|
|
||||||
var html = '<tr>';
|
|
||||||
while (dowCnt < this.weekStart + 7) {
|
|
||||||
html += '<th class="dow">'+DPGlobal.dates.daysMin[(dowCnt++)%7]+'</th>';
|
|
||||||
}
|
|
||||||
html += '</tr>';
|
|
||||||
this.picker.find('.datepicker-days thead').append(html);
|
|
||||||
},
|
|
||||||
|
|
||||||
fillMonths: function(){
|
|
||||||
var html = '';
|
|
||||||
var i = 0
|
|
||||||
while (i < 12) {
|
|
||||||
html += '<span class="month">'+DPGlobal.dates.monthsShort[i++]+'</span>';
|
|
||||||
}
|
|
||||||
this.picker.find('.datepicker-months td').append(html);
|
|
||||||
},
|
|
||||||
|
|
||||||
fill: function() {
|
|
||||||
var d = new Date(this.viewDate),
|
|
||||||
year = d.getFullYear(),
|
|
||||||
month = d.getMonth(),
|
|
||||||
currentDate = this.date.valueOf();
|
|
||||||
this.picker.find('.datepicker-days th:eq(1)')
|
|
||||||
.text(DPGlobal.dates.months[month]+' '+year);
|
|
||||||
var prevMonth = new Date(year, month-1, 28,0,0,0,0),
|
|
||||||
day = DPGlobal.getDaysInMonth(prevMonth.getFullYear(), prevMonth.getMonth());
|
|
||||||
prevMonth.setDate(day);
|
|
||||||
prevMonth.setDate(day - (prevMonth.getDay() - this.weekStart + 7)%7);
|
|
||||||
var nextMonth = new Date(prevMonth);
|
|
||||||
nextMonth.setDate(nextMonth.getDate() + 42);
|
|
||||||
nextMonth = nextMonth.valueOf();
|
|
||||||
var html = [];
|
|
||||||
var clsName,
|
|
||||||
prevY,
|
|
||||||
prevM;
|
|
||||||
while(prevMonth.valueOf() < nextMonth) {
|
|
||||||
if (prevMonth.getDay() === this.weekStart) {
|
|
||||||
html.push('<tr>');
|
|
||||||
}
|
|
||||||
clsName = this.onRender(prevMonth);
|
|
||||||
prevY = prevMonth.getFullYear();
|
|
||||||
prevM = prevMonth.getMonth();
|
|
||||||
if ((prevM < month && prevY === year) || prevY < year) {
|
|
||||||
clsName += ' old';
|
|
||||||
} else if ((prevM > month && prevY === year) || prevY > year) {
|
|
||||||
clsName += ' new';
|
|
||||||
}
|
|
||||||
if (prevMonth.valueOf() === currentDate) {
|
|
||||||
clsName += ' active';
|
|
||||||
}
|
|
||||||
html.push('<td class="day '+clsName+'">'+prevMonth.getDate() + '</td>');
|
|
||||||
if (prevMonth.getDay() === this.weekEnd) {
|
|
||||||
html.push('</tr>');
|
|
||||||
}
|
|
||||||
prevMonth.setDate(prevMonth.getDate()+1);
|
|
||||||
}
|
|
||||||
this.picker.find('.datepicker-days tbody').empty().append(html.join(''));
|
|
||||||
var currentYear = this.date.getFullYear();
|
|
||||||
|
|
||||||
var months = this.picker.find('.datepicker-months')
|
|
||||||
.find('th:eq(1)')
|
|
||||||
.text(year)
|
|
||||||
.end()
|
|
||||||
.find('span').removeClass('active');
|
|
||||||
if (currentYear === year) {
|
|
||||||
months.eq(this.date.getMonth()).addClass('active');
|
|
||||||
}
|
|
||||||
|
|
||||||
html = '';
|
|
||||||
year = parseInt(year/10, 10) * 10;
|
|
||||||
var yearCont = this.picker.find('.datepicker-years')
|
|
||||||
.find('th:eq(1)')
|
|
||||||
.text(year + '-' + (year + 9))
|
|
||||||
.end()
|
|
||||||
.find('td');
|
|
||||||
year -= 1;
|
|
||||||
for (var i = -1; i < 11; i++) {
|
|
||||||
html += '<span class="year'+(i === -1 || i === 10 ? ' old' : '')+(currentYear === year ? ' active' : '')+'">'+year+'</span>';
|
|
||||||
year += 1;
|
|
||||||
}
|
|
||||||
yearCont.html(html);
|
|
||||||
},
|
|
||||||
|
|
||||||
click: function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
var target = $(e.target).closest('span, td, th');
|
|
||||||
if (target.length === 1) {
|
|
||||||
switch(target[0].nodeName.toLowerCase()) {
|
|
||||||
case 'th':
|
|
||||||
switch(target[0].className) {
|
|
||||||
case 'switch':
|
|
||||||
this.showMode(1);
|
|
||||||
break;
|
|
||||||
case 'prev':
|
|
||||||
case 'next':
|
|
||||||
this.viewDate['set'+DPGlobal.modes[this.viewMode].navFnc].call(
|
|
||||||
this.viewDate,
|
|
||||||
this.viewDate['get'+DPGlobal.modes[this.viewMode].navFnc].call(this.viewDate) +
|
|
||||||
DPGlobal.modes[this.viewMode].navStep * (target[0].className === 'prev' ? -1 : 1)
|
|
||||||
);
|
|
||||||
this.fill();
|
|
||||||
this.set();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'span':
|
|
||||||
if (target.is('.month')) {
|
|
||||||
var month = target.parent().find('span').index(target);
|
|
||||||
this.viewDate.setMonth(month);
|
|
||||||
} else {
|
|
||||||
var year = parseInt(target.text(), 10)||0;
|
|
||||||
this.viewDate.setFullYear(year);
|
|
||||||
}
|
|
||||||
if (this.viewMode !== 0) {
|
|
||||||
this.date = new Date(this.viewDate);
|
|
||||||
this.element.trigger({
|
|
||||||
type: 'changeDate',
|
|
||||||
date: this.date,
|
|
||||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.showMode(-1);
|
|
||||||
this.fill();
|
|
||||||
this.set();
|
|
||||||
break;
|
|
||||||
case 'td':
|
|
||||||
if (target.is('.day') && !target.is('.disabled')){
|
|
||||||
var day = parseInt(target.text(), 10)||1;
|
|
||||||
var month = this.viewDate.getMonth();
|
|
||||||
if (target.is('.old')) {
|
|
||||||
month -= 1;
|
|
||||||
} else if (target.is('.new')) {
|
|
||||||
month += 1;
|
|
||||||
}
|
|
||||||
var year = this.viewDate.getFullYear();
|
|
||||||
this.date = new Date(year, month, day,0,0,0,0);
|
|
||||||
this.viewDate = new Date(year, month, Math.min(28, day),0,0,0,0);
|
|
||||||
this.fill();
|
|
||||||
this.set();
|
|
||||||
this.element.trigger({
|
|
||||||
type: 'changeDate',
|
|
||||||
date: this.date,
|
|
||||||
viewMode: DPGlobal.modes[this.viewMode].clsName
|
|
||||||
});
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
mousedown: function(e){
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
},
|
|
||||||
|
|
||||||
showMode: function(dir) {
|
|
||||||
if (dir) {
|
|
||||||
this.viewMode = Math.max(this.minViewMode, Math.min(2, this.viewMode + dir));
|
|
||||||
}
|
|
||||||
this.picker.find('>div').hide().filter('.datepicker-'+DPGlobal.modes[this.viewMode].clsName).show();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.datepicker = function ( option, val ) {
|
|
||||||
return this.each(function () {
|
|
||||||
var $this = $(this),
|
|
||||||
data = $this.data('datepicker'),
|
|
||||||
options = typeof option === 'object' && option;
|
|
||||||
if (!data) {
|
|
||||||
$this.data('datepicker', (data = new Datepicker(this, $.extend({}, $.fn.datepicker.defaults,options))));
|
|
||||||
}
|
|
||||||
if (typeof option === 'string') data[option](val);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.datepicker.defaults = {
|
|
||||||
onRender: function(date) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
};
|
|
||||||
$.fn.datepicker.Constructor = Datepicker;
|
|
||||||
|
|
||||||
var DPGlobal = {
|
|
||||||
modes: [
|
|
||||||
{
|
|
||||||
clsName: 'days',
|
|
||||||
navFnc: 'Month',
|
|
||||||
navStep: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
clsName: 'months',
|
|
||||||
navFnc: 'FullYear',
|
|
||||||
navStep: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
clsName: 'years',
|
|
||||||
navFnc: 'FullYear',
|
|
||||||
navStep: 10
|
|
||||||
}],
|
|
||||||
dates:{
|
|
||||||
days: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'],
|
|
||||||
daysShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'],
|
|
||||||
daysMin: ['Di','Lu','Ma','Me','Je','Ve','Sa'],
|
|
||||||
months: ['Janvier','Février','Mars','Avril','Mai','Juin',
|
|
||||||
'Juillet','Août','Septembre','Octobre','Novembre','Décembre'],
|
|
||||||
monthsShort: ['Jan','Fév','Mar','Avr','Mai','Jun',
|
|
||||||
'Jul','Aoû','Sep','Oct','Nov','Déc']
|
|
||||||
},
|
|
||||||
isLeapYear: function (year) {
|
|
||||||
return (((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0))
|
|
||||||
},
|
|
||||||
getDaysInMonth: function (year, month) {
|
|
||||||
return [31, (DPGlobal.isLeapYear(year) ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
|
|
||||||
},
|
|
||||||
parseFormat: function(format){
|
|
||||||
var separator = format.match(/[.\/\-\s].*?/),
|
|
||||||
parts = format.split(/\W+/);
|
|
||||||
if (!separator || !parts || parts.length === 0){
|
|
||||||
throw new Error("Invalid date format.");
|
|
||||||
}
|
|
||||||
return {separator: separator, parts: parts};
|
|
||||||
},
|
|
||||||
parseDate: function(date, format) {
|
|
||||||
var parts = date.split(format.separator),
|
|
||||||
date = new Date(),
|
|
||||||
val;
|
|
||||||
date.setHours(0);
|
|
||||||
date.setMinutes(0);
|
|
||||||
date.setSeconds(0);
|
|
||||||
date.setMilliseconds(0);
|
|
||||||
if (parts.length === format.parts.length) {
|
|
||||||
var year = date.getFullYear(), day = date.getDate(), month = date.getMonth();
|
|
||||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
|
||||||
val = parseInt(parts[i], 10)||1;
|
|
||||||
switch(format.parts[i]) {
|
|
||||||
case 'dd':
|
|
||||||
case 'd':
|
|
||||||
day = val;
|
|
||||||
date.setDate(val);
|
|
||||||
break;
|
|
||||||
case 'mm':
|
|
||||||
case 'm':
|
|
||||||
month = val - 1;
|
|
||||||
date.setMonth(val - 1);
|
|
||||||
break;
|
|
||||||
case 'yy':
|
|
||||||
year = 2000 + val;
|
|
||||||
date.setFullYear(2000 + val);
|
|
||||||
break;
|
|
||||||
case 'yyyy':
|
|
||||||
year = val;
|
|
||||||
date.setFullYear(val);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
date = new Date(year, month, day, 0 ,0 ,0);
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
},
|
|
||||||
formatDate: function(date, format){
|
|
||||||
var val = {
|
|
||||||
d: date.getDate(),
|
|
||||||
m: date.getMonth() + 1,
|
|
||||||
yy: date.getFullYear().toString().substring(2),
|
|
||||||
yyyy: date.getFullYear()
|
|
||||||
};
|
|
||||||
val.dd = (val.d < 10 ? '0' : '') + val.d;
|
|
||||||
val.mm = (val.m < 10 ? '0' : '') + val.m;
|
|
||||||
var date = [];
|
|
||||||
for (var i=0, cnt = format.parts.length; i < cnt; i++) {
|
|
||||||
date.push(val[format.parts[i]]);
|
|
||||||
}
|
|
||||||
return date.join(format.separator);
|
|
||||||
},
|
|
||||||
headTemplate: '<thead>'+
|
|
||||||
'<tr>'+
|
|
||||||
'<th class="prev">‹</th>'+
|
|
||||||
'<th colspan="5" class="switch"></th>'+
|
|
||||||
'<th class="next">›</th>'+
|
|
||||||
'</tr>'+
|
|
||||||
'</thead>',
|
|
||||||
contTemplate: '<tbody><tr><td colspan="7"></td></tr></tbody>'
|
|
||||||
};
|
|
||||||
DPGlobal.template = '<div class="datepicker dropdown-menu">'+
|
|
||||||
'<div class="datepicker-days">'+
|
|
||||||
'<table class=" table-condensed">'+
|
|
||||||
DPGlobal.headTemplate+
|
|
||||||
'<tbody></tbody>'+
|
|
||||||
'</table>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="datepicker-months">'+
|
|
||||||
'<table class="table-condensed">'+
|
|
||||||
DPGlobal.headTemplate+
|
|
||||||
DPGlobal.contTemplate+
|
|
||||||
'</table>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="datepicker-years">'+
|
|
||||||
'<table class="table-condensed">'+
|
|
||||||
DPGlobal.headTemplate+
|
|
||||||
DPGlobal.contTemplate+
|
|
||||||
'</table>'+
|
|
||||||
'</div>'+
|
|
||||||
'</div>';
|
|
||||||
|
|
||||||
}( window.jQuery );
|
|
654
app/assets/javascripts/vendor/bootstrap-slider.js
vendored
@ -19,370 +19,370 @@
|
|||||||
|
|
||||||
!function( $ ) {
|
!function( $ ) {
|
||||||
|
|
||||||
var Slider = function(element, options) {
|
var Slider = function(element, options) {
|
||||||
this.element = $(element);
|
this.element = $(element);
|
||||||
this.picker = $('<div class="slider">'+
|
this.picker = $('<div class="slider">'+
|
||||||
'<div class="slider-track">'+
|
'<div class="slider-track">'+
|
||||||
'<div class="slider-selection"></div>'+
|
'<div class="slider-selection"></div>'+
|
||||||
'<div class="slider-handle"></div>'+
|
'<div class="slider-handle"></div>'+
|
||||||
'<div class="slider-handle"></div>'+
|
'<div class="slider-handle"></div>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'+
|
'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'+
|
||||||
'</div>')
|
'</div>')
|
||||||
.insertBefore(this.element)
|
.insertBefore(this.element)
|
||||||
.append(this.element);
|
.append(this.element);
|
||||||
this.id = this.element.data('slider-id')||options.id;
|
this.id = this.element.data('slider-id')||options.id;
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
this.picker[0].id = this.id;
|
this.picker[0].id = this.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeof Modernizr !== 'undefined' && Modernizr.touch) {
|
if (typeof Modernizr !== 'undefined' && Modernizr.touch) {
|
||||||
this.touchCapable = true;
|
this.touchCapable = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tooltip = this.element.data('slider-tooltip')||options.tooltip;
|
var tooltip = this.element.data('slider-tooltip')||options.tooltip;
|
||||||
|
|
||||||
this.tooltip = this.picker.find('.tooltip');
|
this.tooltip = this.picker.find('.tooltip');
|
||||||
this.tooltipInner = this.tooltip.find('div.tooltip-inner');
|
this.tooltipInner = this.tooltip.find('div.tooltip-inner');
|
||||||
|
|
||||||
this.orientation = this.element.data('slider-orientation')||options.orientation;
|
this.orientation = this.element.data('slider-orientation')||options.orientation;
|
||||||
switch(this.orientation) {
|
switch(this.orientation) {
|
||||||
case 'vertical':
|
case 'vertical':
|
||||||
this.picker.addClass('slider-vertical');
|
this.picker.addClass('slider-vertical');
|
||||||
this.stylePos = 'top';
|
this.stylePos = 'top';
|
||||||
this.mousePos = 'pageY';
|
this.mousePos = 'pageY';
|
||||||
this.sizePos = 'offsetHeight';
|
this.sizePos = 'offsetHeight';
|
||||||
this.tooltip.addClass('right')[0].style.left = '100%';
|
this.tooltip.addClass('right')[0].style.left = '100%';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
this.picker
|
this.picker
|
||||||
.addClass('slider-horizontal')
|
.addClass('slider-horizontal')
|
||||||
.css('width', this.element.outerWidth());
|
.css('width', this.element.outerWidth());
|
||||||
this.orientation = 'horizontal';
|
this.orientation = 'horizontal';
|
||||||
this.stylePos = 'left';
|
this.stylePos = 'left';
|
||||||
this.mousePos = 'pageX';
|
this.mousePos = 'pageX';
|
||||||
this.sizePos = 'offsetWidth';
|
this.sizePos = 'offsetWidth';
|
||||||
this.tooltip.addClass('top')[0].style.top = -this.tooltip.outerHeight() - 14 + 'px';
|
this.tooltip.addClass('top')[0].style.top = -this.tooltip.outerHeight() - 14 + 'px';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.min = this.element.data('slider-min')||options.min;
|
this.min = this.element.data('slider-min')||options.min;
|
||||||
this.max = this.element.data('slider-max')||options.max;
|
this.max = this.element.data('slider-max')||options.max;
|
||||||
this.step = this.element.data('slider-step')||options.step;
|
this.step = this.element.data('slider-step')||options.step;
|
||||||
this.value = this.element.data('slider-value')||options.value;
|
this.value = this.element.data('slider-value')||options.value;
|
||||||
if (this.value[1]) {
|
if (this.value[1]) {
|
||||||
this.range = true;
|
this.range = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selection = this.element.data('slider-selection')||options.selection;
|
this.selection = this.element.data('slider-selection')||options.selection;
|
||||||
this.selectionEl = this.picker.find('.slider-selection');
|
this.selectionEl = this.picker.find('.slider-selection');
|
||||||
if (this.selection === 'none') {
|
if (this.selection === 'none') {
|
||||||
this.selectionEl.addClass('hide');
|
this.selectionEl.addClass('hide');
|
||||||
}
|
}
|
||||||
this.selectionElStyle = this.selectionEl[0].style;
|
this.selectionElStyle = this.selectionEl[0].style;
|
||||||
|
|
||||||
|
|
||||||
this.handle1 = this.picker.find('.slider-handle:first');
|
this.handle1 = this.picker.find('.slider-handle:first');
|
||||||
this.handle1Stype = this.handle1[0].style;
|
this.handle1Stype = this.handle1[0].style;
|
||||||
this.handle2 = this.picker.find('.slider-handle:last');
|
this.handle2 = this.picker.find('.slider-handle:last');
|
||||||
this.handle2Stype = this.handle2[0].style;
|
this.handle2Stype = this.handle2[0].style;
|
||||||
|
|
||||||
var handle = this.element.data('slider-handle')||options.handle;
|
var handle = this.element.data('slider-handle')||options.handle;
|
||||||
switch(handle) {
|
switch(handle) {
|
||||||
case 'round':
|
case 'round':
|
||||||
this.handle1.addClass('round');
|
this.handle1.addClass('round');
|
||||||
this.handle2.addClass('round');
|
this.handle2.addClass('round');
|
||||||
break
|
break
|
||||||
case 'triangle':
|
case 'triangle':
|
||||||
this.handle1.addClass('triangle');
|
this.handle1.addClass('triangle');
|
||||||
this.handle2.addClass('triangle');
|
this.handle2.addClass('triangle');
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
this.value[0] = Math.max(this.min, Math.min(this.max, this.value[0]));
|
this.value[0] = Math.max(this.min, Math.min(this.max, this.value[0]));
|
||||||
this.value[1] = Math.max(this.min, Math.min(this.max, this.value[1]));
|
this.value[1] = Math.max(this.min, Math.min(this.max, this.value[1]));
|
||||||
} else {
|
} else {
|
||||||
this.value = [ Math.max(this.min, Math.min(this.max, this.value))];
|
this.value = [ Math.max(this.min, Math.min(this.max, this.value))];
|
||||||
this.handle2.addClass('hide');
|
this.handle2.addClass('hide');
|
||||||
if (this.selection == 'after') {
|
if (this.selection == 'after') {
|
||||||
this.value[1] = this.max;
|
this.value[1] = this.max;
|
||||||
} else {
|
} else {
|
||||||
this.value[1] = this.min;
|
this.value[1] = this.min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.diff = this.max - this.min;
|
this.diff = this.max - this.min;
|
||||||
this.percentage = [
|
this.percentage = [
|
||||||
(this.value[0]-this.min)*100/this.diff,
|
(this.value[0]-this.min)*100/this.diff,
|
||||||
(this.value[1]-this.min)*100/this.diff,
|
(this.value[1]-this.min)*100/this.diff,
|
||||||
this.step*100/this.diff
|
this.step*100/this.diff
|
||||||
];
|
];
|
||||||
|
|
||||||
this.offset = this.picker.offset();
|
this.offset = this.picker.offset();
|
||||||
this.size = this.picker[0][this.sizePos];
|
this.size = this.picker[0][this.sizePos];
|
||||||
|
|
||||||
this.formater = options.formater;
|
this.formater = options.formater;
|
||||||
|
|
||||||
this.layout();
|
this.layout();
|
||||||
|
|
||||||
if (this.touchCapable) {
|
if (this.touchCapable) {
|
||||||
// Touch: Bind touch events:
|
// Touch: Bind touch events:
|
||||||
this.picker.on({
|
this.picker.on({
|
||||||
touchstart: $.proxy(this.mousedown, this)
|
touchstart: $.proxy(this.mousedown, this)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.picker.on({
|
this.picker.on({
|
||||||
mousedown: $.proxy(this.mousedown, this)
|
mousedown: $.proxy(this.mousedown, this)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tooltip === 'show') {
|
if (tooltip === 'show') {
|
||||||
this.picker.on({
|
this.picker.on({
|
||||||
mouseenter: $.proxy(this.showTooltip, this),
|
mouseenter: $.proxy(this.showTooltip, this),
|
||||||
mouseleave: $.proxy(this.hideTooltip, this)
|
mouseleave: $.proxy(this.hideTooltip, this)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.tooltip.addClass('hide');
|
this.tooltip.addClass('hide');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Slider.prototype = {
|
Slider.prototype = {
|
||||||
constructor: Slider,
|
constructor: Slider,
|
||||||
|
|
||||||
over: false,
|
over: false,
|
||||||
inDrag: false,
|
inDrag: false,
|
||||||
|
|
||||||
showTooltip: function(){
|
showTooltip: function(){
|
||||||
this.tooltip.addClass('in');
|
this.tooltip.addClass('in');
|
||||||
//var left = Math.round(this.percent*this.width);
|
//var left = Math.round(this.percent*this.width);
|
||||||
//this.tooltip.css('left', left - this.tooltip.outerWidth()/2);
|
//this.tooltip.css('left', left - this.tooltip.outerWidth()/2);
|
||||||
this.over = true;
|
this.over = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
hideTooltip: function(){
|
hideTooltip: function(){
|
||||||
if (this.inDrag === false) {
|
if (this.inDrag === false) {
|
||||||
this.tooltip.removeClass('in');
|
this.tooltip.removeClass('in');
|
||||||
}
|
}
|
||||||
this.over = false;
|
this.over = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
layout: function(){
|
layout: function(){
|
||||||
this.handle1Stype[this.stylePos] = this.percentage[0]+'%';
|
this.handle1Stype[this.stylePos] = this.percentage[0]+'%';
|
||||||
this.handle2Stype[this.stylePos] = this.percentage[1]+'%';
|
this.handle2Stype[this.stylePos] = this.percentage[1]+'%';
|
||||||
if (this.orientation == 'vertical') {
|
if (this.orientation == 'vertical') {
|
||||||
this.selectionElStyle.top = Math.min(this.percentage[0], this.percentage[1]) +'%';
|
this.selectionElStyle.top = Math.min(this.percentage[0], this.percentage[1]) +'%';
|
||||||
this.selectionElStyle.height = Math.abs(this.percentage[0] - this.percentage[1]) +'%';
|
this.selectionElStyle.height = Math.abs(this.percentage[0] - this.percentage[1]) +'%';
|
||||||
} else {
|
} else {
|
||||||
this.selectionElStyle.left = Math.min(this.percentage[0], this.percentage[1]) +'%';
|
this.selectionElStyle.left = Math.min(this.percentage[0], this.percentage[1]) +'%';
|
||||||
this.selectionElStyle.width = Math.abs(this.percentage[0] - this.percentage[1]) +'%';
|
this.selectionElStyle.width = Math.abs(this.percentage[0] - this.percentage[1]) +'%';
|
||||||
}
|
}
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
this.tooltipInner.text(
|
this.tooltipInner.text(
|
||||||
this.formater(this.value[0]) +
|
this.formater(this.value[0]) +
|
||||||
' : ' +
|
' : ' +
|
||||||
this.formater(this.value[1])
|
this.formater(this.value[1])
|
||||||
);
|
);
|
||||||
this.tooltip[0].style[this.stylePos] = this.size * (this.percentage[0] + (this.percentage[1] - this.percentage[0])/2)/100 - (this.orientation === 'vertical' ? this.tooltip.outerHeight()/2 : this.tooltip.outerWidth()/2) +'px';
|
this.tooltip[0].style[this.stylePos] = this.size * (this.percentage[0] + (this.percentage[1] - this.percentage[0])/2)/100 - (this.orientation === 'vertical' ? this.tooltip.outerHeight()/2 : this.tooltip.outerWidth()/2) +'px';
|
||||||
} else {
|
} else {
|
||||||
this.tooltipInner.text(
|
this.tooltipInner.text(
|
||||||
this.formater(this.value[0])
|
this.formater(this.value[0])
|
||||||
);
|
);
|
||||||
this.tooltip[0].style[this.stylePos] = this.size * this.percentage[0]/100 - (this.orientation === 'vertical' ? this.tooltip.outerHeight()/2 : this.tooltip.outerWidth()/2) +'px';
|
this.tooltip[0].style[this.stylePos] = this.size * this.percentage[0]/100 - (this.orientation === 'vertical' ? this.tooltip.outerHeight()/2 : this.tooltip.outerWidth()/2) +'px';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mousedown: function(ev) {
|
mousedown: function(ev) {
|
||||||
|
|
||||||
// Touch: Get the original event:
|
// Touch: Get the original event:
|
||||||
if (this.touchCapable && ev.type === 'touchstart') {
|
if (this.touchCapable && ev.type === 'touchstart') {
|
||||||
ev = ev.originalEvent;
|
ev = ev.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.offset = this.picker.offset();
|
this.offset = this.picker.offset();
|
||||||
this.size = this.picker[0][this.sizePos];
|
this.size = this.picker[0][this.sizePos];
|
||||||
|
|
||||||
var percentage = this.getPercentage(ev);
|
var percentage = this.getPercentage(ev);
|
||||||
|
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
var diff1 = Math.abs(this.percentage[0] - percentage);
|
var diff1 = Math.abs(this.percentage[0] - percentage);
|
||||||
var diff2 = Math.abs(this.percentage[1] - percentage);
|
var diff2 = Math.abs(this.percentage[1] - percentage);
|
||||||
this.dragged = (diff1 < diff2) ? 0 : 1;
|
this.dragged = (diff1 < diff2) ? 0 : 1;
|
||||||
} else {
|
} else {
|
||||||
this.dragged = 0;
|
this.dragged = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.percentage[this.dragged] = percentage;
|
this.percentage[this.dragged] = percentage;
|
||||||
this.layout();
|
this.layout();
|
||||||
|
|
||||||
if (this.touchCapable) {
|
if (this.touchCapable) {
|
||||||
// Touch: Bind touch events:
|
// Touch: Bind touch events:
|
||||||
$(document).on({
|
$(document).on({
|
||||||
touchmove: $.proxy(this.mousemove, this),
|
touchmove: $.proxy(this.mousemove, this),
|
||||||
touchend: $.proxy(this.mouseup, this)
|
touchend: $.proxy(this.mouseup, this)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(document).on({
|
$(document).on({
|
||||||
mousemove: $.proxy(this.mousemove, this),
|
mousemove: $.proxy(this.mousemove, this),
|
||||||
mouseup: $.proxy(this.mouseup, this)
|
mouseup: $.proxy(this.mouseup, this)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.inDrag = true;
|
this.inDrag = true;
|
||||||
var val = this.calculateValue();
|
var val = this.calculateValue();
|
||||||
this.element.trigger({
|
this.element.trigger({
|
||||||
type: 'slideStart',
|
type: 'slideStart',
|
||||||
value: val
|
value: val
|
||||||
}).trigger({
|
}).trigger({
|
||||||
type: 'slide',
|
type: 'slide',
|
||||||
value: val
|
value: val
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
mousemove: function(ev) {
|
mousemove: function(ev) {
|
||||||
|
|
||||||
// Touch: Get the original event:
|
// Touch: Get the original event:
|
||||||
if (this.touchCapable && ev.type === 'touchmove') {
|
if (this.touchCapable && ev.type === 'touchmove') {
|
||||||
ev = ev.originalEvent;
|
ev = ev.originalEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
var percentage = this.getPercentage(ev);
|
var percentage = this.getPercentage(ev);
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
if (this.dragged === 0 && this.percentage[1] < percentage) {
|
if (this.dragged === 0 && this.percentage[1] < percentage) {
|
||||||
this.percentage[0] = this.percentage[1];
|
this.percentage[0] = this.percentage[1];
|
||||||
this.dragged = 1;
|
this.dragged = 1;
|
||||||
} else if (this.dragged === 1 && this.percentage[0] > percentage) {
|
} else if (this.dragged === 1 && this.percentage[0] > percentage) {
|
||||||
this.percentage[1] = this.percentage[0];
|
this.percentage[1] = this.percentage[0];
|
||||||
this.dragged = 0;
|
this.dragged = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.percentage[this.dragged] = percentage;
|
this.percentage[this.dragged] = percentage;
|
||||||
this.layout();
|
this.layout();
|
||||||
var val = this.calculateValue();
|
var val = this.calculateValue();
|
||||||
this.element
|
this.element
|
||||||
.trigger({
|
.trigger({
|
||||||
type: 'slide',
|
type: 'slide',
|
||||||
value: val
|
value: val
|
||||||
})
|
})
|
||||||
.data('value', val)
|
.data('value', val)
|
||||||
.prop('value', val);
|
.prop('value', val);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
mouseup: function(ev) {
|
mouseup: function(ev) {
|
||||||
if (this.touchCapable) {
|
if (this.touchCapable) {
|
||||||
// Touch: Bind touch events:
|
// Touch: Bind touch events:
|
||||||
$(document).off({
|
$(document).off({
|
||||||
touchmove: this.mousemove,
|
touchmove: this.mousemove,
|
||||||
touchend: this.mouseup
|
touchend: this.mouseup
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$(document).off({
|
$(document).off({
|
||||||
mousemove: this.mousemove,
|
mousemove: this.mousemove,
|
||||||
mouseup: this.mouseup
|
mouseup: this.mouseup
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.inDrag = false;
|
this.inDrag = false;
|
||||||
if (this.over == false) {
|
if (this.over == false) {
|
||||||
this.hideTooltip();
|
this.hideTooltip();
|
||||||
}
|
}
|
||||||
this.element;
|
this.element;
|
||||||
var val = this.calculateValue();
|
var val = this.calculateValue();
|
||||||
this.element
|
this.element
|
||||||
.trigger({
|
.trigger({
|
||||||
type: 'slideStop',
|
type: 'slideStop',
|
||||||
value: val
|
value: val
|
||||||
})
|
})
|
||||||
.data('value', val)
|
.data('value', val)
|
||||||
.prop('value', val);
|
.prop('value', val);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
calculateValue: function() {
|
calculateValue: function() {
|
||||||
var val;
|
var val;
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
val = [
|
val = [
|
||||||
(this.min + Math.round((this.diff * this.percentage[0]/100)/this.step)*this.step),
|
(this.min + Math.round((this.diff * this.percentage[0]/100)/this.step)*this.step),
|
||||||
(this.min + Math.round((this.diff * this.percentage[1]/100)/this.step)*this.step)
|
(this.min + Math.round((this.diff * this.percentage[1]/100)/this.step)*this.step)
|
||||||
];
|
];
|
||||||
this.value = val;
|
this.value = val;
|
||||||
} else {
|
} else {
|
||||||
val = (this.min + Math.round((this.diff * this.percentage[0]/100)/this.step)*this.step);
|
val = (this.min + Math.round((this.diff * this.percentage[0]/100)/this.step)*this.step);
|
||||||
this.value = [val, this.value[1]];
|
this.value = [val, this.value[1]];
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
},
|
},
|
||||||
|
|
||||||
getPercentage: function(ev) {
|
getPercentage: function(ev) {
|
||||||
if (this.touchCapable) {
|
if (this.touchCapable) {
|
||||||
ev = ev.touches[0];
|
ev = ev.touches[0];
|
||||||
}
|
}
|
||||||
var percentage = (ev[this.mousePos] - this.offset[this.stylePos])*100/this.size;
|
var percentage = (ev[this.mousePos] - this.offset[this.stylePos])*100/this.size;
|
||||||
percentage = Math.round(percentage/this.percentage[2])*this.percentage[2];
|
percentage = Math.round(percentage/this.percentage[2])*this.percentage[2];
|
||||||
return Math.max(0, Math.min(100, percentage));
|
return Math.max(0, Math.min(100, percentage));
|
||||||
},
|
},
|
||||||
|
|
||||||
getValue: function() {
|
getValue: function() {
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
return this.value;
|
return this.value;
|
||||||
}
|
}
|
||||||
return this.value[0];
|
return this.value[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
setValue: function(val) {
|
setValue: function(val) {
|
||||||
this.value = val;
|
this.value = val;
|
||||||
|
|
||||||
if (this.range) {
|
if (this.range) {
|
||||||
this.value[0] = Math.max(this.min, Math.min(this.max, this.value[0]));
|
this.value[0] = Math.max(this.min, Math.min(this.max, this.value[0]));
|
||||||
this.value[1] = Math.max(this.min, Math.min(this.max, this.value[1]));
|
this.value[1] = Math.max(this.min, Math.min(this.max, this.value[1]));
|
||||||
} else {
|
} else {
|
||||||
this.value = [ Math.max(this.min, Math.min(this.max, this.value))];
|
this.value = [ Math.max(this.min, Math.min(this.max, this.value))];
|
||||||
this.handle2.addClass('hide');
|
this.handle2.addClass('hide');
|
||||||
if (this.selection == 'after') {
|
if (this.selection == 'after') {
|
||||||
this.value[1] = this.max;
|
this.value[1] = this.max;
|
||||||
} else {
|
} else {
|
||||||
this.value[1] = this.min;
|
this.value[1] = this.min;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.diff = this.max - this.min;
|
this.diff = this.max - this.min;
|
||||||
this.percentage = [
|
this.percentage = [
|
||||||
(this.value[0]-this.min)*100/this.diff,
|
(this.value[0]-this.min)*100/this.diff,
|
||||||
(this.value[1]-this.min)*100/this.diff,
|
(this.value[1]-this.min)*100/this.diff,
|
||||||
this.step*100/this.diff
|
this.step*100/this.diff
|
||||||
];
|
];
|
||||||
this.layout();
|
this.layout();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.slider = function ( option, val ) {
|
$.fn.slider = function ( option, val ) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
var $this = $(this),
|
var $this = $(this),
|
||||||
data = $this.data('slider'),
|
data = $this.data('slider'),
|
||||||
options = typeof option === 'object' && option;
|
options = typeof option === 'object' && option;
|
||||||
if (!data) {
|
if (!data) {
|
||||||
$this.data('slider', (data = new Slider(this, $.extend({}, $.fn.slider.defaults,options))));
|
$this.data('slider', (data = new Slider(this, $.extend({}, $.fn.slider.defaults,options))));
|
||||||
}
|
}
|
||||||
if (typeof option == 'string') {
|
if (typeof option == 'string') {
|
||||||
data[option](val);
|
data[option](val);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.slider.defaults = {
|
$.fn.slider.defaults = {
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 10,
|
max: 10,
|
||||||
step: 1,
|
step: 1,
|
||||||
orientation: 'horizontal',
|
orientation: 'horizontal',
|
||||||
value: 5,
|
value: 5,
|
||||||
selection: 'before',
|
selection: 'before',
|
||||||
tooltip: 'hide',
|
tooltip: 'hide',
|
||||||
handle: 'round',
|
handle: 'round',
|
||||||
formater: function(value) {
|
formater: function(value) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.fn.slider.Constructor = Slider;
|
$.fn.slider.Constructor = Slider;
|
||||||
|
|
||||||
}( window.jQuery );
|
}( window.jQuery );
|
@ -1,888 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Timepicker Component for Twitter Bootstrap
|
|
||||||
*
|
|
||||||
* Copyright 2013 Joris de Wit
|
|
||||||
*
|
|
||||||
* Contributors https://github.com/jdewit/bootstrap-timepicker/graphs/contributors
|
|
||||||
*
|
|
||||||
* For the full copyright and license information, please view the LICENSE
|
|
||||||
* file that was distributed with this source code.
|
|
||||||
*/
|
|
||||||
(function($, window, document, undefined) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// TIMEPICKER PUBLIC CLASS DEFINITION
|
|
||||||
var Timepicker = function(element, options) {
|
|
||||||
this.widget = '';
|
|
||||||
this.$element = $(element);
|
|
||||||
this.defaultTime = options.defaultTime;
|
|
||||||
this.disableFocus = options.disableFocus;
|
|
||||||
this.isOpen = options.isOpen;
|
|
||||||
this.minuteStep = options.minuteStep;
|
|
||||||
this.modalBackdrop = options.modalBackdrop;
|
|
||||||
this.secondStep = options.secondStep;
|
|
||||||
this.showInputs = options.showInputs;
|
|
||||||
this.showMeridian = options.showMeridian;
|
|
||||||
this.showSeconds = options.showSeconds;
|
|
||||||
this.template = options.template;
|
|
||||||
this.appendWidgetTo = options.appendWidgetTo;
|
|
||||||
|
|
||||||
this._init();
|
|
||||||
};
|
|
||||||
|
|
||||||
Timepicker.prototype = {
|
|
||||||
|
|
||||||
constructor: Timepicker,
|
|
||||||
|
|
||||||
_init: function() {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
if (this.$element.parent().hasClass('input-append') || this.$element.parent().hasClass('input-prepend')) {
|
|
||||||
this.$element.parent('.input-append, .input-prepend').find('.add-on').on({
|
|
||||||
'click.timepicker': $.proxy(this.showWidget, this)
|
|
||||||
});
|
|
||||||
this.$element.on({
|
|
||||||
'focus.timepicker': $.proxy(this.highlightUnit, this),
|
|
||||||
'click.timepicker': $.proxy(this.highlightUnit, this),
|
|
||||||
'keydown.timepicker': $.proxy(this.elementKeydown, this),
|
|
||||||
'blur.timepicker': $.proxy(this.blurElement, this)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (this.template) {
|
|
||||||
this.$element.on({
|
|
||||||
'focus.timepicker': $.proxy(this.showWidget, this),
|
|
||||||
'click.timepicker': $.proxy(this.showWidget, this),
|
|
||||||
'blur.timepicker': $.proxy(this.blurElement, this)
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.$element.on({
|
|
||||||
'focus.timepicker': $.proxy(this.highlightUnit, this),
|
|
||||||
'click.timepicker': $.proxy(this.highlightUnit, this),
|
|
||||||
'keydown.timepicker': $.proxy(this.elementKeydown, this),
|
|
||||||
'blur.timepicker': $.proxy(this.blurElement, this)
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.template !== false) {
|
|
||||||
this.$widget = $(this.getTemplate()).prependTo(this.$element.parents(this.appendWidgetTo)).on('click', $.proxy(this.widgetClick, this));
|
|
||||||
} else {
|
|
||||||
this.$widget = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.showInputs && this.$widget !== false) {
|
|
||||||
this.$widget.find('input').each(function() {
|
|
||||||
$(this).on({
|
|
||||||
'click.timepicker': function() { $(this).select(); },
|
|
||||||
'keydown.timepicker': $.proxy(self.widgetKeydown, self)
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setDefaultTime(this.defaultTime);
|
|
||||||
},
|
|
||||||
|
|
||||||
blurElement: function() {
|
|
||||||
this.highlightedUnit = undefined;
|
|
||||||
this.updateFromElementVal();
|
|
||||||
},
|
|
||||||
|
|
||||||
decrementHour: function() {
|
|
||||||
if (this.showMeridian) {
|
|
||||||
if (this.hour === 1) {
|
|
||||||
this.hour = 12;
|
|
||||||
} else if (this.hour === 12) {
|
|
||||||
this.hour--;
|
|
||||||
|
|
||||||
return this.toggleMeridian();
|
|
||||||
} else if (this.hour === 0) {
|
|
||||||
this.hour = 11;
|
|
||||||
|
|
||||||
return this.toggleMeridian();
|
|
||||||
} else {
|
|
||||||
this.hour--;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.hour === 0) {
|
|
||||||
this.hour = 23;
|
|
||||||
} else {
|
|
||||||
this.hour--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
decrementMinute: function(step) {
|
|
||||||
var newVal;
|
|
||||||
|
|
||||||
if (step) {
|
|
||||||
newVal = this.minute - step;
|
|
||||||
} else {
|
|
||||||
newVal = this.minute - this.minuteStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newVal < 0) {
|
|
||||||
this.decrementHour();
|
|
||||||
this.minute = newVal + 60;
|
|
||||||
} else {
|
|
||||||
this.minute = newVal;
|
|
||||||
}
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
decrementSecond: function() {
|
|
||||||
var newVal = this.second - this.secondStep;
|
|
||||||
|
|
||||||
if (newVal < 0) {
|
|
||||||
this.decrementMinute(true);
|
|
||||||
this.second = newVal + 60;
|
|
||||||
} else {
|
|
||||||
this.second = newVal;
|
|
||||||
}
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
elementKeydown: function(e) {
|
|
||||||
switch (e.keyCode) {
|
|
||||||
case 9: //tab
|
|
||||||
this.updateFromElementVal();
|
|
||||||
|
|
||||||
switch (this.highlightedUnit) {
|
|
||||||
case 'hour':
|
|
||||||
e.preventDefault();
|
|
||||||
this.highlightNextUnit();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
if (this.showMeridian || this.showSeconds) {
|
|
||||||
e.preventDefault();
|
|
||||||
this.highlightNextUnit();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
if (this.showMeridian) {
|
|
||||||
e.preventDefault();
|
|
||||||
this.highlightNextUnit();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 27: // escape
|
|
||||||
this.updateFromElementVal();
|
|
||||||
break;
|
|
||||||
case 37: // left arrow
|
|
||||||
e.preventDefault();
|
|
||||||
this.highlightPrevUnit();
|
|
||||||
this.updateFromElementVal();
|
|
||||||
break;
|
|
||||||
case 38: // up arrow
|
|
||||||
e.preventDefault();
|
|
||||||
switch (this.highlightedUnit) {
|
|
||||||
case 'hour':
|
|
||||||
this.incrementHour();
|
|
||||||
this.highlightHour();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
this.incrementMinute();
|
|
||||||
this.highlightMinute();
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
this.incrementSecond();
|
|
||||||
this.highlightSecond();
|
|
||||||
break;
|
|
||||||
case 'meridian':
|
|
||||||
this.toggleMeridian();
|
|
||||||
this.highlightMeridian();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 39: // right arrow
|
|
||||||
e.preventDefault();
|
|
||||||
this.updateFromElementVal();
|
|
||||||
this.highlightNextUnit();
|
|
||||||
break;
|
|
||||||
case 40: // down arrow
|
|
||||||
e.preventDefault();
|
|
||||||
switch (this.highlightedUnit) {
|
|
||||||
case 'hour':
|
|
||||||
this.decrementHour();
|
|
||||||
this.highlightHour();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
this.decrementMinute();
|
|
||||||
this.highlightMinute();
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
this.decrementSecond();
|
|
||||||
this.highlightSecond();
|
|
||||||
break;
|
|
||||||
case 'meridian':
|
|
||||||
this.toggleMeridian();
|
|
||||||
this.highlightMeridian();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
formatTime: function(hour, minute, second, meridian) {
|
|
||||||
hour = hour < 10 ? '0' + hour : hour;
|
|
||||||
minute = minute < 10 ? '0' + minute : minute;
|
|
||||||
second = second < 10 ? '0' + second : second;
|
|
||||||
|
|
||||||
return hour + ':' + minute + (this.showSeconds ? ':' + second : '') + (this.showMeridian ? ' ' + meridian : '');
|
|
||||||
},
|
|
||||||
|
|
||||||
getCursorPosition: function() {
|
|
||||||
var input = this.$element.get(0);
|
|
||||||
|
|
||||||
if ('selectionStart' in input) {// Standard-compliant browsers
|
|
||||||
|
|
||||||
return input.selectionStart;
|
|
||||||
} else if (document.selection) {// IE fix
|
|
||||||
input.focus();
|
|
||||||
var sel = document.selection.createRange(),
|
|
||||||
selLen = document.selection.createRange().text.length;
|
|
||||||
|
|
||||||
sel.moveStart('character', - input.value.length);
|
|
||||||
|
|
||||||
return sel.text.length - selLen;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
getTemplate: function() {
|
|
||||||
var template,
|
|
||||||
hourTemplate,
|
|
||||||
minuteTemplate,
|
|
||||||
secondTemplate,
|
|
||||||
meridianTemplate,
|
|
||||||
templateContent;
|
|
||||||
|
|
||||||
if (this.showInputs) {
|
|
||||||
hourTemplate = '<input type="text" name="hour" class="bootstrap-timepicker-hour" maxlength="2"/>';
|
|
||||||
minuteTemplate = '<input type="text" name="minute" class="bootstrap-timepicker-minute" maxlength="2"/>';
|
|
||||||
secondTemplate = '<input type="text" name="second" class="bootstrap-timepicker-second" maxlength="2"/>';
|
|
||||||
meridianTemplate = '<input type="text" name="meridian" class="bootstrap-timepicker-meridian" maxlength="2"/>';
|
|
||||||
} else {
|
|
||||||
hourTemplate = '<span class="bootstrap-timepicker-hour"></span>';
|
|
||||||
minuteTemplate = '<span class="bootstrap-timepicker-minute"></span>';
|
|
||||||
secondTemplate = '<span class="bootstrap-timepicker-second"></span>';
|
|
||||||
meridianTemplate = '<span class="bootstrap-timepicker-meridian"></span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
templateContent = '<table>'+
|
|
||||||
'<tr>'+
|
|
||||||
'<td><a href="#" data-action="incrementHour"><i class="icon-chevron-up"></i></a></td>'+
|
|
||||||
'<td class="separator"> </td>'+
|
|
||||||
'<td><a href="#" data-action="incrementMinute"><i class="icon-chevron-up"></i></a></td>'+
|
|
||||||
(this.showSeconds ?
|
|
||||||
'<td class="separator"> </td>'+
|
|
||||||
'<td><a href="#" data-action="incrementSecond"><i class="icon-chevron-up"></i></a></td>'
|
|
||||||
: '') +
|
|
||||||
(this.showMeridian ?
|
|
||||||
'<td class="separator"> </td>'+
|
|
||||||
'<td class="meridian-column"><a href="#" data-action="toggleMeridian"><i class="icon-chevron-up"></i></a></td>'
|
|
||||||
: '') +
|
|
||||||
'</tr>'+
|
|
||||||
'<tr>'+
|
|
||||||
'<td>'+ hourTemplate +'</td> '+
|
|
||||||
'<td class="separator">:</td>'+
|
|
||||||
'<td>'+ minuteTemplate +'</td> '+
|
|
||||||
(this.showSeconds ?
|
|
||||||
'<td class="separator">:</td>'+
|
|
||||||
'<td>'+ secondTemplate +'</td>'
|
|
||||||
: '') +
|
|
||||||
(this.showMeridian ?
|
|
||||||
'<td class="separator"> </td>'+
|
|
||||||
'<td>'+ meridianTemplate +'</td>'
|
|
||||||
: '') +
|
|
||||||
'</tr>'+
|
|
||||||
'<tr>'+
|
|
||||||
'<td><a href="#" data-action="decrementHour"><i class="icon-chevron-down"></i></a></td>'+
|
|
||||||
'<td class="separator"></td>'+
|
|
||||||
'<td><a href="#" data-action="decrementMinute"><i class="icon-chevron-down"></i></a></td>'+
|
|
||||||
(this.showSeconds ?
|
|
||||||
'<td class="separator"> </td>'+
|
|
||||||
'<td><a href="#" data-action="decrementSecond"><i class="icon-chevron-down"></i></a></td>'
|
|
||||||
: '') +
|
|
||||||
(this.showMeridian ?
|
|
||||||
'<td class="separator"> </td>'+
|
|
||||||
'<td><a href="#" data-action="toggleMeridian"><i class="icon-chevron-down"></i></a></td>'
|
|
||||||
: '') +
|
|
||||||
'</tr>'+
|
|
||||||
'</table>';
|
|
||||||
|
|
||||||
switch(this.template) {
|
|
||||||
case 'modal':
|
|
||||||
template = '<div class="bootstrap-timepicker-widget modal hide fade in" data-backdrop="'+ (this.modalBackdrop ? 'true' : 'false') +'">'+
|
|
||||||
'<div class="modal-header">'+
|
|
||||||
'<a href="#" class="close" data-dismiss="modal">×</a>'+
|
|
||||||
'<h3>Pick a Time</h3>'+
|
|
||||||
'</div>'+
|
|
||||||
'<div class="modal-content">'+
|
|
||||||
templateContent +
|
|
||||||
'</div>'+
|
|
||||||
'<div class="modal-footer">'+
|
|
||||||
'<a href="#" class="btn btn-primary" data-dismiss="modal">OK</a>'+
|
|
||||||
'</div>'+
|
|
||||||
'</div>';
|
|
||||||
break;
|
|
||||||
case 'dropdown':
|
|
||||||
template = '<div class="bootstrap-timepicker-widget dropdown-menu">'+ templateContent +'</div>';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return template;
|
|
||||||
},
|
|
||||||
|
|
||||||
getTime: function() {
|
|
||||||
return this.formatTime(this.hour, this.minute, this.second, this.meridian);
|
|
||||||
},
|
|
||||||
|
|
||||||
hideWidget: function() {
|
|
||||||
if (this.isOpen === false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.showInputs) {
|
|
||||||
this.updateFromWidgetInputs();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$element.trigger({
|
|
||||||
'type': 'hide.timepicker',
|
|
||||||
'time': {
|
|
||||||
'value': this.getTime(),
|
|
||||||
'hours': this.hour,
|
|
||||||
'minutes': this.minute,
|
|
||||||
'seconds': this.second,
|
|
||||||
'meridian': this.meridian
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.template === 'modal' && this.$widget.modal) {
|
|
||||||
this.$widget.modal('hide');
|
|
||||||
} else {
|
|
||||||
this.$widget.removeClass('open');
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).off('mousedown.timepicker');
|
|
||||||
|
|
||||||
this.isOpen = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightUnit: function() {
|
|
||||||
this.position = this.getCursorPosition();
|
|
||||||
if (this.position >= 0 && this.position <= 2) {
|
|
||||||
this.highlightHour();
|
|
||||||
} else if (this.position >= 3 && this.position <= 5) {
|
|
||||||
this.highlightMinute();
|
|
||||||
} else if (this.position >= 6 && this.position <= 8) {
|
|
||||||
if (this.showSeconds) {
|
|
||||||
this.highlightSecond();
|
|
||||||
} else {
|
|
||||||
this.highlightMeridian();
|
|
||||||
}
|
|
||||||
} else if (this.position >= 9 && this.position <= 11) {
|
|
||||||
this.highlightMeridian();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightNextUnit: function() {
|
|
||||||
switch (this.highlightedUnit) {
|
|
||||||
case 'hour':
|
|
||||||
this.highlightMinute();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
if (this.showSeconds) {
|
|
||||||
this.highlightSecond();
|
|
||||||
} else if (this.showMeridian){
|
|
||||||
this.highlightMeridian();
|
|
||||||
} else {
|
|
||||||
this.highlightHour();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
if (this.showMeridian) {
|
|
||||||
this.highlightMeridian();
|
|
||||||
} else {
|
|
||||||
this.highlightHour();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'meridian':
|
|
||||||
this.highlightHour();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightPrevUnit: function() {
|
|
||||||
switch (this.highlightedUnit) {
|
|
||||||
case 'hour':
|
|
||||||
this.highlightMeridian();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
this.highlightHour();
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
this.highlightMinute();
|
|
||||||
break;
|
|
||||||
case 'meridian':
|
|
||||||
if (this.showSeconds) {
|
|
||||||
this.highlightSecond();
|
|
||||||
} else {
|
|
||||||
this.highlightMinute();
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightHour: function() {
|
|
||||||
var $element = this.$element.get(0);
|
|
||||||
|
|
||||||
this.highlightedUnit = 'hour';
|
|
||||||
|
|
||||||
if ($element.setSelectionRange) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$element.setSelectionRange(0,2);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightMinute: function() {
|
|
||||||
var $element = this.$element.get(0);
|
|
||||||
|
|
||||||
this.highlightedUnit = 'minute';
|
|
||||||
|
|
||||||
if ($element.setSelectionRange) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$element.setSelectionRange(3,5);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightSecond: function() {
|
|
||||||
var $element = this.$element.get(0);
|
|
||||||
|
|
||||||
this.highlightedUnit = 'second';
|
|
||||||
|
|
||||||
if ($element.setSelectionRange) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$element.setSelectionRange(6,8);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
highlightMeridian: function() {
|
|
||||||
var $element = this.$element.get(0);
|
|
||||||
|
|
||||||
this.highlightedUnit = 'meridian';
|
|
||||||
|
|
||||||
if ($element.setSelectionRange) {
|
|
||||||
if (this.showSeconds) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$element.setSelectionRange(9,11);
|
|
||||||
}, 0);
|
|
||||||
} else {
|
|
||||||
setTimeout(function() {
|
|
||||||
$element.setSelectionRange(6,8);
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
incrementHour: function() {
|
|
||||||
if (this.showMeridian) {
|
|
||||||
if (this.hour === 11) {
|
|
||||||
this.hour++;
|
|
||||||
return this.toggleMeridian();
|
|
||||||
} else if (this.hour === 12) {
|
|
||||||
this.hour = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (this.hour === 23) {
|
|
||||||
this.hour = 0;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.hour++;
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
incrementMinute: function(step) {
|
|
||||||
var newVal;
|
|
||||||
|
|
||||||
if (step) {
|
|
||||||
newVal = this.minute + step;
|
|
||||||
} else {
|
|
||||||
newVal = this.minute + this.minuteStep - (this.minute % this.minuteStep);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newVal > 59) {
|
|
||||||
this.incrementHour();
|
|
||||||
this.minute = newVal - 60;
|
|
||||||
} else {
|
|
||||||
this.minute = newVal;
|
|
||||||
}
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
incrementSecond: function() {
|
|
||||||
var newVal = this.second + this.secondStep - (this.second % this.secondStep);
|
|
||||||
|
|
||||||
if (newVal > 59) {
|
|
||||||
this.incrementMinute(true);
|
|
||||||
this.second = newVal - 60;
|
|
||||||
} else {
|
|
||||||
this.second = newVal;
|
|
||||||
}
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
remove: function() {
|
|
||||||
$('document').off('.timepicker');
|
|
||||||
if (this.$widget) {
|
|
||||||
this.$widget.remove();
|
|
||||||
}
|
|
||||||
delete this.$element.data().timepicker;
|
|
||||||
},
|
|
||||||
|
|
||||||
setDefaultTime: function(defaultTime){
|
|
||||||
if (!this.$element.val()) {
|
|
||||||
if (defaultTime === 'current') {
|
|
||||||
var dTime = new Date(),
|
|
||||||
hours = dTime.getHours(),
|
|
||||||
minutes = Math.floor(dTime.getMinutes() / this.minuteStep) * this.minuteStep,
|
|
||||||
seconds = Math.floor(dTime.getSeconds() / this.secondStep) * this.secondStep,
|
|
||||||
meridian = 'AM';
|
|
||||||
|
|
||||||
if (this.showMeridian) {
|
|
||||||
if (hours === 0) {
|
|
||||||
hours = 12;
|
|
||||||
} else if (hours >= 12) {
|
|
||||||
if (hours > 12) {
|
|
||||||
hours = hours - 12;
|
|
||||||
}
|
|
||||||
meridian = 'PM';
|
|
||||||
} else {
|
|
||||||
meridian = 'AM';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.hour = hours;
|
|
||||||
this.minute = minutes;
|
|
||||||
this.second = seconds;
|
|
||||||
this.meridian = meridian;
|
|
||||||
|
|
||||||
this.update();
|
|
||||||
|
|
||||||
} else if (defaultTime === false) {
|
|
||||||
this.hour = 0;
|
|
||||||
this.minute = 0;
|
|
||||||
this.second = 0;
|
|
||||||
this.meridian = 'AM';
|
|
||||||
} else {
|
|
||||||
this.setTime(defaultTime);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.updateFromElementVal();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setTime: function(time) {
|
|
||||||
var arr,
|
|
||||||
timeArray;
|
|
||||||
|
|
||||||
if (this.showMeridian) {
|
|
||||||
arr = time.split(' ');
|
|
||||||
timeArray = arr[0].split(':');
|
|
||||||
this.meridian = arr[1];
|
|
||||||
} else {
|
|
||||||
timeArray = time.split(':');
|
|
||||||
}
|
|
||||||
|
|
||||||
this.hour = parseInt(timeArray[0], 10);
|
|
||||||
this.minute = parseInt(timeArray[1], 10);
|
|
||||||
this.second = parseInt(timeArray[2], 10);
|
|
||||||
|
|
||||||
if (isNaN(this.hour)) {
|
|
||||||
this.hour = 0;
|
|
||||||
}
|
|
||||||
if (isNaN(this.minute)) {
|
|
||||||
this.minute = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.showMeridian) {
|
|
||||||
if (this.hour > 12) {
|
|
||||||
this.hour = 12;
|
|
||||||
} else if (this.hour < 1) {
|
|
||||||
this.hour = 12;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.meridian === 'am' || this.meridian === 'a') {
|
|
||||||
this.meridian = 'AM';
|
|
||||||
} else if (this.meridian === 'pm' || this.meridian === 'p') {
|
|
||||||
this.meridian = 'PM';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.meridian !== 'AM' && this.meridian !== 'PM') {
|
|
||||||
this.meridian = 'AM';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.hour >= 24) {
|
|
||||||
this.hour = 23;
|
|
||||||
} else if (this.hour < 0) {
|
|
||||||
this.hour = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.minute < 0) {
|
|
||||||
this.minute = 0;
|
|
||||||
} else if (this.minute >= 60) {
|
|
||||||
this.minute = 59;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.showSeconds) {
|
|
||||||
if (isNaN(this.second)) {
|
|
||||||
this.second = 0;
|
|
||||||
} else if (this.second < 0) {
|
|
||||||
this.second = 0;
|
|
||||||
} else if (this.second >= 60) {
|
|
||||||
this.second = 59;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
showWidget: function() {
|
|
||||||
if (this.isOpen) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.$element.is(':disabled')) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var self = this;
|
|
||||||
$(document).on('mousedown.timepicker', function (e) {
|
|
||||||
// Clicked outside the timepicker, hide it
|
|
||||||
if ($(e.target).closest('.bootstrap-timepicker-widget').length === 0) {
|
|
||||||
self.hideWidget();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$element.trigger({
|
|
||||||
'type': 'show.timepicker',
|
|
||||||
'time': {
|
|
||||||
'value': this.getTime(),
|
|
||||||
'hours': this.hour,
|
|
||||||
'minutes': this.minute,
|
|
||||||
'seconds': this.second,
|
|
||||||
'meridian': this.meridian
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (this.disableFocus) {
|
|
||||||
this.$element.blur();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateFromElementVal();
|
|
||||||
|
|
||||||
if (this.template === 'modal' && this.$widget.modal) {
|
|
||||||
this.$widget.modal('show').on('hidden', $.proxy(this.hideWidget, this));
|
|
||||||
} else {
|
|
||||||
if (this.isOpen === false) {
|
|
||||||
this.$widget.addClass('open');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isOpen = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
toggleMeridian: function() {
|
|
||||||
this.meridian = this.meridian === 'AM' ? 'PM' : 'AM';
|
|
||||||
this.update();
|
|
||||||
},
|
|
||||||
|
|
||||||
update: function() {
|
|
||||||
this.$element.trigger({
|
|
||||||
'type': 'changeTime.timepicker',
|
|
||||||
'time': {
|
|
||||||
'value': this.getTime(),
|
|
||||||
'hours': this.hour,
|
|
||||||
'minutes': this.minute,
|
|
||||||
'seconds': this.second,
|
|
||||||
'meridian': this.meridian
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.updateElement();
|
|
||||||
this.updateWidget();
|
|
||||||
},
|
|
||||||
|
|
||||||
updateElement: function() {
|
|
||||||
this.$element.val(this.getTime()).change();
|
|
||||||
},
|
|
||||||
|
|
||||||
updateFromElementVal: function() {
|
|
||||||
var val = this.$element.val();
|
|
||||||
|
|
||||||
if (val) {
|
|
||||||
this.setTime(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateWidget: function() {
|
|
||||||
if (this.$widget === false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var hour = this.hour < 10 ? '0' + this.hour : this.hour,
|
|
||||||
minute = this.minute < 10 ? '0' + this.minute : this.minute,
|
|
||||||
second = this.second < 10 ? '0' + this.second : this.second;
|
|
||||||
|
|
||||||
if (this.showInputs) {
|
|
||||||
this.$widget.find('input.bootstrap-timepicker-hour').val(hour);
|
|
||||||
this.$widget.find('input.bootstrap-timepicker-minute').val(minute);
|
|
||||||
|
|
||||||
if (this.showSeconds) {
|
|
||||||
this.$widget.find('input.bootstrap-timepicker-second').val(second);
|
|
||||||
}
|
|
||||||
if (this.showMeridian) {
|
|
||||||
this.$widget.find('input.bootstrap-timepicker-meridian').val(this.meridian);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.$widget.find('span.bootstrap-timepicker-hour').text(hour);
|
|
||||||
this.$widget.find('span.bootstrap-timepicker-minute').text(minute);
|
|
||||||
|
|
||||||
if (this.showSeconds) {
|
|
||||||
this.$widget.find('span.bootstrap-timepicker-second').text(second);
|
|
||||||
}
|
|
||||||
if (this.showMeridian) {
|
|
||||||
this.$widget.find('span.bootstrap-timepicker-meridian').text(this.meridian);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updateFromWidgetInputs: function() {
|
|
||||||
if (this.$widget === false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var time = $('input.bootstrap-timepicker-hour', this.$widget).val() + ':' +
|
|
||||||
$('input.bootstrap-timepicker-minute', this.$widget).val() +
|
|
||||||
(this.showSeconds ? ':' + $('input.bootstrap-timepicker-second', this.$widget).val() : '') +
|
|
||||||
(this.showMeridian ? ' ' + $('input.bootstrap-timepicker-meridian', this.$widget).val() : '');
|
|
||||||
|
|
||||||
this.setTime(time);
|
|
||||||
},
|
|
||||||
|
|
||||||
widgetClick: function(e) {
|
|
||||||
e.stopPropagation();
|
|
||||||
e.preventDefault();
|
|
||||||
|
|
||||||
var action = $(e.target).closest('a').data('action');
|
|
||||||
if (action) {
|
|
||||||
this[action]();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
widgetKeydown: function(e) {
|
|
||||||
var $input = $(e.target).closest('input'),
|
|
||||||
name = $input.attr('name');
|
|
||||||
|
|
||||||
switch (e.keyCode) {
|
|
||||||
case 9: //tab
|
|
||||||
if (this.showMeridian) {
|
|
||||||
if (name === 'meridian') {
|
|
||||||
return this.hideWidget();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (this.showSeconds) {
|
|
||||||
if (name === 'second') {
|
|
||||||
return this.hideWidget();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (name === 'minute') {
|
|
||||||
return this.hideWidget();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.updateFromWidgetInputs();
|
|
||||||
break;
|
|
||||||
case 27: // escape
|
|
||||||
this.hideWidget();
|
|
||||||
break;
|
|
||||||
case 38: // up arrow
|
|
||||||
e.preventDefault();
|
|
||||||
switch (name) {
|
|
||||||
case 'hour':
|
|
||||||
this.incrementHour();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
this.incrementMinute();
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
this.incrementSecond();
|
|
||||||
break;
|
|
||||||
case 'meridian':
|
|
||||||
this.toggleMeridian();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 40: // down arrow
|
|
||||||
e.preventDefault();
|
|
||||||
switch (name) {
|
|
||||||
case 'hour':
|
|
||||||
this.decrementHour();
|
|
||||||
break;
|
|
||||||
case 'minute':
|
|
||||||
this.decrementMinute();
|
|
||||||
break;
|
|
||||||
case 'second':
|
|
||||||
this.decrementSecond();
|
|
||||||
break;
|
|
||||||
case 'meridian':
|
|
||||||
this.toggleMeridian();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//TIMEPICKER PLUGIN DEFINITION
|
|
||||||
$.fn.timepicker = function(option) {
|
|
||||||
var args = Array.apply(null, arguments);
|
|
||||||
args.shift();
|
|
||||||
return this.each(function() {
|
|
||||||
var $this = $(this),
|
|
||||||
data = $this.data('timepicker'),
|
|
||||||
options = typeof option === 'object' && option;
|
|
||||||
|
|
||||||
if (!data) {
|
|
||||||
$this.data('timepicker', (data = new Timepicker(this, $.extend({}, $.fn.timepicker.defaults, options, $(this).data()))));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof option === 'string') {
|
|
||||||
data[option].apply(data, args);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.timepicker.defaults = {
|
|
||||||
defaultTime: 'current',
|
|
||||||
disableFocus: false,
|
|
||||||
isOpen: false,
|
|
||||||
minuteStep: 15,
|
|
||||||
modalBackdrop: false,
|
|
||||||
secondStep: 15,
|
|
||||||
showSeconds: false,
|
|
||||||
showInputs: true,
|
|
||||||
showMeridian: true,
|
|
||||||
template: 'dropdown',
|
|
||||||
appendWidgetTo: '.bootstrap-timepicker'
|
|
||||||
};
|
|
||||||
|
|
||||||
$.fn.timepicker.Constructor = Timepicker;
|
|
||||||
|
|
||||||
})(jQuery, window, document);
|
|
@ -1,4 +0,0 @@
|
|||||||
jQuery ->
|
|
||||||
$("a[rel=popover]").popover()
|
|
||||||
$(".tooltip").tooltip()
|
|
||||||
$("a[rel=tooltip]").tooltip()
|
|
125
app/assets/javascripts/vendor/caroussel.js
vendored
@ -1,125 +0,0 @@
|
|||||||
function size_caroussel(min,max){
|
|
||||||
if(!min){
|
|
||||||
|
|
||||||
min = 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!max){
|
|
||||||
|
|
||||||
max = 1000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(min > $(window).width()){
|
|
||||||
|
|
||||||
min = $(window).width();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var maximum = null;
|
|
||||||
|
|
||||||
$('#carousel img').each(function() {
|
|
||||||
var value = parseFloat($(this).attr('data-ratio'));
|
|
||||||
maximum = (value > maximum) ? value : maximum;
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
maw_width = parseInt($(window).width()*0.6);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(maw_width < min){
|
|
||||||
maw_width = min;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(parseInt(maw_width) > parseInt(max)){
|
|
||||||
|
|
||||||
maw_width = max;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ideal_height= parseInt(maw_width/maximum);
|
|
||||||
|
|
||||||
height=ideal_height;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#carousel img').each(function(){
|
|
||||||
ratio = $(this).width()/$(this).height();
|
|
||||||
|
|
||||||
$(this).attr("width", height*$(this).data('ratio'));
|
|
||||||
$(this).attr("height", height);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$("#carousel").trigger("configuration", {
|
|
||||||
height : height
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function getMinMarge( newItems ) {
|
|
||||||
var center = newItems.eq(0).outerWidth(true) + (newItems.eq(1).outerWidth(true) / 2);
|
|
||||||
var minMarg = ($(window).width() / 2) - center;
|
|
||||||
|
|
||||||
return minMarg;
|
|
||||||
}
|
|
||||||
function showTitle( item ) {
|
|
||||||
$('#title').html( item.attr( 'alt' ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
$(window).resize(function(){
|
|
||||||
|
|
||||||
size_caroussel();
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
$(function() {
|
|
||||||
size_caroussel();
|
|
||||||
|
|
||||||
$('#carousel').carouFredSel({
|
|
||||||
width: 10000, // should be wide enough ;)
|
|
||||||
align: false,
|
|
||||||
circular: true,
|
|
||||||
infinite: false,
|
|
||||||
items: 3,
|
|
||||||
prev: '#prev',
|
|
||||||
next: '#next',
|
|
||||||
auto: true,
|
|
||||||
scroll: {
|
|
||||||
items: 1,
|
|
||||||
duration: 1000,
|
|
||||||
onBefore: function( oldItems, newItems, newSizes, animDuration ) {
|
|
||||||
$(this).parent().animate({
|
|
||||||
'marginLeft': getMinMarge( newItems )
|
|
||||||
}, animDuration);
|
|
||||||
oldItems.eq(1).animate({
|
|
||||||
'opacity': 0.8
|
|
||||||
}, animDuration);
|
|
||||||
newItems.eq(1).animate({
|
|
||||||
'opacity': 1
|
|
||||||
}, animDuration);
|
|
||||||
showTitle( newItems.eq(1) );
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onCreate: function( items ) {
|
|
||||||
$(this).parent().css({
|
|
||||||
'marginLeft': getMinMarge( items )
|
|
||||||
});
|
|
||||||
$(this).children().not(':eq(1)').css({
|
|
||||||
'opacity': 0.8
|
|
||||||
});
|
|
||||||
showTitle( items.eq(1) );
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
74
app/assets/javascripts/vendor/filterable.js
vendored
@ -1,74 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2009 Joel Sutherland.
|
|
||||||
* Liscenced under the MIT liscense
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function($) {
|
|
||||||
$.fn.filterable = function(settings) {
|
|
||||||
settings = $.extend({
|
|
||||||
useHash: false,
|
|
||||||
animationSpeed: 1000,
|
|
||||||
show: { width: 'show', opacity: 'show' },
|
|
||||||
hide: { width: 'hide', opacity: 'hide' },
|
|
||||||
useTags: true,
|
|
||||||
tagSelector: '#portfolio-filter a',
|
|
||||||
selectedTagClass: 'current',
|
|
||||||
allTag: 'all'
|
|
||||||
}, settings);
|
|
||||||
|
|
||||||
return $(this).each(function(){
|
|
||||||
|
|
||||||
/* FILTER: select a tag and filter */
|
|
||||||
$(this).bind("filter", function( e, tagToShow ){
|
|
||||||
if(settings.useTags){
|
|
||||||
$(settings.tagSelector).removeClass(settings.selectedTagClass);
|
|
||||||
$(settings.tagSelector + '[href=' + tagToShow + ']').addClass(settings.selectedTagClass);
|
|
||||||
}
|
|
||||||
$(this).trigger("filterportfolio", [ tagToShow.substr(1) ]);
|
|
||||||
});
|
|
||||||
|
|
||||||
/* FILTERPORTFOLIO: pass in a class to show, all others will be hidden */
|
|
||||||
$(this).bind("filterportfolio", function( e, classToShow ){
|
|
||||||
if(classToShow == settings.allTag){
|
|
||||||
$(this).trigger("show");
|
|
||||||
}else{
|
|
||||||
$(this).trigger("show", [ '.' + classToShow ] );
|
|
||||||
$(this).trigger("hide", [ ':not(.' + classToShow + ')' ] );
|
|
||||||
}
|
|
||||||
if(settings.useHash){
|
|
||||||
location.hash = '#' + classToShow;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/* SHOW: show a single class*/
|
|
||||||
$(this).bind("show", function( e, selectorToShow ){
|
|
||||||
$(this).children(selectorToShow).animate(settings.show, settings.animationSpeed);
|
|
||||||
});
|
|
||||||
|
|
||||||
/* SHOW: hide a single class*/
|
|
||||||
$(this).bind("hide", function( e, selectorToHide ){
|
|
||||||
$(this).children(selectorToHide).animate(settings.hide, settings.animationSpeed);
|
|
||||||
});
|
|
||||||
|
|
||||||
/* ============ Check URL Hash ====================*/
|
|
||||||
if(settings.useHash){
|
|
||||||
if(location.hash != '')
|
|
||||||
$(this).trigger("filter", [ location.hash ]);
|
|
||||||
else
|
|
||||||
$(this).trigger("filter", [ '#' + settings.allTag ]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ============ Setup Tags ====================*/
|
|
||||||
if(settings.useTags){
|
|
||||||
$(settings.tagSelector).click(function(){
|
|
||||||
$('#portfolio-list').trigger("filter", [ $(this).attr('href') ]);
|
|
||||||
|
|
||||||
$(settings.tagSelector).removeClass('current');
|
|
||||||
$(this).addClass('current');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})(jQuery);
|
|
||||||
|
|
||||||
|
|
@ -376,9 +376,9 @@
|
|||||||
},
|
},
|
||||||
distanceMet: function (e) {
|
distanceMet: function (e) {
|
||||||
return (Math.max(
|
return (Math.max(
|
||||||
Math.abs(this.pointer.left - e.pageX),
|
Math.abs(this.pointer.left - e.pageX),
|
||||||
Math.abs(this.pointer.top - e.pageY)
|
Math.abs(this.pointer.top - e.pageY)
|
||||||
) >= this.options.distance)
|
) >= this.options.distance)
|
||||||
},
|
},
|
||||||
addContainer: function (container) {
|
addContainer: function (container) {
|
||||||
this.containers.push(container);
|
this.containers.push(container);
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
/* http://keith-wood.name/backgroundPos.html
|
|
||||||
Background position animation for jQuery v1.1.1.
|
|
||||||
Written by Keith Wood (kbwood{at}iinet.com.au) November 2010.
|
|
||||||
Available under the MIT (https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt) license.
|
|
||||||
Please attribute the author if you use it. */
|
|
||||||
|
|
||||||
(function($) { // Hide scope, no $ conflict
|
|
||||||
|
|
||||||
var usesTween = !!$.Tween;
|
|
||||||
|
|
||||||
if (usesTween) { // jQuery 1.8+
|
|
||||||
$.Tween.propHooks['backgroundPosition'] = {
|
|
||||||
get: function(tween) {
|
|
||||||
return parseBackgroundPosition($(tween.elem).css(tween.prop));
|
|
||||||
},
|
|
||||||
set: setBackgroundPosition
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else { // jQuery 1.7-
|
|
||||||
// Enable animation for the background-position attribute
|
|
||||||
$.fx.step['backgroundPosition'] = setBackgroundPosition;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Parse a background-position definition: horizontal [vertical]
|
|
||||||
@param value (string) the definition
|
|
||||||
@return ([2][string, number, string]) the extracted values - relative marker, amount, units */
|
|
||||||
function parseBackgroundPosition(value) {
|
|
||||||
var bgPos = (value || '').split(/ /);
|
|
||||||
var presets = {center: '50%', left: '0%', right: '100%', top: '0%', bottom: '100%'};
|
|
||||||
var decodePos = function(index) {
|
|
||||||
var pos = (presets[bgPos[index]] || bgPos[index] || '50%').
|
|
||||||
match(/^([+-]=)?([+-]?\d+(\.\d*)?)(.*)$/);
|
|
||||||
bgPos[index] = [pos[1], parseFloat(pos[2]), pos[4] || 'px'];
|
|
||||||
};
|
|
||||||
if (bgPos.length == 1 && $.inArray(bgPos[0], ['top', 'bottom']) > -1) {
|
|
||||||
bgPos[1] = bgPos[0];
|
|
||||||
bgPos[0] = '50%';
|
|
||||||
}
|
|
||||||
decodePos(0);
|
|
||||||
decodePos(1);
|
|
||||||
return bgPos;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the value for a step in the animation.
|
|
||||||
@param tween (object) the animation properties */
|
|
||||||
function setBackgroundPosition(tween) {
|
|
||||||
if (!tween.set) {
|
|
||||||
initBackgroundPosition(tween);
|
|
||||||
}
|
|
||||||
$(tween.elem).css('background-position',
|
|
||||||
((tween.pos * (tween.end[0][1] - tween.start[0][1]) + tween.start[0][1]) + tween.end[0][2]) + ' ' +
|
|
||||||
((tween.pos * (tween.end[1][1] - tween.start[1][1]) + tween.start[1][1]) + tween.end[1][2]));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialise the animation.
|
|
||||||
@param tween (object) the animation properties */
|
|
||||||
function initBackgroundPosition(tween) {
|
|
||||||
tween.start = parseBackgroundPosition($(tween.elem).css('backgroundPosition'));
|
|
||||||
tween.end = parseBackgroundPosition(tween.end);
|
|
||||||
for (var i = 0; i < tween.end.length; i++) {
|
|
||||||
if (tween.end[i][0]) { // Relative position
|
|
||||||
tween.end[i][1] = tween.start[i][1] + (tween.end[i][0] == '-=' ? -1 : +1) * tween.end[i][1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tween.set = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
})(jQuery);
|
|
205
app/assets/javascripts/vendor/jquery.easing.1.3.js
vendored
@ -1,205 +0,0 @@
|
|||||||
/*
|
|
||||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
|
||||||
*
|
|
||||||
* Uses the built in easing capabilities added In jQuery 1.1
|
|
||||||
* to offer multiple easing options
|
|
||||||
*
|
|
||||||
* TERMS OF USE - jQuery Easing
|
|
||||||
*
|
|
||||||
* Open source under the BSD License.
|
|
||||||
*
|
|
||||||
* Copyright © 2008 George McGinley Smith
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
|
||||||
* or promote products derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
||||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
|
||||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
|
||||||
|
|
||||||
jQuery.extend( jQuery.easing,
|
|
||||||
{
|
|
||||||
def: 'easeOutQuad',
|
|
||||||
swing: function (x, t, b, c, d) {
|
|
||||||
//alert(jQuery.easing.default);
|
|
||||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
|
||||||
},
|
|
||||||
easeInQuad: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t + b;
|
|
||||||
},
|
|
||||||
easeOutQuad: function (x, t, b, c, d) {
|
|
||||||
return -c *(t/=d)*(t-2) + b;
|
|
||||||
},
|
|
||||||
easeInOutQuad: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
|
||||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
|
||||||
},
|
|
||||||
easeInCubic: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t*t + b;
|
|
||||||
},
|
|
||||||
easeOutCubic: function (x, t, b, c, d) {
|
|
||||||
return c*((t=t/d-1)*t*t + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutCubic: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
|
||||||
return c/2*((t-=2)*t*t + 2) + b;
|
|
||||||
},
|
|
||||||
easeInQuart: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t*t*t + b;
|
|
||||||
},
|
|
||||||
easeOutQuart: function (x, t, b, c, d) {
|
|
||||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutQuart: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
|
||||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
|
||||||
},
|
|
||||||
easeInQuint: function (x, t, b, c, d) {
|
|
||||||
return c*(t/=d)*t*t*t*t + b;
|
|
||||||
},
|
|
||||||
easeOutQuint: function (x, t, b, c, d) {
|
|
||||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutQuint: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
|
||||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
|
||||||
},
|
|
||||||
easeInSine: function (x, t, b, c, d) {
|
|
||||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
|
||||||
},
|
|
||||||
easeOutSine: function (x, t, b, c, d) {
|
|
||||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
|
||||||
},
|
|
||||||
easeInOutSine: function (x, t, b, c, d) {
|
|
||||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
|
||||||
},
|
|
||||||
easeInExpo: function (x, t, b, c, d) {
|
|
||||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
|
||||||
},
|
|
||||||
easeOutExpo: function (x, t, b, c, d) {
|
|
||||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutExpo: function (x, t, b, c, d) {
|
|
||||||
if (t==0) return b;
|
|
||||||
if (t==d) return b+c;
|
|
||||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
|
||||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
|
||||||
},
|
|
||||||
easeInCirc: function (x, t, b, c, d) {
|
|
||||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
|
||||||
},
|
|
||||||
easeOutCirc: function (x, t, b, c, d) {
|
|
||||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
|
||||||
},
|
|
||||||
easeInOutCirc: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
|
||||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
|
||||||
},
|
|
||||||
easeInElastic: function (x, t, b, c, d) {
|
|
||||||
var s=1.70158;var p=0;var a=c;
|
|
||||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
|
||||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
|
||||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
|
||||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
|
||||||
},
|
|
||||||
easeOutElastic: function (x, t, b, c, d) {
|
|
||||||
var s=1.70158;var p=0;var a=c;
|
|
||||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
|
||||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
|
||||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
|
||||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
|
||||||
},
|
|
||||||
easeInOutElastic: function (x, t, b, c, d) {
|
|
||||||
var s=1.70158;var p=0;var a=c;
|
|
||||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
|
||||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
|
||||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
|
||||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
|
||||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
|
||||||
},
|
|
||||||
easeInBack: function (x, t, b, c, d, s) {
|
|
||||||
if (s == undefined) s = 1.70158;
|
|
||||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
|
||||||
},
|
|
||||||
easeOutBack: function (x, t, b, c, d, s) {
|
|
||||||
if (s == undefined) s = 1.70158;
|
|
||||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
|
||||||
},
|
|
||||||
easeInOutBack: function (x, t, b, c, d, s) {
|
|
||||||
if (s == undefined) s = 1.70158;
|
|
||||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
|
||||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
|
||||||
},
|
|
||||||
easeInBounce: function (x, t, b, c, d) {
|
|
||||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
|
||||||
},
|
|
||||||
easeOutBounce: function (x, t, b, c, d) {
|
|
||||||
if ((t/=d) < (1/2.75)) {
|
|
||||||
return c*(7.5625*t*t) + b;
|
|
||||||
} else if (t < (2/2.75)) {
|
|
||||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
|
||||||
} else if (t < (2.5/2.75)) {
|
|
||||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
|
||||||
} else {
|
|
||||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
easeInOutBounce: function (x, t, b, c, d) {
|
|
||||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
|
||||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
*
|
|
||||||
* TERMS OF USE - EASING EQUATIONS
|
|
||||||
*
|
|
||||||
* Open source under the BSD License.
|
|
||||||
*
|
|
||||||
* Copyright © 2001 Robert Penner
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
* are permitted provided that the following conditions are met:
|
|
||||||
*
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this list of
|
|
||||||
* conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
|
||||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
|
||||||
* provided with the distribution.
|
|
||||||
*
|
|
||||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
|
||||||
* or promote products derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
||||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
||||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
|
||||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
||||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
||||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
||||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*
|
|
||||||
*/
|
|
716
app/assets/javascripts/vendor/jquery.event.drag.js
vendored
@ -11,17 +11,17 @@
|
|||||||
|
|
||||||
// add the jquery instance method
|
// add the jquery instance method
|
||||||
$.fn.drag = function( str, arg, opts ){
|
$.fn.drag = function( str, arg, opts ){
|
||||||
// figure out the event type
|
// figure out the event type
|
||||||
var type = typeof str == "string" ? str : "",
|
var type = typeof str == "string" ? str : "",
|
||||||
// figure out the event handler...
|
// figure out the event handler...
|
||||||
fn = $.isFunction( str ) ? str : $.isFunction( arg ) ? arg : null;
|
fn = $.isFunction( str ) ? str : $.isFunction( arg ) ? arg : null;
|
||||||
// fix the event type
|
// fix the event type
|
||||||
if ( type.indexOf("drag") !== 0 )
|
if ( type.indexOf("drag") !== 0 )
|
||||||
type = "drag"+ type;
|
type = "drag"+ type;
|
||||||
// were options passed
|
// were options passed
|
||||||
opts = ( str == fn ? arg : opts ) || {};
|
opts = ( str == fn ? arg : opts ) || {};
|
||||||
// trigger or bind event handler
|
// trigger or bind event handler
|
||||||
return fn ? this.bind( type, opts, fn ) : this.trigger( type );
|
return fn ? this.bind( type, opts, fn ) : this.trigger( type );
|
||||||
};
|
};
|
||||||
|
|
||||||
// local refs (increase compression)
|
// local refs (increase compression)
|
||||||
@ -29,349 +29,349 @@ var $event = $.event,
|
|||||||
$special = $event.special,
|
$special = $event.special,
|
||||||
// configure the drag special event
|
// configure the drag special event
|
||||||
drag = $special.drag = {
|
drag = $special.drag = {
|
||||||
|
|
||||||
// these are the default settings
|
// these are the default settings
|
||||||
defaults: {
|
defaults: {
|
||||||
which: 1, // mouse button pressed to start drag sequence
|
which: 1, // mouse button pressed to start drag sequence
|
||||||
distance: 0, // distance dragged before dragstart
|
distance: 0, // distance dragged before dragstart
|
||||||
not: ':input', // selector to suppress dragging on target elements
|
not: ':input', // selector to suppress dragging on target elements
|
||||||
handle: null, // selector to match handle target elements
|
handle: null, // selector to match handle target elements
|
||||||
relative: false, // true to use "position", false to use "offset"
|
relative: false, // true to use "position", false to use "offset"
|
||||||
drop: true, // false to suppress drop events, true or selector to allow
|
drop: true, // false to suppress drop events, true or selector to allow
|
||||||
click: false // false to suppress click events after dragend (no proxy)
|
click: false // false to suppress click events after dragend (no proxy)
|
||||||
},
|
},
|
||||||
|
|
||||||
// the key name for stored drag data
|
// the key name for stored drag data
|
||||||
datakey: "dragdata",
|
datakey: "dragdata",
|
||||||
|
|
||||||
// prevent bubbling for better performance
|
// prevent bubbling for better performance
|
||||||
noBubble: true,
|
noBubble: true,
|
||||||
|
|
||||||
// count bound related events
|
// count bound related events
|
||||||
add: function( obj ){
|
add: function( obj ){
|
||||||
// read the interaction data
|
// read the interaction data
|
||||||
var data = $.data( this, drag.datakey ),
|
var data = $.data( this, drag.datakey ),
|
||||||
// read any passed options
|
// read any passed options
|
||||||
opts = obj.data || {};
|
opts = obj.data || {};
|
||||||
// count another realted event
|
// count another realted event
|
||||||
data.related += 1;
|
data.related += 1;
|
||||||
// extend data options bound with this event
|
// extend data options bound with this event
|
||||||
// don't iterate "opts" in case it is a node
|
// don't iterate "opts" in case it is a node
|
||||||
$.each( drag.defaults, function( key, def ){
|
$.each( drag.defaults, function( key, def ){
|
||||||
if ( opts[ key ] !== undefined )
|
if ( opts[ key ] !== undefined )
|
||||||
data[ key ] = opts[ key ];
|
data[ key ] = opts[ key ];
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// forget unbound related events
|
// forget unbound related events
|
||||||
remove: function(){
|
remove: function(){
|
||||||
$.data( this, drag.datakey ).related -= 1;
|
$.data( this, drag.datakey ).related -= 1;
|
||||||
},
|
},
|
||||||
|
|
||||||
// configure interaction, capture settings
|
// configure interaction, capture settings
|
||||||
setup: function(){
|
setup: function(){
|
||||||
// check for related events
|
// check for related events
|
||||||
if ( $.data( this, drag.datakey ) )
|
if ( $.data( this, drag.datakey ) )
|
||||||
return;
|
return;
|
||||||
// initialize the drag data with copied defaults
|
// initialize the drag data with copied defaults
|
||||||
var data = $.extend({ related:0 }, drag.defaults );
|
var data = $.extend({ related:0 }, drag.defaults );
|
||||||
// store the interaction data
|
// store the interaction data
|
||||||
$.data( this, drag.datakey, data );
|
$.data( this, drag.datakey, data );
|
||||||
// bind the mousedown event, which starts drag interactions
|
// bind the mousedown event, which starts drag interactions
|
||||||
$event.add( this, "touchstart mousedown", drag.init, data );
|
$event.add( this, "touchstart mousedown", drag.init, data );
|
||||||
// prevent image dragging in IE...
|
// prevent image dragging in IE...
|
||||||
if ( this.attachEvent )
|
if ( this.attachEvent )
|
||||||
this.attachEvent("ondragstart", drag.dontstart );
|
this.attachEvent("ondragstart", drag.dontstart );
|
||||||
},
|
},
|
||||||
|
|
||||||
// destroy configured interaction
|
// destroy configured interaction
|
||||||
teardown: function(){
|
teardown: function(){
|
||||||
var data = $.data( this, drag.datakey ) || {};
|
var data = $.data( this, drag.datakey ) || {};
|
||||||
// check for related events
|
// check for related events
|
||||||
if ( data.related )
|
if ( data.related )
|
||||||
return;
|
return;
|
||||||
// remove the stored data
|
// remove the stored data
|
||||||
$.removeData( this, drag.datakey );
|
$.removeData( this, drag.datakey );
|
||||||
// remove the mousedown event
|
// remove the mousedown event
|
||||||
$event.remove( this, "touchstart mousedown", drag.init );
|
$event.remove( this, "touchstart mousedown", drag.init );
|
||||||
// enable text selection
|
// enable text selection
|
||||||
drag.textselect( true );
|
drag.textselect( true );
|
||||||
// un-prevent image dragging in IE...
|
// un-prevent image dragging in IE...
|
||||||
if ( this.detachEvent )
|
if ( this.detachEvent )
|
||||||
this.detachEvent("ondragstart", drag.dontstart );
|
this.detachEvent("ondragstart", drag.dontstart );
|
||||||
},
|
},
|
||||||
|
|
||||||
// initialize the interaction
|
// initialize the interaction
|
||||||
init: function( event ){
|
init: function( event ){
|
||||||
// sorry, only one touch at a time
|
// sorry, only one touch at a time
|
||||||
if ( drag.touched )
|
if ( drag.touched )
|
||||||
return;
|
return;
|
||||||
// the drag/drop interaction data
|
// the drag/drop interaction data
|
||||||
var dd = event.data, results;
|
var dd = event.data, results;
|
||||||
// check the which directive
|
// check the which directive
|
||||||
if ( event.which != 0 && dd.which > 0 && event.which != dd.which )
|
if ( event.which != 0 && dd.which > 0 && event.which != dd.which )
|
||||||
return;
|
return;
|
||||||
// check for suppressed selector
|
// check for suppressed selector
|
||||||
if ( $( event.target ).is( dd.not ) )
|
if ( $( event.target ).is( dd.not ) )
|
||||||
return;
|
return;
|
||||||
// check for handle selector
|
// check for handle selector
|
||||||
if ( dd.handle && !$( event.target ).closest( dd.handle, event.currentTarget ).length )
|
if ( dd.handle && !$( event.target ).closest( dd.handle, event.currentTarget ).length )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
drag.touched = event.type == 'touchstart' ? this : null;
|
drag.touched = event.type == 'touchstart' ? this : null;
|
||||||
dd.propagates = 1;
|
dd.propagates = 1;
|
||||||
dd.mousedown = this;
|
dd.mousedown = this;
|
||||||
dd.interactions = [ drag.interaction( this, dd ) ];
|
dd.interactions = [ drag.interaction( this, dd ) ];
|
||||||
dd.target = event.target;
|
dd.target = event.target;
|
||||||
dd.pageX = event.pageX;
|
dd.pageX = event.pageX;
|
||||||
dd.pageY = event.pageY;
|
dd.pageY = event.pageY;
|
||||||
dd.dragging = null;
|
dd.dragging = null;
|
||||||
// handle draginit event...
|
// handle draginit event...
|
||||||
results = drag.hijack( event, "draginit", dd );
|
results = drag.hijack( event, "draginit", dd );
|
||||||
// early cancel
|
// early cancel
|
||||||
if ( !dd.propagates )
|
if ( !dd.propagates )
|
||||||
return;
|
return;
|
||||||
// flatten the result set
|
// flatten the result set
|
||||||
results = drag.flatten( results );
|
results = drag.flatten( results );
|
||||||
// insert new interaction elements
|
// insert new interaction elements
|
||||||
if ( results && results.length ){
|
if ( results && results.length ){
|
||||||
dd.interactions = [];
|
dd.interactions = [];
|
||||||
$.each( results, function(){
|
$.each( results, function(){
|
||||||
dd.interactions.push( drag.interaction( this, dd ) );
|
dd.interactions.push( drag.interaction( this, dd ) );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// remember how many interactions are propagating
|
// remember how many interactions are propagating
|
||||||
dd.propagates = dd.interactions.length;
|
dd.propagates = dd.interactions.length;
|
||||||
// locate and init the drop targets
|
// locate and init the drop targets
|
||||||
if ( dd.drop !== false && $special.drop )
|
if ( dd.drop !== false && $special.drop )
|
||||||
$special.drop.handler( event, dd );
|
$special.drop.handler( event, dd );
|
||||||
// disable text selection
|
// disable text selection
|
||||||
drag.textselect( false );
|
drag.textselect( false );
|
||||||
// bind additional events...
|
// bind additional events...
|
||||||
if ( drag.touched )
|
if ( drag.touched )
|
||||||
$event.add( drag.touched, "touchmove touchend", drag.handler, dd );
|
$event.add( drag.touched, "touchmove touchend", drag.handler, dd );
|
||||||
else
|
else
|
||||||
$event.add( document, "mousemove mouseup", drag.handler, dd );
|
$event.add( document, "mousemove mouseup", drag.handler, dd );
|
||||||
// helps prevent text selection or scrolling
|
// helps prevent text selection or scrolling
|
||||||
if ( !drag.touched || dd.live )
|
if ( !drag.touched || dd.live )
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// returns an interaction object
|
// returns an interaction object
|
||||||
interaction: function( elem, dd ){
|
interaction: function( elem, dd ){
|
||||||
var offset = $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 };
|
var offset = $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 };
|
||||||
return {
|
return {
|
||||||
drag: elem,
|
drag: elem,
|
||||||
callback: new drag.callback(),
|
callback: new drag.callback(),
|
||||||
droppable: [],
|
droppable: [],
|
||||||
offset: offset
|
offset: offset
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// handle drag-releatd DOM events
|
// handle drag-releatd DOM events
|
||||||
handler: function( event ){
|
handler: function( event ){
|
||||||
// read the data before hijacking anything
|
// read the data before hijacking anything
|
||||||
var dd = event.data;
|
var dd = event.data;
|
||||||
// handle various events
|
// handle various events
|
||||||
switch ( event.type ){
|
switch ( event.type ){
|
||||||
// mousemove, check distance, start dragging
|
// mousemove, check distance, start dragging
|
||||||
case !dd.dragging && 'touchmove':
|
case !dd.dragging && 'touchmove':
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
case !dd.dragging && 'mousemove':
|
case !dd.dragging && 'mousemove':
|
||||||
// drag tolerance, x² + y² = distance²
|
// drag tolerance, x² + y² = distance²
|
||||||
if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) )
|
if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) )
|
||||||
break; // distance tolerance not reached
|
break; // distance tolerance not reached
|
||||||
event.target = dd.target; // force target from "mousedown" event (fix distance issue)
|
event.target = dd.target; // force target from "mousedown" event (fix distance issue)
|
||||||
drag.hijack( event, "dragstart", dd ); // trigger "dragstart"
|
drag.hijack( event, "dragstart", dd ); // trigger "dragstart"
|
||||||
if ( dd.propagates ) // "dragstart" not rejected
|
if ( dd.propagates ) // "dragstart" not rejected
|
||||||
dd.dragging = true; // activate interaction
|
dd.dragging = true; // activate interaction
|
||||||
// mousemove, dragging
|
// mousemove, dragging
|
||||||
case 'touchmove':
|
case 'touchmove':
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
case 'mousemove':
|
case 'mousemove':
|
||||||
if ( dd.dragging ){
|
if ( dd.dragging ){
|
||||||
// trigger "drag"
|
// trigger "drag"
|
||||||
drag.hijack( event, "drag", dd );
|
drag.hijack( event, "drag", dd );
|
||||||
if ( dd.propagates ){
|
if ( dd.propagates ){
|
||||||
// manage drop events
|
// manage drop events
|
||||||
if ( dd.drop !== false && $special.drop )
|
if ( dd.drop !== false && $special.drop )
|
||||||
$special.drop.handler( event, dd ); // "dropstart", "dropend"
|
$special.drop.handler( event, dd ); // "dropstart", "dropend"
|
||||||
break; // "drag" not rejected, stop
|
break; // "drag" not rejected, stop
|
||||||
}
|
}
|
||||||
event.type = "mouseup"; // helps "drop" handler behave
|
event.type = "mouseup"; // helps "drop" handler behave
|
||||||
}
|
}
|
||||||
// mouseup, stop dragging
|
// mouseup, stop dragging
|
||||||
case 'touchend':
|
case 'touchend':
|
||||||
case 'mouseup':
|
case 'mouseup':
|
||||||
default:
|
default:
|
||||||
if ( drag.touched )
|
if ( drag.touched )
|
||||||
$event.remove( drag.touched, "touchmove touchend", drag.handler ); // remove touch events
|
$event.remove( drag.touched, "touchmove touchend", drag.handler ); // remove touch events
|
||||||
else
|
else
|
||||||
$event.remove( document, "mousemove mouseup", drag.handler ); // remove page events
|
$event.remove( document, "mousemove mouseup", drag.handler ); // remove page events
|
||||||
if ( dd.dragging ){
|
if ( dd.dragging ){
|
||||||
if ( dd.drop !== false && $special.drop )
|
if ( dd.drop !== false && $special.drop )
|
||||||
$special.drop.handler( event, dd ); // "drop"
|
$special.drop.handler( event, dd ); // "drop"
|
||||||
drag.hijack( event, "dragend", dd ); // trigger "dragend"
|
drag.hijack( event, "dragend", dd ); // trigger "dragend"
|
||||||
}
|
}
|
||||||
drag.textselect( true ); // enable text selection
|
drag.textselect( true ); // enable text selection
|
||||||
// if suppressing click events...
|
// if suppressing click events...
|
||||||
if ( dd.click === false && dd.dragging )
|
if ( dd.click === false && dd.dragging )
|
||||||
$.data( dd.mousedown, "suppress.click", new Date().getTime() + 5 );
|
$.data( dd.mousedown, "suppress.click", new Date().getTime() + 5 );
|
||||||
dd.dragging = drag.touched = false; // deactivate element
|
dd.dragging = drag.touched = false; // deactivate element
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// re-use event object for custom events
|
// re-use event object for custom events
|
||||||
hijack: function( event, type, dd, x, elem ){
|
hijack: function( event, type, dd, x, elem ){
|
||||||
// not configured
|
// not configured
|
||||||
if ( !dd )
|
if ( !dd )
|
||||||
return;
|
return;
|
||||||
// remember the original event and type
|
// remember the original event and type
|
||||||
var orig = { event:event.originalEvent, type:event.type },
|
var orig = { event:event.originalEvent, type:event.type },
|
||||||
// is the event drag related or drog related?
|
// is the event drag related or drog related?
|
||||||
mode = type.indexOf("drop") ? "drag" : "drop",
|
mode = type.indexOf("drop") ? "drag" : "drop",
|
||||||
// iteration vars
|
// iteration vars
|
||||||
result, i = x || 0, ia, $elems, callback,
|
result, i = x || 0, ia, $elems, callback,
|
||||||
len = !isNaN( x ) ? x : dd.interactions.length;
|
len = !isNaN( x ) ? x : dd.interactions.length;
|
||||||
// modify the event type
|
// modify the event type
|
||||||
event.type = type;
|
event.type = type;
|
||||||
// remove the original event
|
// remove the original event
|
||||||
event.originalEvent = null;
|
event.originalEvent = null;
|
||||||
// initialize the results
|
// initialize the results
|
||||||
dd.results = [];
|
dd.results = [];
|
||||||
// handle each interacted element
|
// handle each interacted element
|
||||||
do if ( ia = dd.interactions[ i ] ){
|
do if ( ia = dd.interactions[ i ] ){
|
||||||
// validate the interaction
|
// validate the interaction
|
||||||
if ( type !== "dragend" && ia.cancelled )
|
if ( type !== "dragend" && ia.cancelled )
|
||||||
continue;
|
continue;
|
||||||
// set the dragdrop properties on the event object
|
// set the dragdrop properties on the event object
|
||||||
callback = drag.properties( event, dd, ia );
|
callback = drag.properties( event, dd, ia );
|
||||||
// prepare for more results
|
// prepare for more results
|
||||||
ia.results = [];
|
ia.results = [];
|
||||||
// handle each element
|
// handle each element
|
||||||
$( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){
|
$( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){
|
||||||
// identify drag or drop targets individually
|
// identify drag or drop targets individually
|
||||||
callback.target = subject;
|
callback.target = subject;
|
||||||
// force propagtion of the custom event
|
// force propagtion of the custom event
|
||||||
event.isPropagationStopped = function(){ return false; };
|
event.isPropagationStopped = function(){ return false; };
|
||||||
// handle the event
|
// handle the event
|
||||||
result = subject ? $event.dispatch.call( subject, event, callback ) : null;
|
result = subject ? $event.dispatch.call( subject, event, callback ) : null;
|
||||||
// stop the drag interaction for this element
|
// stop the drag interaction for this element
|
||||||
if ( result === false ){
|
if ( result === false ){
|
||||||
if ( mode == "drag" ){
|
if ( mode == "drag" ){
|
||||||
ia.cancelled = true;
|
ia.cancelled = true;
|
||||||
dd.propagates -= 1;
|
dd.propagates -= 1;
|
||||||
}
|
}
|
||||||
if ( type == "drop" ){
|
if ( type == "drop" ){
|
||||||
ia[ mode ][p] = null;
|
ia[ mode ][p] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// assign any dropinit elements
|
// assign any dropinit elements
|
||||||
else if ( type == "dropinit" )
|
else if ( type == "dropinit" )
|
||||||
ia.droppable.push( drag.element( result ) || subject );
|
ia.droppable.push( drag.element( result ) || subject );
|
||||||
// accept a returned proxy element
|
// accept a returned proxy element
|
||||||
if ( type == "dragstart" )
|
if ( type == "dragstart" )
|
||||||
ia.proxy = $( drag.element( result ) || ia.drag )[0];
|
ia.proxy = $( drag.element( result ) || ia.drag )[0];
|
||||||
// remember this result
|
// remember this result
|
||||||
ia.results.push( result );
|
ia.results.push( result );
|
||||||
// forget the event result, for recycling
|
// forget the event result, for recycling
|
||||||
delete event.result;
|
delete event.result;
|
||||||
// break on cancelled handler
|
// break on cancelled handler
|
||||||
if ( type !== "dropinit" )
|
if ( type !== "dropinit" )
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
// flatten the results
|
// flatten the results
|
||||||
dd.results[ i ] = drag.flatten( ia.results );
|
dd.results[ i ] = drag.flatten( ia.results );
|
||||||
// accept a set of valid drop targets
|
// accept a set of valid drop targets
|
||||||
if ( type == "dropinit" )
|
if ( type == "dropinit" )
|
||||||
ia.droppable = drag.flatten( ia.droppable );
|
ia.droppable = drag.flatten( ia.droppable );
|
||||||
// locate drop targets
|
// locate drop targets
|
||||||
if ( type == "dragstart" && !ia.cancelled )
|
if ( type == "dragstart" && !ia.cancelled )
|
||||||
callback.update();
|
callback.update();
|
||||||
}
|
}
|
||||||
while ( ++i < len )
|
while ( ++i < len )
|
||||||
// restore the original event & type
|
// restore the original event & type
|
||||||
event.type = orig.type;
|
event.type = orig.type;
|
||||||
event.originalEvent = orig.event;
|
event.originalEvent = orig.event;
|
||||||
// return all handler results
|
// return all handler results
|
||||||
return drag.flatten( dd.results );
|
return drag.flatten( dd.results );
|
||||||
},
|
},
|
||||||
|
|
||||||
// extend the callback object with drag/drop properties...
|
// extend the callback object with drag/drop properties...
|
||||||
properties: function( event, dd, ia ){
|
properties: function( event, dd, ia ){
|
||||||
var obj = ia.callback;
|
var obj = ia.callback;
|
||||||
// elements
|
// elements
|
||||||
obj.drag = ia.drag;
|
obj.drag = ia.drag;
|
||||||
obj.proxy = ia.proxy || ia.drag;
|
obj.proxy = ia.proxy || ia.drag;
|
||||||
// starting mouse position
|
// starting mouse position
|
||||||
obj.startX = dd.pageX;
|
obj.startX = dd.pageX;
|
||||||
obj.startY = dd.pageY;
|
obj.startY = dd.pageY;
|
||||||
// current distance dragged
|
// current distance dragged
|
||||||
obj.deltaX = event.pageX - dd.pageX;
|
obj.deltaX = event.pageX - dd.pageX;
|
||||||
obj.deltaY = event.pageY - dd.pageY;
|
obj.deltaY = event.pageY - dd.pageY;
|
||||||
// original element position
|
// original element position
|
||||||
obj.originalX = ia.offset.left;
|
obj.originalX = ia.offset.left;
|
||||||
obj.originalY = ia.offset.top;
|
obj.originalY = ia.offset.top;
|
||||||
// adjusted element position
|
// adjusted element position
|
||||||
obj.offsetX = obj.originalX + obj.deltaX;
|
obj.offsetX = obj.originalX + obj.deltaX;
|
||||||
obj.offsetY = obj.originalY + obj.deltaY;
|
obj.offsetY = obj.originalY + obj.deltaY;
|
||||||
// assign the drop targets information
|
// assign the drop targets information
|
||||||
obj.drop = drag.flatten( ( ia.drop || [] ).slice() );
|
obj.drop = drag.flatten( ( ia.drop || [] ).slice() );
|
||||||
obj.available = drag.flatten( ( ia.droppable || [] ).slice() );
|
obj.available = drag.flatten( ( ia.droppable || [] ).slice() );
|
||||||
return obj;
|
return obj;
|
||||||
},
|
},
|
||||||
|
|
||||||
// determine is the argument is an element or jquery instance
|
// determine is the argument is an element or jquery instance
|
||||||
element: function( arg ){
|
element: function( arg ){
|
||||||
if ( arg && ( arg.jquery || arg.nodeType == 1 ) )
|
if ( arg && ( arg.jquery || arg.nodeType == 1 ) )
|
||||||
return arg;
|
return arg;
|
||||||
},
|
},
|
||||||
|
|
||||||
// flatten nested jquery objects and arrays into a single dimension array
|
// flatten nested jquery objects and arrays into a single dimension array
|
||||||
flatten: function( arr ){
|
flatten: function( arr ){
|
||||||
return $.map( arr, function( member ){
|
return $.map( arr, function( member ){
|
||||||
return member && member.jquery ? $.makeArray( member ) :
|
return member && member.jquery ? $.makeArray( member ) :
|
||||||
member && member.length ? drag.flatten( member ) : member;
|
member && member.length ? drag.flatten( member ) : member;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// toggles text selection attributes ON (true) or OFF (false)
|
// toggles text selection attributes ON (true) or OFF (false)
|
||||||
textselect: function( bool ){
|
textselect: function( bool ){
|
||||||
$( document )[ bool ? "unbind" : "bind" ]("selectstart", drag.dontstart )
|
$( document )[ bool ? "unbind" : "bind" ]("selectstart", drag.dontstart )
|
||||||
.css("MozUserSelect", bool ? "" : "none" );
|
.css("MozUserSelect", bool ? "" : "none" );
|
||||||
// .attr("unselectable", bool ? "off" : "on" )
|
// .attr("unselectable", bool ? "off" : "on" )
|
||||||
document.unselectable = bool ? "off" : "on";
|
document.unselectable = bool ? "off" : "on";
|
||||||
},
|
},
|
||||||
|
|
||||||
// suppress "selectstart" and "ondragstart" events
|
// suppress "selectstart" and "ondragstart" events
|
||||||
dontstart: function(){
|
dontstart: function(){
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
// a callback instance contructor
|
// a callback instance contructor
|
||||||
callback: function(){}
|
callback: function(){}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// callback methods
|
// callback methods
|
||||||
drag.callback.prototype = {
|
drag.callback.prototype = {
|
||||||
update: function(){
|
update: function(){
|
||||||
if ( $special.drop && this.available.length )
|
if ( $special.drop && this.available.length )
|
||||||
$.each( this.available, function( i ){
|
$.each( this.available, function( i ){
|
||||||
$special.drop.locate( this, i );
|
$special.drop.locate( this, i );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// patch $.event.$dispatch to allow suppressing clicks
|
// patch $.event.$dispatch to allow suppressing clicks
|
||||||
var $dispatch = $event.dispatch;
|
var $dispatch = $event.dispatch;
|
||||||
$event.dispatch = function( event ){
|
$event.dispatch = function( event ){
|
||||||
if ( $.data( this, "suppress."+ event.type ) - new Date().getTime() > 0 ){
|
if ( $.data( this, "suppress."+ event.type ) - new Date().getTime() > 0 ){
|
||||||
$.removeData( this, "suppress."+ event.type );
|
$.removeData( this, "suppress."+ event.type );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return $dispatch.apply( this, arguments );
|
return $dispatch.apply( this, arguments );
|
||||||
};
|
};
|
||||||
|
|
||||||
// event fix hooks for touch events...
|
// event fix hooks for touch events...
|
||||||
@ -380,20 +380,20 @@ $event.fixHooks.touchstart =
|
|||||||
$event.fixHooks.touchmove =
|
$event.fixHooks.touchmove =
|
||||||
$event.fixHooks.touchend =
|
$event.fixHooks.touchend =
|
||||||
$event.fixHooks.touchcancel = {
|
$event.fixHooks.touchcancel = {
|
||||||
props: "clientX clientY pageX pageY screenX screenY".split( " " ),
|
props: "clientX clientY pageX pageY screenX screenY".split( " " ),
|
||||||
filter: function( event, orig ) {
|
filter: function( event, orig ) {
|
||||||
if ( orig ){
|
if ( orig ){
|
||||||
var touched = ( orig.touches && orig.touches[0] )
|
var touched = ( orig.touches && orig.touches[0] )
|
||||||
|| ( orig.changedTouches && orig.changedTouches[0] )
|
|| ( orig.changedTouches && orig.changedTouches[0] )
|
||||||
|| null;
|
|| null;
|
||||||
// iOS webkit: touchstart, touchmove, touchend
|
// iOS webkit: touchstart, touchmove, touchend
|
||||||
if ( touched )
|
if ( touched )
|
||||||
$.each( touchHooks.props, function( i, prop ){
|
$.each( touchHooks.props, function( i, prop ){
|
||||||
event[ prop ] = touched[ prop ];
|
event[ prop ] = touched[ prop ];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// share the same special event configuration with related events...
|
// share the same special event configuration with related events...
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* FancyBox - jQuery Plugin
|
|
||||||
* Simple and fancy lightbox alternative
|
|
||||||
*
|
|
||||||
* Examples and documentation at: http://fancybox.net
|
|
||||||
*
|
|
||||||
* Copyright (c) 2008 - 2010 Janis Skarnelis
|
|
||||||
* 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.
|
|
||||||
*
|
|
||||||
* Version: 1.3.4 (11/11/2010)
|
|
||||||
* Requires: jQuery v1.3+
|
|
||||||
*
|
|
||||||
* Dual licensed under the MIT and GPL licenses:
|
|
||||||
* http://www.opensource.org/licenses/mit-license.php
|
|
||||||
* http://www.gnu.org/licenses/gpl.html
|
|
||||||
*/
|
|
||||||
|
|
||||||
;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
|
|
||||||
F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
|
|
||||||
c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
|
|
||||||
false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
|
|
||||||
function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
|
|
||||||
'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
|
|
||||||
"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
|
|
||||||
";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
|
|
||||||
opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
|
|
||||||
d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
|
|
||||||
y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
|
|
||||||
i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
|
|
||||||
f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
|
|
||||||
37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
|
|
||||||
s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
|
|
||||||
f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
|
|
||||||
j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
|
|
||||||
"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
|
|
||||||
10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
|
|
||||||
b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
|
|
||||||
0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
|
|
||||||
1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
|
|
||||||
true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
|
|
||||||
b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
|
|
||||||
d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
|
|
||||||
D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
|
|
||||||
b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
|
|
||||||
b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
|
|
||||||
easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery);
|
|
@ -1,45 +0,0 @@
|
|||||||
/*! fancyBox v2.1.4 fancyapps.com | fancyapps.com/fancybox/#license */
|
|
||||||
(function(C,z,f,r){var q=f(C),n=f(z),b=f.fancybox=function(){b.open.apply(this,arguments)},H=navigator.userAgent.match(/msie/),w=null,s=z.createTouch!==r,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},p=function(a){return a&&"string"===f.type(a)},F=function(a){return p(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;d&&F(a)&&(e*=b.getViewport()[d]/100);return Math.ceil(e)},x=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.4",defaults:{padding:15,margin:20,width:800,
|
|
||||||
height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:0.5,leftRatio:0.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3E3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",
|
|
||||||
34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+
|
|
||||||
(H?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="Close" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,
|
|
||||||
openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,
|
|
||||||
isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,
|
|
||||||
c.metadata())):k=c);g=d.href||k.href||(p(c)?c:null);h=d.title!==r?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null));p(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":p(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(p(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&
|
|
||||||
k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==r&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||
|
|
||||||
b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=
|
|
||||||
setTimeout(b.next,b.current.playSpeed))},c=function(){d();f("body").unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index<b.group.length-1))b.player.isActive=!0,f("body").bind({"afterShow.player onUpdate.player":e,"onCancel.player beforeClose.player":c,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")}else c()},next:function(a){var d=b.current;d&&(p(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},
|
|
||||||
prev:function(a){var d=b.current;d&&(p(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==r&&(b.cancel(),b._start(a)))},reposition:function(a,d){var e=b.current,c=e?e.wrap:null,k;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},
|
|
||||||
e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(w),w=null);b.isOpen&&!w&&(w=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),w=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),
|
|
||||||
b.trigger("onUpdate")),b.update())},hideLoading:function(){n.unbind(".loading");f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading();a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body");n.bind("keydown.loading",function(a){if(27===(a.which||a.keyCode))a.preventDefault(),b.cancel()});b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:0.5*d.h+d.y,left:0.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||
|
|
||||||
!1,d={x:q.scrollLeft(),y:q.scrollTop()};a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&C.innerWidth?C.innerWidth:q.width(),d.h=s&&C.innerHeight?C.innerHeight:q.height());return d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb");n.unbind(".fb");q.unbind(".fb")},bindEvents:function(){var a=b.current,d;a&&(q.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&n.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=
|
|
||||||
e.target||e.srcElement;if(27===c&&b.coming)return!1;!e.ctrlKey&&(!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]")))&&f.each(d,function(d,k){if(1<a.group.length&&k[c]!==r)return b[d](k[c]),e.preventDefault(),!1;if(-1<f.inArray(c,k))return b[d](),e.preventDefault(),!1})}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&
|
|
||||||
"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();if(0!==c&&!j&&1<b.group.length&&!a.canShrink){if(0<g||0<k)b.prev(0<g?"down":"left");else if(0>g||0>k)b.next(0>g?"up":"right");d.preventDefault()}}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1)));if(!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,
|
|
||||||
e){e&&(b.helpers[d]&&f.isFunction(b.helpers[d][a]))&&(e=f.extend(!0,{},b.helpers[d].defaults,e),b.helpers[d][a](e,c))});f.event.trigger(a+".fb")}},isImage:function(a){return p(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp)((\?|#).*)?$)/i)},isSWF:function(a){return p(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var d={},e,c;a=l(a);e=b.group[a]||null;if(!e)return!1;d=f.extend(!0,{},b.opts,e);e=d.margin;c=d.padding;"number"===f.type(e)&&(d.margin=[e,e,e,e]);"number"===f.type(c)&&
|
|
||||||
(d.padding=[c,c,c,c]);d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}});d.autoSize&&(d.autoWidth=d.autoHeight=!0);"auto"===d.width&&(d.autoWidth=!0);"auto"===d.height&&(d.autoHeight=!0);d.group=b.group;d.index=a;b.coming=d;if(!1===b.trigger("beforeLoad"))b.coming=null;else{c=d.type;e=d.href;if(!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;b.isActive=
|
|
||||||
!0;if("image"===c||"swf"===c)d.autoHeight=d.autoWidth=!1,d.scrolling="visible";"image"===c&&(d.aspectRatio=!0);"iframe"===c&&s&&(d.scrolling="scroll");d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body");f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)});f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,x(d.padding[a]))});b.trigger("onReady");
|
|
||||||
if("inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error});b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null;b.coming.width=
|
|
||||||
this.width;b.coming.height=this.height;b._afterLoad()};a.onerror=function(){this.onload=this.onerror=null;b._error("image")};a.src=b.coming.href;!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading();b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,
|
|
||||||
(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}});a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1);s||f(this).bind("load.fb",b.update);f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();b._afterLoad()}));a.content=d.appendTo(a.inner);a.iframe.preload||b._afterLoad()},_preloadImages:function(){var a=
|
|
||||||
b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0,f,g;for(g=1;g<=c;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var a=b.coming,d=b.current,e,c,k,g,h;b.hideLoading();if(a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());b.unbindEvents();
|
|
||||||
e=a.content;c=a.type;k=a.scrolling;f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d});g=a.href;switch(c){case "inline":case "ajax":case "html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",
|
|
||||||
!1)}));break;case "image":e=a.tpl.image.replace("{href}",g);break;case "swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>';h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e);b.trigger("beforeShow");
|
|
||||||
a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k);b._setDimension();b.reposition();b.isOpen=!1;b.coming=null;b.bindEvents();if(b.isOpened){if(d.prevMethod)b.transitions[d.prevMethod]()}else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();b.transitions[b.isOpened?a.nextMethod:a.openMethod]();b._preloadImages()}},_setDimension:function(){var a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,
|
|
||||||
v=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,y=h.margin,p=l(y[1]+y[3]),r=l(y[0]+y[2]),z,A,t,D,B,G,C,E,w;e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");y=l(k.outerWidth(!0)-k.width());z=l(k.outerHeight(!0)-k.height());A=p+y;t=r+z;D=F(c)?(a.w-A)*l(c)/100:c;B=F(j)?(a.h-t)*l(j)/100:j;if("iframe"===h.type){if(w=h.content,h.autoHeight&&1===w.data("ready"))try{w[0].contentWindow.document.location&&(g.width(D).height(9999),G=w.contents().find("body"),q&&G.css("overflow-x",
|
|
||||||
"hidden"),B=G.height())}catch(H){}}else if(h.autoWidth||h.autoHeight)g.addClass("fancybox-tmp"),h.autoWidth||g.width(D),h.autoHeight||g.height(B),h.autoWidth&&(D=g.width()),h.autoHeight&&(B=g.height()),g.removeClass("fancybox-tmp");c=l(D);j=l(B);E=D/B;m=l(F(m)?l(m,"w")-A:m);n=l(F(n)?l(n,"w")-A:n);u=l(F(u)?l(u,"h")-t:u);v=l(F(v)?l(v,"h")-t:v);G=n;C=v;h.fitToView&&(n=Math.min(a.w-A,n),v=Math.min(a.h-t,v));A=a.w-p;r=a.h-r;h.aspectRatio?(c>n&&(c=n,j=l(c/E)),j>v&&(j=v,c=l(j*E)),c<m&&(c=m,j=l(c/E)),j<u&&
|
|
||||||
(j=u,c=l(j*E))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,v)));if(h.fitToView)if(g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height(),h.aspectRatio)for(;(a>A||p>r)&&(c>m&&j>u)&&!(19<d++);)j=Math.max(u,Math.min(v,j-10)),c=l(j*E),c<m&&(c=m,j=l(c/E)),c>n&&(c=n,j=l(c/E)),g.width(c).height(j),e.width(c+y),a=e.width(),p=e.height();else c=Math.max(m,Math.min(c,c-(a-A))),j=Math.max(u,Math.min(j,j-(p-r)));q&&("auto"===s&&j<B&&c+y+
|
|
||||||
q<A)&&(c+=q);g.width(c).height(j);e.width(c+y);a=e.width();p=e.height();e=(a>A||p>r)&&c>m&&j>u;c=h.aspectRatio?c<G&&j<C&&c<D&&j<B:(c<G||j<C)&&(c<D||j<B);f.extend(h,{dim:{width:x(a),height:x(p)},origWidth:D,origHeight:B,canShrink:e,canExpand:c,wPadding:y,hPadding:z,wrapSpace:p-k.outerHeight(!0),skinSpace:k.height()-j});!w&&(h.autoHeight&&j>u&&j<v&&!c)&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",
|
|
||||||
top:c[0],left:c[3]};d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x);c.top=x(Math.max(c.top,c.top+(e.h-g)*d.topRatio));c.left=x(Math.max(c.left,c.left+(e.w-f)*d.leftRatio));return c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&
|
|
||||||
(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault();b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),!a.loop&&a.index===a.group.length-1?b.play(!1):b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()))},_afterZoomOut:function(a){a=
|
|
||||||
a||b.current;f(".fancybox-wrap").trigger("onReset").remove();f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null});b.trigger("afterClose",a)}});b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();!e&&(a.isDom&&d.is(":visible"))&&(e=d.find("img:first"),e.length||(e=d));t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):
|
|
||||||
(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio);if("fixed"===b.wrap.css("position")||a.locked)c.top-=m.y,c.left-=m.x;return c={top:x(c.top-h*a.topRatio),left:x(c.left-j*a.leftRatio),width:x(f+j),height:x(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;if("width"===f||"height"===f)e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===
|
|
||||||
f?c:c-g*e-h*e))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position;c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=0.1)):"fade"===e&&(d.opacity=0.1);b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:0.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=0.1));b.wrap.animate(c,
|
|
||||||
{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction,g;e.opacity=0.1;"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=x(l(e[g])-200),c[g]="+=200px"):(e[g]=x(l(e[g])+200),c[g]="-=200px"));"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=
|
|
||||||
b.previous,d=a.prevEffect,e={opacity:0.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px");a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}};b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,create:function(a){a=f.extend({},this.defaults,a);this.overlay&&this.close();this.overlay=f('<div class="fancybox-overlay"></div>').appendTo("body");
|
|
||||||
this.fixed=!1;a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a);this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a);this.fixed||(q.bind("resize.overlay",f.proxy(this.update,this)),this.update());a.closeClick&&this.overlay.bind("click.overlay",function(a){f(a.target).hasClass("fancybox-overlay")&&(b.isActive?b.close():d.close())});this.overlay.css(a.css).show()},
|
|
||||||
close:function(){f(".fancybox-overlay").remove();q.unbind("resize.overlay");this.overlay=null;!1!==this.margin&&(f("body").css("margin-right",this.margin),this.margin=!1);this.el&&this.el.removeClass("fancybox-lock")},update:function(){var a="100%",b;this.overlay.width(a).height("100%");H?(b=Math.max(z.documentElement.offsetWidth,z.body.offsetWidth),n.width()>b&&(a=n.width())):n.width()>q.width()&&(a=n.width());this.overlay.width(a).height(n.height())},onReady:function(a,b){f(".fancybox-overlay").stop(!0,
|
|
||||||
!0);this.overlay||(this.margin=n.height()>q.height()||"scroll"===f("body").css("overflow-y")?f("body").css("margin-right"):!1,this.el=z.all&&!z.querySelector?f("html"):f("body"),this.create(a));a.locked&&this.fixed&&(b.locked=this.overlay.append(b.wrap),b.fixed=!1);!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){b.locked&&(this.el.addClass("fancybox-lock"),!1!==this.margin&&f("body").css("margin-right",l(this.margin)+b.scrollbarWidth));this.open(a)},onUpdate:function(){this.fixed||
|
|
||||||
this.update()},afterClose:function(a){this.overlay&&!b.isActive&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}};b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;f.isFunction(e)&&(e=e.call(d.element,d));if(p(e)&&""!==f.trim(e)){d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>");switch(c){case "inside":c=b.skin;break;case "outside":c=b.wrap;break;case "over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),
|
|
||||||
H&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}};f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var h=f(this).blur(),j=d,k,l;!g.ctrlKey&&(!g.altKey&&!g.shiftKey&&!g.metaKey)&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&(""!==l&&"nofollow"!==l)&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+
|
|
||||||
'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};a=a||{};d=a.index||0;!c||!1===a.live?e.unbind("click.fb-start").bind("click.fb-start",k):n.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k);this.filter("[data-fancybox-start=1]").trigger("click");return this};n.ready(function(){f.scrollbarWidth===r&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),
|
|
||||||
b=b.innerWidth()-b.height(99).innerWidth();a.remove();return b});if(f.support.fixedPosition===r){var a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body"),e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove();a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")})})})(window,document,jQuery);
|
|
@ -1,14 +0,0 @@
|
|||||||
/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
|
|
||||||
* Licensed under the MIT License (LICENSE.txt).
|
|
||||||
*
|
|
||||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
|
||||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
|
||||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
|
||||||
*
|
|
||||||
* Version: 3.0.4
|
|
||||||
*
|
|
||||||
* Requires: 1.2.2+
|
|
||||||
*/
|
|
||||||
|
|
||||||
(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
|
|
||||||
f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
|
|
878
app/assets/javascripts/vendor/jquery.ui.widget.js
vendored
@ -20,511 +20,511 @@
|
|||||||
}(function( $, undefined ) {
|
}(function( $, undefined ) {
|
||||||
|
|
||||||
var uuid = 0,
|
var uuid = 0,
|
||||||
slice = Array.prototype.slice,
|
slice = Array.prototype.slice,
|
||||||
_cleanData = $.cleanData;
|
_cleanData = $.cleanData;
|
||||||
$.cleanData = function( elems ) {
|
$.cleanData = function( elems ) {
|
||||||
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
||||||
try {
|
try {
|
||||||
$( elem ).triggerHandler( "remove" );
|
$( elem ).triggerHandler( "remove" );
|
||||||
// http://bugs.jquery.com/ticket/8235
|
// http://bugs.jquery.com/ticket/8235
|
||||||
} catch( e ) {}
|
} catch( e ) {}
|
||||||
}
|
}
|
||||||
_cleanData( elems );
|
_cleanData( elems );
|
||||||
};
|
};
|
||||||
|
|
||||||
$.widget = function( name, base, prototype ) {
|
$.widget = function( name, base, prototype ) {
|
||||||
var fullName, existingConstructor, constructor, basePrototype,
|
var fullName, existingConstructor, constructor, basePrototype,
|
||||||
// proxiedPrototype allows the provided prototype to remain unmodified
|
// proxiedPrototype allows the provided prototype to remain unmodified
|
||||||
// so that it can be used as a mixin for multiple widgets (#8876)
|
// so that it can be used as a mixin for multiple widgets (#8876)
|
||||||
proxiedPrototype = {},
|
proxiedPrototype = {},
|
||||||
namespace = name.split( "." )[ 0 ];
|
namespace = name.split( "." )[ 0 ];
|
||||||
|
|
||||||
name = name.split( "." )[ 1 ];
|
name = name.split( "." )[ 1 ];
|
||||||
fullName = namespace + "-" + name;
|
fullName = namespace + "-" + name;
|
||||||
|
|
||||||
if ( !prototype ) {
|
if ( !prototype ) {
|
||||||
prototype = base;
|
prototype = base;
|
||||||
base = $.Widget;
|
base = $.Widget;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create selector for plugin
|
// create selector for plugin
|
||||||
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
|
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
|
||||||
return !!$.data( elem, fullName );
|
return !!$.data( elem, fullName );
|
||||||
};
|
};
|
||||||
|
|
||||||
$[ namespace ] = $[ namespace ] || {};
|
$[ namespace ] = $[ namespace ] || {};
|
||||||
existingConstructor = $[ namespace ][ name ];
|
existingConstructor = $[ namespace ][ name ];
|
||||||
constructor = $[ namespace ][ name ] = function( options, element ) {
|
constructor = $[ namespace ][ name ] = function( options, element ) {
|
||||||
// allow instantiation without "new" keyword
|
// allow instantiation without "new" keyword
|
||||||
if ( !this._createWidget ) {
|
if ( !this._createWidget ) {
|
||||||
return new constructor( options, element );
|
return new constructor( options, element );
|
||||||
}
|
}
|
||||||
|
|
||||||
// allow instantiation without initializing for simple inheritance
|
// allow instantiation without initializing for simple inheritance
|
||||||
// must use "new" keyword (the code above always passes args)
|
// must use "new" keyword (the code above always passes args)
|
||||||
if ( arguments.length ) {
|
if ( arguments.length ) {
|
||||||
this._createWidget( options, element );
|
this._createWidget( options, element );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// extend with the existing constructor to carry over any static properties
|
// extend with the existing constructor to carry over any static properties
|
||||||
$.extend( constructor, existingConstructor, {
|
$.extend( constructor, existingConstructor, {
|
||||||
version: prototype.version,
|
version: prototype.version,
|
||||||
// copy the object used to create the prototype in case we need to
|
// copy the object used to create the prototype in case we need to
|
||||||
// redefine the widget later
|
// redefine the widget later
|
||||||
_proto: $.extend( {}, prototype ),
|
_proto: $.extend( {}, prototype ),
|
||||||
// track widgets that inherit from this widget in case this widget is
|
// track widgets that inherit from this widget in case this widget is
|
||||||
// redefined after a widget inherits from it
|
// redefined after a widget inherits from it
|
||||||
_childConstructors: []
|
_childConstructors: []
|
||||||
});
|
});
|
||||||
|
|
||||||
basePrototype = new base();
|
basePrototype = new base();
|
||||||
// we need to make the options hash a property directly on the new instance
|
// we need to make the options hash a property directly on the new instance
|
||||||
// otherwise we'll modify the options hash on the prototype that we're
|
// otherwise we'll modify the options hash on the prototype that we're
|
||||||
// inheriting from
|
// inheriting from
|
||||||
basePrototype.options = $.widget.extend( {}, basePrototype.options );
|
basePrototype.options = $.widget.extend( {}, basePrototype.options );
|
||||||
$.each( prototype, function( prop, value ) {
|
$.each( prototype, function( prop, value ) {
|
||||||
if ( !$.isFunction( value ) ) {
|
if ( !$.isFunction( value ) ) {
|
||||||
proxiedPrototype[ prop ] = value;
|
proxiedPrototype[ prop ] = value;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
proxiedPrototype[ prop ] = (function() {
|
proxiedPrototype[ prop ] = (function() {
|
||||||
var _super = function() {
|
var _super = function() {
|
||||||
return base.prototype[ prop ].apply( this, arguments );
|
return base.prototype[ prop ].apply( this, arguments );
|
||||||
},
|
},
|
||||||
_superApply = function( args ) {
|
_superApply = function( args ) {
|
||||||
return base.prototype[ prop ].apply( this, args );
|
return base.prototype[ prop ].apply( this, args );
|
||||||
};
|
};
|
||||||
return function() {
|
return function() {
|
||||||
var __super = this._super,
|
var __super = this._super,
|
||||||
__superApply = this._superApply,
|
__superApply = this._superApply,
|
||||||
returnValue;
|
returnValue;
|
||||||
|
|
||||||
this._super = _super;
|
this._super = _super;
|
||||||
this._superApply = _superApply;
|
this._superApply = _superApply;
|
||||||
|
|
||||||
returnValue = value.apply( this, arguments );
|
returnValue = value.apply( this, arguments );
|
||||||
|
|
||||||
this._super = __super;
|
this._super = __super;
|
||||||
this._superApply = __superApply;
|
this._superApply = __superApply;
|
||||||
|
|
||||||
return returnValue;
|
return returnValue;
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
});
|
});
|
||||||
constructor.prototype = $.widget.extend( basePrototype, {
|
constructor.prototype = $.widget.extend( basePrototype, {
|
||||||
// TODO: remove support for widgetEventPrefix
|
// TODO: remove support for widgetEventPrefix
|
||||||
// always use the name + a colon as the prefix, e.g., draggable:start
|
// always use the name + a colon as the prefix, e.g., draggable:start
|
||||||
// don't prefix for widgets that aren't DOM-based
|
// don't prefix for widgets that aren't DOM-based
|
||||||
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
|
widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
|
||||||
}, proxiedPrototype, {
|
}, proxiedPrototype, {
|
||||||
constructor: constructor,
|
constructor: constructor,
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
widgetName: name,
|
widgetName: name,
|
||||||
widgetFullName: fullName
|
widgetFullName: fullName
|
||||||
});
|
});
|
||||||
|
|
||||||
// If this widget is being redefined then we need to find all widgets that
|
// If this widget is being redefined then we need to find all widgets that
|
||||||
// are inheriting from it and redefine all of them so that they inherit from
|
// are inheriting from it and redefine all of them so that they inherit from
|
||||||
// the new version of this widget. We're essentially trying to replace one
|
// the new version of this widget. We're essentially trying to replace one
|
||||||
// level in the prototype chain.
|
// level in the prototype chain.
|
||||||
if ( existingConstructor ) {
|
if ( existingConstructor ) {
|
||||||
$.each( existingConstructor._childConstructors, function( i, child ) {
|
$.each( existingConstructor._childConstructors, function( i, child ) {
|
||||||
var childPrototype = child.prototype;
|
var childPrototype = child.prototype;
|
||||||
|
|
||||||
// redefine the child widget using the same prototype that was
|
// redefine the child widget using the same prototype that was
|
||||||
// originally used, but inherit from the new version of the base
|
// originally used, but inherit from the new version of the base
|
||||||
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
|
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
|
||||||
});
|
});
|
||||||
// remove the list of existing child constructors from the old constructor
|
// remove the list of existing child constructors from the old constructor
|
||||||
// so the old child constructors can be garbage collected
|
// so the old child constructors can be garbage collected
|
||||||
delete existingConstructor._childConstructors;
|
delete existingConstructor._childConstructors;
|
||||||
} else {
|
} else {
|
||||||
base._childConstructors.push( constructor );
|
base._childConstructors.push( constructor );
|
||||||
}
|
}
|
||||||
|
|
||||||
$.widget.bridge( name, constructor );
|
$.widget.bridge( name, constructor );
|
||||||
};
|
};
|
||||||
|
|
||||||
$.widget.extend = function( target ) {
|
$.widget.extend = function( target ) {
|
||||||
var input = slice.call( arguments, 1 ),
|
var input = slice.call( arguments, 1 ),
|
||||||
inputIndex = 0,
|
inputIndex = 0,
|
||||||
inputLength = input.length,
|
inputLength = input.length,
|
||||||
key,
|
key,
|
||||||
value;
|
value;
|
||||||
for ( ; inputIndex < inputLength; inputIndex++ ) {
|
for ( ; inputIndex < inputLength; inputIndex++ ) {
|
||||||
for ( key in input[ inputIndex ] ) {
|
for ( key in input[ inputIndex ] ) {
|
||||||
value = input[ inputIndex ][ key ];
|
value = input[ inputIndex ][ key ];
|
||||||
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
|
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
|
||||||
// Clone objects
|
// Clone objects
|
||||||
if ( $.isPlainObject( value ) ) {
|
if ( $.isPlainObject( value ) ) {
|
||||||
target[ key ] = $.isPlainObject( target[ key ] ) ?
|
target[ key ] = $.isPlainObject( target[ key ] ) ?
|
||||||
$.widget.extend( {}, target[ key ], value ) :
|
$.widget.extend( {}, target[ key ], value ) :
|
||||||
// Don't extend strings, arrays, etc. with objects
|
// Don't extend strings, arrays, etc. with objects
|
||||||
$.widget.extend( {}, value );
|
$.widget.extend( {}, value );
|
||||||
// Copy everything else by reference
|
// Copy everything else by reference
|
||||||
} else {
|
} else {
|
||||||
target[ key ] = value;
|
target[ key ] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return target;
|
return target;
|
||||||
};
|
};
|
||||||
|
|
||||||
$.widget.bridge = function( name, object ) {
|
$.widget.bridge = function( name, object ) {
|
||||||
var fullName = object.prototype.widgetFullName || name;
|
var fullName = object.prototype.widgetFullName || name;
|
||||||
$.fn[ name ] = function( options ) {
|
$.fn[ name ] = function( options ) {
|
||||||
var isMethodCall = typeof options === "string",
|
var isMethodCall = typeof options === "string",
|
||||||
args = slice.call( arguments, 1 ),
|
args = slice.call( arguments, 1 ),
|
||||||
returnValue = this;
|
returnValue = this;
|
||||||
|
|
||||||
// allow multiple hashes to be passed on init
|
// allow multiple hashes to be passed on init
|
||||||
options = !isMethodCall && args.length ?
|
options = !isMethodCall && args.length ?
|
||||||
$.widget.extend.apply( null, [ options ].concat(args) ) :
|
$.widget.extend.apply( null, [ options ].concat(args) ) :
|
||||||
options;
|
options;
|
||||||
|
|
||||||
if ( isMethodCall ) {
|
if ( isMethodCall ) {
|
||||||
this.each(function() {
|
this.each(function() {
|
||||||
var methodValue,
|
var methodValue,
|
||||||
instance = $.data( this, fullName );
|
instance = $.data( this, fullName );
|
||||||
if ( !instance ) {
|
if ( !instance ) {
|
||||||
return $.error( "cannot call methods on " + name + " prior to initialization; " +
|
return $.error( "cannot call methods on " + name + " prior to initialization; " +
|
||||||
"attempted to call method '" + options + "'" );
|
"attempted to call method '" + options + "'" );
|
||||||
}
|
}
|
||||||
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
|
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
|
||||||
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
|
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
|
||||||
}
|
}
|
||||||
methodValue = instance[ options ].apply( instance, args );
|
methodValue = instance[ options ].apply( instance, args );
|
||||||
if ( methodValue !== instance && methodValue !== undefined ) {
|
if ( methodValue !== instance && methodValue !== undefined ) {
|
||||||
returnValue = methodValue && methodValue.jquery ?
|
returnValue = methodValue && methodValue.jquery ?
|
||||||
returnValue.pushStack( methodValue.get() ) :
|
returnValue.pushStack( methodValue.get() ) :
|
||||||
methodValue;
|
methodValue;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.each(function() {
|
this.each(function() {
|
||||||
var instance = $.data( this, fullName );
|
var instance = $.data( this, fullName );
|
||||||
if ( instance ) {
|
if ( instance ) {
|
||||||
instance.option( options || {} )._init();
|
instance.option( options || {} )._init();
|
||||||
} else {
|
} else {
|
||||||
$.data( this, fullName, new object( options, this ) );
|
$.data( this, fullName, new object( options, this ) );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue;
|
return returnValue;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
$.Widget = function( /* options, element */ ) {};
|
$.Widget = function( /* options, element */ ) {};
|
||||||
$.Widget._childConstructors = [];
|
$.Widget._childConstructors = [];
|
||||||
|
|
||||||
$.Widget.prototype = {
|
$.Widget.prototype = {
|
||||||
widgetName: "widget",
|
widgetName: "widget",
|
||||||
widgetEventPrefix: "",
|
widgetEventPrefix: "",
|
||||||
defaultElement: "<div>",
|
defaultElement: "<div>",
|
||||||
options: {
|
options: {
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
create: null
|
create: null
|
||||||
},
|
},
|
||||||
_createWidget: function( options, element ) {
|
_createWidget: function( options, element ) {
|
||||||
element = $( element || this.defaultElement || this )[ 0 ];
|
element = $( element || this.defaultElement || this )[ 0 ];
|
||||||
this.element = $( element );
|
this.element = $( element );
|
||||||
this.uuid = uuid++;
|
this.uuid = uuid++;
|
||||||
this.eventNamespace = "." + this.widgetName + this.uuid;
|
this.eventNamespace = "." + this.widgetName + this.uuid;
|
||||||
this.options = $.widget.extend( {},
|
this.options = $.widget.extend( {},
|
||||||
this.options,
|
this.options,
|
||||||
this._getCreateOptions(),
|
this._getCreateOptions(),
|
||||||
options );
|
options );
|
||||||
|
|
||||||
this.bindings = $();
|
this.bindings = $();
|
||||||
this.hoverable = $();
|
this.hoverable = $();
|
||||||
this.focusable = $();
|
this.focusable = $();
|
||||||
|
|
||||||
if ( element !== this ) {
|
if ( element !== this ) {
|
||||||
$.data( element, this.widgetFullName, this );
|
$.data( element, this.widgetFullName, this );
|
||||||
this._on( true, this.element, {
|
this._on( true, this.element, {
|
||||||
remove: function( event ) {
|
remove: function( event ) {
|
||||||
if ( event.target === element ) {
|
if ( event.target === element ) {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.document = $( element.style ?
|
this.document = $( element.style ?
|
||||||
// element within the document
|
// element within the document
|
||||||
element.ownerDocument :
|
element.ownerDocument :
|
||||||
// element is window or document
|
// element is window or document
|
||||||
element.document || element );
|
element.document || element );
|
||||||
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
|
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
|
||||||
}
|
}
|
||||||
|
|
||||||
this._create();
|
this._create();
|
||||||
this._trigger( "create", null, this._getCreateEventData() );
|
this._trigger( "create", null, this._getCreateEventData() );
|
||||||
this._init();
|
this._init();
|
||||||
},
|
},
|
||||||
_getCreateOptions: $.noop,
|
_getCreateOptions: $.noop,
|
||||||
_getCreateEventData: $.noop,
|
_getCreateEventData: $.noop,
|
||||||
_create: $.noop,
|
_create: $.noop,
|
||||||
_init: $.noop,
|
_init: $.noop,
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
this._destroy();
|
this._destroy();
|
||||||
// we can probably remove the unbind calls in 2.0
|
// we can probably remove the unbind calls in 2.0
|
||||||
// all event bindings should go through this._on()
|
// all event bindings should go through this._on()
|
||||||
this.element
|
this.element
|
||||||
.unbind( this.eventNamespace )
|
.unbind( this.eventNamespace )
|
||||||
// 1.9 BC for #7810
|
// 1.9 BC for #7810
|
||||||
// TODO remove dual storage
|
// TODO remove dual storage
|
||||||
.removeData( this.widgetName )
|
.removeData( this.widgetName )
|
||||||
.removeData( this.widgetFullName )
|
.removeData( this.widgetFullName )
|
||||||
// support: jquery <1.6.3
|
// support: jquery <1.6.3
|
||||||
// http://bugs.jquery.com/ticket/9413
|
// http://bugs.jquery.com/ticket/9413
|
||||||
.removeData( $.camelCase( this.widgetFullName ) );
|
.removeData( $.camelCase( this.widgetFullName ) );
|
||||||
this.widget()
|
this.widget()
|
||||||
.unbind( this.eventNamespace )
|
.unbind( this.eventNamespace )
|
||||||
.removeAttr( "aria-disabled" )
|
.removeAttr( "aria-disabled" )
|
||||||
.removeClass(
|
.removeClass(
|
||||||
this.widgetFullName + "-disabled " +
|
this.widgetFullName + "-disabled " +
|
||||||
"ui-state-disabled" );
|
"ui-state-disabled" );
|
||||||
|
|
||||||
// clean up events and states
|
// clean up events and states
|
||||||
this.bindings.unbind( this.eventNamespace );
|
this.bindings.unbind( this.eventNamespace );
|
||||||
this.hoverable.removeClass( "ui-state-hover" );
|
this.hoverable.removeClass( "ui-state-hover" );
|
||||||
this.focusable.removeClass( "ui-state-focus" );
|
this.focusable.removeClass( "ui-state-focus" );
|
||||||
},
|
},
|
||||||
_destroy: $.noop,
|
_destroy: $.noop,
|
||||||
|
|
||||||
widget: function() {
|
widget: function() {
|
||||||
return this.element;
|
return this.element;
|
||||||
},
|
},
|
||||||
|
|
||||||
option: function( key, value ) {
|
option: function( key, value ) {
|
||||||
var options = key,
|
var options = key,
|
||||||
parts,
|
parts,
|
||||||
curOption,
|
curOption,
|
||||||
i;
|
i;
|
||||||
|
|
||||||
if ( arguments.length === 0 ) {
|
if ( arguments.length === 0 ) {
|
||||||
// don't return a reference to the internal hash
|
// don't return a reference to the internal hash
|
||||||
return $.widget.extend( {}, this.options );
|
return $.widget.extend( {}, this.options );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( typeof key === "string" ) {
|
if ( typeof key === "string" ) {
|
||||||
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
|
||||||
options = {};
|
options = {};
|
||||||
parts = key.split( "." );
|
parts = key.split( "." );
|
||||||
key = parts.shift();
|
key = parts.shift();
|
||||||
if ( parts.length ) {
|
if ( parts.length ) {
|
||||||
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
|
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
|
||||||
for ( i = 0; i < parts.length - 1; i++ ) {
|
for ( i = 0; i < parts.length - 1; i++ ) {
|
||||||
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
|
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
|
||||||
curOption = curOption[ parts[ i ] ];
|
curOption = curOption[ parts[ i ] ];
|
||||||
}
|
}
|
||||||
key = parts.pop();
|
key = parts.pop();
|
||||||
if ( value === undefined ) {
|
if ( value === undefined ) {
|
||||||
return curOption[ key ] === undefined ? null : curOption[ key ];
|
return curOption[ key ] === undefined ? null : curOption[ key ];
|
||||||
}
|
}
|
||||||
curOption[ key ] = value;
|
curOption[ key ] = value;
|
||||||
} else {
|
} else {
|
||||||
if ( value === undefined ) {
|
if ( value === undefined ) {
|
||||||
return this.options[ key ] === undefined ? null : this.options[ key ];
|
return this.options[ key ] === undefined ? null : this.options[ key ];
|
||||||
}
|
}
|
||||||
options[ key ] = value;
|
options[ key ] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this._setOptions( options );
|
this._setOptions( options );
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
_setOptions: function( options ) {
|
_setOptions: function( options ) {
|
||||||
var key;
|
var key;
|
||||||
|
|
||||||
for ( key in options ) {
|
for ( key in options ) {
|
||||||
this._setOption( key, options[ key ] );
|
this._setOption( key, options[ key ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
_setOption: function( key, value ) {
|
_setOption: function( key, value ) {
|
||||||
this.options[ key ] = value;
|
this.options[ key ] = value;
|
||||||
|
|
||||||
if ( key === "disabled" ) {
|
if ( key === "disabled" ) {
|
||||||
this.widget()
|
this.widget()
|
||||||
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
|
.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
|
||||||
.attr( "aria-disabled", value );
|
.attr( "aria-disabled", value );
|
||||||
this.hoverable.removeClass( "ui-state-hover" );
|
this.hoverable.removeClass( "ui-state-hover" );
|
||||||
this.focusable.removeClass( "ui-state-focus" );
|
this.focusable.removeClass( "ui-state-focus" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
enable: function() {
|
enable: function() {
|
||||||
return this._setOption( "disabled", false );
|
return this._setOption( "disabled", false );
|
||||||
},
|
},
|
||||||
disable: function() {
|
disable: function() {
|
||||||
return this._setOption( "disabled", true );
|
return this._setOption( "disabled", true );
|
||||||
},
|
},
|
||||||
|
|
||||||
_on: function( suppressDisabledCheck, element, handlers ) {
|
_on: function( suppressDisabledCheck, element, handlers ) {
|
||||||
var delegateElement,
|
var delegateElement,
|
||||||
instance = this;
|
instance = this;
|
||||||
|
|
||||||
// no suppressDisabledCheck flag, shuffle arguments
|
// no suppressDisabledCheck flag, shuffle arguments
|
||||||
if ( typeof suppressDisabledCheck !== "boolean" ) {
|
if ( typeof suppressDisabledCheck !== "boolean" ) {
|
||||||
handlers = element;
|
handlers = element;
|
||||||
element = suppressDisabledCheck;
|
element = suppressDisabledCheck;
|
||||||
suppressDisabledCheck = false;
|
suppressDisabledCheck = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// no element argument, shuffle and use this.element
|
// no element argument, shuffle and use this.element
|
||||||
if ( !handlers ) {
|
if ( !handlers ) {
|
||||||
handlers = element;
|
handlers = element;
|
||||||
element = this.element;
|
element = this.element;
|
||||||
delegateElement = this.widget();
|
delegateElement = this.widget();
|
||||||
} else {
|
} else {
|
||||||
// accept selectors, DOM elements
|
// accept selectors, DOM elements
|
||||||
element = delegateElement = $( element );
|
element = delegateElement = $( element );
|
||||||
this.bindings = this.bindings.add( element );
|
this.bindings = this.bindings.add( element );
|
||||||
}
|
}
|
||||||
|
|
||||||
$.each( handlers, function( event, handler ) {
|
$.each( handlers, function( event, handler ) {
|
||||||
function handlerProxy() {
|
function handlerProxy() {
|
||||||
// allow widgets to customize the disabled handling
|
// allow widgets to customize the disabled handling
|
||||||
// - disabled as an array instead of boolean
|
// - disabled as an array instead of boolean
|
||||||
// - disabled class as method for disabling individual parts
|
// - disabled class as method for disabling individual parts
|
||||||
if ( !suppressDisabledCheck &&
|
if ( !suppressDisabledCheck &&
|
||||||
( instance.options.disabled === true ||
|
( instance.options.disabled === true ||
|
||||||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
|
$( this ).hasClass( "ui-state-disabled" ) ) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||||
.apply( instance, arguments );
|
.apply( instance, arguments );
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy the guid so direct unbinding works
|
// copy the guid so direct unbinding works
|
||||||
if ( typeof handler !== "string" ) {
|
if ( typeof handler !== "string" ) {
|
||||||
handlerProxy.guid = handler.guid =
|
handlerProxy.guid = handler.guid =
|
||||||
handler.guid || handlerProxy.guid || $.guid++;
|
handler.guid || handlerProxy.guid || $.guid++;
|
||||||
}
|
}
|
||||||
|
|
||||||
var match = event.match( /^(\w+)\s*(.*)$/ ),
|
var match = event.match( /^(\w+)\s*(.*)$/ ),
|
||||||
eventName = match[1] + instance.eventNamespace,
|
eventName = match[1] + instance.eventNamespace,
|
||||||
selector = match[2];
|
selector = match[2];
|
||||||
if ( selector ) {
|
if ( selector ) {
|
||||||
delegateElement.delegate( selector, eventName, handlerProxy );
|
delegateElement.delegate( selector, eventName, handlerProxy );
|
||||||
} else {
|
} else {
|
||||||
element.bind( eventName, handlerProxy );
|
element.bind( eventName, handlerProxy );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_off: function( element, eventName ) {
|
_off: function( element, eventName ) {
|
||||||
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
|
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
|
||||||
element.unbind( eventName ).undelegate( eventName );
|
element.unbind( eventName ).undelegate( eventName );
|
||||||
},
|
},
|
||||||
|
|
||||||
_delay: function( handler, delay ) {
|
_delay: function( handler, delay ) {
|
||||||
function handlerProxy() {
|
function handlerProxy() {
|
||||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||||
.apply( instance, arguments );
|
.apply( instance, arguments );
|
||||||
}
|
}
|
||||||
var instance = this;
|
var instance = this;
|
||||||
return setTimeout( handlerProxy, delay || 0 );
|
return setTimeout( handlerProxy, delay || 0 );
|
||||||
},
|
},
|
||||||
|
|
||||||
_hoverable: function( element ) {
|
_hoverable: function( element ) {
|
||||||
this.hoverable = this.hoverable.add( element );
|
this.hoverable = this.hoverable.add( element );
|
||||||
this._on( element, {
|
this._on( element, {
|
||||||
mouseenter: function( event ) {
|
mouseenter: function( event ) {
|
||||||
$( event.currentTarget ).addClass( "ui-state-hover" );
|
$( event.currentTarget ).addClass( "ui-state-hover" );
|
||||||
},
|
},
|
||||||
mouseleave: function( event ) {
|
mouseleave: function( event ) {
|
||||||
$( event.currentTarget ).removeClass( "ui-state-hover" );
|
$( event.currentTarget ).removeClass( "ui-state-hover" );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_focusable: function( element ) {
|
_focusable: function( element ) {
|
||||||
this.focusable = this.focusable.add( element );
|
this.focusable = this.focusable.add( element );
|
||||||
this._on( element, {
|
this._on( element, {
|
||||||
focusin: function( event ) {
|
focusin: function( event ) {
|
||||||
$( event.currentTarget ).addClass( "ui-state-focus" );
|
$( event.currentTarget ).addClass( "ui-state-focus" );
|
||||||
},
|
},
|
||||||
focusout: function( event ) {
|
focusout: function( event ) {
|
||||||
$( event.currentTarget ).removeClass( "ui-state-focus" );
|
$( event.currentTarget ).removeClass( "ui-state-focus" );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_trigger: function( type, event, data ) {
|
_trigger: function( type, event, data ) {
|
||||||
var prop, orig,
|
var prop, orig,
|
||||||
callback = this.options[ type ];
|
callback = this.options[ type ];
|
||||||
|
|
||||||
data = data || {};
|
data = data || {};
|
||||||
event = $.Event( event );
|
event = $.Event( event );
|
||||||
event.type = ( type === this.widgetEventPrefix ?
|
event.type = ( type === this.widgetEventPrefix ?
|
||||||
type :
|
type :
|
||||||
this.widgetEventPrefix + type ).toLowerCase();
|
this.widgetEventPrefix + type ).toLowerCase();
|
||||||
// the original event may come from any element
|
// the original event may come from any element
|
||||||
// so we need to reset the target on the new event
|
// so we need to reset the target on the new event
|
||||||
event.target = this.element[ 0 ];
|
event.target = this.element[ 0 ];
|
||||||
|
|
||||||
// copy original event properties over to the new event
|
// copy original event properties over to the new event
|
||||||
orig = event.originalEvent;
|
orig = event.originalEvent;
|
||||||
if ( orig ) {
|
if ( orig ) {
|
||||||
for ( prop in orig ) {
|
for ( prop in orig ) {
|
||||||
if ( !( prop in event ) ) {
|
if ( !( prop in event ) ) {
|
||||||
event[ prop ] = orig[ prop ];
|
event[ prop ] = orig[ prop ];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.element.trigger( event, data );
|
this.element.trigger( event, data );
|
||||||
return !( $.isFunction( callback ) &&
|
return !( $.isFunction( callback ) &&
|
||||||
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
|
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
|
||||||
event.isDefaultPrevented() );
|
event.isDefaultPrevented() );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
|
||||||
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
|
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
|
||||||
if ( typeof options === "string" ) {
|
if ( typeof options === "string" ) {
|
||||||
options = { effect: options };
|
options = { effect: options };
|
||||||
}
|
}
|
||||||
var hasOptions,
|
var hasOptions,
|
||||||
effectName = !options ?
|
effectName = !options ?
|
||||||
method :
|
method :
|
||||||
options === true || typeof options === "number" ?
|
options === true || typeof options === "number" ?
|
||||||
defaultEffect :
|
defaultEffect :
|
||||||
options.effect || defaultEffect;
|
options.effect || defaultEffect;
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if ( typeof options === "number" ) {
|
if ( typeof options === "number" ) {
|
||||||
options = { duration: options };
|
options = { duration: options };
|
||||||
}
|
}
|
||||||
hasOptions = !$.isEmptyObject( options );
|
hasOptions = !$.isEmptyObject( options );
|
||||||
options.complete = callback;
|
options.complete = callback;
|
||||||
if ( options.delay ) {
|
if ( options.delay ) {
|
||||||
element.delay( options.delay );
|
element.delay( options.delay );
|
||||||
}
|
}
|
||||||
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
|
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
|
||||||
element[ method ]( options );
|
element[ method ]( options );
|
||||||
} else if ( effectName !== method && element[ effectName ] ) {
|
} else if ( effectName !== method && element[ effectName ] ) {
|
||||||
element[ effectName ]( options.duration, options.easing, callback );
|
element[ effectName ]( options.duration, options.easing, callback );
|
||||||
} else {
|
} else {
|
||||||
element.queue(function( next ) {
|
element.queue(function( next ) {
|
||||||
$( this )[ method ]();
|
$( this )[ method ]();
|
||||||
if ( callback ) {
|
if ( callback ) {
|
||||||
callback.call( element[ 0 ] );
|
callback.call( element[ 0 ] );
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
9579
app/assets/javascripts/vendor/wysihtml5-0.4.0pre.js
vendored
553
app/assets/javascripts/vendor/wysihtml5-parser.js
vendored
@ -1,553 +0,0 @@
|
|||||||
/**
|
|
||||||
* Full HTML5 compatibility rule set
|
|
||||||
* These rules define which tags and CSS classes are supported and which tags should be specially treated.
|
|
||||||
*
|
|
||||||
* Examples based on this rule set:
|
|
||||||
*
|
|
||||||
* <a href="http://foobar.com">foo</a>
|
|
||||||
* ... becomes ...
|
|
||||||
* <a href="http://foobar.com" target="_blank" rel="nofollow">foo</a>
|
|
||||||
*
|
|
||||||
* <img align="left" src="http://foobar.com/image.png">
|
|
||||||
* ... becomes ...
|
|
||||||
* <img class="wysiwyg-float-left" src="http://foobar.com/image.png" alt="">
|
|
||||||
*
|
|
||||||
* <div>foo<script>alert(document.cookie)</script></div>
|
|
||||||
* ... becomes ...
|
|
||||||
* <div>foo</div>
|
|
||||||
*
|
|
||||||
* <marquee>foo</marquee>
|
|
||||||
* ... becomes ...
|
|
||||||
* <span>foo</span>
|
|
||||||
*
|
|
||||||
* foo <br clear="both"> bar
|
|
||||||
* ... becomes ...
|
|
||||||
* foo <br class="wysiwyg-clear-both"> bar
|
|
||||||
*
|
|
||||||
* <div>hello <iframe src="http://google.com"></iframe></div>
|
|
||||||
* ... becomes ...
|
|
||||||
* <div>hello </div>
|
|
||||||
*
|
|
||||||
* <center>hello</center>
|
|
||||||
* ... becomes ...
|
|
||||||
* <div class="wysiwyg-text-align-center">hello</div>
|
|
||||||
*/
|
|
||||||
var wysihtml5ParserRules = {
|
|
||||||
/**
|
|
||||||
* CSS Class white-list
|
|
||||||
* Following CSS classes won't be removed when parsed by the wysihtml5 HTML parser
|
|
||||||
*/
|
|
||||||
"classes": {
|
|
||||||
"wysiwyg-clear-both": 1,
|
|
||||||
"wysiwyg-clear-left": 1,
|
|
||||||
"wysiwyg-clear-right": 1,
|
|
||||||
"wysiwyg-color-aqua": 1,
|
|
||||||
"wysiwyg-color-black": 1,
|
|
||||||
"wysiwyg-color-blue": 1,
|
|
||||||
"wysiwyg-color-fuchsia": 1,
|
|
||||||
"wysiwyg-color-gray": 1,
|
|
||||||
"wysiwyg-color-green": 1,
|
|
||||||
"wysiwyg-color-lime": 1,
|
|
||||||
"wysiwyg-color-maroon": 1,
|
|
||||||
"wysiwyg-color-navy": 1,
|
|
||||||
"wysiwyg-color-olive": 1,
|
|
||||||
"wysiwyg-color-purple": 1,
|
|
||||||
"wysiwyg-color-red": 1,
|
|
||||||
"wysiwyg-color-silver": 1,
|
|
||||||
"wysiwyg-color-teal": 1,
|
|
||||||
"wysiwyg-color-white": 1,
|
|
||||||
"wysiwyg-color-yellow": 1,
|
|
||||||
"wysiwyg-float-left": 1,
|
|
||||||
"wysiwyg-float-right": 1,
|
|
||||||
"wysiwyg-font-size-large": 1,
|
|
||||||
"wysiwyg-font-size-larger": 1,
|
|
||||||
"wysiwyg-font-size-medium": 1,
|
|
||||||
"wysiwyg-font-size-small": 1,
|
|
||||||
"wysiwyg-font-size-smaller": 1,
|
|
||||||
"wysiwyg-font-size-x-large": 1,
|
|
||||||
"wysiwyg-font-size-x-small": 1,
|
|
||||||
"wysiwyg-font-size-xx-large": 1,
|
|
||||||
"wysiwyg-font-size-xx-small": 1,
|
|
||||||
"wysiwyg-text-align-center": 1,
|
|
||||||
"wysiwyg-text-align-justify": 1,
|
|
||||||
"wysiwyg-text-align-left": 1,
|
|
||||||
"wysiwyg-text-align-right": 1
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Tag list
|
|
||||||
*
|
|
||||||
* The following options are available:
|
|
||||||
*
|
|
||||||
* - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
|
|
||||||
* The following methods are implemented in wysihtml5.dom.parse:
|
|
||||||
* - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
|
|
||||||
* <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
|
|
||||||
* - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
|
|
||||||
* <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
|
|
||||||
* - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
|
|
||||||
*
|
|
||||||
* - remove: removes the element and its content
|
|
||||||
*
|
|
||||||
* - rename_tag: renames the element to the given tag
|
|
||||||
*
|
|
||||||
* - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
|
|
||||||
*
|
|
||||||
* - set_attributes: sets/overrides the given attributes
|
|
||||||
*
|
|
||||||
* - check_attributes: checks the given HTML attribute via the given method
|
|
||||||
* - url: allows only valid urls (starting with http:// or https://)
|
|
||||||
* - src: allows something like "/foobar.jpg", "http://google.com", ...
|
|
||||||
* - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg"
|
|
||||||
* - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
|
|
||||||
* - numbers: ensures that the attribute only contains numeric characters
|
|
||||||
*/
|
|
||||||
"tags": {
|
|
||||||
"tr": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"strike": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"form": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"rt": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"code": {},
|
|
||||||
"acronym": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"br": {
|
|
||||||
"add_class": {
|
|
||||||
"clear": "clear_br"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"details": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"h4": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"em": {},
|
|
||||||
"title": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"multicol": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"figure": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"xmp": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"small": {
|
|
||||||
"rename_tag": "span",
|
|
||||||
"set_class": "wysiwyg-font-size-smaller"
|
|
||||||
},
|
|
||||||
"area": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"time": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"dir": {
|
|
||||||
"rename_tag": "ul"
|
|
||||||
},
|
|
||||||
"bdi": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"command": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"ul": {},
|
|
||||||
"progress": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"dfn": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"iframe": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"figcaption": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"a": {
|
|
||||||
"check_attributes": {
|
|
||||||
"href": "url" // if you compiled master manually then change this from 'url' to 'href'
|
|
||||||
},
|
|
||||||
"set_attributes": {
|
|
||||||
"rel": "nofollow",
|
|
||||||
"target": "_blank"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"img": {
|
|
||||||
"check_attributes": {
|
|
||||||
"width": "numbers",
|
|
||||||
"alt": "alt",
|
|
||||||
"src": "url", // if you compiled master manually then change this from 'url' to 'src'
|
|
||||||
"height": "numbers"
|
|
||||||
},
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_img"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rb": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"footer": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"noframes": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"abbr": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"u": {},
|
|
||||||
"bgsound": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"sup": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"address": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"basefont": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"nav": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"h1": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"head": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"tbody": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dd": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"s": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"li": {},
|
|
||||||
"td": {
|
|
||||||
"check_attributes": {
|
|
||||||
"rowspan": "numbers",
|
|
||||||
"colspan": "numbers"
|
|
||||||
},
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"object": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"div": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"option": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"select": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"i": {},
|
|
||||||
"track": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"wbr": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"fieldset": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"big": {
|
|
||||||
"rename_tag": "span",
|
|
||||||
"set_class": "wysiwyg-font-size-larger"
|
|
||||||
},
|
|
||||||
"button": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"noscript": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"svg": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"input": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"table": {},
|
|
||||||
"keygen": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"h5": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"meta": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"map": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"isindex": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"mark": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"caption": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tfoot": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"base": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"video": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"strong": {},
|
|
||||||
"canvas": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"output": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"marquee": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"b": {},
|
|
||||||
"q": {
|
|
||||||
"check_attributes": {
|
|
||||||
"cite": "url"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"applet": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"span": {},
|
|
||||||
"rp": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"spacer": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"source": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"aside": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"frame": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"section": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"body": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"ol": {},
|
|
||||||
"nobr": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"html": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"summary": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"var": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"del": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"blockquote": {
|
|
||||||
"check_attributes": {
|
|
||||||
"cite": "url"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"style": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"device": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"meter": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"h3": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"textarea": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"embed": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"hgroup": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"font": {
|
|
||||||
"rename_tag": "span",
|
|
||||||
"add_class": {
|
|
||||||
"size": "size_font"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tt": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"noembed": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"thead": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"blink": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"plaintext": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"xml": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"h6": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"param": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"th": {
|
|
||||||
"check_attributes": {
|
|
||||||
"rowspan": "numbers",
|
|
||||||
"colspan": "numbers"
|
|
||||||
},
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"legend": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"hr": {},
|
|
||||||
"label": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"dl": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"kbd": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"listing": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"dt": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"nextid": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"pre": {},
|
|
||||||
"center": {
|
|
||||||
"rename_tag": "div",
|
|
||||||
"set_class": "wysiwyg-text-align-center"
|
|
||||||
},
|
|
||||||
"audio": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"datalist": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"samp": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"col": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"article": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
},
|
|
||||||
"cite": {},
|
|
||||||
"link": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"script": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"bdo": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"menu": {
|
|
||||||
"rename_tag": "ul"
|
|
||||||
},
|
|
||||||
"colgroup": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"ruby": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"h2": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ins": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"p": {
|
|
||||||
"add_class": {
|
|
||||||
"align": "align_text"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"sub": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"comment": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"frameset": {
|
|
||||||
"remove": 1
|
|
||||||
},
|
|
||||||
"optgroup": {
|
|
||||||
"rename_tag": "span"
|
|
||||||
},
|
|
||||||
"header": {
|
|
||||||
"rename_tag": "div"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
@ -1,622 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
@import "admin/framework/bootstrap.less";
|
|
||||||
|
|
||||||
// Font Awesome
|
|
||||||
@import "fontawesome/font-awesome";
|
|
||||||
@import "admin/lesshat";
|
|
||||||
|
|
||||||
@import "manager";
|
|
||||||
@import "redactor";
|
|
||||||
@import "admin/pane_hover";
|
|
||||||
@import "vendor/select2";
|
|
||||||
|
|
||||||
|
|
||||||
html {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
height: 100%;
|
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#sortable_category{
|
|
||||||
.category_row{
|
|
||||||
padding:8px 0px;
|
|
||||||
background:rgba(240,240,240,1);
|
|
||||||
margin:3px 0px;
|
|
||||||
|
|
||||||
.actions{
|
|
||||||
text-align:right;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.receptable{
|
|
||||||
position:relative;
|
|
||||||
|
|
||||||
.placeholder{
|
|
||||||
position:absolute;
|
|
||||||
top:0px;
|
|
||||||
left:0px;
|
|
||||||
right:0px;
|
|
||||||
bottom:0px;
|
|
||||||
height:auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#tags .tag_label{
|
|
||||||
i{ display:none;}
|
|
||||||
|
|
||||||
&.active{
|
|
||||||
|
|
||||||
background:rgba(0,136,204,1);
|
|
||||||
color:white;
|
|
||||||
i{ display:inline;}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.set_tag{
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag_label{
|
|
||||||
border-radius:11px;background:rgba(206,220,244,1);border:1px solid rgba(170,196,238,1);padding:2px 9px;display:inline-block;cursor:default;color:black;
|
|
||||||
margin-bottom:5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.map_content_map img {
|
|
||||||
max-width: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mapCanvas label {
|
|
||||||
width: auto; display:inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
body.admin{
|
|
||||||
|
|
||||||
#artworks{
|
|
||||||
.artwork{
|
|
||||||
float:left;width:250px;height:270px;margin:0px 10px 10px 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
padding:0px;
|
|
||||||
|
|
||||||
.right{
|
|
||||||
float:right;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon{
|
|
||||||
border:1px solid #0088cc;
|
|
||||||
display:inline-block;
|
|
||||||
padding:6px;
|
|
||||||
border-radius:50%;
|
|
||||||
font-size:1.1em;
|
|
||||||
width:1.1em;
|
|
||||||
height:1.1em;
|
|
||||||
text-align:center;
|
|
||||||
background:white;
|
|
||||||
|
|
||||||
&:hover{
|
|
||||||
background:#0088cc;
|
|
||||||
color:white;
|
|
||||||
text-decoration:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#upload_details{
|
|
||||||
display:none;
|
|
||||||
.content{
|
|
||||||
position:absolute;
|
|
||||||
top:0px;
|
|
||||||
left:0px;
|
|
||||||
right:0px;
|
|
||||||
bottom:0px;
|
|
||||||
overflow:auto;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
height:400px;
|
|
||||||
width:800px;
|
|
||||||
position:absolute;
|
|
||||||
top:-400px;
|
|
||||||
right:1em;
|
|
||||||
|
|
||||||
background:white;
|
|
||||||
box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);
|
|
||||||
background-color: @dropdownBackground;
|
|
||||||
border: 1px solid #ccc; // Fallback for IE7-8
|
|
||||||
border: 1px solid @dropdownBorder;
|
|
||||||
*border-right-width: 2px;
|
|
||||||
*border-bottom-width: 2px;
|
|
||||||
.border-radius(6px);
|
|
||||||
.box-shadow(0 5px 10px rgba(0,0,0,.2));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
#upload_details::before {
|
|
||||||
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
border-left: 7px solid transparent;
|
|
||||||
border-right: 7px solid transparent;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
right: 215px;
|
|
||||||
border-top: 7px solid rgba(0, 0, 0, 0.2);
|
|
||||||
|
|
||||||
border-bottom: 0;
|
|
||||||
bottom: -7px;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#upload_details::after {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
border-left: 6px solid transparent;
|
|
||||||
border-right: 6px solid transparent;
|
|
||||||
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
right: 216px;
|
|
||||||
border-top: 6px solid #ffffff;
|
|
||||||
border-bottom: 0;
|
|
||||||
bottom: -6px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#toolbar-text{
|
|
||||||
position:fixed;
|
|
||||||
z-index:2;
|
|
||||||
box-shadow: #000000 0px 0px 5px;
|
|
||||||
top:40px;
|
|
||||||
left:0px;
|
|
||||||
right:330px;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#flashs{
|
|
||||||
position:fixed;
|
|
||||||
bottom:0px;
|
|
||||||
|
|
||||||
right:1em;
|
|
||||||
min-width:600px;
|
|
||||||
width:50%;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
form .clearfix:before, form .clearfix:after {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.error{
|
|
||||||
color:red;
|
|
||||||
|
|
||||||
input{
|
|
||||||
border-color:red;
|
|
||||||
}
|
|
||||||
|
|
||||||
*{
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
body.dragging, body.dragging * {
|
|
||||||
cursor: move !important;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.dragged {
|
|
||||||
position: absolute;
|
|
||||||
opacity: 0.5;
|
|
||||||
z-index: 2000;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.sortable li.placeholder {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
ol.sortable li.placeholder:before {
|
|
||||||
position: absolute;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.placeholder{
|
|
||||||
background:rgba(143,202,70,0.8);
|
|
||||||
height:10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.prevv_folder{
|
|
||||||
|
|
||||||
border-top:1px solid #999999;
|
|
||||||
border-bottom:1px solid #999999;
|
|
||||||
padding:8px 0px;
|
|
||||||
|
|
||||||
.placeholder{
|
|
||||||
height:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.active{
|
|
||||||
background:rgba(143,202,70,0.8);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#sortable_menu_item{
|
|
||||||
.menu_item_row{
|
|
||||||
padding:8px 0px;
|
|
||||||
background:rgba(240,240,240,1);
|
|
||||||
margin:3px 0px;
|
|
||||||
|
|
||||||
.actions{
|
|
||||||
text-align:right;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.receptable{
|
|
||||||
position:relative;
|
|
||||||
|
|
||||||
.placeholder{
|
|
||||||
position:absolute;
|
|
||||||
top:0px;
|
|
||||||
left:0px;
|
|
||||||
right:0px;
|
|
||||||
bottom:0px;
|
|
||||||
height:auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu_item_informations{
|
|
||||||
|
|
||||||
|
|
||||||
form{
|
|
||||||
|
|
||||||
.preview{
|
|
||||||
|
|
||||||
img{
|
|
||||||
height:50px;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
position:fixed;
|
|
||||||
z-index:3;
|
|
||||||
overflow:auto;
|
|
||||||
box-shadow:rgba(0,0,0,1) 0px 0px 5px;
|
|
||||||
margin-bottom:0px;
|
|
||||||
top:40px;
|
|
||||||
right:0px;
|
|
||||||
width:330px;
|
|
||||||
bottom:0px;
|
|
||||||
background:white;
|
|
||||||
.placeholder{
|
|
||||||
display:inline-block;
|
|
||||||
width:91px;
|
|
||||||
height:91px;
|
|
||||||
margin:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.portlet{
|
|
||||||
display:inline-block;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.block_portlets{
|
|
||||||
min-height:50px;
|
|
||||||
border:1px dotted rgba(227,227,227,1);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.block_portlets_sortable{
|
|
||||||
border:0px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.portlet{
|
|
||||||
position:relative;
|
|
||||||
&:hover{
|
|
||||||
background:rgba(244,248,250,1);
|
|
||||||
|
|
||||||
.btn-toolbar{
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#menu_item_inspector_container{
|
|
||||||
|
|
||||||
.accordion{
|
|
||||||
|
|
||||||
height:auto;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.accordion-group{
|
|
||||||
border:0px;
|
|
||||||
border-radius:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.accordion-body{
|
|
||||||
background:white;
|
|
||||||
|
|
||||||
}
|
|
||||||
.accordion-heading{
|
|
||||||
border-radius:0px;
|
|
||||||
border:0px;
|
|
||||||
background:-webkit-linear-gradient(top, #222222, #111111);
|
|
||||||
padding:0px;
|
|
||||||
min-height:0px;
|
|
||||||
a{
|
|
||||||
padding:10px 20px;
|
|
||||||
color:white;
|
|
||||||
|
|
||||||
&:hover{
|
|
||||||
text-decoration:none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
.inspector_handle{
|
|
||||||
height:10px;
|
|
||||||
width:100%;
|
|
||||||
background:black;
|
|
||||||
cursor:pointer;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.portlet{
|
|
||||||
img{height:50px;cursor:pointer;}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-toolbar{
|
|
||||||
display:none;
|
|
||||||
top:-35px;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#column_sliders{
|
|
||||||
|
|
||||||
position:relative;
|
|
||||||
|
|
||||||
.slider{
|
|
||||||
position:absolute;
|
|
||||||
top:0px;
|
|
||||||
left:0px;
|
|
||||||
width:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider-selection{
|
|
||||||
display:none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.slider:not(:first-child){
|
|
||||||
|
|
||||||
|
|
||||||
.slider-track{
|
|
||||||
background:transparent;
|
|
||||||
box-shadow:transparent 0px 0px 0px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.slider-handle{
|
|
||||||
z-index:100;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.html_content_form{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ace_editor_pre{
|
|
||||||
position:relative;
|
|
||||||
width:100%;
|
|
||||||
height:400px;
|
|
||||||
background:white;
|
|
||||||
border:1px solid #353535;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
&.large{
|
|
||||||
position:fixed;
|
|
||||||
top:0px;
|
|
||||||
left:0px;
|
|
||||||
bottom:0px;
|
|
||||||
right:0px;
|
|
||||||
background:white;
|
|
||||||
z-index:2000 !important;
|
|
||||||
|
|
||||||
|
|
||||||
#ace_editor_pre{
|
|
||||||
position:absolute;
|
|
||||||
top:10px;
|
|
||||||
left:10px;
|
|
||||||
bottom:50px;
|
|
||||||
right:10px;
|
|
||||||
width:inherit;
|
|
||||||
height:inherit;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.action{
|
|
||||||
|
|
||||||
position:absolute;
|
|
||||||
|
|
||||||
bottom:15px;
|
|
||||||
right:5px;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.image_square{
|
|
||||||
display:inline-block;
|
|
||||||
padding:5px;
|
|
||||||
margin:5px;
|
|
||||||
position:relative;
|
|
||||||
border : 1px solid rgb(230,230,230);
|
|
||||||
|
|
||||||
background:white;
|
|
||||||
|
|
||||||
.actions{
|
|
||||||
display:none;
|
|
||||||
position:absolute;
|
|
||||||
top:0px;
|
|
||||||
right:0px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.image_square .img{
|
|
||||||
text-align:center;
|
|
||||||
width:150px;
|
|
||||||
height:150px;
|
|
||||||
margin:0px;
|
|
||||||
background-position:center center;
|
|
||||||
background-repeat:no-repeat;
|
|
||||||
|
|
||||||
background-size: contain;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.image_square:hover .actions{
|
|
||||||
display:block;
|
|
||||||
border:none;
|
|
||||||
padding:0px;
|
|
||||||
margin:0px;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.image_square:hover .actions:hover{
|
|
||||||
|
|
||||||
opacity:1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.event_date_form{
|
|
||||||
background:rgba(143,193,46,0.9);
|
|
||||||
margin:0px -10px 20px -10px;
|
|
||||||
padding:10px;
|
|
||||||
|
|
||||||
color:black;
|
|
||||||
|
|
||||||
p{
|
|
||||||
line-height:35px;
|
|
||||||
}
|
|
||||||
|
|
||||||
label{
|
|
||||||
display:inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.field_with_suppr{
|
|
||||||
display:inline-block;
|
|
||||||
position:relative;
|
|
||||||
|
|
||||||
.suppr{
|
|
||||||
|
|
||||||
display:block;
|
|
||||||
position:absolute;
|
|
||||||
top:7px;
|
|
||||||
right:5px;
|
|
||||||
img{
|
|
||||||
cursor:pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.periodes_form .field, .jockers_form .field{
|
|
||||||
border:1px solid #5b94c7;
|
|
||||||
margin:0.5em;
|
|
||||||
}
|
|
||||||
|
|
820
app/assets/stylesheets/admin.css.scss
Normal file
@ -0,0 +1,820 @@
|
|||||||
|
|
||||||
|
|
||||||
|
@import "bootstrap";
|
||||||
|
|
||||||
|
@import "fontawesome/font-awesome";
|
||||||
|
@import "manager";
|
||||||
|
@import "redactor";
|
||||||
|
@import "pane_hover";
|
||||||
|
@import "vendor/select2";
|
||||||
|
|
||||||
|
#admin_nav{
|
||||||
|
border-radius:0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
span.preview{
|
||||||
|
img{
|
||||||
|
max-width:125px;
|
||||||
|
max-height:125px;
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
img{
|
||||||
|
|
||||||
|
max-width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#tags .tag_label{
|
||||||
|
i{ display:none;}
|
||||||
|
|
||||||
|
&.active{
|
||||||
|
|
||||||
|
background:rgba(0,136,204,1);
|
||||||
|
color:white;
|
||||||
|
i{ display:inline;}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.set_tag{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag_label{
|
||||||
|
border-radius:11px;background:rgba(206,220,244,1);border:1px solid rgba(170,196,238,1);padding:2px 9px;display:inline-block;cursor:default;color:black;
|
||||||
|
margin-bottom:5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.map_content_map img {
|
||||||
|
max-width: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mapCanvas label {
|
||||||
|
width: auto; display:inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.admin{
|
||||||
|
|
||||||
|
#artworks{
|
||||||
|
.artwork{
|
||||||
|
float:left;width:250px;height:270px;margin:0px 10px 10px 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
padding:0px;
|
||||||
|
|
||||||
|
.right{
|
||||||
|
float:right;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon{
|
||||||
|
border:1px solid #0088cc;
|
||||||
|
display:inline-block;
|
||||||
|
padding:6px;
|
||||||
|
border-radius:50%;
|
||||||
|
|
||||||
|
text-align:center;
|
||||||
|
background:white;
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
background:#0088cc;
|
||||||
|
color:white;
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#upload_details{
|
||||||
|
display:none;
|
||||||
|
.content{
|
||||||
|
position:absolute;
|
||||||
|
top:0px;
|
||||||
|
left:0px;
|
||||||
|
right:0px;
|
||||||
|
bottom:0px;
|
||||||
|
overflow:auto;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
height:400px;
|
||||||
|
width:800px;
|
||||||
|
position:absolute;
|
||||||
|
top:-400px;
|
||||||
|
right:1em;
|
||||||
|
|
||||||
|
background:white;
|
||||||
|
box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);
|
||||||
|
//background-color: @dropdownBackground;
|
||||||
|
border: 1px solid #ccc; // Fallback for IE7-8
|
||||||
|
//border: 1px solid @dropdownBorder;
|
||||||
|
*border-right-width: 2px;
|
||||||
|
*border-bottom-width: 2px;
|
||||||
|
//.border-radius(6px);
|
||||||
|
//.box-shadow(0 5px 10px rgba(0,0,0,.2));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
#upload_details::before {
|
||||||
|
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
right: 215px;
|
||||||
|
border-top: 7px solid rgba(0, 0, 0, 0.2);
|
||||||
|
|
||||||
|
border-bottom: 0;
|
||||||
|
bottom: -7px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#upload_details::after {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
right: 216px;
|
||||||
|
border-top: 6px solid #ffffff;
|
||||||
|
border-bottom: 0;
|
||||||
|
bottom: -6px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#toolbar-text{
|
||||||
|
position:fixed;
|
||||||
|
z-index:2;
|
||||||
|
|
||||||
|
top:52px;
|
||||||
|
left:0px;
|
||||||
|
right:330px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#flashs{
|
||||||
|
position:fixed;
|
||||||
|
bottom:0px;
|
||||||
|
|
||||||
|
left:1em;
|
||||||
|
min-width:600px;
|
||||||
|
width:50%;
|
||||||
|
z-index:3;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
form .clearfix:before, form .clearfix:after {
|
||||||
|
display: inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.error{
|
||||||
|
color:red;
|
||||||
|
|
||||||
|
input{
|
||||||
|
border-color:red;
|
||||||
|
}
|
||||||
|
|
||||||
|
*{
|
||||||
|
color:red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
body.dragging, body.dragging * {
|
||||||
|
cursor: move !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.dragged {
|
||||||
|
position: absolute;
|
||||||
|
opacity: 0.5;
|
||||||
|
z-index: 2000;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol.sortable li.placeholder {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol.sortable li.placeholder:before {
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.placeholder{
|
||||||
|
background:rgba(143,202,70,0.8);
|
||||||
|
height:10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.prevv_folder{
|
||||||
|
|
||||||
|
border-top:1px solid #999999;
|
||||||
|
border-bottom:1px solid #999999;
|
||||||
|
padding:8px 0px;
|
||||||
|
|
||||||
|
.placeholder{
|
||||||
|
height:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.active{
|
||||||
|
background:rgba(143,202,70,0.8);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#sortable_menu_item{
|
||||||
|
.menu_item_row{
|
||||||
|
padding:8px 0px;
|
||||||
|
background:rgba(240,240,240,1);
|
||||||
|
margin:3px 0px;
|
||||||
|
|
||||||
|
.actions{
|
||||||
|
text-align:right;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.receptable{
|
||||||
|
position:relative;
|
||||||
|
|
||||||
|
.placeholder{
|
||||||
|
position:absolute;
|
||||||
|
top:0px;
|
||||||
|
left:0px;
|
||||||
|
right:0px;
|
||||||
|
bottom:0px;
|
||||||
|
height:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu_item_informations{
|
||||||
|
|
||||||
|
|
||||||
|
form{
|
||||||
|
|
||||||
|
.preview{
|
||||||
|
|
||||||
|
img{
|
||||||
|
height:50px;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
position:fixed;
|
||||||
|
z-index:3;
|
||||||
|
overflow:auto;
|
||||||
|
box-shadow:rgba(0,0,0,1) 0px 0px 5px;
|
||||||
|
margin-bottom:0px;
|
||||||
|
top:52px;
|
||||||
|
right:0px;
|
||||||
|
width:330px;
|
||||||
|
bottom:0px;
|
||||||
|
background:white;
|
||||||
|
.placeholder{
|
||||||
|
display:inline-block;
|
||||||
|
width:91px;
|
||||||
|
height:91px;
|
||||||
|
margin:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.block_portlets{
|
||||||
|
min-height:50px;
|
||||||
|
border:1px dotted rgba(227,227,227,1);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.block_portlets_sortable{
|
||||||
|
border:0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#menu_item_inspector_container{
|
||||||
|
.panel{
|
||||||
|
border-radius:0px;
|
||||||
|
border-left:0px;
|
||||||
|
border-right:0px;
|
||||||
|
|
||||||
|
}
|
||||||
|
.accordion{
|
||||||
|
|
||||||
|
height:auto;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.accordion-group{
|
||||||
|
border:0px;
|
||||||
|
border-radius:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.accordion-body{
|
||||||
|
background:white;
|
||||||
|
|
||||||
|
}
|
||||||
|
.accordion-heading{
|
||||||
|
border-radius:0px;
|
||||||
|
border:0px;
|
||||||
|
background:-webkit-linear-gradient(top, #222222, #111111);
|
||||||
|
padding:0px;
|
||||||
|
min-height:0px;
|
||||||
|
a{
|
||||||
|
padding:10px 20px;
|
||||||
|
color:white;
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
text-decoration:none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.inspector_handle{
|
||||||
|
height:10px;
|
||||||
|
width:100%;
|
||||||
|
background:black;
|
||||||
|
cursor:pointer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.content_type{
|
||||||
|
display:inline-block;
|
||||||
|
img{height:50px;cursor:pointer;}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-toolbar{
|
||||||
|
display:none;
|
||||||
|
top:-35px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#column_sliders{
|
||||||
|
|
||||||
|
position:relative;
|
||||||
|
|
||||||
|
.slider{
|
||||||
|
position:absolute;
|
||||||
|
top:0px;
|
||||||
|
left:0px;
|
||||||
|
width:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider-selection{
|
||||||
|
display:none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.slider:not(:first-child){
|
||||||
|
|
||||||
|
|
||||||
|
.slider-track{
|
||||||
|
background:transparent;
|
||||||
|
box-shadow:transparent 0px 0px 0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.slider-handle{
|
||||||
|
z-index:100;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.html_content_form{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ace_editor_pre{
|
||||||
|
position:relative;
|
||||||
|
width:100%;
|
||||||
|
height:400px;
|
||||||
|
background:white;
|
||||||
|
border:1px solid #353535;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
&.large{
|
||||||
|
position:fixed;
|
||||||
|
top:0px;
|
||||||
|
left:0px;
|
||||||
|
bottom:0px;
|
||||||
|
right:0px;
|
||||||
|
background:white;
|
||||||
|
z-index:2000 !important;
|
||||||
|
|
||||||
|
|
||||||
|
#ace_editor_pre{
|
||||||
|
position:absolute;
|
||||||
|
top:10px;
|
||||||
|
left:10px;
|
||||||
|
bottom:50px;
|
||||||
|
right:10px;
|
||||||
|
width:inherit;
|
||||||
|
height:inherit;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.action{
|
||||||
|
|
||||||
|
position:absolute;
|
||||||
|
|
||||||
|
bottom:15px;
|
||||||
|
right:5px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.image_square{
|
||||||
|
display:inline-block;
|
||||||
|
padding:5px;
|
||||||
|
margin:5px;
|
||||||
|
position:relative;
|
||||||
|
border : 1px solid rgb(230,230,230);
|
||||||
|
|
||||||
|
background:white;
|
||||||
|
|
||||||
|
.actions{
|
||||||
|
display:none;
|
||||||
|
position:absolute;
|
||||||
|
top:0px;
|
||||||
|
right:0px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_square .img{
|
||||||
|
text-align:center;
|
||||||
|
width:150px;
|
||||||
|
height:150px;
|
||||||
|
margin:0px;
|
||||||
|
background-position:center center;
|
||||||
|
background-repeat:no-repeat;
|
||||||
|
|
||||||
|
background-size: contain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_square:hover .actions{
|
||||||
|
display:block;
|
||||||
|
border:none;
|
||||||
|
padding:0px;
|
||||||
|
margin:0px;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.image_square:hover .actions:hover{
|
||||||
|
|
||||||
|
opacity:1;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.event_date_form{
|
||||||
|
background:rgba(143,193,46,0.9);
|
||||||
|
margin:0px -10px 20px -10px;
|
||||||
|
padding:10px;
|
||||||
|
|
||||||
|
color:black;
|
||||||
|
|
||||||
|
p{
|
||||||
|
line-height:35px;
|
||||||
|
}
|
||||||
|
|
||||||
|
label{
|
||||||
|
display:inline;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.field_with_suppr{
|
||||||
|
display:inline-block;
|
||||||
|
position:relative;
|
||||||
|
|
||||||
|
.suppr{
|
||||||
|
|
||||||
|
display:block;
|
||||||
|
position:absolute;
|
||||||
|
top:7px;
|
||||||
|
right:5px;
|
||||||
|
img{
|
||||||
|
cursor:pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.periodes_form .field, .jockers_form .field{
|
||||||
|
border:1px solid #5b94c7;
|
||||||
|
margin:0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.table-striped{
|
||||||
|
|
||||||
|
tr:nth-child(odd) {
|
||||||
|
td, th{
|
||||||
|
background:#f9f9f9 !important;
|
||||||
|
}}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media print {
|
||||||
|
.visible-print { display: inherit !important; }
|
||||||
|
.hidden-print { display: none !important; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.portlet_placeholder{
|
||||||
|
background:rgba(80,80,80,0.5);
|
||||||
|
|
||||||
|
height:5px;
|
||||||
|
|
||||||
|
i{
|
||||||
|
display:none;
|
||||||
|
top:-20px;
|
||||||
|
left:-5px;
|
||||||
|
font-size:15px;
|
||||||
|
|
||||||
|
padding:5px;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
&:hover{
|
||||||
|
background:rgba(80,80,80,1);
|
||||||
|
|
||||||
|
i{
|
||||||
|
display:block;
|
||||||
|
position:absolute;top:-9px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
.portlet{
|
||||||
|
cursor:pointer;
|
||||||
|
box-sizing: border-box;
|
||||||
|
&.active{
|
||||||
|
border:3px solid rgba(129,155,237,1);
|
||||||
|
.redactor-editor{
|
||||||
|
background:rgba(225,237,251,1);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
&.portlet_text_content{
|
||||||
|
border:0;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.move{
|
||||||
|
opacity:0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
h1{
|
||||||
|
margin-top:0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.table-striped tr:nth-child(odd) td, .table-striped tr:nth-child(odd) th{
|
||||||
|
|
||||||
|
background:rgba(235,244,250,1) !important;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.block_portlets{
|
||||||
|
.portlet{
|
||||||
|
min-height:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#menu_item_informations{
|
||||||
|
#collapse3{
|
||||||
|
|
||||||
|
position:relative;
|
||||||
|
padding-bottom:50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#element_form_action{
|
||||||
|
|
||||||
|
position:fixed;
|
||||||
|
width:330px;
|
||||||
|
right:0;
|
||||||
|
bottom:0;
|
||||||
|
border-top:solid rgba(221,221,221,1) 1px;
|
||||||
|
|
||||||
|
.portlet_handle, .trash, .save{
|
||||||
|
border-radius:0;
|
||||||
|
border:0;
|
||||||
|
margin:0;
|
||||||
|
display:block;
|
||||||
|
float:left;
|
||||||
|
padding:10px 12px;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.portlet_handle{
|
||||||
|
width:35%;
|
||||||
|
|
||||||
|
.cancel_message{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.trash{
|
||||||
|
width:20%;
|
||||||
|
}
|
||||||
|
.save{
|
||||||
|
width:45%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.row{
|
||||||
|
|
||||||
|
margin:auto;
|
||||||
|
max-width:1100px;
|
||||||
|
display:block;
|
||||||
|
|
||||||
|
|
||||||
|
&:after{
|
||||||
|
content: "";
|
||||||
|
display: table;
|
||||||
|
clear: both;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.columns{
|
||||||
|
|
||||||
|
display:block;
|
||||||
|
|
||||||
|
box-sizing: border-box;
|
||||||
|
float:left;
|
||||||
|
display:inline-block;
|
||||||
|
|
||||||
|
&.span_12{
|
||||||
|
width:100%;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&.span_11{
|
||||||
|
width:100/12*11;
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_10{
|
||||||
|
width:percentage(1/12*10);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_9{
|
||||||
|
width:percentage(1/12*9);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_8{
|
||||||
|
width:percentage(1/12*8);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_7{
|
||||||
|
width:percentage(1/12*7);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&.span_6{
|
||||||
|
width:percentage(1/12*6);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_5{
|
||||||
|
width:percentage(1/12*5);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_4{
|
||||||
|
width:percentage(1/12*4);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_3{
|
||||||
|
width:percentage(1/12*3);
|
||||||
|
|
||||||
|
}
|
||||||
|
&.span_2{
|
||||||
|
width:percentage(1/12*2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
&.span_1{
|
||||||
|
width:percentage(1/12*1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#menu_item_informations{
|
||||||
|
h4{
|
||||||
|
color: #333333;
|
||||||
|
background-color: whitesmoke;
|
||||||
|
border:1px solid #dddddd;
|
||||||
|
padding:10px 15px;
|
||||||
|
font-size:16px;
|
||||||
|
cursor:pointer;
|
||||||
|
border-left:0px;
|
||||||
|
border-right:0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.panel{
|
||||||
|
padding:0 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#collapse3{
|
||||||
|
height:auto !important;
|
||||||
|
|
||||||
|
}
|
@ -1,34 +0,0 @@
|
|||||||
//
|
|
||||||
// Accordion
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Parent container
|
|
||||||
.accordion {
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Group == heading + body
|
|
||||||
.accordion-group {
|
|
||||||
margin-bottom: 2px;
|
|
||||||
border: 1px solid #e5e5e5;
|
|
||||||
.border-radius(@baseBorderRadius);
|
|
||||||
}
|
|
||||||
.accordion-heading {
|
|
||||||
border-bottom: 0;
|
|
||||||
}
|
|
||||||
.accordion-heading .accordion-toggle {
|
|
||||||
display: block;
|
|
||||||
padding: 8px 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// General toggle styles
|
|
||||||
.accordion-toggle {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inner needs the styles because you can't animate properly with any styles on the element
|
|
||||||
.accordion-inner {
|
|
||||||
padding: 9px 15px;
|
|
||||||
border-top: 1px solid #e5e5e5;
|
|
||||||
}
|
|
@ -1,79 +0,0 @@
|
|||||||
//
|
|
||||||
// Alerts
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Base styles
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
.alert {
|
|
||||||
padding: 8px 35px 8px 14px;
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
text-shadow: 0 1px 0 rgba(255,255,255,.5);
|
|
||||||
background-color: @warningBackground;
|
|
||||||
border: 1px solid @warningBorder;
|
|
||||||
.border-radius(@baseBorderRadius);
|
|
||||||
}
|
|
||||||
.alert,
|
|
||||||
.alert h4 {
|
|
||||||
// Specified for the h4 to prevent conflicts of changing @headingsColor
|
|
||||||
color: @warningText;
|
|
||||||
}
|
|
||||||
.alert h4 {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Adjust close link position
|
|
||||||
.alert .close {
|
|
||||||
position: relative;
|
|
||||||
top: -2px;
|
|
||||||
right: -21px;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Alternate styles
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
.alert-success {
|
|
||||||
background-color: @successBackground;
|
|
||||||
border-color: @successBorder;
|
|
||||||
color: @successText;
|
|
||||||
}
|
|
||||||
.alert-success h4 {
|
|
||||||
color: @successText;
|
|
||||||
}
|
|
||||||
.alert-danger,
|
|
||||||
.alert-error {
|
|
||||||
background-color: @errorBackground;
|
|
||||||
border-color: @errorBorder;
|
|
||||||
color: @errorText;
|
|
||||||
}
|
|
||||||
.alert-danger h4,
|
|
||||||
.alert-error h4 {
|
|
||||||
color: @errorText;
|
|
||||||
}
|
|
||||||
.alert-info {
|
|
||||||
background-color: @infoBackground;
|
|
||||||
border-color: @infoBorder;
|
|
||||||
color: @infoText;
|
|
||||||
}
|
|
||||||
.alert-info h4 {
|
|
||||||
color: @infoText;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Block alerts
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
.alert-block {
|
|
||||||
padding-top: 14px;
|
|
||||||
padding-bottom: 14px;
|
|
||||||
}
|
|
||||||
.alert-block > p,
|
|
||||||
.alert-block > ul {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
.alert-block p + p {
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
@ -1,67 +0,0 @@
|
|||||||
/*!
|
|
||||||
* Bootstrap v2.3.2
|
|
||||||
*
|
|
||||||
* Copyright 2012 Twitter, Inc
|
|
||||||
* Licensed under the Apache License v2.0
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Designed and built with all the love in the world @twitter by @mdo and @fat.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Core variables and mixins
|
|
||||||
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
|
|
||||||
@import "mixins.less";
|
|
||||||
|
|
||||||
// CSS Reset
|
|
||||||
@import "reset.less";
|
|
||||||
|
|
||||||
// Grid system and page structure
|
|
||||||
@import "scaffolding.less";
|
|
||||||
@import "grid.less";
|
|
||||||
@import "layouts.less";
|
|
||||||
|
|
||||||
// Base CSS
|
|
||||||
@import "type.less";
|
|
||||||
@import "code.less";
|
|
||||||
@import "formt.less";
|
|
||||||
@import "forms.less";
|
|
||||||
@import "tables.less";
|
|
||||||
|
|
||||||
// Components: common
|
|
||||||
@import "sprites.less";
|
|
||||||
@import "dropdowns.less";
|
|
||||||
@import "wells.less";
|
|
||||||
@import "component-animations.less";
|
|
||||||
@import "close.less";
|
|
||||||
|
|
||||||
// Components: Buttons & Alerts
|
|
||||||
@import "buttons.less";
|
|
||||||
@import "button-groups.less";
|
|
||||||
@import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
|
|
||||||
|
|
||||||
// Components: Nav
|
|
||||||
@import "navs.less";
|
|
||||||
@import "navbar.less";
|
|
||||||
@import "breadcrumbs.less";
|
|
||||||
@import "pagination.less";
|
|
||||||
@import "pager.less";
|
|
||||||
|
|
||||||
// Components: Popovers
|
|
||||||
@import "modals.less";
|
|
||||||
@import "tooltip.less";
|
|
||||||
@import "popovers.less";
|
|
||||||
|
|
||||||
// Components: Misc
|
|
||||||
@import "thumbnails.less";
|
|
||||||
@import "media.less";
|
|
||||||
@import "labels-badges.less";
|
|
||||||
@import "progress-bars.less";
|
|
||||||
@import "accordion.less";
|
|
||||||
@import "carousel.less";
|
|
||||||
@import "hero-unit.less";
|
|
||||||
|
|
||||||
// Utility classes
|
|
||||||
@import "utilities.less"; // Has to be last to override when necessary
|
|
||||||
|
|
||||||
|
|
||||||
@import "slider.less";
|
|
@ -1,24 +0,0 @@
|
|||||||
//
|
|
||||||
// Breadcrumbs
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
.breadcrumb {
|
|
||||||
padding: 8px 15px;
|
|
||||||
margin: 0 0 @baseLineHeight;
|
|
||||||
list-style: none;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
.border-radius(@baseBorderRadius);
|
|
||||||
> li {
|
|
||||||
display: inline-block;
|
|
||||||
.ie7-inline-block();
|
|
||||||
text-shadow: 0 1px 0 @white;
|
|
||||||
> .divider {
|
|
||||||
padding: 0 5px;
|
|
||||||
color: #ccc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
> .active {
|
|
||||||
color: @grayLight;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,229 +0,0 @@
|
|||||||
//
|
|
||||||
// Button groups
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Make the div behave like a button
|
|
||||||
.btn-group {
|
|
||||||
position: relative;
|
|
||||||
display: inline-block;
|
|
||||||
.ie7-inline-block();
|
|
||||||
font-size: 0; // remove as part 1 of font-size inline-block hack
|
|
||||||
vertical-align: middle; // match .btn alignment given font-size hack above
|
|
||||||
white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page)
|
|
||||||
.ie7-restore-left-whitespace();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Space out series of button groups
|
|
||||||
.btn-group + .btn-group {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optional: Group multiple button groups together for a toolbar
|
|
||||||
.btn-toolbar {
|
|
||||||
font-size: 0; // Hack to remove whitespace that results from using inline-block
|
|
||||||
margin-top: @baseLineHeight / 2;
|
|
||||||
margin-bottom: @baseLineHeight / 2;
|
|
||||||
> .btn + .btn,
|
|
||||||
> .btn-group + .btn,
|
|
||||||
> .btn + .btn-group {
|
|
||||||
margin-left: 5px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Float them, remove border radius, then re-add to first and last elements
|
|
||||||
.btn-group > .btn {
|
|
||||||
position: relative;
|
|
||||||
.border-radius(0);
|
|
||||||
}
|
|
||||||
.btn-group > .btn + .btn {
|
|
||||||
margin-left: -1px;
|
|
||||||
}
|
|
||||||
.btn-group > .btn,
|
|
||||||
.btn-group > .dropdown-menu,
|
|
||||||
.btn-group > .popover {
|
|
||||||
font-size: @baseFontSize; // redeclare as part 2 of font-size inline-block hack
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset fonts for other sizes
|
|
||||||
.btn-group > .btn-mini {
|
|
||||||
font-size: @fontSizeMini;
|
|
||||||
}
|
|
||||||
.btn-group > .btn-small {
|
|
||||||
font-size: @fontSizeSmall;
|
|
||||||
}
|
|
||||||
.btn-group > .btn-large {
|
|
||||||
font-size: @fontSizeLarge;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
|
|
||||||
.btn-group > .btn:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
.border-top-left-radius(@baseBorderRadius);
|
|
||||||
.border-bottom-left-radius(@baseBorderRadius);
|
|
||||||
}
|
|
||||||
// Need .dropdown-toggle since :last-child doesn't apply given a .dropdown-menu immediately after it
|
|
||||||
.btn-group > .btn:last-child,
|
|
||||||
.btn-group > .dropdown-toggle {
|
|
||||||
.border-top-right-radius(@baseBorderRadius);
|
|
||||||
.border-bottom-right-radius(@baseBorderRadius);
|
|
||||||
}
|
|
||||||
// Reset corners for large buttons
|
|
||||||
.btn-group > .btn.large:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
.border-top-left-radius(@borderRadiusLarge);
|
|
||||||
.border-bottom-left-radius(@borderRadiusLarge);
|
|
||||||
}
|
|
||||||
.btn-group > .btn.large:last-child,
|
|
||||||
.btn-group > .large.dropdown-toggle {
|
|
||||||
.border-top-right-radius(@borderRadiusLarge);
|
|
||||||
.border-bottom-right-radius(@borderRadiusLarge);
|
|
||||||
}
|
|
||||||
|
|
||||||
// On hover/focus/active, bring the proper btn to front
|
|
||||||
.btn-group > .btn:hover,
|
|
||||||
.btn-group > .btn:focus,
|
|
||||||
.btn-group > .btn:active,
|
|
||||||
.btn-group > .btn.active {
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// On active and open, don't show outline
|
|
||||||
.btn-group .dropdown-toggle:active,
|
|
||||||
.btn-group.open .dropdown-toggle {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Split button dropdowns
|
|
||||||
// ----------------------
|
|
||||||
|
|
||||||
// Give the line between buttons some depth
|
|
||||||
.btn-group > .btn + .dropdown-toggle {
|
|
||||||
padding-left: 8px;
|
|
||||||
padding-right: 8px;
|
|
||||||
.box-shadow(~"inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
|
|
||||||
*padding-top: 5px;
|
|
||||||
*padding-bottom: 5px;
|
|
||||||
}
|
|
||||||
.btn-group > .btn-mini + .dropdown-toggle {
|
|
||||||
padding-left: 5px;
|
|
||||||
padding-right: 5px;
|
|
||||||
*padding-top: 2px;
|
|
||||||
*padding-bottom: 2px;
|
|
||||||
}
|
|
||||||
.btn-group > .btn-small + .dropdown-toggle {
|
|
||||||
*padding-top: 5px;
|
|
||||||
*padding-bottom: 4px;
|
|
||||||
}
|
|
||||||
.btn-group > .btn-large + .dropdown-toggle {
|
|
||||||
padding-left: 12px;
|
|
||||||
padding-right: 12px;
|
|
||||||
*padding-top: 7px;
|
|
||||||
*padding-bottom: 7px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-group.open {
|
|
||||||
|
|
||||||
// The clickable button for toggling the menu
|
|
||||||
// Remove the gradient and set the same inset shadow as the :active state
|
|
||||||
.dropdown-toggle {
|
|
||||||
background-image: none;
|
|
||||||
.box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keep the hover's background when dropdown is open
|
|
||||||
.btn.dropdown-toggle {
|
|
||||||
background-color: @btnBackgroundHighlight;
|
|
||||||
}
|
|
||||||
.btn-primary.dropdown-toggle {
|
|
||||||
background-color: @btnPrimaryBackgroundHighlight;
|
|
||||||
}
|
|
||||||
.btn-warning.dropdown-toggle {
|
|
||||||
background-color: @btnWarningBackgroundHighlight;
|
|
||||||
}
|
|
||||||
.btn-danger.dropdown-toggle {
|
|
||||||
background-color: @btnDangerBackgroundHighlight;
|
|
||||||
}
|
|
||||||
.btn-success.dropdown-toggle {
|
|
||||||
background-color: @btnSuccessBackgroundHighlight;
|
|
||||||
}
|
|
||||||
.btn-info.dropdown-toggle {
|
|
||||||
background-color: @btnInfoBackgroundHighlight;
|
|
||||||
}
|
|
||||||
.btn-inverse.dropdown-toggle {
|
|
||||||
background-color: @btnInverseBackgroundHighlight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Reposition the caret
|
|
||||||
.btn .caret {
|
|
||||||
margin-top: 8px;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
// Carets in other button sizes
|
|
||||||
.btn-large .caret {
|
|
||||||
margin-top: 6px;
|
|
||||||
}
|
|
||||||
.btn-large .caret {
|
|
||||||
border-left-width: 5px;
|
|
||||||
border-right-width: 5px;
|
|
||||||
border-top-width: 5px;
|
|
||||||
}
|
|
||||||
.btn-mini .caret,
|
|
||||||
.btn-small .caret {
|
|
||||||
margin-top: 8px;
|
|
||||||
}
|
|
||||||
// Upside down carets for .dropup
|
|
||||||
.dropup .btn-large .caret {
|
|
||||||
border-bottom-width: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Account for other colors
|
|
||||||
.btn-primary,
|
|
||||||
.btn-warning,
|
|
||||||
.btn-danger,
|
|
||||||
.btn-info,
|
|
||||||
.btn-success,
|
|
||||||
.btn-inverse {
|
|
||||||
.caret {
|
|
||||||
border-top-color: @white;
|
|
||||||
border-bottom-color: @white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Vertical button groups
|
|
||||||
// ----------------------
|
|
||||||
|
|
||||||
.btn-group-vertical {
|
|
||||||
display: inline-block; // makes buttons only take up the width they need
|
|
||||||
.ie7-inline-block();
|
|
||||||
}
|
|
||||||
.btn-group-vertical > .btn {
|
|
||||||
display: block;
|
|
||||||
float: none;
|
|
||||||
max-width: 100%;
|
|
||||||
.border-radius(0);
|
|
||||||
}
|
|
||||||
.btn-group-vertical > .btn + .btn {
|
|
||||||
margin-left: 0;
|
|
||||||
margin-top: -1px;
|
|
||||||
}
|
|
||||||
.btn-group-vertical > .btn:first-child {
|
|
||||||
.border-radius(@baseBorderRadius @baseBorderRadius 0 0);
|
|
||||||
}
|
|
||||||
.btn-group-vertical > .btn:last-child {
|
|
||||||
.border-radius(0 0 @baseBorderRadius @baseBorderRadius);
|
|
||||||
}
|
|
||||||
.btn-group-vertical > .btn-large:first-child {
|
|
||||||
.border-radius(@borderRadiusLarge @borderRadiusLarge 0 0);
|
|
||||||
}
|
|
||||||
.btn-group-vertical > .btn-large:last-child {
|
|
||||||
.border-radius(0 0 @borderRadiusLarge @borderRadiusLarge);
|
|
||||||
}
|
|
@ -1,228 +0,0 @@
|
|||||||
//
|
|
||||||
// Buttons
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Base styles
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Core
|
|
||||||
.btn {
|
|
||||||
display: inline-block;
|
|
||||||
.ie7-inline-block();
|
|
||||||
padding: 4px 12px;
|
|
||||||
margin-bottom: 0; // For input.btn
|
|
||||||
font-size: @baseFontSize;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
text-align: center;
|
|
||||||
vertical-align: middle;
|
|
||||||
cursor: pointer;
|
|
||||||
.buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark, 0 1px 1px rgba(255,255,255,.75));
|
|
||||||
border: 1px solid @btnBorder;
|
|
||||||
*border: 0; // Remove the border to prevent IE7's black border on input:focus
|
|
||||||
border-bottom-color: darken(@btnBorder, 10%);
|
|
||||||
.border-radius(@baseBorderRadius);
|
|
||||||
.ie7-restore-left-whitespace(); // Give IE7 some love
|
|
||||||
.box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
|
|
||||||
|
|
||||||
// Hover/focus state
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
color: @grayDark;
|
|
||||||
text-decoration: none;
|
|
||||||
background-position: 0 -15px;
|
|
||||||
|
|
||||||
// transition is only when going to hover/focus, otherwise the background
|
|
||||||
// behind the gradient (there for IE<=9 fallback) gets mismatched
|
|
||||||
.transition(background-position .1s linear);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Focus state for keyboard and accessibility
|
|
||||||
&:focus {
|
|
||||||
.tab-focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Active state
|
|
||||||
&.active,
|
|
||||||
&:active {
|
|
||||||
background-image: none;
|
|
||||||
outline: 0;
|
|
||||||
.box-shadow(~"inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05)");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disabled state
|
|
||||||
&.disabled,
|
|
||||||
&[disabled] {
|
|
||||||
cursor: default;
|
|
||||||
background-image: none;
|
|
||||||
.opacity(65);
|
|
||||||
.box-shadow(none);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Button Sizes
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Large
|
|
||||||
.btn-large {
|
|
||||||
padding: @paddingLarge;
|
|
||||||
font-size: @fontSizeLarge;
|
|
||||||
.border-radius(@borderRadiusLarge);
|
|
||||||
}
|
|
||||||
.btn-large [class^="icon-"],
|
|
||||||
.btn-large [class*=" icon-"] {
|
|
||||||
margin-top: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Small
|
|
||||||
.btn-small {
|
|
||||||
padding: @paddingSmall;
|
|
||||||
font-size: @fontSizeSmall;
|
|
||||||
.border-radius(@borderRadiusSmall);
|
|
||||||
}
|
|
||||||
.btn-small [class^="icon-"],
|
|
||||||
.btn-small [class*=" icon-"] {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
.btn-mini [class^="icon-"],
|
|
||||||
.btn-mini [class*=" icon-"] {
|
|
||||||
margin-top: -1px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Mini
|
|
||||||
.btn-mini {
|
|
||||||
padding: @paddingMini;
|
|
||||||
font-size: @fontSizeMini;
|
|
||||||
.border-radius(@borderRadiusSmall);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Block button
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
.btn-block {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
padding-left: 0;
|
|
||||||
padding-right: 0;
|
|
||||||
.box-sizing(border-box);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Vertically space out multiple block buttons
|
|
||||||
.btn-block + .btn-block {
|
|
||||||
margin-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Specificity overrides
|
|
||||||
input[type="submit"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="button"] {
|
|
||||||
&.btn-block {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Alternate buttons
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Provide *some* extra contrast for those who can get it
|
|
||||||
.btn-primary.active,
|
|
||||||
.btn-warning.active,
|
|
||||||
.btn-danger.active,
|
|
||||||
.btn-success.active,
|
|
||||||
.btn-info.active,
|
|
||||||
.btn-inverse.active {
|
|
||||||
color: rgba(255,255,255,.75);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the backgrounds
|
|
||||||
// -------------------------
|
|
||||||
.btn-primary {
|
|
||||||
.buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
|
|
||||||
}
|
|
||||||
// Warning appears are orange
|
|
||||||
.btn-warning {
|
|
||||||
.buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
|
|
||||||
}
|
|
||||||
// Danger and error appear as red
|
|
||||||
.btn-danger {
|
|
||||||
.buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
|
|
||||||
}
|
|
||||||
// Success appears as green
|
|
||||||
.btn-success {
|
|
||||||
.buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
|
|
||||||
}
|
|
||||||
// Info appears as a neutral blue
|
|
||||||
.btn-info {
|
|
||||||
.buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
|
|
||||||
}
|
|
||||||
// Inverse appears as dark gray
|
|
||||||
.btn-inverse {
|
|
||||||
.buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Cross-browser Jank
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
button.btn,
|
|
||||||
input[type="submit"].btn {
|
|
||||||
|
|
||||||
// Firefox 3.6 only I believe
|
|
||||||
&::-moz-focus-inner {
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE7 has some default padding on button controls
|
|
||||||
*padding-top: 3px;
|
|
||||||
*padding-bottom: 3px;
|
|
||||||
|
|
||||||
&.btn-large {
|
|
||||||
*padding-top: 7px;
|
|
||||||
*padding-bottom: 7px;
|
|
||||||
}
|
|
||||||
&.btn-small {
|
|
||||||
*padding-top: 3px;
|
|
||||||
*padding-bottom: 3px;
|
|
||||||
}
|
|
||||||
&.btn-mini {
|
|
||||||
*padding-top: 1px;
|
|
||||||
*padding-bottom: 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Link buttons
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Make a button look and behave like a link
|
|
||||||
.btn-link,
|
|
||||||
.btn-link:active,
|
|
||||||
.btn-link[disabled] {
|
|
||||||
background-color: transparent;
|
|
||||||
background-image: none;
|
|
||||||
.box-shadow(none);
|
|
||||||
}
|
|
||||||
.btn-link {
|
|
||||||
border-color: transparent;
|
|
||||||
cursor: pointer;
|
|
||||||
color: @linkColor;
|
|
||||||
.border-radius(0);
|
|
||||||
}
|
|
||||||
.btn-link:hover,
|
|
||||||
.btn-link:focus {
|
|
||||||
color: @linkColorHover;
|
|
||||||
text-decoration: underline;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
.btn-link[disabled]:hover,
|
|
||||||
.btn-link[disabled]:focus {
|
|
||||||
color: @grayDark;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
@ -1,158 +0,0 @@
|
|||||||
//
|
|
||||||
// Carousel
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
.carousel {
|
|
||||||
position: relative;
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-inner {
|
|
||||||
overflow: hidden;
|
|
||||||
width: 100%;
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.carousel-inner {
|
|
||||||
|
|
||||||
> .item {
|
|
||||||
display: none;
|
|
||||||
position: relative;
|
|
||||||
.transition(.6s ease-in-out left);
|
|
||||||
|
|
||||||
// Account for jankitude on images
|
|
||||||
> img,
|
|
||||||
> a > img {
|
|
||||||
display: block;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
> .active,
|
|
||||||
> .next,
|
|
||||||
> .prev { display: block; }
|
|
||||||
|
|
||||||
> .active {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .next,
|
|
||||||
> .prev {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .next {
|
|
||||||
left: 100%;
|
|
||||||
}
|
|
||||||
> .prev {
|
|
||||||
left: -100%;
|
|
||||||
}
|
|
||||||
> .next.left,
|
|
||||||
> .prev.right {
|
|
||||||
left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
> .active.left {
|
|
||||||
left: -100%;
|
|
||||||
}
|
|
||||||
> .active.right {
|
|
||||||
left: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Left/right controls for nav
|
|
||||||
// ---------------------------
|
|
||||||
|
|
||||||
.carousel-control {
|
|
||||||
position: absolute;
|
|
||||||
top: 40%;
|
|
||||||
left: 15px;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
margin-top: -20px;
|
|
||||||
font-size: 60px;
|
|
||||||
font-weight: 100;
|
|
||||||
line-height: 30px;
|
|
||||||
color: @white;
|
|
||||||
text-align: center;
|
|
||||||
background: @grayDarker;
|
|
||||||
border: 3px solid @white;
|
|
||||||
.border-radius(23px);
|
|
||||||
.opacity(50);
|
|
||||||
|
|
||||||
// we can't have this transition here
|
|
||||||
// because webkit cancels the carousel
|
|
||||||
// animation if you trip this while
|
|
||||||
// in the middle of another animation
|
|
||||||
// ;_;
|
|
||||||
// .transition(opacity .2s linear);
|
|
||||||
|
|
||||||
// Reposition the right one
|
|
||||||
&.right {
|
|
||||||
left: auto;
|
|
||||||
right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hover/focus state
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
color: @white;
|
|
||||||
text-decoration: none;
|
|
||||||
.opacity(90);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Carousel indicator pips
|
|
||||||
// -----------------------------
|
|
||||||
.carousel-indicators {
|
|
||||||
position: absolute;
|
|
||||||
top: 15px;
|
|
||||||
right: 15px;
|
|
||||||
z-index: 5;
|
|
||||||
margin: 0;
|
|
||||||
list-style: none;
|
|
||||||
|
|
||||||
li {
|
|
||||||
display: block;
|
|
||||||
float: left;
|
|
||||||
width: 10px;
|
|
||||||
height: 10px;
|
|
||||||
margin-left: 5px;
|
|
||||||
text-indent: -999px;
|
|
||||||
background-color: #ccc;
|
|
||||||
background-color: rgba(255,255,255,.25);
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
.active {
|
|
||||||
background-color: #fff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Caption for text below images
|
|
||||||
// -----------------------------
|
|
||||||
|
|
||||||
.carousel-caption {
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
padding: 15px;
|
|
||||||
background: @grayDark;
|
|
||||||
background: rgba(0,0,0,.75);
|
|
||||||
}
|
|
||||||
.carousel-caption h4,
|
|
||||||
.carousel-caption p {
|
|
||||||
color: @white;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
}
|
|
||||||
.carousel-caption h4 {
|
|
||||||
margin: 0 0 5px;
|
|
||||||
}
|
|
||||||
.carousel-caption p {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
//
|
|
||||||
// Close icons
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
.close {
|
|
||||||
float: right;
|
|
||||||
font-size: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
color: @black;
|
|
||||||
text-shadow: 0 1px 0 rgba(255,255,255,1);
|
|
||||||
.opacity(20);
|
|
||||||
&:hover,
|
|
||||||
&:focus {
|
|
||||||
color: @black;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: pointer;
|
|
||||||
.opacity(40);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Additional properties for button version
|
|
||||||
// iOS requires the button element instead of an anchor tag.
|
|
||||||
// If you want the anchor version, it requires `href="#"`.
|
|
||||||
button.close {
|
|
||||||
padding: 0;
|
|
||||||
cursor: pointer;
|
|
||||||
background: transparent;
|
|
||||||
border: 0;
|
|
||||||
-webkit-appearance: none;
|
|
||||||
}
|
|
@ -1,61 +0,0 @@
|
|||||||
//
|
|
||||||
// Code (inline and blocK)
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Inline and block code styles
|
|
||||||
code,
|
|
||||||
pre {
|
|
||||||
padding: 0 3px 2px;
|
|
||||||
#font > #family > .monospace;
|
|
||||||
font-size: @baseFontSize - 2;
|
|
||||||
color: @grayDark;
|
|
||||||
.border-radius(3px);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Inline code
|
|
||||||
code {
|
|
||||||
padding: 2px 4px;
|
|
||||||
color: #d14;
|
|
||||||
background-color: #f7f7f9;
|
|
||||||
border: 1px solid #e1e1e8;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Blocks of code
|
|
||||||
pre {
|
|
||||||
display: block;
|
|
||||||
padding: (@baseLineHeight - 1) / 2;
|
|
||||||
margin: 0 0 @baseLineHeight / 2;
|
|
||||||
font-size: @baseFontSize - 1; // 14px to 13px
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
word-break: break-all;
|
|
||||||
word-wrap: break-word;
|
|
||||||
white-space: pre;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
border: 1px solid #ccc; // fallback for IE7-8
|
|
||||||
border: 1px solid rgba(0,0,0,.15);
|
|
||||||
.border-radius(@baseBorderRadius);
|
|
||||||
|
|
||||||
// Make prettyprint styles more spaced out for readability
|
|
||||||
&.prettyprint {
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Account for some code outputs that place code tags in pre tags
|
|
||||||
code {
|
|
||||||
padding: 0;
|
|
||||||
color: inherit;
|
|
||||||
white-space: pre;
|
|
||||||
white-space: pre-wrap;
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enable scrollable blocks of code
|
|
||||||
.pre-scrollable {
|
|
||||||
max-height: 340px;
|
|
||||||
overflow-y: scroll;
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
//
|
|
||||||
// Component animations
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
.fade {
|
|
||||||
opacity: 0;
|
|
||||||
.transition(opacity .15s linear);
|
|
||||||
&.in {
|
|
||||||
opacity: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.collapse {
|
|
||||||
position: relative;
|
|
||||||
height: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
.transition(height .35s ease);
|
|
||||||
&.in {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,248 +0,0 @@
|
|||||||
//
|
|
||||||
// Dropdown menus
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Use the .menu class on any <li> element within the topbar or ul.tabs and you'll get some superfancy dropdowns
|
|
||||||
.dropup,
|
|
||||||
.dropdown {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
.dropdown-toggle {
|
|
||||||
// The caret makes the toggle a bit too tall in IE7
|
|
||||||
*margin-bottom: -3px;
|
|
||||||
}
|
|
||||||
.dropdown-toggle:active,
|
|
||||||
.open .dropdown-toggle {
|
|
||||||
outline: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dropdown arrow/caret
|
|
||||||
// --------------------
|
|
||||||
.caret {
|
|
||||||
display: inline-block;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
vertical-align: top;
|
|
||||||
border-top: 4px solid @black;
|
|
||||||
border-right: 4px solid transparent;
|
|
||||||
border-left: 4px solid transparent;
|
|
||||||
content: "";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Place the caret
|
|
||||||
.dropdown .caret {
|
|
||||||
margin-top: 8px;
|
|
||||||
margin-left: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The dropdown menu (ul)
|
|
||||||
// ----------------------
|
|
||||||
.dropdown-menu {
|
|
||||||
position: absolute;
|
|
||||||
top: 100%;
|
|
||||||
left: 0;
|
|
||||||
z-index: @zindexDropdown;
|
|
||||||
display: none; // none by default, but block on "open" of the menu
|
|
||||||
float: left;
|
|
||||||
min-width: 160px;
|
|
||||||
padding: 5px 0;
|
|
||||||
margin: 2px 0 0; // override default ul
|
|
||||||
list-style: none;
|
|
||||||
background-color: @dropdownBackground;
|
|
||||||
border: 1px solid #ccc; // Fallback for IE7-8
|
|
||||||
border: 1px solid @dropdownBorder;
|
|
||||||
*border-right-width: 2px;
|
|
||||||
*border-bottom-width: 2px;
|
|
||||||
.border-radius(6px);
|
|
||||||
.box-shadow(0 5px 10px rgba(0,0,0,.2));
|
|
||||||
-webkit-background-clip: padding-box;
|
|
||||||
-moz-background-clip: padding;
|
|
||||||
background-clip: padding-box;
|
|
||||||
|
|
||||||
// Aligns the dropdown menu to right
|
|
||||||
&.pull-right {
|
|
||||||
right: 0;
|
|
||||||
left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dividers (basically an hr) within the dropdown
|
|
||||||
.divider {
|
|
||||||
.nav-divider(@dropdownDividerTop, @dropdownDividerBottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Links within the dropdown menu
|
|
||||||
> li > a {
|
|
||||||
display: block;
|
|
||||||
padding: 3px 20px;
|
|
||||||
clear: both;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
color: @dropdownLinkColor;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hover/Focus state
|
|
||||||
// -----------
|
|
||||||
.dropdown-menu > li > a:hover,
|
|
||||||
.dropdown-menu > li > a:focus,
|
|
||||||
.dropdown-submenu:hover > a,
|
|
||||||
.dropdown-submenu:focus > a {
|
|
||||||
text-decoration: none;
|
|
||||||
color: @dropdownLinkColorHover;
|
|
||||||
#gradient > .vertical(@dropdownLinkBackgroundHover, darken(@dropdownLinkBackgroundHover, 5%));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Active state
|
|
||||||
// ------------
|
|
||||||
.dropdown-menu > .active > a,
|
|
||||||
.dropdown-menu > .active > a:hover,
|
|
||||||
.dropdown-menu > .active > a:focus {
|
|
||||||
color: @dropdownLinkColorActive;
|
|
||||||
text-decoration: none;
|
|
||||||
outline: 0;
|
|
||||||
#gradient > .vertical(@dropdownLinkBackgroundActive, darken(@dropdownLinkBackgroundActive, 5%));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disabled state
|
|
||||||
// --------------
|
|
||||||
// Gray out text and ensure the hover/focus state remains gray
|
|
||||||
.dropdown-menu > .disabled > a,
|
|
||||||
.dropdown-menu > .disabled > a:hover,
|
|
||||||
.dropdown-menu > .disabled > a:focus {
|
|
||||||
color: @grayLight;
|
|
||||||
}
|
|
||||||
// Nuke hover/focus effects
|
|
||||||
.dropdown-menu > .disabled > a:hover,
|
|
||||||
.dropdown-menu > .disabled > a:focus {
|
|
||||||
text-decoration: none;
|
|
||||||
background-color: transparent;
|
|
||||||
background-image: none; // Remove CSS gradient
|
|
||||||
.reset-filter();
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Open state for the dropdown
|
|
||||||
// ---------------------------
|
|
||||||
.open {
|
|
||||||
// IE7's z-index only goes to the nearest positioned ancestor, which would
|
|
||||||
// make the menu appear below buttons that appeared later on the page
|
|
||||||
*z-index: @zindexDropdown;
|
|
||||||
|
|
||||||
& > .dropdown-menu {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backdrop to catch body clicks on mobile, etc.
|
|
||||||
// ---------------------------
|
|
||||||
.dropdown-backdrop {
|
|
||||||
position: fixed;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
top: 0;
|
|
||||||
z-index: @zindexDropdown - 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Right aligned dropdowns
|
|
||||||
// ---------------------------
|
|
||||||
.pull-right > .dropdown-menu {
|
|
||||||
right: 0;
|
|
||||||
left: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Allow for dropdowns to go bottom up (aka, dropup-menu)
|
|
||||||
// ------------------------------------------------------
|
|
||||||
// Just add .dropup after the standard .dropdown class and you're set, bro.
|
|
||||||
// TODO: abstract this so that the navbar fixed styles are not placed here?
|
|
||||||
.dropup,
|
|
||||||
.navbar-fixed-bottom .dropdown {
|
|
||||||
// Reverse the caret
|
|
||||||
.caret {
|
|
||||||
border-top: 0;
|
|
||||||
border-bottom: 4px solid @black;
|
|
||||||
content: "";
|
|
||||||
}
|
|
||||||
// Different positioning for bottom up menu
|
|
||||||
.dropdown-menu {
|
|
||||||
top: auto;
|
|
||||||
bottom: 100%;
|
|
||||||
margin-bottom: 1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sub menus
|
|
||||||
// ---------------------------
|
|
||||||
.dropdown-submenu {
|
|
||||||
position: relative;
|
|
||||||
}
|
|
||||||
// Default dropdowns
|
|
||||||
.dropdown-submenu > .dropdown-menu {
|
|
||||||
top: 0;
|
|
||||||
left: 100%;
|
|
||||||
margin-top: -6px;
|
|
||||||
margin-left: -1px;
|
|
||||||
.border-radius(0 6px 6px 6px);
|
|
||||||
}
|
|
||||||
.dropdown-submenu:hover > .dropdown-menu {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dropups
|
|
||||||
.dropup .dropdown-submenu > .dropdown-menu {
|
|
||||||
top: auto;
|
|
||||||
bottom: 0;
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: -2px;
|
|
||||||
.border-radius(5px 5px 5px 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Caret to indicate there is a submenu
|
|
||||||
.dropdown-submenu > a:after {
|
|
||||||
display: block;
|
|
||||||
content: " ";
|
|
||||||
float: right;
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border-color: transparent;
|
|
||||||
border-style: solid;
|
|
||||||
border-width: 5px 0 5px 5px;
|
|
||||||
border-left-color: darken(@dropdownBackground, 20%);
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-right: -10px;
|
|
||||||
}
|
|
||||||
.dropdown-submenu:hover > a:after {
|
|
||||||
border-left-color: @dropdownLinkColorHover;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Left aligned submenus
|
|
||||||
.dropdown-submenu.pull-left {
|
|
||||||
// Undo the float
|
|
||||||
// Yes, this is awkward since .pull-left adds a float, but it sticks to our conventions elsewhere.
|
|
||||||
float: none;
|
|
||||||
|
|
||||||
// Positioning the submenu
|
|
||||||
> .dropdown-menu {
|
|
||||||
left: -100%;
|
|
||||||
margin-left: 10px;
|
|
||||||
.border-radius(6px 0 6px 6px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tweak nav headers
|
|
||||||
// -----------------
|
|
||||||
// Increase padding from 15px to 20px on sides
|
|
||||||
.dropdown .dropdown-menu .nav-header {
|
|
||||||
padding-left: 20px;
|
|
||||||
padding-right: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Typeahead
|
|
||||||
// ---------
|
|
||||||
.typeahead {
|
|
||||||
z-index: 1051;
|
|
||||||
margin-top: 2px; // give it some space to breathe
|
|
||||||
.border-radius(@baseBorderRadius);
|
|
||||||
}
|
|
@ -1,695 +0,0 @@
|
|||||||
//
|
|
||||||
// Forms
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// GENERAL STYLES
|
|
||||||
// --------------
|
|
||||||
|
|
||||||
// Make all forms have space below them
|
|
||||||
form {
|
|
||||||
margin: 0 0 @baseLineHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
fieldset {
|
|
||||||
padding: 0;
|
|
||||||
margin: 0;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Groups of fields with labels on top (legends)
|
|
||||||
legend {
|
|
||||||
display: block;
|
|
||||||
// width: 100%;
|
|
||||||
padding: 0;
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
font-size: @baseFontSize * 1.5;
|
|
||||||
line-height: @baseLineHeight * 2;
|
|
||||||
color: @grayDark;
|
|
||||||
border: 0;
|
|
||||||
border-bottom: 1px solid #e5e5e5;
|
|
||||||
|
|
||||||
// Small
|
|
||||||
small {
|
|
||||||
font-size: @baseLineHeight * .75;
|
|
||||||
color: @grayLight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set font for forms
|
|
||||||
label,
|
|
||||||
input,
|
|
||||||
button,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
#font > .shorthand(@baseFontSize,normal,@baseLineHeight); // Set size, weight, line-height here
|
|
||||||
}
|
|
||||||
input,
|
|
||||||
button,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
font-family: @baseFontFamily; // And only set font-family here for those that need it (note the missing label element)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Identify controls by their labels
|
|
||||||
label {
|
|
||||||
display: block;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Form controls
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
// Shared size and type resets
|
|
||||||
select,
|
|
||||||
textarea,
|
|
||||||
input[type="text"],
|
|
||||||
input[type="password"],
|
|
||||||
input[type="datetime"],
|
|
||||||
input[type="datetime-local"],
|
|
||||||
input[type="date"],
|
|
||||||
input[type="month"],
|
|
||||||
input[type="time"],
|
|
||||||
input[type="week"],
|
|
||||||
input[type="number"],
|
|
||||||
input[type="email"],
|
|
||||||
input[type="url"],
|
|
||||||
input[type="search"],
|
|
||||||
input[type="tel"],
|
|
||||||
input[type="color"],
|
|
||||||
.input-style,
|
|
||||||
.uneditable-input {
|
|
||||||
display: inline-block;
|
|
||||||
height: @baseLineHeight;
|
|
||||||
padding: 4px 6px;
|
|
||||||
margin-bottom: @baseLineHeight / 2;
|
|
||||||
font-size: @baseFontSize;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
color: @gray;
|
|
||||||
.border-radius(@inputBorderRadius);
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset appearance properties for textual inputs and textarea
|
|
||||||
// Declare width for legacy (can't be on input[type=*] selectors or it's too specific)
|
|
||||||
input,
|
|
||||||
textarea,
|
|
||||||
.uneditable-input {
|
|
||||||
// width: 206px; // plus 12px padding and 2px border
|
|
||||||
}
|
|
||||||
// Reset height since textareas have rows
|
|
||||||
textarea {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
// Everything else
|
|
||||||
textarea,
|
|
||||||
input[type="text"],
|
|
||||||
input[type="password"],
|
|
||||||
input[type="datetime"],
|
|
||||||
input[type="datetime-local"],
|
|
||||||
input[type="date"],
|
|
||||||
input[type="month"],
|
|
||||||
input[type="time"],
|
|
||||||
input[type="week"],
|
|
||||||
input[type="number"],
|
|
||||||
input[type="email"],
|
|
||||||
input[type="url"],
|
|
||||||
input[type="search"],
|
|
||||||
input[type="tel"],
|
|
||||||
input[type="color"],
|
|
||||||
.input-style,
|
|
||||||
.uneditable-input {
|
|
||||||
background-color: @inputBackground;
|
|
||||||
border: 1px solid @inputBorder;
|
|
||||||
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075));
|
|
||||||
.transition(~"border linear .2s, box-shadow linear .2s");
|
|
||||||
|
|
||||||
// Focus state
|
|
||||||
&:focus {
|
|
||||||
border-color: rgba(82,168,236,.8);
|
|
||||||
outline: 0;
|
|
||||||
outline: thin dotted \9; /* IE6-9 */
|
|
||||||
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Position radios and checkboxes better
|
|
||||||
input[type="radio"],
|
|
||||||
input[type="checkbox"] {
|
|
||||||
margin: 4px 0 0;
|
|
||||||
*margin-top: 0; /* IE7 */
|
|
||||||
margin-top: 1px \9; /* IE8-9 */
|
|
||||||
line-height: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset width of input images, buttons, radios, checkboxes
|
|
||||||
input[type="file"],
|
|
||||||
input[type="image"],
|
|
||||||
input[type="submit"],
|
|
||||||
input[type="reset"],
|
|
||||||
input[type="button"],
|
|
||||||
input[type="radio"],
|
|
||||||
input[type="checkbox"] {
|
|
||||||
// width: auto; // Override of generic input selector
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the height of select and file controls to match text inputs
|
|
||||||
select,
|
|
||||||
input[type="file"] {
|
|
||||||
height: @inputHeight; /* In IE7, the height of the select element cannot be changed by height, only font-size */
|
|
||||||
*margin-top: 4px; /* For IE7, add top margin to align select with labels */
|
|
||||||
line-height: @inputHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make select elements obey height by applying a border
|
|
||||||
select {
|
|
||||||
// width: 220px; // default input width + 10px of padding that doesn't get applied
|
|
||||||
border: 1px solid @inputBorder;
|
|
||||||
background-color: @inputBackground; // Chrome on Linux and Mobile Safari need background-color
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make multiple select elements height not fixed
|
|
||||||
select[multiple],
|
|
||||||
select[size] {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Focus for select, file, radio, and checkbox
|
|
||||||
select:focus,
|
|
||||||
input[type="file"]:focus,
|
|
||||||
input[type="radio"]:focus,
|
|
||||||
input[type="checkbox"]:focus {
|
|
||||||
.tab-focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Uneditable inputs
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
// Make uneditable inputs look inactive
|
|
||||||
.uneditable-input,
|
|
||||||
.uneditable-textarea {
|
|
||||||
color: @grayLight;
|
|
||||||
background-color: darken(@inputBackground, 1%);
|
|
||||||
border-color: @inputBorder;
|
|
||||||
.box-shadow(inset 0 1px 2px rgba(0,0,0,.025));
|
|
||||||
cursor: not-allowed;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For text that needs to appear as an input but should not be an input
|
|
||||||
.uneditable-input {
|
|
||||||
overflow: hidden; // prevent text from wrapping, but still cut it off like an input does
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make uneditable textareas behave like a textarea
|
|
||||||
.uneditable-textarea {
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Placeholder
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
// Placeholder text gets special styles because when browsers invalidate entire lines if it doesn't understand a selector
|
|
||||||
input,
|
|
||||||
textarea {
|
|
||||||
.placeholder();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// CHECKBOXES & RADIOS
|
|
||||||
// -------------------
|
|
||||||
|
|
||||||
// Indent the labels to position radios/checkboxes as hanging
|
|
||||||
.radio,
|
|
||||||
.checkbox {
|
|
||||||
min-height: @baseLineHeight; // clear the floating input if there is no label text
|
|
||||||
padding-left: 20px;
|
|
||||||
}
|
|
||||||
.radio input[type="radio"],
|
|
||||||
.checkbox input[type="checkbox"] {
|
|
||||||
float: left;
|
|
||||||
margin-left: -20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Move the options list down to align with labels
|
|
||||||
.controls > .radio:first-child,
|
|
||||||
.controls > .checkbox:first-child {
|
|
||||||
padding-top: 5px; // has to be padding because margin collaspes
|
|
||||||
}
|
|
||||||
|
|
||||||
// Radios and checkboxes on same line
|
|
||||||
// TODO v3: Convert .inline to .control-inline
|
|
||||||
.radio.inline,
|
|
||||||
.checkbox.inline {
|
|
||||||
display: inline-block;
|
|
||||||
padding-top: 5px;
|
|
||||||
margin-bottom: 0;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
.radio.inline + .radio.inline,
|
|
||||||
.checkbox.inline + .checkbox.inline {
|
|
||||||
margin-left: 10px; // space out consecutive inline controls
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// INPUT SIZES
|
|
||||||
// -----------
|
|
||||||
|
|
||||||
// General classes for quick sizes
|
|
||||||
/*
|
|
||||||
.input-mini { width: 60px; }
|
|
||||||
.input-small { width: 90px; }
|
|
||||||
.input-medium { width: 150px; }
|
|
||||||
.input-large { width: 210px; }
|
|
||||||
.input-xlarge { width: 270px; }
|
|
||||||
.input-xxlarge { width: 530px; }
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
// Grid style input sizes
|
|
||||||
input[class*="span"],
|
|
||||||
select[class*="span"],
|
|
||||||
textarea[class*="span"],
|
|
||||||
.uneditable-input[class*="span"],
|
|
||||||
// Redeclare since the fluid row class is more specific
|
|
||||||
.row-fluid input[class*="span"],
|
|
||||||
.row-fluid select[class*="span"],
|
|
||||||
.row-fluid textarea[class*="span"],
|
|
||||||
.row-fluid .uneditable-input[class*="span"] {
|
|
||||||
float: none;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
// Ensure input-prepend/append never wraps
|
|
||||||
.input-append input[class*="span"],
|
|
||||||
.input-append .uneditable-input[class*="span"],
|
|
||||||
.input-prepend input[class*="span"],
|
|
||||||
.input-prepend .uneditable-input[class*="span"],
|
|
||||||
.row-fluid input[class*="span"],
|
|
||||||
.row-fluid select[class*="span"],
|
|
||||||
.row-fluid textarea[class*="span"],
|
|
||||||
.row-fluid .uneditable-input[class*="span"],
|
|
||||||
.row-fluid .input-prepend [class*="span"],
|
|
||||||
.row-fluid .input-append [class*="span"] {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// GRID SIZING FOR INPUTS
|
|
||||||
// ----------------------
|
|
||||||
|
|
||||||
// Grid sizes
|
|
||||||
#grid > .input(@gridColumnWidth, @gridGutterWidth);
|
|
||||||
|
|
||||||
// Control row for multiple inputs per line
|
|
||||||
.controls-row {
|
|
||||||
.clearfix(); // Clear the float from controls
|
|
||||||
}
|
|
||||||
|
|
||||||
// Float to collapse white-space for proper grid alignment
|
|
||||||
.controls-row [class*="span"],
|
|
||||||
// Redeclare the fluid grid collapse since we undo the float for inputs
|
|
||||||
.row-fluid .controls-row [class*="span"] {
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
// Explicity set top padding on all checkboxes/radios, not just first-child
|
|
||||||
.controls-row .checkbox[class*="span"],
|
|
||||||
.controls-row .radio[class*="span"] {
|
|
||||||
padding-top: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// DISABLED STATE
|
|
||||||
// --------------
|
|
||||||
|
|
||||||
// Disabled and read-only inputs
|
|
||||||
input[disabled],
|
|
||||||
select[disabled],
|
|
||||||
textarea[disabled],
|
|
||||||
input[readonly],
|
|
||||||
select[readonly],
|
|
||||||
textarea[readonly] {
|
|
||||||
cursor: not-allowed;
|
|
||||||
background-color: @inputDisabledBackground;
|
|
||||||
}
|
|
||||||
// Explicitly reset the colors here
|
|
||||||
input[type="radio"][disabled],
|
|
||||||
input[type="checkbox"][disabled],
|
|
||||||
input[type="radio"][readonly],
|
|
||||||
input[type="checkbox"][readonly] {
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// FORM FIELD FEEDBACK STATES
|
|
||||||
// --------------------------
|
|
||||||
|
|
||||||
// Warning
|
|
||||||
.control-group.warning {
|
|
||||||
.formFieldState(@warningText, @warningText, @warningBackground);
|
|
||||||
}
|
|
||||||
// Error
|
|
||||||
.control-group.error {
|
|
||||||
.formFieldState(@errorText, @errorText, @errorBackground);
|
|
||||||
}
|
|
||||||
// Success
|
|
||||||
.control-group.success {
|
|
||||||
.formFieldState(@successText, @successText, @successBackground);
|
|
||||||
}
|
|
||||||
// Success
|
|
||||||
.control-group.info {
|
|
||||||
.formFieldState(@infoText, @infoText, @infoBackground);
|
|
||||||
}
|
|
||||||
|
|
||||||
// HTML5 invalid states
|
|
||||||
// Shares styles with the .control-group.error above
|
|
||||||
input:focus:invalid,
|
|
||||||
textarea:focus:invalid,
|
|
||||||
select:focus:invalid {
|
|
||||||
color: #b94a48;
|
|
||||||
border-color: #ee5f5b;
|
|
||||||
&:focus {
|
|
||||||
border-color: darken(#ee5f5b, 10%);
|
|
||||||
@shadow: 0 0 6px lighten(#ee5f5b, 20%);
|
|
||||||
.box-shadow(@shadow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// FORM ACTIONS
|
|
||||||
// ------------
|
|
||||||
|
|
||||||
.form-actions {
|
|
||||||
padding: (@baseLineHeight - 1) 20px @baseLineHeight;
|
|
||||||
margin-top: @baseLineHeight;
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
background-color: @formActionsBackground;
|
|
||||||
border-top: 1px solid #e5e5e5;
|
|
||||||
.clearfix(); // Adding clearfix to allow for .pull-right button containers
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// HELP TEXT
|
|
||||||
// ---------
|
|
||||||
|
|
||||||
.help-block,
|
|
||||||
.help-inline {
|
|
||||||
color: lighten(@textColor, 15%); // lighten the text some for contrast
|
|
||||||
}
|
|
||||||
|
|
||||||
.help-block {
|
|
||||||
display: block; // account for any element using help-block
|
|
||||||
margin-bottom: @baseLineHeight / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
.help-inline {
|
|
||||||
display: inline-block;
|
|
||||||
.ie7-inline-block();
|
|
||||||
vertical-align: middle;
|
|
||||||
padding-left: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// INPUT GROUPS
|
|
||||||
// ------------
|
|
||||||
|
|
||||||
// Allow us to put symbols and text within the input field for a cleaner look
|
|
||||||
.input-append,
|
|
||||||
.input-prepend {
|
|
||||||
display: inline-block;
|
|
||||||
margin-bottom: @baseLineHeight / 2;
|
|
||||||
vertical-align: middle;
|
|
||||||
font-size: 0; // white space collapse hack
|
|
||||||
white-space: nowrap; // Prevent span and input from separating
|
|
||||||
|
|
||||||
// Reset the white space collapse hack
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
.uneditable-input,
|
|
||||||
.dropdown-menu,
|
|
||||||
.popover {
|
|
||||||
font-size: @baseFontSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
.uneditable-input {
|
|
||||||
position: relative; // placed here by default so that on :focus we can place the input above the .add-on for full border and box-shadow goodness
|
|
||||||
margin-bottom: 0; // prevent bottom margin from screwing up alignment in stacked forms
|
|
||||||
*margin-left: 0;
|
|
||||||
vertical-align: top;
|
|
||||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
|
||||||
// Make input on top when focused so blue border and shadow always show
|
|
||||||
&:focus {
|
|
||||||
z-index: 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.add-on {
|
|
||||||
display: inline-block;
|
|
||||||
width: auto;
|
|
||||||
height: @baseLineHeight;
|
|
||||||
min-width: 16px;
|
|
||||||
padding: 4px 5px;
|
|
||||||
font-size: @baseFontSize;
|
|
||||||
font-weight: normal;
|
|
||||||
line-height: @baseLineHeight;
|
|
||||||
text-align: center;
|
|
||||||
text-shadow: 0 1px 0 @white;
|
|
||||||
background-color: @grayLighter;
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
.add-on,
|
|
||||||
.btn,
|
|
||||||
.btn-group > .dropdown-toggle {
|
|
||||||
vertical-align: top;
|
|
||||||
.border-radius(0);
|
|
||||||
}
|
|
||||||
.active {
|
|
||||||
background-color: lighten(@green, 30);
|
|
||||||
border-color: @green;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-prepend {
|
|
||||||
.add-on,
|
|
||||||
.btn {
|
|
||||||
margin-right: -1px;
|
|
||||||
}
|
|
||||||
.add-on:first-child,
|
|
||||||
.btn:first-child {
|
|
||||||
// FYI, `.btn:first-child` accounts for a button group that's prepended
|
|
||||||
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-append {
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
.uneditable-input {
|
|
||||||
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
|
|
||||||
+ .btn-group .btn:last-child {
|
|
||||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.add-on,
|
|
||||||
.btn,
|
|
||||||
.btn-group {
|
|
||||||
margin-left: -1px;
|
|
||||||
}
|
|
||||||
.add-on:last-child,
|
|
||||||
.btn:last-child,
|
|
||||||
.btn-group:last-child > .dropdown-toggle {
|
|
||||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove all border-radius for inputs with both prepend and append
|
|
||||||
.input-prepend.input-append {
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
.uneditable-input {
|
|
||||||
.border-radius(0);
|
|
||||||
+ .btn-group .btn {
|
|
||||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.add-on:first-child,
|
|
||||||
.btn:first-child {
|
|
||||||
margin-right: -1px;
|
|
||||||
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
|
|
||||||
}
|
|
||||||
.add-on:last-child,
|
|
||||||
.btn:last-child {
|
|
||||||
margin-left: -1px;
|
|
||||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
|
||||||
}
|
|
||||||
.btn-group:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// SEARCH FORM
|
|
||||||
// -----------
|
|
||||||
|
|
||||||
input.search-query {
|
|
||||||
padding-right: 14px;
|
|
||||||
padding-right: 4px \9;
|
|
||||||
padding-left: 14px;
|
|
||||||
padding-left: 4px \9; /* IE7-8 doesn't have border-radius, so don't indent the padding */
|
|
||||||
margin-bottom: 0; // Remove the default margin on all inputs
|
|
||||||
.border-radius(15px);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Allow for input prepend/append in search forms */
|
|
||||||
.form-search .input-append .search-query,
|
|
||||||
.form-search .input-prepend .search-query {
|
|
||||||
.border-radius(0); // Override due to specificity
|
|
||||||
}
|
|
||||||
.form-search .input-append .search-query {
|
|
||||||
.border-radius(14px 0 0 14px);
|
|
||||||
}
|
|
||||||
.form-search .input-append .btn {
|
|
||||||
.border-radius(0 14px 14px 0);
|
|
||||||
}
|
|
||||||
.form-search .input-prepend .search-query {
|
|
||||||
.border-radius(0 14px 14px 0);
|
|
||||||
}
|
|
||||||
.form-search .input-prepend .btn {
|
|
||||||
.border-radius(14px 0 0 14px);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// HORIZONTAL & VERTICAL FORMS
|
|
||||||
// ---------------------------
|
|
||||||
|
|
||||||
// Common properties
|
|
||||||
// -----------------
|
|
||||||
|
|
||||||
.form-search,
|
|
||||||
.form-inline,
|
|
||||||
.form-horizontal {
|
|
||||||
input,
|
|
||||||
textarea,
|
|
||||||
select,
|
|
||||||
.help-inline,
|
|
||||||
.uneditable-input,
|
|
||||||
.input-prepend,
|
|
||||||
.input-append {
|
|
||||||
display: inline-block;
|
|
||||||
.ie7-inline-block();
|
|
||||||
margin-bottom: 0;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
// Re-hide hidden elements due to specifity
|
|
||||||
.hide {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.form-search label,
|
|
||||||
.form-inline label,
|
|
||||||
.form-search .btn-group,
|
|
||||||
.form-inline .btn-group {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
// Remove margin for input-prepend/-append
|
|
||||||
.form-search .input-append,
|
|
||||||
.form-inline .input-append,
|
|
||||||
.form-search .input-prepend,
|
|
||||||
.form-inline .input-prepend {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
// Inline checkbox/radio labels (remove padding on left)
|
|
||||||
.form-search .radio,
|
|
||||||
.form-search .checkbox,
|
|
||||||
.form-inline .radio,
|
|
||||||
.form-inline .checkbox {
|
|
||||||
padding-left: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
// Remove float and margin, set to inline-block
|
|
||||||
.form-search .radio input[type="radio"],
|
|
||||||
.form-search .checkbox input[type="checkbox"],
|
|
||||||
.form-inline .radio input[type="radio"],
|
|
||||||
.form-inline .checkbox input[type="checkbox"] {
|
|
||||||
float: left;
|
|
||||||
margin-right: 3px;
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Margin to space out fieldsets
|
|
||||||
.control-group {
|
|
||||||
margin-bottom: @baseLineHeight / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Legend collapses margin, so next element is responsible for spacing
|
|
||||||
legend + .control-group {
|
|
||||||
margin-top: @baseLineHeight;
|
|
||||||
-webkit-margin-top-collapse: separate;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Horizontal-specific styles
|
|
||||||
// --------------------------
|
|
||||||
|
|
||||||
.form-horizontal {
|
|
||||||
// Increase spacing between groups
|
|
||||||
.control-group {
|
|
||||||
margin-bottom: @baseLineHeight;
|
|
||||||
.clearfix();
|
|
||||||
}
|
|
||||||
// Float the labels left
|
|
||||||
.control-label {
|
|
||||||
float: left;
|
|
||||||
width: @horizontalComponentOffset - 20;
|
|
||||||
padding-top: 5px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
// Move over all input controls and content
|
|
||||||
.controls {
|
|
||||||
// Super jank IE7 fix to ensure the inputs in .input-append and input-prepend
|
|
||||||
// don't inherit the margin of the parent, in this case .controls
|
|
||||||
*display: inline-block;
|
|
||||||
*padding-left: 20px;
|
|
||||||
margin-left: @horizontalComponentOffset;
|
|
||||||
*margin-left: 0;
|
|
||||||
&:first-child {
|
|
||||||
*padding-left: @horizontalComponentOffset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Remove bottom margin on block level help text since that's accounted for on .control-group
|
|
||||||
.help-block {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
// And apply it only to .help-block instances that follow a form control
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
textarea,
|
|
||||||
.uneditable-input,
|
|
||||||
.input-prepend,
|
|
||||||
.input-append {
|
|
||||||
+ .help-block {
|
|
||||||
margin-top: @baseLineHeight / 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Move over buttons in .form-actions to align with .controls
|
|
||||||
.form-actions {
|
|
||||||
padding-left: @horizontalComponentOffset;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,310 +0,0 @@
|
|||||||
.formtastic{
|
|
||||||
.label, .badge {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0px;
|
|
||||||
font-size: inherit;
|
|
||||||
font-weight: normal;
|
|
||||||
font-family:inherit;
|
|
||||||
line-height: 14px;
|
|
||||||
color:inherit;
|
|
||||||
vertical-align: baseline;
|
|
||||||
white-space: auto;
|
|
||||||
text-shadow: none;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
It's *strongly* suggested that you don't modify this file. Instead, load a new stylesheet after
|
|
||||||
this one in your layouts (eg formtastic_changes.css) and override the styles to suit your needs.
|
|
||||||
This will allow you to update formtastic.css with new releases without clobbering your own changes.
|
|
||||||
|
|
||||||
This stylesheet forms part of the Formtastic Rails Plugin
|
|
||||||
(c) 2008-2011 Justin French
|
|
||||||
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just .formtastic
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic,
|
|
||||||
.formtastic ul,
|
|
||||||
.formtastic ol,
|
|
||||||
.formtastic li,
|
|
||||||
.formtastic fieldset,
|
|
||||||
.formtastic legend,
|
|
||||||
.formtastic button,
|
|
||||||
.formtastic textarea,
|
|
||||||
.formtastic select,
|
|
||||||
.formtastic p {
|
|
||||||
margin:0;
|
|
||||||
padding:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic fieldset {
|
|
||||||
border:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic em,
|
|
||||||
.formtastic strong {
|
|
||||||
font-style:normal;
|
|
||||||
font-weight:normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic ol,
|
|
||||||
.formtastic ul {
|
|
||||||
list-style:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic abbr,
|
|
||||||
.formtastic acronym {
|
|
||||||
border:0;
|
|
||||||
font-variant:normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic input,
|
|
||||||
.formtastic button,
|
|
||||||
.formtastic textarea {
|
|
||||||
font-family:sans-serif;
|
|
||||||
font-size:inherit;
|
|
||||||
font-weight:inherit;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic input,
|
|
||||||
.formtastic textarea,
|
|
||||||
.formtastic select {
|
|
||||||
font-size:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic legend {
|
|
||||||
white-space:normal;
|
|
||||||
color:#000;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* SEMANTIC ERRORS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .errors {
|
|
||||||
color:#cc0000;
|
|
||||||
margin:0.5em 0 1.5em 25%;
|
|
||||||
list-style:square;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .errors li {
|
|
||||||
padding:0;
|
|
||||||
border:none;
|
|
||||||
display:list-item;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* BUTTONS & ACTIONS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .buttons,
|
|
||||||
.formtastic .actions {
|
|
||||||
overflow:hidden; /* clear containing floats */
|
|
||||||
padding-left:25%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .button,
|
|
||||||
.formtastic .action {
|
|
||||||
float:left;
|
|
||||||
padding-right:0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .button_action button {
|
|
||||||
padding:3px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .link_action a {
|
|
||||||
display:block;
|
|
||||||
padding:3px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* INPUTS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .inputs {
|
|
||||||
overflow:hidden; /* clear containing floats */
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .input {
|
|
||||||
overflow:hidden; /* clear containing floats */
|
|
||||||
padding:0.5em 0; /* padding and negative margin juggling is for Firefox */
|
|
||||||
margin-top:-0.5em;
|
|
||||||
margin-bottom:1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* LEFT ALIGNED LABELS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .input .label {
|
|
||||||
display:block;
|
|
||||||
width:25%;
|
|
||||||
float:left;
|
|
||||||
padding-top:.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .fragments .label,
|
|
||||||
.formtastic .choices .label {
|
|
||||||
position:absolute;
|
|
||||||
width:95%;
|
|
||||||
left:0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .fragments .label label,
|
|
||||||
.formtastic .choices .label label {
|
|
||||||
position:absolute;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets)
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .choices {
|
|
||||||
position:relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .choices-group {
|
|
||||||
float:left;
|
|
||||||
width:74%;
|
|
||||||
margin:0;
|
|
||||||
padding:0 0 0 25%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .choice {
|
|
||||||
padding:0;
|
|
||||||
border:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* INLINE HINTS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .input .inline-hints {
|
|
||||||
color:#666;
|
|
||||||
margin:0.5em 0 0 25%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* INLINE ERRORS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .inline-errors {
|
|
||||||
color:#cc0000;
|
|
||||||
margin:0.5em 0 0 25%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .errors {
|
|
||||||
color:#cc0000;
|
|
||||||
margin:0.5em 0 0 25%;
|
|
||||||
list-style:square;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .errors li {
|
|
||||||
padding:0;
|
|
||||||
border:none;
|
|
||||||
display:list-item;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE, SEARCH (ETC) OVERRIDES
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .stringish input {
|
|
||||||
width:70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .stringish input[size],
|
|
||||||
.formtastic .stringish input[max] {
|
|
||||||
width:auto;
|
|
||||||
max-width:70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* TEXTAREA OVERRIDES
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .text textarea {
|
|
||||||
width:70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .text textarea[cols] {
|
|
||||||
width:auto;
|
|
||||||
max-width:70%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* HIDDEN OVERRIDES
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .hidden {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* BOOLEAN LABELS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .boolean label {
|
|
||||||
padding-left:25%;
|
|
||||||
display:block;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* CHOICE GROUPS
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .choices-group {
|
|
||||||
margin-bottom:-0.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .choice {
|
|
||||||
margin:0.1em 0 0.5em 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .choice label {
|
|
||||||
float:none;
|
|
||||||
width:100%;
|
|
||||||
line-height:100%;
|
|
||||||
padding-top:0;
|
|
||||||
margin-bottom:0.6em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input)
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .choice label input,
|
|
||||||
.formtastic .boolean label input {
|
|
||||||
margin:0 0.3em 0 0.1em;
|
|
||||||
line-height:100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* FRAGMENTED INPUTS (DATE/TIME/DATETIME)
|
|
||||||
--------------------------------------------------------------------------------------------------*/
|
|
||||||
.formtastic .fragments {
|
|
||||||
position:relative;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .fragments-group {
|
|
||||||
float:left;
|
|
||||||
width:74%;
|
|
||||||
margin:0;
|
|
||||||
padding:0 0 0 25%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .fragment {
|
|
||||||
float:left;
|
|
||||||
width:auto;
|
|
||||||
margin:0 .3em 0 0;
|
|
||||||
padding:0;
|
|
||||||
border:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .fragment label {
|
|
||||||
display:none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.formtastic .fragment label input {
|
|
||||||
display:inline;
|
|
||||||
margin:0;
|
|
||||||
padding:0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.formtastic .button{
|
|
||||||
.btn;
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
//
|
|
||||||
// Grid system
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Fixed (940px)
|
|
||||||
#grid > .core(@gridColumnWidth, @gridGutterWidth);
|
|
||||||
|
|
||||||
// Fluid (940px)
|
|
||||||
#grid > .fluid(@fluidGridColumnWidth, @fluidGridGutterWidth);
|
|
||||||
|
|
||||||
// Reset utility classes due to specificity
|
|
||||||
[class*="span"].hide,
|
|
||||||
.row-fluid [class*="span"].hide {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="span"].pull-right,
|
|
||||||
.row-fluid [class*="span"].pull-right {
|
|
||||||
float: right;
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
//
|
|
||||||
// Hero unit
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
.hero-unit {
|
|
||||||
padding: 60px;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
font-size: 18px;
|
|
||||||
font-weight: 200;
|
|
||||||
line-height: @baseLineHeight * 1.5;
|
|
||||||
color: @heroUnitLeadColor;
|
|
||||||
background-color: @heroUnitBackground;
|
|
||||||
.border-radius(6px);
|
|
||||||
h1 {
|
|
||||||
margin-bottom: 0;
|
|
||||||
font-size: 60px;
|
|
||||||
line-height: 1;
|
|
||||||
color: @heroUnitHeadingColor;
|
|
||||||
letter-spacing: -1px;
|
|
||||||
}
|
|
||||||
li {
|
|
||||||
line-height: @baseLineHeight * 1.5; // Reset since we specify in type.less
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,84 +0,0 @@
|
|||||||
//
|
|
||||||
// Labels and badges
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Base classes
|
|
||||||
.label,.label2,
|
|
||||||
.badge {
|
|
||||||
display: inline-block;
|
|
||||||
padding: 2px 4px;
|
|
||||||
font-size: @baseFontSize * .846;
|
|
||||||
font-weight: bold;
|
|
||||||
line-height: 14px; // ensure proper line-height if floated
|
|
||||||
color: @white;
|
|
||||||
vertical-align: baseline;
|
|
||||||
white-space: nowrap;
|
|
||||||
text-shadow: 0 -1px 0 rgba(0,0,0,.25);
|
|
||||||
background-color: @grayLight;
|
|
||||||
}
|
|
||||||
// Set unique padding and border-radii
|
|
||||||
.label,.label2, {
|
|
||||||
.border-radius(3px);
|
|
||||||
}
|
|
||||||
.badge {
|
|
||||||
padding-left: 9px;
|
|
||||||
padding-right: 9px;
|
|
||||||
.border-radius(9px);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Empty labels/badges collapse
|
|
||||||
.label,.label2,
|
|
||||||
.badge {
|
|
||||||
&:empty {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Hover/focus state, but only for links
|
|
||||||
a {
|
|
||||||
&.label:hover,
|
|
||||||
&.label:focus,
|
|
||||||
&.badge:hover,
|
|
||||||
&.badge:focus {
|
|
||||||
color: @white;
|
|
||||||
text-decoration: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Colors
|
|
||||||
// Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
|
|
||||||
.label,.label2,
|
|
||||||
.badge {
|
|
||||||
// Important (red)
|
|
||||||
&-important { background-color: @errorText; }
|
|
||||||
&-important[href] { background-color: darken(@errorText, 10%); }
|
|
||||||
// Warnings (orange)
|
|
||||||
&-warning { background-color: @orange; }
|
|
||||||
&-warning[href] { background-color: darken(@orange, 10%); }
|
|
||||||
// Success (green)
|
|
||||||
&-success { background-color: @successText; }
|
|
||||||
&-success[href] { background-color: darken(@successText, 10%); }
|
|
||||||
// Info (turquoise)
|
|
||||||
&-info { background-color: @infoText; }
|
|
||||||
&-info[href] { background-color: darken(@infoText, 10%); }
|
|
||||||
// Inverse (black)
|
|
||||||
&-inverse { background-color: @grayDark; }
|
|
||||||
&-inverse[href] { background-color: darken(@grayDark, 10%); }
|
|
||||||
}
|
|
||||||
|
|
||||||
// Quick fix for labels/badges in buttons
|
|
||||||
.btn {
|
|
||||||
.label.label2,,
|
|
||||||
.badge {
|
|
||||||
position: relative;
|
|
||||||
top: -1px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btn-mini {
|
|
||||||
.label.label2,,
|
|
||||||
.badge {
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
//
|
|
||||||
// Layouts
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Container (centered, fixed-width layouts)
|
|
||||||
.container {
|
|
||||||
.container-fixed();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fluid layouts (left aligned, with sidebar, min- & max-width content)
|
|
||||||
.container-fluid {
|
|
||||||
padding-right: @gridGutterWidth;
|
|
||||||
padding-left: @gridGutterWidth;
|
|
||||||
.clearfix();
|
|
||||||
}
|
|
@ -1,55 +0,0 @@
|
|||||||
// Media objects
|
|
||||||
// Source: http://stubbornella.org/content/?p=497
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// Common styles
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
// Clear the floats
|
|
||||||
.media,
|
|
||||||
.media-body {
|
|
||||||
overflow: hidden;
|
|
||||||
*overflow: visible;
|
|
||||||
zoom: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Proper spacing between instances of .media
|
|
||||||
.media,
|
|
||||||
.media .media {
|
|
||||||
margin-top: 15px;
|
|
||||||
}
|
|
||||||
.media:first-child {
|
|
||||||
margin-top: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// For images and videos, set to block
|
|
||||||
.media-object {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reset margins on headings for tighter default spacing
|
|
||||||
.media-heading {
|
|
||||||
margin: 0 0 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Media image alignment
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
.media > .pull-left {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.media > .pull-right {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Media list variation
|
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
// Undo default ul/ol styles
|
|
||||||
.media-list {
|
|
||||||
margin-left: 0;
|
|
||||||
list-style: none;
|
|
||||||
}
|
|
@ -1,702 +0,0 @@
|
|||||||
//
|
|
||||||
// Mixins
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
// UTILITY MIXINS
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Clearfix
|
|
||||||
// --------
|
|
||||||
// For clearing floats like a boss h5bp.com/q
|
|
||||||
.clearfix {
|
|
||||||
*zoom: 1;
|
|
||||||
&:before,
|
|
||||||
&:after {
|
|
||||||
display: table;
|
|
||||||
content: "";
|
|
||||||
// Fixes Opera/contenteditable bug:
|
|
||||||
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
&:after {
|
|
||||||
clear: both;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Webkit-style focus
|
|
||||||
// ------------------
|
|
||||||
.tab-focus() {
|
|
||||||
// Default
|
|
||||||
outline: thin dotted #333;
|
|
||||||
// Webkit
|
|
||||||
outline: 5px auto -webkit-focus-ring-color;
|
|
||||||
outline-offset: -2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Center-align a block level element
|
|
||||||
// ----------------------------------
|
|
||||||
.center-block() {
|
|
||||||
display: block;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE7 inline-block
|
|
||||||
// ----------------
|
|
||||||
.ie7-inline-block() {
|
|
||||||
*display: inline; /* IE7 inline-block hack */
|
|
||||||
*zoom: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE7 likes to collapse whitespace on either side of the inline-block elements.
|
|
||||||
// Ems because we're attempting to match the width of a space character. Left
|
|
||||||
// version is for form buttons, which typically come after other elements, and
|
|
||||||
// right version is for icons, which come before. Applying both is ok, but it will
|
|
||||||
// mean that space between those elements will be .6em (~2 space characters) in IE7,
|
|
||||||
// instead of the 1 space in other browsers.
|
|
||||||
.ie7-restore-left-whitespace() {
|
|
||||||
*margin-left: .3em;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
*margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.ie7-restore-right-whitespace() {
|
|
||||||
*margin-right: .3em;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sizing shortcuts
|
|
||||||
// -------------------------
|
|
||||||
.size(@height, @width) {
|
|
||||||
width: @width;
|
|
||||||
height: @height;
|
|
||||||
}
|
|
||||||
.square(@size) {
|
|
||||||
.size(@size, @size);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Placeholder text
|
|
||||||
// -------------------------
|
|
||||||
.placeholder(@color: @placeholderText) {
|
|
||||||
&:-moz-placeholder {
|
|
||||||
color: @color;
|
|
||||||
}
|
|
||||||
&:-ms-input-placeholder {
|
|
||||||
color: @color;
|
|
||||||
}
|
|
||||||
&::-webkit-input-placeholder {
|
|
||||||
color: @color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Text overflow
|
|
||||||
// -------------------------
|
|
||||||
// Requires inline-block or block for proper styling
|
|
||||||
.text-overflow() {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
// CSS image replacement
|
|
||||||
// -------------------------
|
|
||||||
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
|
|
||||||
.hide-text {
|
|
||||||
font: 0/0 a;
|
|
||||||
color: transparent;
|
|
||||||
text-shadow: none;
|
|
||||||
background-color: transparent;
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// FONTS
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
#font {
|
|
||||||
#family {
|
|
||||||
.serif() {
|
|
||||||
font-family: @serifFontFamily;
|
|
||||||
}
|
|
||||||
.sans-serif() {
|
|
||||||
font-family: @sansFontFamily;
|
|
||||||
}
|
|
||||||
.monospace() {
|
|
||||||
font-family: @monoFontFamily;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
|
||||||
font-size: @size;
|
|
||||||
font-weight: @weight;
|
|
||||||
line-height: @lineHeight;
|
|
||||||
}
|
|
||||||
.serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
|
||||||
#font > #family > .serif;
|
|
||||||
#font > .shorthand(@size, @weight, @lineHeight);
|
|
||||||
}
|
|
||||||
.sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
|
||||||
#font > #family > .sans-serif;
|
|
||||||
#font > .shorthand(@size, @weight, @lineHeight);
|
|
||||||
}
|
|
||||||
.monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
|
|
||||||
#font > #family > .monospace;
|
|
||||||
#font > .shorthand(@size, @weight, @lineHeight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// FORMS
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Block level inputs
|
|
||||||
.input-block-level {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
min-height: @inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
|
|
||||||
.box-sizing(border-box); // Makes inputs behave like true block-level elements
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Mixin for form field states
|
|
||||||
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
|
|
||||||
// Set the text color
|
|
||||||
.control-label,
|
|
||||||
.help-block,
|
|
||||||
.help-inline {
|
|
||||||
color: @textColor;
|
|
||||||
}
|
|
||||||
// Style inputs accordingly
|
|
||||||
.checkbox,
|
|
||||||
.radio,
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
color: @textColor;
|
|
||||||
}
|
|
||||||
input,
|
|
||||||
select,
|
|
||||||
textarea {
|
|
||||||
border-color: @borderColor;
|
|
||||||
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
|
|
||||||
&:focus {
|
|
||||||
border-color: darken(@borderColor, 10%);
|
|
||||||
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%);
|
|
||||||
.box-shadow(@shadow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Give a small background color for input-prepend/-append
|
|
||||||
.input-prepend .add-on,
|
|
||||||
.input-append .add-on {
|
|
||||||
color: @textColor;
|
|
||||||
background-color: @backgroundColor;
|
|
||||||
border-color: @textColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CSS3 PROPERTIES
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Border Radius
|
|
||||||
.border-radius(@radius) {
|
|
||||||
-webkit-border-radius: @radius;
|
|
||||||
-moz-border-radius: @radius;
|
|
||||||
border-radius: @radius;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Single Corner Border Radius
|
|
||||||
.border-top-left-radius(@radius) {
|
|
||||||
-webkit-border-top-left-radius: @radius;
|
|
||||||
-moz-border-radius-topleft: @radius;
|
|
||||||
border-top-left-radius: @radius;
|
|
||||||
}
|
|
||||||
.border-top-right-radius(@radius) {
|
|
||||||
-webkit-border-top-right-radius: @radius;
|
|
||||||
-moz-border-radius-topright: @radius;
|
|
||||||
border-top-right-radius: @radius;
|
|
||||||
}
|
|
||||||
.border-bottom-right-radius(@radius) {
|
|
||||||
-webkit-border-bottom-right-radius: @radius;
|
|
||||||
-moz-border-radius-bottomright: @radius;
|
|
||||||
border-bottom-right-radius: @radius;
|
|
||||||
}
|
|
||||||
.border-bottom-left-radius(@radius) {
|
|
||||||
-webkit-border-bottom-left-radius: @radius;
|
|
||||||
-moz-border-radius-bottomleft: @radius;
|
|
||||||
border-bottom-left-radius: @radius;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Single Side Border Radius
|
|
||||||
.border-top-radius(@radius) {
|
|
||||||
.border-top-right-radius(@radius);
|
|
||||||
.border-top-left-radius(@radius);
|
|
||||||
}
|
|
||||||
.border-right-radius(@radius) {
|
|
||||||
.border-top-right-radius(@radius);
|
|
||||||
.border-bottom-right-radius(@radius);
|
|
||||||
}
|
|
||||||
.border-bottom-radius(@radius) {
|
|
||||||
.border-bottom-right-radius(@radius);
|
|
||||||
.border-bottom-left-radius(@radius);
|
|
||||||
}
|
|
||||||
.border-left-radius(@radius) {
|
|
||||||
.border-top-left-radius(@radius);
|
|
||||||
.border-bottom-left-radius(@radius);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Drop shadows
|
|
||||||
.box-shadow(@shadow) {
|
|
||||||
-webkit-box-shadow: @shadow;
|
|
||||||
-moz-box-shadow: @shadow;
|
|
||||||
box-shadow: @shadow;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transitions
|
|
||||||
.transition(@transition) {
|
|
||||||
-webkit-transition: @transition;
|
|
||||||
-moz-transition: @transition;
|
|
||||||
-o-transition: @transition;
|
|
||||||
transition: @transition;
|
|
||||||
}
|
|
||||||
.transition-delay(@transition-delay) {
|
|
||||||
-webkit-transition-delay: @transition-delay;
|
|
||||||
-moz-transition-delay: @transition-delay;
|
|
||||||
-o-transition-delay: @transition-delay;
|
|
||||||
transition-delay: @transition-delay;
|
|
||||||
}
|
|
||||||
.transition-duration(@transition-duration) {
|
|
||||||
-webkit-transition-duration: @transition-duration;
|
|
||||||
-moz-transition-duration: @transition-duration;
|
|
||||||
-o-transition-duration: @transition-duration;
|
|
||||||
transition-duration: @transition-duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transformations
|
|
||||||
.rotate(@degrees) {
|
|
||||||
-webkit-transform: rotate(@degrees);
|
|
||||||
-moz-transform: rotate(@degrees);
|
|
||||||
-ms-transform: rotate(@degrees);
|
|
||||||
-o-transform: rotate(@degrees);
|
|
||||||
transform: rotate(@degrees);
|
|
||||||
}
|
|
||||||
.scale(@ratio) {
|
|
||||||
-webkit-transform: scale(@ratio);
|
|
||||||
-moz-transform: scale(@ratio);
|
|
||||||
-ms-transform: scale(@ratio);
|
|
||||||
-o-transform: scale(@ratio);
|
|
||||||
transform: scale(@ratio);
|
|
||||||
}
|
|
||||||
.translate(@x, @y) {
|
|
||||||
-webkit-transform: translate(@x, @y);
|
|
||||||
-moz-transform: translate(@x, @y);
|
|
||||||
-ms-transform: translate(@x, @y);
|
|
||||||
-o-transform: translate(@x, @y);
|
|
||||||
transform: translate(@x, @y);
|
|
||||||
}
|
|
||||||
.skew(@x, @y) {
|
|
||||||
-webkit-transform: skew(@x, @y);
|
|
||||||
-moz-transform: skew(@x, @y);
|
|
||||||
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885
|
|
||||||
-o-transform: skew(@x, @y);
|
|
||||||
transform: skew(@x, @y);
|
|
||||||
-webkit-backface-visibility: hidden; // See https://github.com/twitter/bootstrap/issues/5319
|
|
||||||
}
|
|
||||||
.translate3d(@x, @y, @z) {
|
|
||||||
-webkit-transform: translate3d(@x, @y, @z);
|
|
||||||
-moz-transform: translate3d(@x, @y, @z);
|
|
||||||
-o-transform: translate3d(@x, @y, @z);
|
|
||||||
transform: translate3d(@x, @y, @z);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Backface visibility
|
|
||||||
// Prevent browsers from flickering when using CSS 3D transforms.
|
|
||||||
// Default value is `visible`, but can be changed to `hidden
|
|
||||||
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
|
|
||||||
.backface-visibility(@visibility){
|
|
||||||
-webkit-backface-visibility: @visibility;
|
|
||||||
-moz-backface-visibility: @visibility;
|
|
||||||
backface-visibility: @visibility;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Background clipping
|
|
||||||
// Heads up: FF 3.6 and under need "padding" instead of "padding-box"
|
|
||||||
.background-clip(@clip) {
|
|
||||||
-webkit-background-clip: @clip;
|
|
||||||
-moz-background-clip: @clip;
|
|
||||||
background-clip: @clip;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Background sizing
|
|
||||||
.background-size(@size) {
|
|
||||||
-webkit-background-size: @size;
|
|
||||||
-moz-background-size: @size;
|
|
||||||
-o-background-size: @size;
|
|
||||||
background-size: @size;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Box sizing
|
|
||||||
.box-sizing(@boxmodel) {
|
|
||||||
-webkit-box-sizing: @boxmodel;
|
|
||||||
-moz-box-sizing: @boxmodel;
|
|
||||||
box-sizing: @boxmodel;
|
|
||||||
}
|
|
||||||
|
|
||||||
// User select
|
|
||||||
// For selecting text on the page
|
|
||||||
.user-select(@select) {
|
|
||||||
-webkit-user-select: @select;
|
|
||||||
-moz-user-select: @select;
|
|
||||||
-ms-user-select: @select;
|
|
||||||
-o-user-select: @select;
|
|
||||||
user-select: @select;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Resize anything
|
|
||||||
.resizable(@direction) {
|
|
||||||
resize: @direction; // Options: horizontal, vertical, both
|
|
||||||
overflow: auto; // Safari fix
|
|
||||||
}
|
|
||||||
|
|
||||||
// CSS3 Content Columns
|
|
||||||
.content-columns(@columnCount, @columnGap: @gridGutterWidth) {
|
|
||||||
-webkit-column-count: @columnCount;
|
|
||||||
-moz-column-count: @columnCount;
|
|
||||||
column-count: @columnCount;
|
|
||||||
-webkit-column-gap: @columnGap;
|
|
||||||
-moz-column-gap: @columnGap;
|
|
||||||
column-gap: @columnGap;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Optional hyphenation
|
|
||||||
.hyphens(@mode: auto) {
|
|
||||||
word-wrap: break-word;
|
|
||||||
-webkit-hyphens: @mode;
|
|
||||||
-moz-hyphens: @mode;
|
|
||||||
-ms-hyphens: @mode;
|
|
||||||
-o-hyphens: @mode;
|
|
||||||
hyphens: @mode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Opacity
|
|
||||||
.opacity(@opacity) {
|
|
||||||
opacity: @opacity / 100;
|
|
||||||
filter: ~"alpha(opacity=@{opacity})";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// BACKGROUNDS
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Add an alphatransparency value to any background or border color (via Elyse Holladay)
|
|
||||||
#translucent {
|
|
||||||
.background(@color: @white, @alpha: 1) {
|
|
||||||
background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
|
|
||||||
}
|
|
||||||
.border(@color: @white, @alpha: 1) {
|
|
||||||
border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
|
|
||||||
.background-clip(padding-box);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gradient Bar Colors for buttons and alerts
|
|
||||||
.gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
|
|
||||||
color: @textColor;
|
|
||||||
text-shadow: @textShadow;
|
|
||||||
#gradient > .vertical(@primaryColor, @secondaryColor);
|
|
||||||
border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
|
|
||||||
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Gradients
|
|
||||||
#gradient {
|
|
||||||
.horizontal(@startColor: #555, @endColor: #333) {
|
|
||||||
background-color: @endColor;
|
|
||||||
background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
|
|
||||||
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
|
|
||||||
background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
|
|
||||||
background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
|
|
||||||
background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down
|
|
||||||
}
|
|
||||||
.vertical(@startColor: #555, @endColor: #333) {
|
|
||||||
background-color: mix(@startColor, @endColor, 60%);
|
|
||||||
background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
|
|
||||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
|
|
||||||
background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
|
|
||||||
background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
|
|
||||||
background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down
|
|
||||||
}
|
|
||||||
.directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
|
|
||||||
background-color: @endColor;
|
|
||||||
background-repeat: repeat-x;
|
|
||||||
background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
|
|
||||||
background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
|
|
||||||
background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
|
|
||||||
background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10
|
|
||||||
}
|
|
||||||
.horizontal-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
|
|
||||||
background-color: mix(@midColor, @endColor, 80%);
|
|
||||||
background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
|
|
||||||
background-image: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-image: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-image: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-image: linear-gradient(to right, @startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
|
|
||||||
}
|
|
||||||
|
|
||||||
.vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
|
|
||||||
background-color: mix(@midColor, @endColor, 80%);
|
|
||||||
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
|
|
||||||
background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
|
|
||||||
}
|
|
||||||
.radial(@innerColor: #555, @outerColor: #333) {
|
|
||||||
background-color: @outerColor;
|
|
||||||
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
|
|
||||||
background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
|
|
||||||
background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
|
|
||||||
background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
|
|
||||||
background-repeat: no-repeat;
|
|
||||||
}
|
|
||||||
.striped(@color: #555, @angle: 45deg) {
|
|
||||||
background-color: @color;
|
|
||||||
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
|
|
||||||
background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
|
|
||||||
background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
|
|
||||||
background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
|
|
||||||
background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Reset filters for IE
|
|
||||||
.reset-filter() {
|
|
||||||
filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// COMPONENT MIXINS
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Horizontal dividers
|
|
||||||
// -------------------------
|
|
||||||
// Dividers (basically an hr) within dropdowns and nav lists
|
|
||||||
.nav-divider(@top: #e5e5e5, @bottom: @white) {
|
|
||||||
// IE7 needs a set width since we gave a height. Restricting just
|
|
||||||
// to IE7 to keep the 1px left/right space in other browsers.
|
|
||||||
// It is unclear where IE is getting the extra space that we need
|
|
||||||
// to negative-margin away, but so it goes.
|
|
||||||
*width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px
|
|
||||||
*margin: -5px 0 5px;
|
|
||||||
overflow: hidden;
|
|
||||||
background-color: @top;
|
|
||||||
border-bottom: 1px solid @bottom;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Button backgrounds
|
|
||||||
// ------------------
|
|
||||||
.buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
|
|
||||||
// gradientBar will set the background to a pleasing blend of these, to support IE<=9
|
|
||||||
.gradientBar(@startColor, @endColor, @textColor, @textShadow);
|
|
||||||
*background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
|
||||||
.reset-filter();
|
|
||||||
|
|
||||||
// in these cases the gradient won't cover the background, so we override
|
|
||||||
&:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
|
|
||||||
color: @textColor;
|
|
||||||
background-color: @endColor;
|
|
||||||
*background-color: darken(@endColor, 5%);
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
|
|
||||||
&:active,
|
|
||||||
&.active {
|
|
||||||
background-color: darken(@endColor, 10%) e("\9");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Navbar vertical align
|
|
||||||
// -------------------------
|
|
||||||
// Vertically center elements in the navbar.
|
|
||||||
// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
|
|
||||||
.navbarVerticalAlign(@elementHeight) {
|
|
||||||
margin-top: (@navbarHeight - @elementHeight) / 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Grid System
|
|
||||||
// -----------
|
|
||||||
|
|
||||||
// Centered container element
|
|
||||||
.container-fixed() {
|
|
||||||
margin-right: auto;
|
|
||||||
margin-left: auto;
|
|
||||||
.clearfix();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Table columns
|
|
||||||
.tableColumns(@columnSpan: 1) {
|
|
||||||
float: none; // undo default grid column styles
|
|
||||||
width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
|
|
||||||
margin-left: 0; // undo default grid column styles
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make a Grid
|
|
||||||
// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
|
|
||||||
.makeRow() {
|
|
||||||
margin-left: @gridGutterWidth * -1;
|
|
||||||
.clearfix();
|
|
||||||
}
|
|
||||||
.makeColumn(@columns: 1, @offset: 0) {
|
|
||||||
float: left;
|
|
||||||
margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
|
|
||||||
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
// The Grid
|
|
||||||
#grid {
|
|
||||||
|
|
||||||
.core (@gridColumnWidth, @gridGutterWidth) {
|
|
||||||
|
|
||||||
.spanX (@index) when (@index > 0) {
|
|
||||||
.span@{index} { .span(@index); }
|
|
||||||
.spanX(@index - 1);
|
|
||||||
}
|
|
||||||
.spanX (0) {}
|
|
||||||
|
|
||||||
.offsetX (@index) when (@index > 0) {
|
|
||||||
.offset@{index} { .offset(@index); }
|
|
||||||
.offsetX(@index - 1);
|
|
||||||
}
|
|
||||||
.offsetX (0) {}
|
|
||||||
|
|
||||||
.offset (@columns) {
|
|
||||||
margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
.span (@columns) {
|
|
||||||
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
|
|
||||||
}
|
|
||||||
|
|
||||||
.row {
|
|
||||||
margin-left: @gridGutterWidth * -1;
|
|
||||||
.clearfix();
|
|
||||||
}
|
|
||||||
|
|
||||||
[class*="span"] {
|
|
||||||
float: left;
|
|
||||||
min-height: 1px; // prevent collapsing columns
|
|
||||||
margin-left: @gridGutterWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the container width, and override it for fixed navbars in media queries
|
|
||||||
.container,
|
|
||||||
.navbar-static-top .container,
|
|
||||||
.navbar-fixed-top .container,
|
|
||||||
.navbar-fixed-bottom .container { .span(@gridColumns); }
|
|
||||||
|
|
||||||
// generate .spanX and .offsetX
|
|
||||||
.spanX (@gridColumns);
|
|
||||||
.offsetX (@gridColumns);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
|
|
||||||
|
|
||||||
.spanX (@index) when (@index > 0) {
|
|
||||||
.span@{index} { .span(@index); }
|
|
||||||
.spanX(@index - 1);
|
|
||||||
}
|
|
||||||
.spanX (0) {}
|
|
||||||
|
|
||||||
.offsetX (@index) when (@index > 0) {
|
|
||||||
.offset@{index} { .offset(@index); }
|
|
||||||
.offset@{index}:first-child { .offsetFirstChild(@index); }
|
|
||||||
.offsetX(@index - 1);
|
|
||||||
}
|
|
||||||
.offsetX (0) {}
|
|
||||||
|
|
||||||
.offset (@columns) {
|
|
||||||
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2);
|
|
||||||
*margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.offsetFirstChild (@columns) {
|
|
||||||
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth);
|
|
||||||
*margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.span (@columns) {
|
|
||||||
width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
|
|
||||||
*width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.row-fluid {
|
|
||||||
width: 100%;
|
|
||||||
.clearfix();
|
|
||||||
[class*="span"] {
|
|
||||||
.input-block-level();
|
|
||||||
float: left;
|
|
||||||
margin-left: @fluidGridGutterWidth;
|
|
||||||
*margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
|
|
||||||
}
|
|
||||||
[class*="span"]:first-child {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Space grid-sized controls properly if multiple per line
|
|
||||||
.controls-row [class*="span"] + [class*="span"] {
|
|
||||||
margin-left: @fluidGridGutterWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
// generate .spanX and .offsetX
|
|
||||||
.spanX (@gridColumns);
|
|
||||||
.offsetX (@gridColumns);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.input(@gridColumnWidth, @gridGutterWidth) {
|
|
||||||
|
|
||||||
.spanX (@index) when (@index > 0) {
|
|
||||||
input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
|
|
||||||
.spanX(@index - 1);
|
|
||||||
}
|
|
||||||
.spanX (0) {}
|
|
||||||
|
|
||||||
.span(@columns) {
|
|
||||||
width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14;
|
|
||||||
}
|
|
||||||
|
|
||||||
input,
|
|
||||||
textarea,
|
|
||||||
.uneditable-input {
|
|
||||||
margin-left: 0; // override margin-left from core grid system
|
|
||||||
}
|
|
||||||
|
|
||||||
// Space grid-sized controls properly if multiple per line
|
|
||||||
.controls-row [class*="span"] + [class*="span"] {
|
|
||||||
margin-left: @gridGutterWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
// generate .spanX
|
|
||||||
.spanX (@gridColumns);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,95 +0,0 @@
|
|||||||
//
|
|
||||||
// Modals
|
|
||||||
// --------------------------------------------------
|
|
||||||
|
|
||||||
// Background
|
|
||||||
.modal-backdrop {
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
z-index: @zindexModalBackdrop;
|
|
||||||
background-color: @black;
|
|
||||||
// Fade for backdrop
|
|
||||||
&.fade { opacity: 0; }
|
|
||||||
}
|
|
||||||
|
|
||||||
.modal-backdrop,
|
|
||||||
.modal-backdrop.fade.in {
|
|
||||||
.opacity(0.6);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Base modal
|
|
||||||
.modal {
|
|
||||||
position: fixed;
|
|
||||||
top: 10%;
|
|
||||||
left: 50%;
|
|
||||||
z-index: @zindexModal;
|
|
||||||
width: 560px;
|
|
||||||
margin-left: -280px;
|
|
||||||
background-color: @white;
|
|
||||||
border: 1px solid #999;
|
|
||||||
border: 1px solid rgba(0,0,0,.3);
|
|
||||||
*border: 1px solid #999; /* IE6-7 */
|
|
||||||
.border-radius(6px);
|
|
||||||
.box-shadow(0 3px 7px rgba(0,0,0,0.3));
|
|
||||||
.background-clip(padding-box);
|
|
||||||
// Remove focus outline from opened modal
|
|
||||||
outline: none;
|
|
||||||
|
|
||||||
&.fade {
|
|
||||||
.transition(e('opacity .3s linear, top .3s ease-out'));
|
|
||||||
top: -25%;
|
|
||||||
}
|
|
||||||
&.fade.in { top: 10%; }
|
|
||||||
}
|
|
||||||
.modal-header {
|
|
||||||
padding: 9px 15px;
|
|
||||||
border-bottom: 1px solid #eee;
|
|
||||||
// Close icon
|
|
||||||
.close { margin-top: 2px; }
|
|
||||||
// Heading
|
|
||||||
h3 {
|
|
||||||
margin: 0;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Body (where all modal content resides)
|
|
||||||
.modal-body {
|
|
||||||
position: relative;
|
|
||||||
overflow-y: auto;
|
|
||||||
max-height: 400px;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
// Remove bottom margin if need be
|
|
||||||
.modal-form {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Footer (for actions)
|
|
||||||
.modal-footer {
|
|
||||||
padding: 14px 15px 15px;
|
|
||||||
margin-bottom: 0;
|
|
||||||
text-align: right; // right align buttons
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
border-top: 1px solid #ddd;
|
|
||||||
.border-radius(0 0 6px 6px);
|
|
||||||
.box-shadow(inset 0 1px 0 @white);
|
|
||||||
.clearfix(); // clear it in case folks use .pull-* classes on buttons
|
|
||||||
|
|
||||||
// Properly space out buttons
|
|
||||||
.btn + .btn {
|
|
||||||
margin-left: 5px;
|
|
||||||
margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
|
|
||||||
}
|
|
||||||
// but override that for button groups
|
|
||||||
.btn-group .btn + .btn {
|
|
||||||
margin-left: -1px;
|
|
||||||
}
|
|
||||||
// and override it for block buttons as well
|
|
||||||
.btn-block + .btn-block {
|
|
||||||
margin-left: 0;
|
|
||||||
}
|
|
||||||
}
|
|