diff --git a/.rbenv-version b/.rbenv-version new file mode 100644 index 0000000..35094b5 --- /dev/null +++ b/.rbenv-version @@ -0,0 +1 @@ +1.9.3-rc1 diff --git a/.rvmrc b/.rvmrc index 044096b..64ec42c 100644 --- a/.rvmrc +++ b/.rvmrc @@ -4,22 +4,35 @@ # development environment upon cd'ing into the directory # First we specify our desired [@], the @gemset name is optional. -environment_id="ruby-1.9.2-p180@roomies" +environment_id="ruby-1.9.2-p290@roomies" + +# +# Uncomment following line if you want options to be set only for given project. +# +# PROJECT_JRUBY_OPTS=( --1.9 ) # # First we attempt to load the desired environment directly from the environment -# file. This is very fast and efficicent compared to running through the entire +# file. This is very fast and efficient compared to running through the entire # CLI and selector. If you want feedback on which environment was used then # insert the word 'use' after --create as this triggers verbose mode. # if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \ - && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] ; then + && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]] +then \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id" - [[ -s ".rvm/hooks/after_use" ]] && . ".rvm/hooks/after_use" + if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] + then + . "${rvm_path:-$HOME/.rvm}/hooks/after_use" + fi else # If the environment file has not yet been created, use the RVM CLI to select. - rvm --create "$environment_id" + if ! rvm --create use "$environment_id" + then + echo "Failed to create RVM environment '${environment_id}'." + exit 1 + fi fi # @@ -32,18 +45,3 @@ fi # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d' # fi -# -# If you use bundler and would like to run bundle each time you enter the -# directory, you can uncomment the following code. -# -# # Ensure that Bundler is installed. Install it if it is not. -# if ! command -v bundle >/dev/null; then -# printf "The rubygem 'bundler' is not installed. Installing it now.\n" -# gem install bundler -# fi -# -# # Bundle while reducing excess noise. -# printf "Bundling your gems. This may take a few minutes on a fresh clone.\n" -# bundle | grep -v '^Using ' | grep -v ' is complete' | sed '/^$/d' -# - diff --git a/Gemfile b/Gemfile index 5c69bfe..748a07a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,47 +1,71 @@ source 'http://rubygems.org' -gem 'rails', '3.0.7' - -# Bundle edge Rails instead: -# gem 'rails', :git => 'git://github.com/rails/rails.git' - -gem "sass", "~>3.1.0" -gem "haml", "~> 3.1.0" -gem "compass", "~>0.11" -gem 'html5-boilerplate' -gem 'simple_form' -gem 'devise', '>= 1.2.0' -gem 'devise_invitable', '~> 0.4.0' -gem 'omniauth' -gem 'barista', '~> 1.0' -gem 'mongoid', '>= 2.0.0' -gem 'bson_ext', '>= 1.2.4' -gem 'mongoid_rails_migrations', '>=0.0.2' -gem 'jquery-rails' -gem 'haml-rails' -gem 'hoptoad_notifier' -gem 'dalli' -gem 'rake', '0.8.7' -gem 'actionmailer-with-request' +gem 'rails', "~> 3.1.0" -group :production do - gem 'therubyracer-heroku' +# Web server +gem 'thin' +gem 'rack', '1.3.3' + +# Mongo +gem 'mongoid', "~> 2.1" +gem "bson_ext", "~> 1.4" +gem 'mongoid_rails_migrations' + +# Authentication +gem 'devise', "~> 1.4.5" +gem 'devise_invitable', '~> 0.5.4' +gem 'omniauth', "~> 0.2.6" + +# Markdown +gem 'rdiscount', "~> 1.6.8" + +# Other +gem 'simple_form', "~> 1.4.2" + +# Exception tracking +gem "airbrake" + +# Stripe API +gem 'stripe' + +# Rails extensions +gem 'jquery-rails', "~> 1.0.13" +gem 'haml-rails', "~>0.3.4" +gem "rspec-rails", "~> 2.6.1", :group => [:development, :test] + +group :assets do + gem 'sass-rails', "~> 3.1" + gem 'coffee-rails', "~> 3.1" + gem 'uglifier' + gem 'compass', "0.12.alpha.0" +end + +group :development do + gem "rails-footnotes", ">= 3.7" + # gem 'ruby-debug19' + gem 'mailcatcher' + gem 'foreman' + gem 'guard' + gem 'guard-rspec' + gem 'guard-bundler' + gem 'guard-spork' + gem 'spork', '~> 0.9.0.rc9' + if RUBY_PLATFORM.downcase.include?("darwin") + gem 'rb-fsevent' + gem 'growl' + end end -# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) -# gem 'ruby-debug' -# gem 'ruby-debug19', :require => 'ruby-debug' -# Bundle gems for the local environment. Make sure to -# put test-only gems in this group so their generators -# and rake tasks are available in development mode: -group :development, :test do - gem 'rspec-rails' - gem 'database_cleaner' +group :test do + gem 'shoulda-matchers' gem 'mongoid-rspec' - gem 'factory_girl_rails' - gem 'barista_growl', :git => 'http://github.com/TrevorBurnham/barista_growl.git' - gem 'ruby-debug19' - gem 'jasmine' - gem 'mailcatcher' + gem "turn" # pretty printed test output + gem "database_cleaner", ">= 0.6.7" + gem "factory_girl_rails", "~> 1.2.0" + gem "launchy", ">= 0.4.0" +end + +group :production do + gem 'therubyracer-heroku', '0.8.1.pre3' end diff --git a/Gemfile.lock b/Gemfile.lock index 879df96..f4f2da0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,147 +1,140 @@ -GIT - remote: http://github.com/TrevorBurnham/barista_growl.git - revision: 4d52084c5e0fd0d040e2da2e8b65d8344ce36672 - specs: - barista_growl (0.1.0) - barista - growl - GEM remote: http://rubygems.org/ specs: - abstract (1.0.0) - actionmailer (3.0.7) - actionpack (= 3.0.7) - mail (~> 2.2.15) - actionmailer-with-request (0.3.0) - rails (>= 3) - actionpack (3.0.7) - activemodel (= 3.0.7) - activesupport (= 3.0.7) - builder (~> 2.1.2) - erubis (~> 2.6.6) - i18n (~> 0.5.0) - rack (~> 1.2.1) - rack-mount (~> 0.6.14) - rack-test (~> 0.5.7) - tzinfo (~> 0.3.23) - activemodel (3.0.7) - activesupport (= 3.0.7) - builder (~> 2.1.2) - i18n (~> 0.5.0) - activerecord (3.0.7) - activemodel (= 3.0.7) - activesupport (= 3.0.7) - arel (~> 2.0.2) - tzinfo (~> 0.3.23) - activeresource (3.0.7) - activemodel (= 3.0.7) - activesupport (= 3.0.7) - activesupport (3.0.7) + actionmailer (3.1.0) + actionpack (= 3.1.0) + mail (~> 2.3.0) + actionpack (3.1.0) + activemodel (= 3.1.0) + activesupport (= 3.1.0) + builder (~> 3.0.0) + erubis (~> 2.7.0) + i18n (~> 0.6) + rack (~> 1.3.2) + rack-cache (~> 1.0.3) + rack-mount (~> 0.8.2) + rack-test (~> 0.6.1) + sprockets (~> 2.0.0) + activemodel (3.1.0) + activesupport (= 3.1.0) + bcrypt-ruby (~> 3.0.0) + builder (~> 3.0.0) + i18n (~> 0.6) + activerecord (3.1.0) + activemodel (= 3.1.0) + activesupport (= 3.1.0) + arel (~> 2.2.1) + tzinfo (~> 0.3.29) + activeresource (3.1.0) + activemodel (= 3.1.0) + activesupport (= 3.1.0) + activesupport (3.1.0) + multi_json (~> 1.0) addressable (2.2.4) - archive-tar-minitar (0.5.2) - arel (2.0.10) - barista (1.0.0) - coffee-script (~> 2.1.1) - bcrypt-ruby (2.1.4) - bson (1.3.1) - bson_ext (1.3.1) - builder (2.1.2) - childprocess (0.1.9) - ffi (~> 1.0.6) - chunky_png (1.1.2) - coffee-script (2.1.3) + airbrake (3.0.4) + activesupport + builder + ansi (1.3.0) + arel (2.2.1) + bcrypt-ruby (3.0.1) + bson (1.4.0) + bson_ext (1.4.0) + builder (3.0.0) + chunky_png (1.2.5) + coffee-rails (3.1.1) + coffee-script (>= 2.2.0) + railties (~> 3.1.0) + coffee-script (2.2.0) coffee-script-source - coffee-script-source (1.1.1) - columnize (0.3.2) - compass (0.11.0) - chunky_png (~> 1.1.1) + execjs + coffee-script-source (1.1.2) + compass (0.12.alpha.0) + chunky_png (~> 1.2) fssm (>= 0.2.7) - sass (>= 3.1.0.alpha.249) - daemons (1.1.3) - dalli (1.0.4) + sass (~> 3.1) + daemons (1.1.4) database_cleaner (0.6.7) - devise (1.3.4) - bcrypt-ruby (~> 2.1.2) + devise (1.4.7) + bcrypt-ruby (~> 3.0) orm_adapter (~> 0.0.3) warden (~> 1.0.3) - devise_invitable (0.4.2) - devise (<= 1.4.0, >= 1.2.0) - rails (~> 3.0.0) - diff-lcs (1.1.2) - erubis (2.6.6) - abstract (>= 1.0.0) + devise_invitable (0.5.5) + devise (~> 1.4.1) + rails (>= 3.0.0, < 3.2) + diff-lcs (1.1.3) + erubis (2.7.0) eventmachine (0.12.10) - factory_girl (1.3.3) - factory_girl_rails (1.0.1) - factory_girl (~> 1.3) + execjs (1.2.9) + multi_json (~> 1.0) + factory_girl (2.1.2) + activesupport + factory_girl_rails (1.2.0) + factory_girl (~> 2.1.0) railties (>= 3.0.0) faraday (0.6.1) addressable (~> 2.2.4) multipart-post (~> 1.1.0) - rack (< 2, >= 1.1.0) - ffi (1.0.9) + rack (>= 1.1.0, < 2) + foreman (0.22.0) + term-ansicolor (~> 1.0.5) + thor (>= 0.13.6) fssm (0.2.7) growl (1.0.3) - haml (3.1.2) + guard (0.8.3) + thor (~> 0.14.6) + guard-bundler (0.1.3) + bundler (>= 1.0.0) + guard (>= 0.2.2) + guard-rspec (0.4.5) + guard (>= 0.4.0) + guard-spork (0.3.0) + guard (>= 0.8.2) + spork (>= 0.8.4) + haml (3.1.3) haml-rails (0.3.4) actionpack (~> 3.0) activesupport (~> 3.0) haml (~> 3.0) railties (~> 3.0) - hoptoad_notifier (2.4.9) - activesupport - builder - html5-boilerplate (0.3.3) - compass (>= 0.10.0) - i18n (0.5.0) - jasmine (1.0.2.1) - json_pure (>= 1.4.3) - rack (>= 1.1) - rspec (>= 1.3.1) - selenium-webdriver (>= 0.1.3) - jquery-rails (1.0.7) + hike (1.2.1) + i18n (0.6.0) + jquery-rails (1.0.14) railties (~> 3.0) thor (~> 0.14) - json (1.5.1) - json_pure (1.5.1) - linecache19 (0.5.12) - ruby_core_source (>= 0.1.4) - mail (2.2.19) - activesupport (>= 2.3.6) + launchy (2.0.3) + mail (2.3.0) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) - mailcatcher (0.2.4) - eventmachine - haml - i18n - json - mail - sinatra - skinny (>= 0.1.2) - sqlite3-ruby - thin + mailcatcher (0.5.1) + activesupport (~> 3.0) + eventmachine (~> 0.12) + haml (~> 3.1) + mail (~> 2.3) + sinatra (~> 1.2) + skinny (~> 0.1) + sqlite3 (~> 1.3) + thin (~> 1.2) mime-types (1.16) - mongo (1.3.1) - bson (>= 1.3.1) - mongoid (2.0.2) + mongo (1.4.0) + bson (= 1.4.0) + mongoid (2.2.2) activemodel (~> 3.0) mongo (~> 1.3) tzinfo (~> 0.3.22) - mongoid-rspec (1.4.2) + mongoid-rspec (1.4.4) mongoid (~> 2.0) rspec (~> 2) - mongoid_rails_migrations (0.0.10) - activesupport (~> 3.0.0) - bundler (>= 0.9.19) - rails (~> 3.0.0) - railties (~> 3.0.0) + mongoid_rails_migrations (0.0.14) + activesupport (>= 3.0.0) + bundler (>= 1.0.0) + rails (>= 3.0.0) + railties (>= 3.0.0) multi_json (1.0.3) multi_xml (0.2.2) - multipart-post (1.1.1) + multipart-post (1.1.3) net-ldap (0.2.2) - nokogiri (1.4.4) + nokogiri (1.4.7) oa-basic (0.2.6) oa-core (= 0.2.6) rest-client (~> 1.6.0) @@ -168,7 +161,7 @@ GEM oa-core (= 0.2.6) rack-openid (~> 1.3.1) ruby-openid-apps-discovery (~> 1.2.0) - oauth (0.4.4) + oauth (0.4.5) oauth2 (0.4.1) faraday (~> 0.6.1) multi_json (>= 0.0.5) @@ -180,37 +173,50 @@ GEM oa-oauth (= 0.2.6) oa-openid (= 0.2.6) orm_adapter (0.0.5) - polyglot (0.3.1) - pyu-ruby-sasl (0.0.3.2) - rack (1.2.3) - rack-mount (0.6.14) + polyglot (0.3.2) + pyu-ruby-sasl (0.0.3.3) + rack (1.3.3) + rack-cache (1.0.3) + rack (>= 0.4) + rack-mount (0.8.3) rack (>= 1.0.0) rack-openid (1.3.1) rack (>= 1.1.0) ruby-openid (>= 2.1.8) - rack-test (0.5.7) + rack-protection (1.1.2) + rack + rack-ssl (1.3.2) + rack + rack-test (0.6.1) rack (>= 1.0) - rails (3.0.7) - actionmailer (= 3.0.7) - actionpack (= 3.0.7) - activerecord (= 3.0.7) - activeresource (= 3.0.7) - activesupport (= 3.0.7) + rails (3.1.0) + actionmailer (= 3.1.0) + actionpack (= 3.1.0) + activerecord (= 3.1.0) + activeresource (= 3.1.0) + activesupport (= 3.1.0) bundler (~> 1.0) - railties (= 3.0.7) - railties (3.0.7) - actionpack (= 3.0.7) - activesupport (= 3.0.7) + railties (= 3.1.0) + rails-footnotes (3.7.5) + rails (>= 3.0.0) + railties (3.1.0) + actionpack (= 3.1.0) + activesupport (= 3.1.0) + rack-ssl (~> 1.3.2) rake (>= 0.8.7) - thor (~> 0.14.4) - rake (0.8.7) - rest-client (1.6.1) + rdoc (~> 3.4) + thor (~> 0.14.6) + rake (0.9.2) + rb-fsevent (0.4.3.1) + rdiscount (1.6.8) + rdoc (3.9.4) + rest-client (1.6.7) mime-types (>= 1.16) rspec (2.6.0) rspec-core (~> 2.6.0) rspec-expectations (~> 2.6.0) rspec-mocks (~> 2.6.0) - rspec-core (2.6.3) + rspec-core (2.6.4) rspec-expectations (2.6.0) diff-lcs (~> 1.1.2) rspec-mocks (2.6.0) @@ -219,79 +225,94 @@ GEM activesupport (~> 3.0) railties (~> 3.0) rspec (~> 2.6.0) - ruby-debug-base19 (0.11.25) - columnize (>= 0.3.1) - linecache19 (>= 0.5.11) - ruby_core_source (>= 0.1.4) - ruby-debug19 (0.11.6) - columnize (>= 0.3.1) - linecache19 (>= 0.5.11) - ruby-debug-base19 (>= 0.11.19) ruby-openid (2.1.8) ruby-openid-apps-discovery (1.2.0) ruby-openid (>= 2.1.7) - ruby_core_source (0.1.5) - archive-tar-minitar (>= 0.5.2) rubyntlm (0.1.1) - rubyzip (0.9.4) - sass (3.1.3) - selenium-webdriver (0.2.0) - childprocess (>= 0.1.7) - ffi (>= 1.0.7) - json_pure - rubyzip - simple_form (1.4.0) - sinatra (1.2.6) - rack (~> 1.1) - tilt (< 2.0, >= 1.2.2) + sass (3.1.8) + sass-rails (3.1.3) + actionpack (~> 3.1.0) + railties (~> 3.1.0) + sass (>= 3.1.4) + sprockets (~> 2.0.0) + tilt (~> 1.3.2) + shoulda-matchers (1.0.0.beta3) + simple_form (1.4.2) + actionpack (~> 3.0) + activemodel (~> 3.0) + sinatra (1.3.0) + rack (~> 1.3) + rack-protection (~> 1.1) + tilt (~> 1.3) skinny (0.1.2) eventmachine thin - sqlite3 (1.3.3) - sqlite3-ruby (1.3.3) - sqlite3 (>= 1.3.3) + spork (0.9.0.rc9) + sprockets (2.0.1) + hike (~> 1.2) + rack (~> 1.0) + tilt (~> 1.1, != 1.3.0) + sqlite3 (1.3.4) + stripe (1.5.17) + rest-client + term-ansicolor (1.0.6) therubyracer-heroku (0.8.1.pre3) thin (1.2.11) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) thor (0.14.6) - tilt (1.3.2) - treetop (1.4.9) + tilt (1.3.3) + treetop (1.4.10) + polyglot polyglot (>= 0.3.1) - tzinfo (0.3.28) - warden (1.0.4) + turn (0.8.2) + ansi (>= 1.2.2) + tzinfo (0.3.30) + uglifier (1.0.3) + execjs (>= 0.3.0) + multi_json (>= 1.0.2) + warden (1.0.5) rack (>= 1.0) PLATFORMS ruby DEPENDENCIES - actionmailer-with-request - barista (~> 1.0) - barista_growl! - bson_ext (>= 1.2.4) - compass (~> 0.11) - dalli - database_cleaner - devise (>= 1.2.0) - devise_invitable (~> 0.4.0) - factory_girl_rails - haml (~> 3.1.0) - haml-rails - hoptoad_notifier - html5-boilerplate - jasmine - jquery-rails + airbrake + bson_ext (~> 1.4) + coffee-rails (~> 3.1) + compass (= 0.12.alpha.0) + database_cleaner (>= 0.6.7) + devise (~> 1.4.5) + devise_invitable (~> 0.5.4) + factory_girl_rails (~> 1.2.0) + foreman + growl + guard + guard-bundler + guard-rspec + guard-spork + haml-rails (~> 0.3.4) + jquery-rails (~> 1.0.13) + launchy (>= 0.4.0) mailcatcher - mongoid (>= 2.0.0) + mongoid (~> 2.1) mongoid-rspec - mongoid_rails_migrations (>= 0.0.2) - omniauth - rails (= 3.0.7) - rake (= 0.8.7) - rspec-rails - ruby-debug19 - sass (~> 3.1.0) - simple_form - therubyracer-heroku + mongoid_rails_migrations + omniauth (~> 0.2.6) + rack (= 1.3.3) + rails (~> 3.1.0) + rails-footnotes (>= 3.7) + rb-fsevent + rdiscount (~> 1.6.8) + rspec-rails (~> 2.6.1) + sass-rails (~> 3.1) + shoulda-matchers + simple_form (~> 1.4.2) + spork (~> 0.9.0.rc9) + stripe + therubyracer-heroku (= 0.8.1.pre3) + thin + turn + uglifier diff --git a/Guardfile b/Guardfile new file mode 100644 index 0000000..d485320 --- /dev/null +++ b/Guardfile @@ -0,0 +1,31 @@ +guard 'bundler' do + watch('Gemfile') +end + +guard 'spork', :wait => 30, :rspec_env => { 'RAILS_ENV' => 'test' }, :cucumber => false, :test_unit => false do + watch('config/application.rb') + watch('config/environment.rb') + watch(%r{^config/environments/.+\.rb$}) + watch(%r{^config/initializers/.+\.rb$}) + watch('spec/spec_helper.rb') +end + + +guard 'rspec', :version => 2, :cli => '--drb' do + watch(%r{^spec/.+_spec\.rb$}) + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } + watch('spec/spec_helper.rb') { "spec" } + + # Rails example + watch(%r{^spec/.+_spec\.rb$}) + watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } + watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } + watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } + watch(%r{^spec/support/(.+)\.rb$}) { "spec" } + watch('spec/spec_helper.rb') { "spec" } + watch('config/routes.rb') { "spec/routing" } + watch('app/controllers/application_controller.rb') { "spec/controllers" } + # Capybara request specs + watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" } +end + diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..e1fc1d2 --- /dev/null +++ b/Procfile @@ -0,0 +1,3 @@ +web: bundle exec rails server thin -p $PORT +mongodb: mongod +mailcatcher: mailcatcher -fv diff --git a/public/images/139.png b/app/assets/images/139.png similarity index 100% rename from public/images/139.png rename to app/assets/images/139.png diff --git a/public/images/203.png b/app/assets/images/203.png similarity index 100% rename from public/images/203.png rename to app/assets/images/203.png diff --git a/public/images/206.png b/app/assets/images/206.png similarity index 100% rename from public/images/206.png rename to app/assets/images/206.png diff --git a/public/images/243.png b/app/assets/images/243.png similarity index 100% rename from public/images/243.png rename to app/assets/images/243.png diff --git a/public/images/244.png b/app/assets/images/244.png similarity index 100% rename from public/images/244.png rename to app/assets/images/244.png diff --git a/public/images/46.png b/app/assets/images/46.png similarity index 100% rename from public/images/46.png rename to app/assets/images/46.png diff --git a/public/images/49.png b/app/assets/images/49.png similarity index 100% rename from public/images/49.png rename to app/assets/images/49.png diff --git a/public/images/53.png b/app/assets/images/53.png similarity index 100% rename from public/images/53.png rename to app/assets/images/53.png diff --git a/public/images/58.png b/app/assets/images/58.png similarity index 100% rename from public/images/58.png rename to app/assets/images/58.png diff --git a/public/images/58_24px.png b/app/assets/images/58_24px.png similarity index 100% rename from public/images/58_24px.png rename to app/assets/images/58_24px.png diff --git a/public/images/58_32px.png b/app/assets/images/58_32px.png similarity index 100% rename from public/images/58_32px.png rename to app/assets/images/58_32px.png diff --git a/public/images/70.png b/app/assets/images/70.png similarity index 100% rename from public/images/70.png rename to app/assets/images/70.png diff --git a/public/images/74.png b/app/assets/images/74.png similarity index 100% rename from public/images/74.png rename to app/assets/images/74.png diff --git a/public/images/about/couch.jpg b/app/assets/images/about/couch.jpg similarity index 100% rename from public/images/about/couch.jpg rename to app/assets/images/about/couch.jpg diff --git a/public/images/authbuttons/aol_128.png b/app/assets/images/authbuttons/aol_128.png similarity index 100% rename from public/images/authbuttons/aol_128.png rename to app/assets/images/authbuttons/aol_128.png diff --git a/public/images/authbuttons/aol_256.png b/app/assets/images/authbuttons/aol_256.png similarity index 100% rename from public/images/authbuttons/aol_256.png rename to app/assets/images/authbuttons/aol_256.png diff --git a/public/images/authbuttons/aol_32.png b/app/assets/images/authbuttons/aol_32.png similarity index 100% rename from public/images/authbuttons/aol_32.png rename to app/assets/images/authbuttons/aol_32.png diff --git a/public/images/authbuttons/aol_64.png b/app/assets/images/authbuttons/aol_64.png similarity index 100% rename from public/images/authbuttons/aol_64.png rename to app/assets/images/authbuttons/aol_64.png diff --git a/public/images/authbuttons/basecamp_128.png b/app/assets/images/authbuttons/basecamp_128.png similarity index 100% rename from public/images/authbuttons/basecamp_128.png rename to app/assets/images/authbuttons/basecamp_128.png diff --git a/public/images/authbuttons/basecamp_256.png b/app/assets/images/authbuttons/basecamp_256.png similarity index 100% rename from public/images/authbuttons/basecamp_256.png rename to app/assets/images/authbuttons/basecamp_256.png diff --git a/public/images/authbuttons/basecamp_32.png b/app/assets/images/authbuttons/basecamp_32.png similarity index 100% rename from public/images/authbuttons/basecamp_32.png rename to app/assets/images/authbuttons/basecamp_32.png diff --git a/public/images/authbuttons/basecamp_64.png b/app/assets/images/authbuttons/basecamp_64.png similarity index 100% rename from public/images/authbuttons/basecamp_64.png rename to app/assets/images/authbuttons/basecamp_64.png diff --git a/public/images/authbuttons/campfire_128.png b/app/assets/images/authbuttons/campfire_128.png similarity index 100% rename from public/images/authbuttons/campfire_128.png rename to app/assets/images/authbuttons/campfire_128.png diff --git a/public/images/authbuttons/campfire_256.png b/app/assets/images/authbuttons/campfire_256.png similarity index 100% rename from public/images/authbuttons/campfire_256.png rename to app/assets/images/authbuttons/campfire_256.png diff --git a/public/images/authbuttons/campfire_32.png b/app/assets/images/authbuttons/campfire_32.png similarity index 100% rename from public/images/authbuttons/campfire_32.png rename to app/assets/images/authbuttons/campfire_32.png diff --git a/public/images/authbuttons/campfire_64.png b/app/assets/images/authbuttons/campfire_64.png similarity index 100% rename from public/images/authbuttons/campfire_64.png rename to app/assets/images/authbuttons/campfire_64.png diff --git a/public/images/authbuttons/facebook_128.png b/app/assets/images/authbuttons/facebook_128.png similarity index 100% rename from public/images/authbuttons/facebook_128.png rename to app/assets/images/authbuttons/facebook_128.png diff --git a/public/images/authbuttons/facebook_256.png b/app/assets/images/authbuttons/facebook_256.png similarity index 100% rename from public/images/authbuttons/facebook_256.png rename to app/assets/images/authbuttons/facebook_256.png diff --git a/public/images/authbuttons/facebook_32.png b/app/assets/images/authbuttons/facebook_32.png similarity index 100% rename from public/images/authbuttons/facebook_32.png rename to app/assets/images/authbuttons/facebook_32.png diff --git a/public/images/authbuttons/facebook_64.png b/app/assets/images/authbuttons/facebook_64.png similarity index 100% rename from public/images/authbuttons/facebook_64.png rename to app/assets/images/authbuttons/facebook_64.png diff --git a/public/images/authbuttons/github_128.png b/app/assets/images/authbuttons/github_128.png similarity index 100% rename from public/images/authbuttons/github_128.png rename to app/assets/images/authbuttons/github_128.png diff --git a/public/images/authbuttons/github_256.png b/app/assets/images/authbuttons/github_256.png similarity index 100% rename from public/images/authbuttons/github_256.png rename to app/assets/images/authbuttons/github_256.png diff --git a/public/images/authbuttons/github_32.png b/app/assets/images/authbuttons/github_32.png similarity index 100% rename from public/images/authbuttons/github_32.png rename to app/assets/images/authbuttons/github_32.png diff --git a/public/images/authbuttons/github_64.png b/app/assets/images/authbuttons/github_64.png similarity index 100% rename from public/images/authbuttons/github_64.png rename to app/assets/images/authbuttons/github_64.png diff --git a/public/images/authbuttons/google_128.png b/app/assets/images/authbuttons/google_128.png similarity index 100% rename from public/images/authbuttons/google_128.png rename to app/assets/images/authbuttons/google_128.png diff --git a/public/images/authbuttons/google_256.png b/app/assets/images/authbuttons/google_256.png similarity index 100% rename from public/images/authbuttons/google_256.png rename to app/assets/images/authbuttons/google_256.png diff --git a/public/images/authbuttons/google_32.png b/app/assets/images/authbuttons/google_32.png similarity index 100% rename from public/images/authbuttons/google_32.png rename to app/assets/images/authbuttons/google_32.png diff --git a/public/images/authbuttons/google_64.png b/app/assets/images/authbuttons/google_64.png similarity index 100% rename from public/images/authbuttons/google_64.png rename to app/assets/images/authbuttons/google_64.png diff --git a/public/images/authbuttons/linkedin_128.png b/app/assets/images/authbuttons/linkedin_128.png similarity index 100% rename from public/images/authbuttons/linkedin_128.png rename to app/assets/images/authbuttons/linkedin_128.png diff --git a/public/images/authbuttons/linkedin_256.png b/app/assets/images/authbuttons/linkedin_256.png similarity index 100% rename from public/images/authbuttons/linkedin_256.png rename to app/assets/images/authbuttons/linkedin_256.png diff --git a/public/images/authbuttons/linkedin_32.png b/app/assets/images/authbuttons/linkedin_32.png similarity index 100% rename from public/images/authbuttons/linkedin_32.png rename to app/assets/images/authbuttons/linkedin_32.png diff --git a/public/images/authbuttons/linkedin_64.png b/app/assets/images/authbuttons/linkedin_64.png similarity index 100% rename from public/images/authbuttons/linkedin_64.png rename to app/assets/images/authbuttons/linkedin_64.png diff --git a/public/images/authbuttons/myspace_128.png b/app/assets/images/authbuttons/myspace_128.png similarity index 100% rename from public/images/authbuttons/myspace_128.png rename to app/assets/images/authbuttons/myspace_128.png diff --git a/public/images/authbuttons/myspace_256.png b/app/assets/images/authbuttons/myspace_256.png similarity index 100% rename from public/images/authbuttons/myspace_256.png rename to app/assets/images/authbuttons/myspace_256.png diff --git a/public/images/authbuttons/myspace_32.png b/app/assets/images/authbuttons/myspace_32.png similarity index 100% rename from public/images/authbuttons/myspace_32.png rename to app/assets/images/authbuttons/myspace_32.png diff --git a/public/images/authbuttons/myspace_64.png b/app/assets/images/authbuttons/myspace_64.png similarity index 100% rename from public/images/authbuttons/myspace_64.png rename to app/assets/images/authbuttons/myspace_64.png diff --git a/public/images/authbuttons/openid_128.png b/app/assets/images/authbuttons/openid_128.png similarity index 100% rename from public/images/authbuttons/openid_128.png rename to app/assets/images/authbuttons/openid_128.png diff --git a/public/images/authbuttons/openid_256.png b/app/assets/images/authbuttons/openid_256.png similarity index 100% rename from public/images/authbuttons/openid_256.png rename to app/assets/images/authbuttons/openid_256.png diff --git a/public/images/authbuttons/openid_32.png b/app/assets/images/authbuttons/openid_32.png similarity index 100% rename from public/images/authbuttons/openid_32.png rename to app/assets/images/authbuttons/openid_32.png diff --git a/public/images/authbuttons/openid_64.png b/app/assets/images/authbuttons/openid_64.png similarity index 100% rename from public/images/authbuttons/openid_64.png rename to app/assets/images/authbuttons/openid_64.png diff --git a/public/images/authbuttons/presently_128.png b/app/assets/images/authbuttons/presently_128.png similarity index 100% rename from public/images/authbuttons/presently_128.png rename to app/assets/images/authbuttons/presently_128.png diff --git a/public/images/authbuttons/presently_256.png b/app/assets/images/authbuttons/presently_256.png similarity index 100% rename from public/images/authbuttons/presently_256.png rename to app/assets/images/authbuttons/presently_256.png diff --git a/public/images/authbuttons/presently_32.png b/app/assets/images/authbuttons/presently_32.png similarity index 100% rename from public/images/authbuttons/presently_32.png rename to app/assets/images/authbuttons/presently_32.png diff --git a/public/images/authbuttons/presently_64.png b/app/assets/images/authbuttons/presently_64.png similarity index 100% rename from public/images/authbuttons/presently_64.png rename to app/assets/images/authbuttons/presently_64.png diff --git a/public/images/authbuttons/twitter_128.png b/app/assets/images/authbuttons/twitter_128.png similarity index 100% rename from public/images/authbuttons/twitter_128.png rename to app/assets/images/authbuttons/twitter_128.png diff --git a/public/images/authbuttons/twitter_256.png b/app/assets/images/authbuttons/twitter_256.png similarity index 100% rename from public/images/authbuttons/twitter_256.png rename to app/assets/images/authbuttons/twitter_256.png diff --git a/public/images/authbuttons/twitter_32.png b/app/assets/images/authbuttons/twitter_32.png similarity index 100% rename from public/images/authbuttons/twitter_32.png rename to app/assets/images/authbuttons/twitter_32.png diff --git a/public/images/authbuttons/twitter_64.png b/app/assets/images/authbuttons/twitter_64.png similarity index 100% rename from public/images/authbuttons/twitter_64.png rename to app/assets/images/authbuttons/twitter_64.png diff --git a/public/images/authbuttons/yahoo_128.png b/app/assets/images/authbuttons/yahoo_128.png similarity index 100% rename from public/images/authbuttons/yahoo_128.png rename to app/assets/images/authbuttons/yahoo_128.png diff --git a/public/images/authbuttons/yahoo_256.png b/app/assets/images/authbuttons/yahoo_256.png similarity index 100% rename from public/images/authbuttons/yahoo_256.png rename to app/assets/images/authbuttons/yahoo_256.png diff --git a/public/images/authbuttons/yahoo_32.png b/app/assets/images/authbuttons/yahoo_32.png similarity index 100% rename from public/images/authbuttons/yahoo_32.png rename to app/assets/images/authbuttons/yahoo_32.png diff --git a/public/images/authbuttons/yahoo_64.png b/app/assets/images/authbuttons/yahoo_64.png similarity index 100% rename from public/images/authbuttons/yahoo_64.png rename to app/assets/images/authbuttons/yahoo_64.png diff --git a/public/images/badges/roomie_awesome.png b/app/assets/images/badges/roomie_awesome.png similarity index 100% rename from public/images/badges/roomie_awesome.png rename to app/assets/images/badges/roomie_awesome.png diff --git a/public/images/badges/roomie_best.png b/app/assets/images/badges/roomie_best.png similarity index 100% rename from public/images/badges/roomie_best.png rename to app/assets/images/badges/roomie_best.png diff --git a/public/images/badges/roomie_good.png b/app/assets/images/badges/roomie_good.png similarity index 100% rename from public/images/badges/roomie_good.png rename to app/assets/images/badges/roomie_good.png diff --git a/public/images/badges/roomie_great.png b/app/assets/images/badges/roomie_great.png similarity index 100% rename from public/images/badges/roomie_great.png rename to app/assets/images/badges/roomie_great.png diff --git a/public/images/cloud.png b/app/assets/images/cloud.png similarity index 100% rename from public/images/cloud.png rename to app/assets/images/cloud.png diff --git a/public/images/clouds.png b/app/assets/images/clouds.png similarity index 100% rename from public/images/clouds.png rename to app/assets/images/clouds.png diff --git a/public/images/hills.png b/app/assets/images/hills.png similarity index 100% rename from public/images/hills.png rename to app/assets/images/hills.png diff --git a/public/images/icons/check.png b/app/assets/images/icons/check.png similarity index 100% rename from public/images/icons/check.png rename to app/assets/images/icons/check.png diff --git a/public/images/icons/corkboard.png b/app/assets/images/icons/corkboard.png similarity index 100% rename from public/images/icons/corkboard.png rename to app/assets/images/icons/corkboard.png diff --git a/public/images/icons/edit.png b/app/assets/images/icons/edit.png similarity index 100% rename from public/images/icons/edit.png rename to app/assets/images/icons/edit.png diff --git a/public/images/icons/info.png b/app/assets/images/icons/info.png similarity index 100% rename from public/images/icons/info.png rename to app/assets/images/icons/info.png diff --git a/public/images/icons/invitation.png b/app/assets/images/icons/invitation.png similarity index 100% rename from public/images/icons/invitation.png rename to app/assets/images/icons/invitation.png diff --git a/public/images/icons/past_due.png b/app/assets/images/icons/past_due.png similarity index 100% rename from public/images/icons/past_due.png rename to app/assets/images/icons/past_due.png diff --git a/public/images/icons/past_due_active.png b/app/assets/images/icons/past_due_active.png similarity index 100% rename from public/images/icons/past_due_active.png rename to app/assets/images/icons/past_due_active.png diff --git a/public/images/icons/pointer.png b/app/assets/images/icons/pointer.png similarity index 100% rename from public/images/icons/pointer.png rename to app/assets/images/icons/pointer.png diff --git a/public/images/icons/profile.png b/app/assets/images/icons/profile.png similarity index 100% rename from public/images/icons/profile.png rename to app/assets/images/icons/profile.png diff --git a/public/images/icons/reward.png b/app/assets/images/icons/reward.png similarity index 100% rename from public/images/icons/reward.png rename to app/assets/images/icons/reward.png diff --git a/public/images/icons/reward_active.png b/app/assets/images/icons/reward_active.png similarity index 100% rename from public/images/icons/reward_active.png rename to app/assets/images/icons/reward_active.png diff --git a/public/images/icons/reward_hover.png b/app/assets/images/icons/reward_hover.png similarity index 100% rename from public/images/icons/reward_hover.png rename to app/assets/images/icons/reward_hover.png diff --git a/public/images/loader.gif b/app/assets/images/loader.gif similarity index 100% rename from public/images/loader.gif rename to app/assets/images/loader.gif diff --git a/public/images/logo.png b/app/assets/images/logo.png similarity index 100% rename from public/images/logo.png rename to app/assets/images/logo.png diff --git a/public/images/naked/0.png b/app/assets/images/naked/0.png similarity index 100% rename from public/images/naked/0.png rename to app/assets/images/naked/0.png diff --git a/public/images/naked/1.png b/app/assets/images/naked/1.png similarity index 100% rename from public/images/naked/1.png rename to app/assets/images/naked/1.png diff --git a/public/images/naked/2.png b/app/assets/images/naked/2.png similarity index 100% rename from public/images/naked/2.png rename to app/assets/images/naked/2.png diff --git a/public/images/naked/3.png b/app/assets/images/naked/3.png similarity index 100% rename from public/images/naked/3.png rename to app/assets/images/naked/3.png diff --git a/public/images/naked/4.png b/app/assets/images/naked/4.png similarity index 100% rename from public/images/naked/4.png rename to app/assets/images/naked/4.png diff --git a/public/images/naked/5.png b/app/assets/images/naked/5.png similarity index 100% rename from public/images/naked/5.png rename to app/assets/images/naked/5.png diff --git a/public/images/pacman.png b/app/assets/images/pacman.png similarity index 100% rename from public/images/pacman.png rename to app/assets/images/pacman.png diff --git a/public/images/pig.png b/app/assets/images/pig.png similarity index 100% rename from public/images/pig.png rename to app/assets/images/pig.png diff --git a/public/images/privacy_facebook.png b/app/assets/images/privacy_facebook.png similarity index 100% rename from public/images/privacy_facebook.png rename to app/assets/images/privacy_facebook.png diff --git a/public/images/profile_default.png b/app/assets/images/profile_default.png similarity index 100% rename from public/images/profile_default.png rename to app/assets/images/profile_default.png diff --git a/public/images/rails.png b/app/assets/images/rails.png similarity index 100% rename from public/images/rails.png rename to app/assets/images/rails.png diff --git a/public/images/screens/calendar.png b/app/assets/images/screens/calendar.png similarity index 100% rename from public/images/screens/calendar.png rename to app/assets/images/screens/calendar.png diff --git a/public/images/screens/corkboard.png b/app/assets/images/screens/corkboard.png similarity index 100% rename from public/images/screens/corkboard.png rename to app/assets/images/screens/corkboard.png diff --git a/public/images/screens/profile.png b/app/assets/images/screens/profile.png similarity index 100% rename from public/images/screens/profile.png rename to app/assets/images/screens/profile.png diff --git a/public/images/support/Qs3Xz.jpg b/app/assets/images/support/Qs3Xz.jpg similarity index 100% rename from public/images/support/Qs3Xz.jpg rename to app/assets/images/support/Qs3Xz.jpg diff --git a/public/images/support/k2o6l.jpg b/app/assets/images/support/k2o6l.jpg similarity index 100% rename from public/images/support/k2o6l.jpg rename to app/assets/images/support/k2o6l.jpg diff --git a/public/images/support/metDP.jpg b/app/assets/images/support/metDP.jpg similarity index 100% rename from public/images/support/metDP.jpg rename to app/assets/images/support/metDP.jpg diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..971b832 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,19 @@ +// This is a manifest file that'll be compiled into including all the files listed below. +// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically +// be included in the compiled file accessible from http://example.com/assets/application.js +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +//= require modernizr.min +//= require selectivizr.min +//= require underscore.min +//= require jquery +//= require jquery-ui +//= require jquery_ujs +//= require date +//= require base +//= require_tree +//= require_self + +// Boot Script +jQuery(this.roomies.initialize); diff --git a/app/assets/javascripts/assignments.js.coffee b/app/assets/javascripts/assignments.js.coffee new file mode 100644 index 0000000..8418f3d --- /dev/null +++ b/app/assets/javascripts/assignments.js.coffee @@ -0,0 +1,115 @@ +# ========================================= +# ========== NEW ASSIGNMENT JAZZ ========== +# ========================================= +jQuery -> + $('#repeating').live 'change', -> + $('.littler_guys').toggle() + $('.littler_guys').find('#assignment_duration').attr('value','') + + selectRoomies = (name) -> + $('#assignment_assignee_ids option').each -> + $this = $(this) + if $this.text() == name + $this.attr('selected',true) + + split = (val) -> + return val.split( /,\s*/ ) + + extractLast = (term) -> + return split( term ).pop() + + do roomies.ui.autocompleteSetup = -> + assignee_names = [] + $assignees = $('#assignment_assignee_ids') + $assignees.parent('div').hide() + + $assignees.children('option').each -> + assignee_names.push($(this).text()) + + $( "#assignment_assignee_names" ) + # // don't navigate away from the field on tab when selecting an item + .live 'keydown', (event) -> + if event.keyCode == $.ui.keyCode.TAB && $(this).data('autocomplete').menu.active + event.preventDefault() + .autocomplete { + delay: 100, + minLength: 0, + source: (request, response) -> + # // delegate back to autocomplete, but extract the last term + response($.ui.autocomplete.filter(assignee_names, extractLast(request.term))) + , + focus: -> + # // prevent value inserted on focus + return false + , + select: (event, ui) -> + terms = split( this.value ) + # // remove the current input + terms.pop() + # // add the selected item + terms.push( ui.item.value ) + # // add placeholder to get the comma-and-space at the end + terms.push( "" ) + this.value = terms.join( ", " ) + return false + } + + $( "#assignment_assignee_names" ).live 'keyup', -> + $('#assignment_assignee_ids option').attr('selected',false) + names = split( $(this).val() ) + selectRoomies name for name in names + + $( "#assignment_assignee_names" ).live 'focusout', -> + $('#assignment_assignee_ids option').attr('selected',false) + names = split( $(this).val() ) + selectRoomies name for name in names + + do roomies.ui.superDate = -> + $picker = $("#picker") + $superdate = $('.superdate') + + $superdate.live 'keyup', -> + val = $(this).val() + if val? + # // parsing anything the user enters as a date + date = Date.parse( val ) + + # // making the date more legible and concise + date = date.toString('MMMM d, yyyy') if date + + # // updating the datepicker + $picker.datepicker('setDate', date) + + $superdate.live 'focusout', -> + $superdate = $(this) + val = $(this).val() + if val? + date = Date.parse( val ) + date = date.toString('MMMM d, yyyy') if date + $(this).val(date) + $picker.datepicker('setDate', date) + + $('.superdate').live 'focusin', -> + $superdate = $(this) + val = $(this).val() + if val? + date = Date.parse( val ) + date = date.toString('MMMM d, yyyy') if date + $(this).val(date) + $picker.datepicker('setDate', date) + + $picker.datepicker( + dateFormat: 'MM d, yy', + beforeShow: (dateText, inst) -> + if $superdate.val? + $picker.datepicker("setDate", $superdate.val()) + onSelect: (dateText, inst) -> + date = dateText.toString('MMMM d, yyyy') + $superdate.val(date) + ) + + $('.ui-datepicker-today a').click() + $superdate = $('.superdate:eq(0)') + window.roomies.ui.recalculateStickyFooter() + return $superdate + diff --git a/app/assets/javascripts/base.js.coffee b/app/assets/javascripts/base.js.coffee new file mode 100644 index 0000000..dea1aba --- /dev/null +++ b/app/assets/javascripts/base.js.coffee @@ -0,0 +1,212 @@ +# App Namespace +this.roomies = + init: [] + ui: {} + utils: {} +# Classical Namespace +this.Roomies = {} + +# Convienence variables +roomies = this.roomies +Roomies = this.Roomies + +# ========================================= +# ============= Roomies Core ============== +# ========================================= + +roomies.initialize = -> + for initFunctionName in roomies.init + initFunction = roomies.utils.getNestedValueForObject(roomies, initFunctionName) + initFunction() + +# This method provides access to an objects nested properties +# Example: +# a = { b: { c : "foo" } } +# // b is a direct property of a +# // c is a direct property of b +# // c is a nested property of a +# getNestedValueForObject(a, 'b.c') => "foo" +roomies.utils.getNestedValueForObject = (obj, identifier) -> + parts = identifier.split('.') + return obj[identifier] if parts.length is 1 + nestedValue = obj + for part in parts + nestedValue = nestedValue[part] + return nestedValue + + +# ========================================= +# =========== Functions & Stuff =========== +# ========================================= + +# // Handles the sticky footer +roomies.ui.recalculateStickyFooter = -> + footer = $('footer') + body = $('body') + footer.css({position:'static'}) + if window.innerHeight > body.height() + footer.css({position:'fixed', bottom:0}) + +roomies.init.push('ui.recalculateStickyFooter') + +jQuery ($) -> + _fadeSpeed = 100 + _slideDownSpeed = 200 + _slideUpSpeed = 250 + hovering_over = null + $ = jQuery + $body = $('body') + $main = $('#main') + $footer = $('footer') + $modal = $('#modal') + $loader = $('.loader') + $darknessification = $('#darknessification') + $ajaxed = $modal.children('#ajaxed') + $ajaxed_again = $modal.children('#ajaxed_again') + + # NEW # + roomies.$ = jQuery + roomies.ui.$body = $body + roomies.ui.$main = $main + roomies.ui.$footer = $footer + roomies.ui.$modal = $modal + roomies.ui.$loader = $loader + + $(window).bind 'resize', -> + roomies.ui.recalculateStickyFooter() + centerModal() + + # // Hides the flash notice if it's visible. + $('#flash').live 'click', -> + $('#flash').hide 'fast', -> + roomies.ui.recalculateStickyFooter() + + # // Hides the flash notice after 5 seconds if the user hasn't clicked on it yet. + setTimeout( -> + $('#flash .notice').parent().hide 'fast', -> + roomies.ui.recalculateStickyFooter() + , 5000) + + calculateCenter = (container, element) -> + l = (container.outerWidth()/2) - (element.outerWidth()/2) + t = ($(window).height()/2) - (element.outerHeight()/2) + t = 0 if t < 0 + + center = { left: l + 'px', top: t + 'px' } + return center + + showLoader = -> + $darknessification.fadeIn _fadeSpeed + center = calculateCenter($('html'), $loader) + $loader.css({left: center.left, top: center.top}).show 'fast' + + + # ========================================= + # ========== HEADER NOTIFICATION ========== + # ========================================= + + $('nav li.notification a').live 'mouseover', -> + $this = $(this) + $pastDueLabel = $("#{$this.text()}") + $pastDueLabel.hide().appendTo('header') + + l = $this.offset().left - (($pastDueLabel.outerWidth() - $this.outerWidth()) / 2) + t = $this.offset().top + $this.outerHeight() + 5 + + $pastDueLabel.css({left:l,top:t}).slideDown('fast').fadeIn() + + $('nav li.notification a').live 'mouseout', -> + $('.notification_title').fadeOut -> $(this).remove() + + + # ========================================= + # ================= MODAL ================= + # ========================================= + + hideModal = (event) -> + $darknessification.hide 'fast' + $modal.hide 'fast' + + roomies.ui.hideModal = hideModal + + centerModal = (animate = false) -> + center = calculateCenter($('html'), $modal) + if animate + $modal.animate({left: center.left, top: center.top}) + else + $modal.css({left: center.left, top: center.top}) + + generateModal = (anchor, inline = false) -> + showLoader() + unless inline + $ajaxed_again.hide() + $ajaxed.show() + $.ajax + url: anchor.attr('href'), + success: (data) -> + if inline + $ajaxed.hide 'fast', -> + $ajaxed_again.empty() + $(data).appendTo $ajaxed_again + $ajaxed_again.show 'fast' + $("back").appendTo '#modal #ajaxed_again h1' + else + $ajaxed.empty() + $(data).appendTo $ajaxed + + $loader.fadeOut 'fast' + $('#modal #ajaxed h1 span').remove() + $('x').appendTo '#modal h1' + unless inline + roomies.ui.superDate() + roomies.ui.autocompleteSetup() + $darknessification.fadeIn _fadeSpeed + $modal.fadeIn _fadeSpeed + centerModal() + + if $ajaxed.children('form.assignment').length > 0 || $ajaxed_again.children('form.assignment').length > 0 + $modal.css('width','600px') + centerModal() + + if anchor.parent('li').hasClass('rewards') + anchor.parent('li').remove() + $.ajax + type: 'post', + url: "/rewards/view_all" + + setTimeout( -> + centerModal(true) + ,400) + + return false + + # // Listens for a click on any anchor with a class of ajax. + # // Knabs the anchor's href and ajaxes it in to the modal. + roomies.ui.setupAjaxLinks = -> + roomies.ui.$body.delegate('a.ajax', 'click', -> + if $(this).hasClass('view_detail') + generateModal($(this), true) + else + generateModal($(this)) + return false + ) + roomies.init.push('ui.setupAjaxLinks') + + # // Listens for a click on the overlay when the modal or detail list is up. + $darknessification.live 'click', -> + hideModal() + + # // Watches for an escape keypress and hides the modal, overlay, and detail list. + $(window).live 'keyup', (event) -> + if event.keyCode == 27 + $('.detail_day_view').hide 'fast' + hideModal() + + # // Watches for a click on the 'x' and hides the modal and overlay. + $('#modal h1 span').live 'click', -> + if $(this).hasClass('go_back') + $ajaxed_again.hide 'fast', -> + $ajaxed.show 'fast', -> + centerModal(true) + else + hideModal() diff --git a/app/assets/javascripts/corkboard.js.coffee b/app/assets/javascripts/corkboard.js.coffee new file mode 100644 index 0000000..c54f6c0 --- /dev/null +++ b/app/assets/javascripts/corkboard.js.coffee @@ -0,0 +1,251 @@ +# ========================================= +# =============== CORKBOARD =============== +# ========================================= +jQuery -> + $('.monthly').hide() + # // Listens for a click on the calendar view option links. + $('.header_bar a').live 'click', -> + unless $(this).hasClass('active') + $header_bar = $(this).parent().parent().siblings('.header_bar') + $('.header_bar.monthly, .header_bar.upcoming').hide() + + # // Checks to see if the we want to show the full on calendar or not. + if $header_bar.hasClass('upcoming') + $('.header_bar.upcoming').show() + $('.calendar').hide 'fast', -> + $('.centric').show 'fast', -> + window.roomies.ui.recalculateStickyFooter() + else + $('.header_bar.monthly').show() + $('.centric').hide 'fast', -> + $('.calendar').show 'fast', -> + window.roomies.ui.recalculateStickyFooter() + + if $('.corkboard_view.current').hasClass('all') + then $('.corkboard_view.my').children('.calendar, .centric').hide() + else $('.corkboard_view.all').children('.calendar, .centric').hide() + + return false + + setListHeights = -> + max_list_height = 0 + $('.semantic_shmantic').each -> + $this = $(this) + $this.css('height','auto') + max_list_height = $this.height() if $this.height() > max_list_height + + $('.semantic_shmantic').each -> + $(this).css('height',max_list_height) + + # // Listens for a click on the assignee filters and changes the UI accordingly. + $('#upcoming_filters #assignee_filters li').live 'click', -> + unless $(this).hasClass('active') + $(this).siblings().andSelf().toggleClass('active') + $('.corkboard_view').toggleClass('current') + generateDetailLists() + setListHeights() + + # // $('#assignment_filters').live 'click', (event) -> + # // $this = $(event.target) + # // unless $this.hasClass('active') + # // $this.addClass('active').siblings().removeClass('active') + # // $('.corkboard_view.current .assignment').slideDown 'fast' + # // $(".corkboard_view.current .#{$this.data('filter')}").slideUp 'fast', -> + # // window.roomies.ui.recalculateStickyFooter() + + setListHeights() + + # // Listens for a click on the body and closes the detailed list of + # // assignments that's what it should be doing. + window.roomies.ui.$body.live 'click', (event) -> + $clicky = $(event.target) + if $clicky.parent('.todo').length < 1 && !$clicky.hasClass('detail_day_view') + if $('.detail_day_view').length > 0 + $('.detail_day_view').hide 'fast' + + # ========================================= + # =============== CALENDARS =============== + # ========================================= + + # // Listens for a click, hover, and leave event on the anchors in the calendar. + # // Pops up with a list of the corresponding assignments for that day. + $('.todo a').live 'click', -> return false + $('.todo a').live 'mouseleave', -> hovering_over = null + $('.todo a').live 'mouseenter', -> + + $this = $(this) + $('.detail_day_view').hide 'fast' + day_number = $(this).parent('.todo').parent('.day').data('number') + hovering_over = day_number + + # // Sets a delay on animating in the list of assignments, then positions + # // it perfectly where we want it. + setTimeout( -> + if hovering_over == day_number + $('.detail_day_view').each -> + $detailList = $(this) + if $detailList.data('number') == day_number && $detailList.data('type') == $this.hasClass('tasks') + $('.detail_day_view').hide 'fast' + # // Sets the top to just above the anchor and the left to the anchor's left. + top = $this.offset().top - $detailList.outerHeight() - 10 + $detailList.css({top: top, left: $this.offset().left}).fadeIn 'fast' + + listPlacement = $detailList.offset().left + $detailList.outerWidth() + mainWidth = $main.offset().left + $main.width() + + # // Checks to see if the popup needs to go the other direction or not. + if listPlacement > mainWidth + left = ($this.offset().left + $this.outerWidth()) - $detailList.outerWidth() + $detailList.css('left',left) + , 500) + + # // Listens for the mouse leave event on our list of assignments + # // and hides them when detected. + $('.detail_day_view').live 'mouseleave', -> + $('.detail_day_view').hide 'fast' + + # // Loops through all todo badges on each day and generates a detailed list. + generateDetailLists = -> + $('.corkboard_view.current .calendar .todo').each -> + $this = $(this) + $badges = $this.children('a') + $('.detail_day_view').remove() + + if $badges.length < 2 + $badges.css('marginLeft','13px') + + day_number = $this.parent('.day').data('number') + + $badges.each -> + $this = $(this) + type = $this.hasClass('tasks') + + $detailList = $("
") + + $.ajax + url: $this.attr('href'), + success: (data) -> + $(data).each -> + $("
  • + #{this.purpose} +
  • ").appendTo $detailList + + $detailList.appendTo $main + + generateDetailLists() + + + # ========================================= + # =========== ASSIGNMENT LISTS ============ + # ========================================= + + $('.assignment[data-completed=true]') + .removeClass('assignment') + .find('.type') + .removeClass() + .addClass('check') + + # // Handles mouseenter and mouseleave for the corkboard lists. + $('.list .assignment').live 'mouseenter', -> + unless $(this).hasClass('working_on_it') + $(this) + .find('li:eq(2)').animate {paddingRight:'0px'}, 'fast', -> + $(this).prev().stop(true).show 'fast' + .siblings('li:eq(0)').removeClass().addClass('check') + + $('.list .assignment').live 'mouseleave', -> + $(this) + .find('li:eq(1)').fadeOut 'fast', -> + $(this).hide().next().stop(true).animate {paddingRight:'25px'}, 'fast' + .siblings('li:eq(0)').removeClass().addClass('type') + + $('.list li[data-completed=true], .list .completed').live 'mouseenter', -> + $(this) + .children('ul') + .children('li:eq(0)') + .removeClass() + .addClass('undo') + .attr('title','mark as incomplete') + + $('.list li[data-completed=true], .list .completed').live 'mouseleave', -> + $(this) + .children('ul') + .children('li:eq(0)') + .removeClass() + .addClass('check') + .attr('title','completed') + .next() + .hide 'fast' + + # // Edit assignment on edit icon click. + $('.edit').live 'click', -> + $this = $(this) + id = $this.data("assignment_id") + $this.attr('href',"/assignments/#{id}/edit") + generateModal($this) + + # // Mark as completed on check icon click. + $('.check').live 'click', -> + $this = $(this) + id = $this.data('assignment_id') + $assignment = $this.parent('ul').parent('li') + + $assignment.addClass('working_on_it').children('ul').children('li:eq(0), li:eq(1)').hide 'fast' + $assignmentType = $assignment.children('ul').children('li:eq(0)') + left = ($assignmentType.offset().left + $assignmentType.width() - 34) + top = ($assignmentType.offset().top + 2) + $assignmentLoader = $("
    ").appendTo('#main').css({top:top,left:left,opacity:0.4}).show 'fast' + + if $assignment.hasClass('task') + type = 'task' + else + type = 'expense' + + $.ajax + type: 'post', + url: "/assignments/#{id}/complete", + success: (data) -> + $assignmentLoader.hide('fast', -> $(this).remove()) + $assignment + .removeClass() + .attr('data-type',type) + .addClass('completed') + .find('.type') + .removeClass() + .addClass('check') + .show('fast') + return false + + # // Mark as incomplete on x icon click. + $('li[data-completed=true] .undo, .list .undo').live 'click', -> + $this = $(this) + id = $this.data('assignment_id') + $assignment = $this.parent('ul').parent('li') + type = $assignment.data('type') + + $assignment.addClass('working_on_it').children('ul').children('li:eq(0), li:eq(1)').hide 'fast' + $assignmentType = $assignment.children('ul').children('li:eq(0)') + left = ($assignmentType.offset().left + $assignmentType.width() - 34) + top = ($assignmentType.offset().top + 2) + $assignmentLoader = $("
    ").appendTo('#main').css({top:top,left:left,opacity:0.4}).show 'fast' + + $.ajax + type: 'post', + url: "/assignments/#{id}/undo_complete", + success: (data) -> + $assignmentLoader.hide('fast', -> $(this).remove()) + $darknessification.fadeOut 'fast' + $assignment + .attr('data-completed','') + .removeClass() + .addClass('assignment') + .find('.check') + .removeClass() + .addClass('type') + .attr('title',type) + .show('fast') + .find('.undo') + .removeClass() + .addClass('type') + .attr('title',type) + return false diff --git a/app/assets/javascripts/houses.js.coffee b/app/assets/javascripts/houses.js.coffee new file mode 100644 index 0000000..afa70d2 --- /dev/null +++ b/app/assets/javascripts/houses.js.coffee @@ -0,0 +1,82 @@ +class Roomies.SponsorHouseView + + constructor: (selector)-> + @el = $(selector)[0] + this.bindEvents() + this.prefill() + + prefill: () -> + @$('#card_number').val('4242-4242-4242-4242') + @$('#card_expiry_month').val('10') + @$('#card_expiry_year').val('2020') + @$('#card_cvc').val('123') + + addCard: (event) -> + # prevent going to server + event.preventDefault() + # prevent repeated clicks + $('input[type=submit]', event.target).attr('disabled', 'disabled') + + card = this.getCard() + + responseHandler = (status, response) -> + # remove status indicator + if status == 200 + @last4 = response.card.last4 + @stripe_token = response.id + @$('#stripe_token').val(@stripe_token) + @$('#credit_card_info').replaceWith('

    XXXX-XXXX-XXXX-'+@last4+'

    ') + else + # handle error + + if this.validate(card) + # show status indicator + Stripe.createToken card, _(responseHandler).bind(@) + return true + + sponsor: (event) -> + $form = $(event.target) + # prevent repeated clicks + $('input[type=submit]', event.target).attr('disabled', 'disabled') + $.post $target.attr('action'), $target.serialize(), (data, status) -> + + return false + + cancel: (event) -> + this.roomies.ui.hideModel() + return false + + $: (selector) -> + return $(selector, @el) + + validate: (card) -> + this.validateCC(card.number) + this.validateCVC(card.cvc) + this.validateExpiry(card.exp_month, card.exp_year) + + getCard: () -> + return { + number: @$('#card_number').val() + exp_month: @$('#card_expiry_month').val() + exp_year: @$('#card_expiry_year').val() + cvc: @$('#card_cvc').val() + } + + getCardType: () -> + Stripe.cardType(@$('#card_number').val()) + + #private + bindEvents: () -> + _(@).bindAll('addCard', 'sponsor', 'cancel') + @$('#credit_card_info').bind('submit', @addCard) + @$('.edit_house').bind('submit', @sponsor) + @$('.cancel').bind('click', @cancel) + + validateCC: (creditCardNumber) -> + return Stripe.validateCardNumber(creditCardNumber) + validateCVC: (cvc) -> + return Stripe.validateCVC(cvc) + validateExpiry: (month, year) -> + return Stripe.validateExpiry(month, year) + + diff --git a/app/assets/javascripts/pages.js.coffee b/app/assets/javascripts/pages.js.coffee new file mode 100644 index 0000000..41d38d8 --- /dev/null +++ b/app/assets/javascripts/pages.js.coffee @@ -0,0 +1,41 @@ +# ========================================= +# ========== SIGN UP AMAZINGNESS ========== +# ========================================= + +signup_ready = false +$('.home #user_new #user_submit').live 'click', -> + $('.home #user_new .input:eq(0)').fadeOut( -> + $('.home #password_junk').fadeIn() + signup_ready = true + ) + $('.other_auths').fadeOut( -> + $('.generate').fadeIn() + ) + return false unless signup_ready + +$('.generate').live 'click', -> + characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz" + random_string = '' + for i in [1..32] + random_number = Math.floor(Math.random() * characters.length) + random_string += characters.substring(random_number, random_number + 1) + + $('#password_junk input').attr('value',random_string) + $darknessification.fadeIn _fadeSpeed + $ajaxed.empty() + + $("

    generated password

    +

    #{random_string}

    +

    Be sure to write this down, because we will be storing it securly and won't be able to access it again. + If you forget your password, you can always click on the \"forgot password\" link when signing in.

    +

    sign me up! + ").appendTo('#modal #ajaxed').fadeIn _fadeSpeed + + modal_left = ($('html').outerWidth()/2) - ($modal.outerWidth()/2) + $modal.css({left: modal_left}).show() + + return false + +$('p.button a').live 'click', -> + $('#user_new').submit() + return false \ No newline at end of file diff --git a/public/javascripts/plugins.js b/app/assets/javascripts/plugins.js similarity index 100% rename from public/javascripts/plugins.js rename to app/assets/javascripts/plugins.js diff --git a/public/stylesheets/.gitkeep b/app/assets/stylesheets/.gitkeep similarity index 100% rename from public/stylesheets/.gitkeep rename to app/assets/stylesheets/.gitkeep diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..a693a87 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,9 @@ +/* + * This is a manifest file that'll automatically include all the stylesheets available in this directory + * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at + * the top of the compiled file, but it's generally better to create a new file per style scope. + *= require_self + *= require grid + *= require_tree . + *= require jquery-ui-1.8.11.custom.css +*/ \ No newline at end of file diff --git a/app/stylesheets/pages/_assignments.sass b/app/assets/stylesheets/assignments.css.sass similarity index 85% rename from app/stylesheets/pages/_assignments.sass rename to app/assets/stylesheets/assignments.css.sass index 10d3cdc..febeb34 100644 --- a/app/stylesheets/pages/_assignments.sass +++ b/app/assets/stylesheets/assignments.css.sass @@ -1,3 +1,7 @@ +@import compass +@import partials/colors +@import grid + #main.assignments h2 font-size: 1em @@ -17,8 +21,8 @@ display: block position: relative margin-bottom: 20px - background: url('../images/244.png') no-repeat right top - background: url('../images/244.png') no-repeat 98% 50% + background: url(244.png) no-repeat right top + background: url(244.png) no-repeat 98% 50% ul#names float: left width: 432px diff --git a/app/stylesheets/pages/_content.sass b/app/assets/stylesheets/content.css.sass similarity index 79% rename from app/stylesheets/pages/_content.sass rename to app/assets/stylesheets/content.css.sass index 7299ed4..791edeb 100644 --- a/app/stylesheets/pages/_content.sass +++ b/app/assets/stylesheets/content.css.sass @@ -1,3 +1,7 @@ +@import compass +@import blueprint +@import partials/colors + #main.pages section margin: 0 auto diff --git a/app/stylesheets/pages/_corkboard.sass b/app/assets/stylesheets/corkboard.css.sass similarity index 93% rename from app/stylesheets/pages/_corkboard.sass rename to app/assets/stylesheets/corkboard.css.sass index cdf0464..5746dda 100644 --- a/app/stylesheets/pages/_corkboard.sass +++ b/app/assets/stylesheets/corkboard.css.sass @@ -1,4 +1,11 @@ -#main.corkboard +@import compass +@import partials/awesome +@import partials/colors +@import grid + +body.corkboards + div + margin-bottom: .5em #guidance width: 720px @@ -27,7 +34,7 @@ display: block width: 134px height: 124px - background: url("../images/icons/pointer.png") no-repeat center center + background: url(pointer.png) no-repeat center center position: absolute top: -80px right: -75px @@ -42,12 +49,15 @@ &.active, &:active font-weight: bold - .list - +column(4) - padding: 0 - float: left - &:last-child - +column(4, true) + .upcoming_lists + clear: both + +clearfix + .list + +column(4) + padding: 0 + float: left + &:last-child + +column(4, true) ul +background-image(linear-gradient($lightblue, $blue)) @@ -96,15 +106,15 @@ float: right cursor: pointer background-repeat: no-repeat - background-image: url('../images/icons/check.png') + background-image: url(check.png) background-position: 7px 5px &.edit display: none - background-image: url('../images/icons/edit.png') + background-image: url(edit.png) background-position: 0 4px &.undo width: 16px - background-image: url('../images/46.png') + background-image: url(46.png) background-position: 0 4px #specials.content @@ -154,6 +164,12 @@ #expense_filter +gradient-button($green) + .header_bar.monthly + display: none + + .current_cal + padding-top: 0 + .centric, .calendar +column(12) padding: 0 diff --git a/app/assets/stylesheets/grid.css.sass b/app/assets/stylesheets/grid.css.sass new file mode 100644 index 0000000..ffb0d94 --- /dev/null +++ b/app/assets/stylesheets/grid.css.sass @@ -0,0 +1,7 @@ +@import blueprint + +// blueprint grid setup +$blueprint_grid_columns : 12 +$blueprint_grid_width : 60px +$blueprint-grid-margin : 20px +$blueprint-container-size : 960px \ No newline at end of file diff --git a/app/stylesheets/pages/_home.sass b/app/assets/stylesheets/home.css.sass similarity index 91% rename from app/stylesheets/pages/_home.sass rename to app/assets/stylesheets/home.css.sass index f6fb1c2..9317b53 100644 --- a/app/stylesheets/pages/_home.sass +++ b/app/assets/stylesheets/home.css.sass @@ -1,3 +1,7 @@ +@import compass +@import partials/colors +@import grid + #main.home margin-top: 1em .mantra @@ -92,7 +96,7 @@ margin-bottom: 10px margin-top: 0 font-weight: bold - background: url('../images/cloud.png') no-repeat 0px 20px + background: url(cloud.png) no-repeat 0px 20px p font-size: 17px line-height: 1.5 @@ -105,9 +109,9 @@ +column(4) h2 text-indent: 65px - background: url('../images/pacman.png') no-repeat 0px 15px + background: url(pacman.png) no-repeat 0px 15px &.last +column(4, true) h2 - background: url('../images/pig.png') no-repeat 0px 15px + background: url(pig.png) no-repeat 0px 15px diff --git a/app/stylesheets/partials/_awesome.sass b/app/assets/stylesheets/partials/_awesome.sass similarity index 100% rename from app/stylesheets/partials/_awesome.sass rename to app/assets/stylesheets/partials/_awesome.sass diff --git a/app/stylesheets/partials/_base.sass b/app/assets/stylesheets/partials/_base.sass similarity index 82% rename from app/stylesheets/partials/_base.sass rename to app/assets/stylesheets/partials/_base.sass index f4bbc52..40da969 100644 --- a/app/stylesheets/partials/_base.sass +++ b/app/assets/stylesheets/partials/_base.sass @@ -15,3 +15,16 @@ html background: -webkit-gradient(linear, left top, left bottom, from(#212933), to(#a6ceff)) // body visibility: hidden + +// RESET +ul + padding-left: 0 + margin: 0 + +p + margin: 0 + +h1, h2, h3, h4, h5, h6 + font-size: 1em + margin: 0 + padding: 0 \ No newline at end of file diff --git a/app/assets/stylesheets/partials/_boilerplate.sass b/app/assets/stylesheets/partials/_boilerplate.sass new file mode 100644 index 0000000..e091bc7 --- /dev/null +++ b/app/assets/stylesheets/partials/_boilerplate.sass @@ -0,0 +1,427 @@ +/* + * HTML5 ✰ Boilerplate + * + * What follows is the result of much research on cross-browser styling. + * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal, + * Kroc Camen, and the H5BP dev community and team. + * + * Detailed information about this CSS: h5bp.com/css + * + * ==|== normalize ========================================================== */ + +/* ============================================================================= + * HTML5 display definitions + * ========================================================================== */ + +article, aside, details, figcaption, figure, footer, header, hgroup, nav, section + display: block + +audio, canvas, video + display: inline-block + //*display: inline + //*zoom: 1 + +audio:not([controls]), [hidden] + display: none + +/* ============================================================================= + * Base + * ========================================================================== */ + +/* + * 1. Correct text resizing oddly in IE6/7 when body font-size is set using em units + * 2. Force vertical scrollbar in non-IE + * 3. Prevent iOS text size adjust on device orientation change, without disabling user zoom: h5bp.com/g */ + +html + font-size: 100% + overflow-y: scroll + -webkit-text-size-adjust: 100% + -ms-text-size-adjust: 100% + +body + margin: 0 + font-size: 13px + line-height: 1.231 + font-family: sans-serif + color: #222 + +button, input, select, textarea + font-family: sans-serif + color: #222 + +/* + * Remove text-shadow in selection highlight: h5bp.com/i + * These selection declarations have to be separate + * Also: hot pink! (or customize the background color to match your design) */ +::-moz-selection, ::selection + background: #fe57a1 + color: #fff + text-shadow: none + +/* ============================================================================= + * Links + * ========================================================================== */ + +a + color: #00e + &:visited + color: #551a8b + &:hover + color: #06e + &:focus + outline: thin dotted + &:hover, &:active + outline: 0 + +/* Improve readability when focused and hovered in all browsers: h5bp.com/h + +/* ============================================================================= + * Typography + * ========================================================================== */ + +abbr[title] + border-bottom: 1px dotted + +b, strong + font-weight: bold + +blockquote + margin: 1em 40px + +dfn + font-style: italic + +hr + display: block + height: 1px + border: 0 + border-top: 1px solid #ccc + margin: 1em 0 + padding: 0 + +ins + background: #ff9 + color: #000 + text-decoration: none + +mark + background: #ff0 + color: #000 + font-style: italic + font-weight: bold + +/* Redeclare monospace font family: h5bp.com/j */ + +pre, code, kbd, samp + font-family: monospace, monospace + _font-family: 'courier new', monospace + font-size: 1em + +/* Improve readability of pre-formatted text in all browsers */ + +pre + white-space: pre + white-space: pre-wrap + word-wrap: break-word + +q + quotes: none + &:before, &:after + content: "" + content: none + +small + font-size: 85% + +/* Position subscript and superscript content without affecting line-height: h5bp.com/k */ + +sub + font-size: 75% + line-height: 0 + position: relative + vertical-align: baseline + +sup + font-size: 75% + line-height: 0 + position: relative + vertical-align: baseline + top: -0.5em + +sub + bottom: -0.25em + +/* ============================================================================= + * Lists + * ========================================================================== */ + +ul, ol + margin: 1em 0 + padding: 0 0 0 40px + +dd + margin: 0 0 0 40px + +nav + ul, ol + list-style: none + list-style-image: none + margin: 0 + padding: 0 + +/* ============================================================================= + * Embedded content + * ========================================================================== */ + +/* + * 1. Improve image quality when scaled in IE7: h5bp.com/d + * 2. Remove the gap between images and borders on image containers: h5bp.com/e */ + +img + border: 0 + -ms-interpolation-mode: bicubic + vertical-align: middle + +/* + * Correct overflow not hidden in IE9 */ +svg:not(:root) + overflow: hidden + +/* ============================================================================= + * Figures + * ========================================================================== */ + +figure, form + margin: 0 + +/* ============================================================================= + * Forms + * ========================================================================== */ + +fieldset + border: 0 + margin: 0 + padding: 0 + +/* Indicate that 'label' will shift focus to the associated form element */ + +label + cursor: pointer + +/* + * 1. Correct color not inheriting in IE6/7/8/9 + * 2. Correct alignment displayed oddly in IE6/7 */ + +legend + border: 0 + *margin-left: -7px + padding: 0 + +/* + * 1. Correct font-size not inheriting in all browsers + * 2. Remove margins in FF3/4 S5 Chrome + * 3. Define consistent vertical alignment display in all browsers */ + +button, input, select, textarea + font-size: 100% + margin: 0 + vertical-align: baseline + *vertical-align: middle + +/* + * 1. Define line-height as normal to match FF3/4 (set using !important in the UA stylesheet) + * 2. Correct inner spacing displayed oddly in IE6/7 */ + +button, input + line-height: normal + *overflow: visible + +/* + * Reintroduce inner spacing in 'table' to avoid overlap and whitespace issues in IE6/7 */ + +table + button, input + *overflow: auto + +/* + * 1. Display hand cursor for clickable form elements + * 2. Allow styling of clickable form elements in iOS */ + +button + cursor: pointer + -webkit-appearance: button + +input + &[type="button"], &[type="reset"], &[type="submit"] + cursor: pointer + -webkit-appearance: button + &[type="checkbox"], &[type="radio"] + box-sizing: border-box + &[type="search"] + -webkit-appearance: textfield + -moz-box-sizing: content-box + -webkit-box-sizing: content-box + box-sizing: content-box + &::-webkit-search-decoration + -webkit-appearance: none + +/* + * Consistent box sizing and appearance */ +/* + * Remove inner padding and border in FF3/4: h5bp.com/l */ +button::-moz-focus-inner, input::-moz-focus-inner + border: 0 + padding: 0 + +/* + * 1. Remove default vertical scrollbar in IE6/7/8/9 + * 2. Allow only vertical resizing */ +textarea + overflow: auto + vertical-align: top + resize: vertical + +/* Colors for form validity */ + +input:valid, textarea:valid + +input:invalid, textarea:invalid + background-color: #f0dddd + +/* ============================================================================= + * Tables + * ========================================================================== */ + +table + border-collapse: collapse + border-spacing: 0 + +td + vertical-align: top + +/* ==|== primary styles ===================================================== + * Author: + * ========================================================================== */ + +/* ==|== non-semantic helper classes ======================================== + * Please define your styles before this section. + * ========================================================================== */ + +/* For image replacement */ + +.ir + display: block + border: 0 + text-indent: -999em + overflow: hidden + background-color: transparent + background-repeat: no-repeat + text-align: left + direction: ltr + br + display: none + +/* Hide from both screenreaders and browsers: h5bp.com/u */ + +.hidden + display: none !important + visibility: hidden + +/* Hide only visually, but have it available for screenreaders: h5bp.com/v */ + +.visuallyhidden + border: 0 + clip: rect(0 0 0 0) + height: 1px + margin: -1px + overflow: hidden + padding: 0 + position: absolute + width: 1px + &.focusable + &:active, &:focus + clip: auto + height: auto + margin: 0 + overflow: visible + position: static + width: auto + +/* Extends the .visuallyhidden class to allow the element to be focusable when navigated to via the keyboard: h5bp.com/p */ + +/* Hide visually and from screenreaders, but maintain layout */ + +.invisible + visibility: hidden + +/* Contain floats: h5bp.com/q */ + +.clearfix + &:before + content: "" + display: table + &:after + content: "" + display: table + clear: both + zoom: 1 + +/* ==|== media queries ====================================================== + * PLACEHOLDER Media Queries for Responsive Design. + * These override the primary ('mobile first') styles + * Modify as content requires. + * ========================================================================== */ + +@media only screen and (min-width: 480px) + /* Style adjustments for viewports 480px and over go here */ + +@media only screen and (min-width: 768px) + /* Style adjustments for viewports 768px and over go here */ + +/* ==|== print styles ======================================================= + * Print styles. + * Inlined to avoid required HTTP connection: h5bp.com/r + * ========================================================================== */ + +@media print + * + background: transparent !important + color: black !important + text-shadow: none !important + filter: none !important + -ms-filter: none !important + /* Black prints faster: h5bp.com/s */ + a + text-decoration: underline + &:visited + text-decoration: underline + &[href]:after + content: " (" attr(href) ")" + abbr[title]:after + content: " (" attr(title) ")" + .ir a:after + content: "" + a + &[href^="javascript:"]:after, &[href^="#"]:after + content: "" + /* Don't show links for images, or javascript/internal links */ + pre, blockquote + border: 1px solid #999 + page-break-inside: avoid + thead + display: table-header-group + /* h5bp.com/t */ + tr + page-break-inside: avoid + img + page-break-inside: avoid + max-width: 100% !important + @page + margin: 0.5cm + + p, h2, h3 + orphans: 3 + widows: 3 + h2, h3 + page-break-after: avoid \ No newline at end of file diff --git a/app/stylesheets/partials/_colors.sass b/app/assets/stylesheets/partials/_colors.sass similarity index 100% rename from app/stylesheets/partials/_colors.sass rename to app/assets/stylesheets/partials/_colors.sass diff --git a/app/stylesheets/partials/_flash.sass b/app/assets/stylesheets/partials/_flash.sass similarity index 96% rename from app/stylesheets/partials/_flash.sass rename to app/assets/stylesheets/partials/_flash.sass index 8a92f5f..ca48f70 100644 --- a/app/stylesheets/partials/_flash.sass +++ b/app/assets/stylesheets/partials/_flash.sass @@ -1,3 +1,7 @@ +@import compass +@import blueprint +@import partials/colors + #main #flash .notice, .alert, .notifications, .error diff --git a/app/stylesheets/partials/_fonts.sass b/app/assets/stylesheets/partials/_fonts.sass similarity index 100% rename from app/stylesheets/partials/_fonts.sass rename to app/assets/stylesheets/partials/_fonts.sass diff --git a/app/stylesheets/partials/_forms.sass b/app/assets/stylesheets/partials/_forms.sass similarity index 97% rename from app/stylesheets/partials/_forms.sass rename to app/assets/stylesheets/partials/_forms.sass index 4430b03..6a52291 100644 --- a/app/stylesheets/partials/_forms.sass +++ b/app/assets/stylesheets/partials/_forms.sass @@ -1,3 +1,8 @@ +@import compass +@import blueprint +@import partials/colors +@import partials/awesome + form.simple_form // width: 438px float: right diff --git a/app/stylesheets/partials/_header.sass b/app/assets/stylesheets/partials/_header.sass similarity index 78% rename from app/stylesheets/partials/_header.sass rename to app/assets/stylesheets/partials/_header.sass index 789742f..017fb3e 100644 --- a/app/stylesheets/partials/_header.sass +++ b/app/assets/stylesheets/partials/_header.sass @@ -1,3 +1,8 @@ +@import compass +@import blueprint +@import partials/colors +@import partials/awesome + body header margin: 0 @@ -12,7 +17,7 @@ body height: 75px display: block text-indent: -9999px - background: url('../images/logo.png') no-repeat + background: url('logo.png') no-repeat span.notification_title color: #fff display: block @@ -76,22 +81,26 @@ body +text-shadow(rgba(0,0,0,0.5) 0 1px 1px, rgba(0,0,0,0.2) 0 0 3px) li.past_due a - background-image: url('../images/icons/past_due.png') + background-image: url('icons/past_due.png') &:active - background-image: url('../images/icons/past_due_active.png') + background-image: url('icons/past_due_active.png') li.confirm a - background-image: url('../images/58_24px.png') + background-image: url('58_24px.png') li.house a - background-image: url('../images/icons/invitation.png') + background-image: url('icons/invitation.png') + li.my_house + a + background: url(203.png) no-repeat .7em center + padding-left: 2.5em li.rewards a - background-image: url('../images/icons/reward.png') + background-image: url('icons/reward.png') &:hover - background-image: url('../images/icons/reward_hover.png') + background-image: url('icons/reward_hover.png') &:active - background-image: url('../images/icons/reward_active.png') + background-image: url('icons/reward_active.png') li.link a @@ -99,12 +108,12 @@ body +text-shadow(none) li.corkboard a - background: url('../images/icons/corkboard.png') no-repeat .7em center + background: url('icons/corkboard.png') no-repeat .7em center padding-left: 2.5em li.profile a - background: url('../images/icons/profile.png') no-repeat .7em center + background: url('icons/profile.png') no-repeat .7em center padding-left: 2.5em #beta float: left diff --git a/app/stylesheets/partials/_media.sass b/app/assets/stylesheets/partials/_media.sass similarity index 92% rename from app/stylesheets/partials/_media.sass rename to app/assets/stylesheets/partials/_media.sass index 4c7a723..dd3222e 100644 --- a/app/stylesheets/partials/_media.sass +++ b/app/assets/stylesheets/partials/_media.sass @@ -4,7 +4,7 @@ // @media print - +media-print + @media all and (orientation:portrait) @@ -17,4 +17,3 @@ @media screen and (max-device-width: 480px) // Pass in false if you don't want iOS and WinMobile to mobile-optimize the text for you - +media-mobile(true) diff --git a/app/stylesheets/partials/_modals.sass b/app/assets/stylesheets/partials/_modals.sass similarity index 98% rename from app/stylesheets/partials/_modals.sass rename to app/assets/stylesheets/partials/_modals.sass index bc72a49..3bff50c 100644 --- a/app/stylesheets/partials/_modals.sass +++ b/app/assets/stylesheets/partials/_modals.sass @@ -1,3 +1,8 @@ +@import compass +@import blueprint +@import partials/colors +@import partials/awesome + #main #modal z-index: 110 width: 505px diff --git a/app/stylesheets/partials/_page.sass b/app/assets/stylesheets/partials/_page.sass similarity index 80% rename from app/stylesheets/partials/_page.sass rename to app/assets/stylesheets/partials/_page.sass index f49ffcb..6dff31c 100644 --- a/app/stylesheets/partials/_page.sass +++ b/app/assets/stylesheets/partials/_page.sass @@ -13,13 +13,7 @@ body, select, input, textarea // text-shadow: 1px 1px 0 #d9eaff // Set your base font here, to apply evenly font-family: $base-font-family - -//Headers (h1, h2, etc) have no default font-size or margin; define those yourself -h1, h2, h3, h4, h5, h6 - // Bold might not be the best choice if you are - // embedding a @font-face that's already bold - // font-weight: bold - + hr border: none margin: 0 @@ -44,7 +38,7 @@ strong, th small // Use font-size mixin to convert to percentage for YUI // http://developer.yahoo.com/yui/3/cssfonts/#fontsize - +font-size(11px) + font-size: 85% // approx 85% when base-font-size eq 13px // Add the 'required' attribute on your @@ -63,21 +57,21 @@ input:invalid, textarea:invalid // Add your own custom styles below //----------------------------------- -@-webkit-keyframes moveClouds - from - background-position: 0px - to - background-position: -1680px - -@-moz-keyframes moveClouds - from - background-position: 0px - to - background-position: -1680px +//@-webkit-keyframes moveClouds +// from +// background-position: 0px +// to +// background-position: -1680px +// +//@-moz-keyframes moveClouds +// from +// background-position: 0px +// to +// background-position: -1680px body overflow: hidden - background: url('../images/clouds.png') 200px 0px repeat-x + background: url(clouds.png) 200px 0px repeat-x &.registrations, &.sessions, &.assignments, &.pages, &.invitations, &.passwords, &.accounts #main, #main.pages h1 @@ -116,9 +110,9 @@ body opacity: 0.4 height: 160px position: absolute - -moz-animation: moveClouds 300s linear infinite - -webkit-animation: moveClouds 300s linear infinite - background: url('../images/clouds.png') top left repeat-x + //-moz-animation: moveClouds 300s linear infinite + // -webkit-animation: moveClouds 300s linear infinite + background: url(clouds.png) top left repeat-x @import forms @import header @@ -130,7 +124,7 @@ body #main overflow: hidden - padding: 5em 0 2em 10px + padding: 5em 0 2em 0 .header_bar, .content .list h2 padding: 0 @@ -145,10 +139,14 @@ body text-shadow: #fffdc2 0 1px 1px +background-image(linear-gradient(#f7eb8b, #f7d340)) +box-shadow(#fffedb 1px 1px 0 inset, #fffedb -1px -1px 0 inset) + .header_bar + margin-bottom: 0 +column(12) h1 float: left + font-size: 1em + line-height: 43px p float: right height: 43px @@ -170,9 +168,8 @@ body list-style: none .content - +clearfix - +column(12) - padding: 30px 0 + //+clearfix + //+column(12) #error_explanation h2 @@ -201,14 +198,8 @@ body z-index: 107 display: none position: absolute - background: url('../images/loader.gif') no-repeat + background: url(loader.gif) no-repeat -@import pages/home -@import pages/profile -@import pages/corkboard -@import pages/support -@import pages/assignments -@import pages/content @import modals footer @@ -216,7 +207,7 @@ footer width: 100% height: 150px overflow: hidden - background: url('../images/hills.png') bottom left repeat-x + background: url(hills.png) bottom left repeat-x +text-shadow(rgba(0,0,0,.4) 0 -1px 0) .container height: 140px diff --git a/app/assets/stylesheets/partials/_tables.sass b/app/assets/stylesheets/partials/_tables.sass new file mode 100644 index 0000000..307e965 --- /dev/null +++ b/app/assets/stylesheets/partials/_tables.sass @@ -0,0 +1,39 @@ +@import compass +@import blueprint +@import partials/colors + +h1 + border: none +table:not(.ui-datepicker-calendar, .battle) + margin: 0 10px + tr + +border-radius(5px) + +column(12, true) + font-size: 16px + line-height: 25px + margin-right: 0px + color: $font-color + +background-image(linear-gradient(#d9eaff, #f2f8ff)) + +background-image(linear-gradient(saturate(lighten($blue, 18%), 40%), saturate(lighten($blue, 23%), 20%))) + +box-shadow(transparentize(white, .5) 0 1px 0 inset, transparentize($blue, .2) 0 0 0 1px inset ) + td, th + +column(2) + padding: 7px 0 + text-align: center + vertical-align: middle + form + margin: 0 + width: auto + td:first-child, th:first-child + +column(3) + text-align: left + padding-left: 20px + td:nth-child(3n+3), th:nth-child(3n+3) + +column(1) + td:last-child, th:last-child + +column(1, true) + &:first-child + line-height: 2 + +background-image(linear-gradient(saturate(lighten($blue, 23%), 20%), saturate(lighten($blue, 13%), 25%))) + + diff --git a/app/stylesheets/pages/_profile.sass b/app/assets/stylesheets/profile.css.sass similarity index 98% rename from app/stylesheets/pages/_profile.sass rename to app/assets/stylesheets/profile.css.sass index 64214f6..5dca424 100644 --- a/app/stylesheets/pages/_profile.sass +++ b/app/assets/stylesheets/profile.css.sass @@ -1,3 +1,7 @@ +@import compass +@import grid +@import partials/colors + #main.profile #achievements, #progress, #battle +column(12, true) @@ -103,7 +107,7 @@ text-indent: 3.5em line-height: 3 +background-image(linear-gradient(white,black)) - background-image: url('../images/203.png') + background-image: url(203.png) background-position: .5em center background-repeat: no-repeat +box-shadow(rgba(0,0,0,1) 0 0 0 1px inset) diff --git a/app/assets/stylesheets/style.css.sass b/app/assets/stylesheets/style.css.sass new file mode 100644 index 0000000..caf98b5 --- /dev/null +++ b/app/assets/stylesheets/style.css.sass @@ -0,0 +1,20 @@ +// Here's where we define some default constants +@import compass +@import blueprint +@import grid +@import partials/base + +#main + // +showgrid + +// Finally, put your own styles in these partials +// and add more as needed (i.e. forms, tables, nav) +@import partials/fonts +@import partials/page +@import partials/flash +@import partials/modals +@import partials/forms +@import partials/tables + +// Media should come last +@import partials/media diff --git a/app/assets/stylesheets/subscriptions.css.sass b/app/assets/stylesheets/subscriptions.css.sass new file mode 100644 index 0000000..0709c55 --- /dev/null +++ b/app/assets/stylesheets/subscriptions.css.sass @@ -0,0 +1,7 @@ +@import compass +form#credit_card_info + +background-image(linear-gradient(#fff, #eee)) + padding: 1.5em + display: block + width: 300px + +border-radius(5px) \ No newline at end of file diff --git a/app/stylesheets/pages/_support.sass b/app/assets/stylesheets/support.css.sass similarity index 94% rename from app/stylesheets/pages/_support.sass rename to app/assets/stylesheets/support.css.sass index 855b5c1..ae0310e 100644 --- a/app/stylesheets/pages/_support.sass +++ b/app/assets/stylesheets/support.css.sass @@ -1,3 +1,7 @@ +@import compass +@import blueprint +@import partials/colors + #main.support .mantra padding: 0 @@ -20,7 +24,7 @@ p:nth-child(5) font-size: 70px line-height: 20px - form.request + form.support_request padding: 30px width: 420px margin: 10px 0 50px diff --git a/app/coffeescripts/application.coffee b/app/coffeescripts/application.coffee deleted file mode 100644 index 9d2a256..0000000 --- a/app/coffeescripts/application.coffee +++ /dev/null @@ -1,572 +0,0 @@ -# ========================================= -# ================ Globals ================ -# ========================================= - -_fadeSpeed = 100 -_slideDownSpeed = 200 -_slideUpSpeed = 250 -hovering_over = null -$ = jQuery -$body = $('body') -$main = $('#main') -$footer = $('footer') -$modal = $('#modal') -$loader = $('.loader') -$darknessification = $('#darknessification') -$ajaxed = $modal.children('#ajaxed') -$ajaxed_again = $modal.children('#ajaxed_again') - -# ========================================= -# =========== Functions & Stuff =========== -# ========================================= - -# // Handles the sticky footer -stickyFooter = -> - $footer.css({position:'static'}) - if window.innerHeight > $body.height() - $footer.css({position:'fixed', bottom:0}) - -stickyFooter() - -$(window).bind 'resize', -> - stickyFooter() - centerModal() - -# // Hides the flash notice if it's visible. -$('#flash').live 'click', -> - $('#flash').hide 'fast', -> - stickyFooter() - -# // Hides the flash notice after 5 seconds if the user hasn't clicked on it yet. -setTimeout( -> - $('#flash .notice').parent().hide 'fast', -> - stickyFooter() -, 5000) - -calculateCenter = (container, element) -> - l = (container.outerWidth()/2) - (element.outerWidth()/2) - t = ($(window).height()/2) - (element.outerHeight()/2) - t = 0 if t < 0 - - center = { left: l + 'px', top: t + 'px' } - return center - -showLoader = -> - $darknessification.fadeIn _fadeSpeed - center = calculateCenter($('html'), $loader) - $loader.css({left: center.left, top: center.top}).show 'fast' - - -# ========================================= -# ========== HEADER NOTIFICATION ========== -# ========================================= - -$('nav li.notification a').live 'mouseover', -> - $this = $(this) - $pastDueLabel = $("#{$this.text()}") - $pastDueLabel.hide().appendTo('header') - - l = $this.offset().left - (($pastDueLabel.outerWidth() - $this.outerWidth()) / 2) - t = $this.offset().top + $this.outerHeight() + 5 - - $pastDueLabel.css({left:l,top:t}).slideDown('fast').fadeIn() - -$('nav li.notification a').live 'mouseout', -> - $('.notification_title').fadeOut -> $(this).remove() - - -# ========================================= -# ================= MODAL ================= -# ========================================= - -hideModal = (event) -> - $darknessification.hide 'fast' - $modal.hide 'fast' - -centerModal = (animate = false) -> - center = calculateCenter($('html'), $modal) - if animate - $modal.animate({left: center.left, top: center.top}) - else - $modal.css({left: center.left, top: center.top}) - -generateModal = (anchor, inline = false) -> - showLoader() - unless inline - $ajaxed_again.hide() - $ajaxed.show() - $.ajax - url: anchor.attr('href'), - success: (data) -> - if inline - $ajaxed.hide 'fast', -> - $ajaxed_again.empty() - $(data).appendTo $ajaxed_again - $ajaxed_again.show 'fast' - $("back").appendTo '#modal #ajaxed_again h1' - else - $ajaxed.empty() - $(data).appendTo $ajaxed - - $loader.fadeOut 'fast' - $('#modal #ajaxed h1 span').remove() - $('x').appendTo '#modal h1' - unless inline - superDate() - autocompleteSetup() - $darknessification.fadeIn _fadeSpeed - $modal.fadeIn _fadeSpeed - centerModal() - - if $ajaxed.children('form.assignment').length > 0 || $ajaxed_again.children('form.assignment').length > 0 - $modal.css('width','600px') - centerModal() - - if anchor.parent('li').hasClass('rewards') - anchor.parent('li').remove() - $.ajax - type: 'post', - url: "/rewards/view_all" - - setTimeout( -> - centerModal(true) - ,400) - - return false - -# // Listens for a click on any anchor with a class of ajax. -# // Knabs the anchor's href and ajaxes it in to the modal. -$('a.ajax').live 'click', -> - if $(this).hasClass('view_detail') - generateModal($(this), true) - else - generateModal($(this)) - -# // Listens for a click on the overlay when the modal or detail list is up. -$darknessification.live 'click', -> - hideModal() - -# // Watches for an escape keypress and hides the modal, overlay, and detail list. -$(window).live 'keyup', (event) -> - if event.keyCode == 27 - $('.detail_day_view').hide 'fast' - hideModal() - -# // Watches for a click on the 'x' and hides the modal and overlay. -$('#modal h1 span').live 'click', -> - if $(this).hasClass('go_back') - $ajaxed_again.hide 'fast', -> - $ajaxed.show 'fast', -> - centerModal(true) - else - hideModal() - - -# ========================================= -# =============== CORKBOARD =============== -# ========================================= - -# // Listens for a click on the calendar view option links. -$('.header_bar a').live 'click', -> - unless $(this).hasClass('active') - $header_bar = $(this).parent().parent().siblings('.header_bar') - $('.header_bar.monthly, .header_bar.upcoming').hide() - - # // Checks to see if the we want to show the full on calendar or not. - if $header_bar.hasClass('upcoming') - $('.header_bar.upcoming').show() - $('.calendar').hide 'fast', -> - $('.centric').show 'fast', -> - stickyFooter() - else - $('.header_bar.monthly').show() - $('.centric').hide 'fast', -> - $('.calendar').show 'fast', -> - stickyFooter() - - if $('.corkboard_view.current').hasClass('all') - then $('.corkboard_view.my').children('.calendar, .centric').hide() - else $('.corkboard_view.all').children('.calendar, .centric').hide() - - return false - -setListHeights = -> - max_list_height = 0 - $('.semantic_shmantic').each -> - $this = $(this) - $this.css('height','auto') - max_list_height = $this.height() if $this.height() > max_list_height - - $('.semantic_shmantic').each -> - $(this).css('height',max_list_height) - -# // Listens for a click on the assignee filters and changes the UI accordingly. -$('#upcoming_filters #assignee_filters li').live 'click', -> - unless $(this).hasClass('active') - $(this).siblings().andSelf().toggleClass('active') - $('.corkboard_view').toggleClass('current') - generateDetailLists() - setListHeights() - -# // $('#assignment_filters').live 'click', (event) -> -# // $this = $(event.target) -# // unless $this.hasClass('active') -# // $this.addClass('active').siblings().removeClass('active') -# // $('.corkboard_view.current .assignment').slideDown 'fast' -# // $(".corkboard_view.current .#{$this.data('filter')}").slideUp 'fast', -> -# // stickyFooter() - -setListHeights() - -# // Listens for a click on the body and closes the detailed list of -# // assignments that's what it should be doing. -$body.live 'click', (event) -> - $clicky = $(event.target) - if $clicky.parent('.todo').length < 1 && !$clicky.hasClass('detail_day_view') - if $('.detail_day_view').length > 0 - $('.detail_day_view').hide 'fast' - -# ========================================= -# =============== CALENDARS =============== -# ========================================= - -# // Listens for a click, hover, and leave event on the anchors in the calendar. -# // Pops up with a list of the corresponding assignments for that day. -$('.todo a').live 'click', -> return false -$('.todo a').live 'mouseleave', -> hovering_over = null -$('.todo a').live 'mouseenter', -> - - $this = $(this) - $('.detail_day_view').hide 'fast' - day_number = $(this).parent('.todo').parent('.day').data('number') - hovering_over = day_number - - # // Sets a delay on animating in the list of assignments, then positions - # // it perfectly where we want it. - setTimeout( -> - if hovering_over == day_number - $('.detail_day_view').each -> - $detailList = $(this) - if $detailList.data('number') == day_number && $detailList.data('type') == $this.hasClass('tasks') - $('.detail_day_view').hide 'fast' - # // Sets the top to just above the anchor and the left to the anchor's left. - top = $this.offset().top - $detailList.outerHeight() - 10 - $detailList.css({top: top, left: $this.offset().left}).fadeIn 'fast' - - listPlacement = $detailList.offset().left + $detailList.outerWidth() - mainWidth = $main.offset().left + $main.width() - - # // Checks to see if the popup needs to go the other direction or not. - if listPlacement > mainWidth - left = ($this.offset().left + $this.outerWidth()) - $detailList.outerWidth() - $detailList.css('left',left) - , 500) - -# // Listens for the mouse leave event on our list of assignments -# // and hides them when detected. -$('.detail_day_view').live 'mouseleave', -> - $('.detail_day_view').hide 'fast' - -# // Loops through all todo badges on each day and generates a detailed list. -generateDetailLists = -> - $('.corkboard_view.current .calendar .todo').each -> - $this = $(this) - $badges = $this.children('a') - $('.detail_day_view').remove() - - if $badges.length < 2 - $badges.css('marginLeft','13px') - - day_number = $this.parent('.day').data('number') - - $badges.each -> - $this = $(this) - type = $this.hasClass('tasks') - - $detailList = $("

    ") - - $.ajax - url: $this.attr('href'), - success: (data) -> - $(data).each -> - $("
  • - #{this.purpose} -
  • ").appendTo $detailList - - $detailList.appendTo $main - -generateDetailLists() - - -# ========================================= -# =========== ASSIGNMENT LISTS ============ -# ========================================= - -$('.assignment[data-completed=true]') - .removeClass('assignment') - .find('.type') - .removeClass() - .addClass('check') - -# // Handles mouseenter and mouseleave for the corkboard lists. -$('.list .assignment').live 'mouseenter', -> - unless $(this).hasClass('working_on_it') - $(this) - .find('li:eq(2)').animate {paddingRight:'0px'}, 'fast', -> - $(this).prev().stop(true).show 'fast' - .siblings('li:eq(0)').removeClass().addClass('check') - -$('.list .assignment').live 'mouseleave', -> - $(this) - .find('li:eq(1)').fadeOut 'fast', -> - $(this).hide().next().stop(true).animate {paddingRight:'25px'}, 'fast' - .siblings('li:eq(0)').removeClass().addClass('type') - -$('.list li[data-completed=true], .list .completed').live 'mouseenter', -> - $(this) - .children('ul') - .children('li:eq(0)') - .removeClass() - .addClass('undo') - .attr('title','mark as incomplete') - -$('.list li[data-completed=true], .list .completed').live 'mouseleave', -> - $(this) - .children('ul') - .children('li:eq(0)') - .removeClass() - .addClass('check') - .attr('title','completed') - .next() - .hide 'fast' - -# // Edit assignment on edit icon click. -$('.edit').live 'click', -> - $this = $(this) - id = $this.data("assignment_id") - $this.attr('href',"/assignments/#{id}/edit") - generateModal($this) - -# // Mark as completed on check icon click. -$('.check').live 'click', -> - $this = $(this) - id = $this.data('assignment_id') - $assignment = $this.parent('ul').parent('li') - - $assignment.addClass('working_on_it').children('ul').children('li:eq(0), li:eq(1)').hide 'fast' - $assignmentType = $assignment.children('ul').children('li:eq(0)') - left = ($assignmentType.offset().left + $assignmentType.width() - 34) - top = ($assignmentType.offset().top + 2) - $assignmentLoader = $("
    ").appendTo('#main').css({top:top,left:left,opacity:0.4}).show 'fast' - - if $assignment.hasClass('task') - type = 'task' - else - type = 'expense' - - $.ajax - type: 'post', - url: "/assignments/#{id}/complete", - success: (data) -> - $assignmentLoader.hide('fast', -> $(this).remove()) - $assignment - .removeClass() - .attr('data-type',type) - .addClass('completed') - .find('.type') - .removeClass() - .addClass('check') - .show('fast') - return false - -# // Mark as incomplete on x icon click. -$('li[data-completed=true] .undo, .list .undo').live 'click', -> - $this = $(this) - id = $this.data('assignment_id') - $assignment = $this.parent('ul').parent('li') - type = $assignment.data('type') - - $assignment.addClass('working_on_it').children('ul').children('li:eq(0), li:eq(1)').hide 'fast' - $assignmentType = $assignment.children('ul').children('li:eq(0)') - left = ($assignmentType.offset().left + $assignmentType.width() - 34) - top = ($assignmentType.offset().top + 2) - $assignmentLoader = $("
    ").appendTo('#main').css({top:top,left:left,opacity:0.4}).show 'fast' - - $.ajax - type: 'post', - url: "/assignments/#{id}/undo_complete", - success: (data) -> - $assignmentLoader.hide('fast', -> $(this).remove()) - $darknessification.fadeOut 'fast' - $assignment - .attr('data-completed','') - .removeClass() - .addClass('assignment') - .find('.check') - .removeClass() - .addClass('type') - .attr('title',type) - .show('fast') - .find('.undo') - .removeClass() - .addClass('type') - .attr('title',type) - return false - - -# ========================================= -# ========== NEW ASSIGNMENT JAZZ ========== -# ========================================= - -$('#repeating').live 'change', -> - $('.littler_guys').toggle() - $('.littler_guys').find('#assignment_duration').attr('value','') - -selectRoomies = (name) -> - $('#assignment_assignee_ids option').each -> - $this = $(this) - if $this.text() == name - $this.attr('selected',true) - -split = (val) -> - return val.split( /,\s*/ ) - -extractLast = (term) -> - return split( term ).pop() - -do autocompleteSetup = -> - assignee_names = [] - $assignees = $('#assignment_assignee_ids') - $assignees.parent('div').hide() - - $assignees.children('option').each -> - assignee_names.push($(this).text()) - - $( "#assignment_assignee_names" ) - # // don't navigate away from the field on tab when selecting an item - .live 'keydown', (event) -> - if event.keyCode == $.ui.keyCode.TAB && $(this).data('autocomplete').menu.active - event.preventDefault() - .autocomplete { - delay: 100, - minLength: 0, - source: (request, response) -> - # // delegate back to autocomplete, but extract the last term - response($.ui.autocomplete.filter(assignee_names, extractLast(request.term))) - , - focus: -> - # // prevent value inserted on focus - return false - , - select: (event, ui) -> - terms = split( this.value ) - # // remove the current input - terms.pop() - # // add the selected item - terms.push( ui.item.value ) - # // add placeholder to get the comma-and-space at the end - terms.push( "" ) - this.value = terms.join( ", " ) - return false - } - -$( "#assignment_assignee_names" ).live 'keyup', -> - $('#assignment_assignee_ids option').attr('selected',false) - names = split( $(this).val() ) - selectRoomies name for name in names - -$( "#assignment_assignee_names" ).live 'focusout', -> - $('#assignment_assignee_ids option').attr('selected',false) - names = split( $(this).val() ) - selectRoomies name for name in names - -do superDate = -> - $picker = $("#picker") - $superdate = $('.superdate') - - $superdate.live 'keyup', -> - val = $(this).val() - if val? - # // parsing anything the user enters as a date - date = Date.parse( val ) - - # // making the date more legible and concise - date = date.toString('MMMM d, yyyy') if date - - # // updating the datepicker - $picker.datepicker('setDate', date) - - $superdate.live 'focusout', -> - $superdate = $(this) - val = $(this).val() - if val? - date = Date.parse( val ) - date = date.toString('MMMM d, yyyy') if date - $(this).val(date) - $picker.datepicker('setDate', date) - - $('.superdate').live 'focusin', -> - $superdate = $(this) - val = $(this).val() - if val? - date = Date.parse( val ) - date = date.toString('MMMM d, yyyy') if date - $(this).val(date) - $picker.datepicker('setDate', date) - - $picker.datepicker( - dateFormat: 'MM d, yy', - beforeShow: (dateText, inst) -> - if $superdate.val? - $picker.datepicker("setDate", $superdate.val()) - onSelect: (dateText, inst) -> - date = dateText.toString('MMMM d, yyyy') - $superdate.val(date) - ) - - $('.ui-datepicker-today a').click() - $superdate = $('.superdate:eq(0)') - stickyFooter() - - -# ========================================= -# ========== SIGN UP AMAZINGNESS ========== -# ========================================= - -signup_ready = false -$('.home #user_new #user_submit').live 'click', -> - $('.home #user_new .input:eq(0)').fadeOut( -> - $('.home #password_junk').fadeIn() - signup_ready = true - ) - $('.other_auths').fadeOut( -> - $('.generate').fadeIn() - ) - return false unless signup_ready - -$('.generate').live 'click', -> - characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz" - random_string = '' - for i in [1..32] - random_number = Math.floor(Math.random() * characters.length) - random_string += characters.substring(random_number, random_number + 1) - - $('#password_junk input').attr('value',random_string) - $darknessification.fadeIn _fadeSpeed - $ajaxed.empty() - - $("

    generated password

    -

    #{random_string}

    -

    Be sure to write this down, because we will be storing it securly and won't be able to access it again. - If you forget your password, you can always click on the \"forgot password\" link when signing in.

    -

    sign me up! - ").appendTo('#modal #ajaxed').fadeIn _fadeSpeed - - modal_left = ($('html').outerWidth()/2) - ($modal.outerWidth()/2) - $modal.css({left: modal_left}).show() - - return false - -$('p.button a').live 'click', -> - $('#user_new').submit() - return false diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3b81dff..a1a5dee 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,6 @@ class ApplicationController < ActionController::Base protect_from_forgery - before_filter :prepare_sign_in, :set_locale + before_filter :prepare_sign_in, :set_locale, :set_time_zone # preventing modals from loading entire pages layout proc { |controller| controller.request.xhr? ? false : 'application' } @@ -21,12 +21,20 @@ def infer_locale end end + def set_time_zone + if user_signed_in? and current_user.time_zone.present? + Time.zone = current_user.time_zone + else + Time.zone = Roomies::Application.config.time_zone + end + end + def after_sign_in_path_for(user) logger.debug "called from after_sign_in_path" unless self.controller_name == "invitations" reward(type: :sign_in) end - corkboard_index_url + corkboard_url end def reward(options = {}) diff --git a/app/controllers/assignments_controller.rb b/app/controllers/assignments_controller.rb index 99cbd43..568832e 100644 --- a/app/controllers/assignments_controller.rb +++ b/app/controllers/assignments_controller.rb @@ -74,7 +74,7 @@ def create assignment.assignees.each do |user| recipients << user.email.to_s end - UserMailer.assignment_created(assignment, recipients, "#{corkboard_index_url}/?assignment=#{assignment.id}").deliver + UserMailer.assignment_created(assignment, recipients, "#{corkboard_url}/?assignment=#{assignment.id}").deliver reward(type: :assignments_create_lazy) flash[:notice] = t(:roomies_assigned, scope: [:assignments, :create]) @@ -86,7 +86,7 @@ def create recipients << user.email.to_s end end - UserMailer.assignment_created(assignment, recipients, "#{corkboard_index_url}/?assignment=#{assignment.id}").deliver + UserMailer.assignment_created(assignment, recipients, "#{corkboard_url}/?assignment=#{assignment.id}").deliver reward(type: :assignments_create_sharing) flash[:notice] = t(:everyone_assigned, scope: [:assignments, :create]) @@ -104,7 +104,7 @@ def create flash[:error] = t(:no_assignees, scope: [:assignments, :create]) end end - respond_with assignment, location: corkboard_index_url + respond_with assignment, location: corkboard_url else redirect_to current_user, notice: t(:build_house_before, scope: [:assignments, :create]) end @@ -116,7 +116,7 @@ def update if @assignment.update_attributes(params[:assignment]) flash[:notice] = t(:updated, scope: [:assignments, :update]) end - respond_with @assignment, location: corkboard_index_url + respond_with @assignment, location: corkboard_url end def destroy @@ -136,10 +136,10 @@ def complete reward(user: @assignment.completor) flash[:notice] = t(:completed, scope: [:assignments, :complete]) end - respond_with @assignment, location: corkboard_index_url + respond_with @assignment, location: corkboard_url else flash[:notice] = t(:already_completed, scope: [:assignments, :complete]) - respond_with @assignment, location: corkboard_index_url + respond_with @assignment, location: corkboard_url end end @@ -150,7 +150,7 @@ def undo_complete reward(user: @assignment.completor) @assignment.completor_id = nil if @assignment.save - respond_with @assignment, location: corkboard_index_url + respond_with @assignment, location: corkboard_url end end end @@ -201,7 +201,7 @@ def confirm flash[:notice] = t(:confirmed, scope: [:assignments, :confirm]) end - respond_with @assignment, location: corkboard_index_url + respond_with @assignment, location: corkboard_url end def reject @@ -212,7 +212,7 @@ def reject reward(user: @assignment.completor) flash[:notice] = t(:rejected, scope: [:assignments, :reject]) end - respond_with @assignment, location: corkboard_index_url + respond_with @assignment, location: corkboard_url end diff --git a/app/controllers/corkboard_controller.rb b/app/controllers/corkboards_controller.rb similarity index 94% rename from app/controllers/corkboard_controller.rb rename to app/controllers/corkboards_controller.rb index b4cf354..e2ba2e3 100644 --- a/app/controllers/corkboard_controller.rb +++ b/app/controllers/corkboards_controller.rb @@ -1,7 +1,6 @@ -class CorkboardController < ApplicationController - +class CorkboardsController < ApplicationController before_filter :authenticate_user! - def index + def show if current_user.house.nil? @all = nil diff --git a/app/controllers/houses_controller.rb b/app/controllers/houses_controller.rb index 40d896d..68154b7 100644 --- a/app/controllers/houses_controller.rb +++ b/app/controllers/houses_controller.rb @@ -8,7 +8,7 @@ def index end def show - @house = House.find(params[:id]) + @house = current_user.house respond_with @house end @@ -29,7 +29,7 @@ def create current_user.save flash[:notice] = t('.house_created') end - respond_with @house, location: corkboard_index_url + respond_with @house, location: corkboard_url end def update diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 1621690..9fdf33f 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -3,7 +3,7 @@ class PagesController < ApplicationController respond_to :html, :json def home - if user_signed_in? then redirect_to corkboard_index_url end + redirect_to corkboard_url if user_signed_in? end def about diff --git a/app/controllers/subscriptions_controller.rb b/app/controllers/subscriptions_controller.rb new file mode 100644 index 0000000..c2e030c --- /dev/null +++ b/app/controllers/subscriptions_controller.rb @@ -0,0 +1,40 @@ +class SubscriptionsController < ApplicationController + + def new + @house = current_user.house + render :new + end + + def create + @house = current_user.house + redirect_to current_user_url, notice: "Your house is already sponsored." and return if @house.sponsored? + if params[:stripe_token].present? + current_user.stripe_token = params[:stripe_token] + current_user.save + end + if current_user.billing.active_card.present? + @house.sponsor = current_user + if @house.save + flash[:notice] = 'Thanks for sponsoring!' + else + flash[:failure] = 'There was an error with your billing' + end + end + + redirect_to current_user_url + end + + + def destroy + house = current_user.house + if house.sponsor = current_user + house.sponsor = nil + end + if house.save + flash[:notice] = "You are no longe sponsoring #{house.name}" + else + flash[:failure] = "There was a problem canceling your subscription. Please contact support." + end + redirect_to current_user_url + end +end diff --git a/app/controllers/support_controller.rb b/app/controllers/support_controller.rb deleted file mode 100644 index 97e9391..0000000 --- a/app/controllers/support_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class SupportController < ApplicationController - - def index - render :index - end - - def create - Support.submit_request(params).deliver - flash[:notice] = t(:sent, scope: [:support, :create]) - render :index - end - - def show - render :index - end -end diff --git a/app/controllers/support_requests_controller.rb b/app/controllers/support_requests_controller.rb new file mode 100644 index 0000000..83861a5 --- /dev/null +++ b/app/controllers/support_requests_controller.rb @@ -0,0 +1,18 @@ +class SupportRequestsController < ApplicationController + + def new + @support_request = SupportRequest.new + render :new + end + + def create + @support_request = SupportRequest.new(params[:support_request]) + if @support_request.save + flash[:notice] = t(:sent, scope: [:support, :create]) + redirect_to root_url + else + render :new + end + end + +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 26af4c6..c02d436 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -14,8 +14,13 @@ def index end def show - @user = User.find(params[:id]) - if @user.house + @user = if params[:id] + User.find(params[:id]) + else + current_user + end + @house = @user.house + if @house @tasks = @user.house.assignments.where(assignee_ids: [@user.id], type: "task", completed_at: nil) @expenses = @user.house.assignments.where(assignee_ids: [@user.id], type: "expense", completed_at: nil) end @@ -79,13 +84,18 @@ def destroy def accept_house_invitation house_invitation = HouseInvitation.find(params[:id]) house_inviter = User.find(house_invitation.house_inviter_id) - current_user.house = house_inviter.house unless current_user.nil? or house_inviter.nil? - if current_user.save - house_invitation.destroy - redirect_to current_user, notice: t('.house_joined') + # making sure we have a signed in user first + if user_signed_in? + current_user.house = house_inviter.house unless !user_signed_in? or house_inviter.nil? + if current_user.save + house_invitation.destroy + redirect_to current_user, notice: t('.house_joined') + else + redirect_to root_url, notice: t('.house_join_fail') + end else - redirect_to root_url, notice: t('.house_join_fail') + redirect_to new_user_registration_url end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 4d0bd0f..9b7f29d 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -13,9 +13,9 @@ def title def random_image image_files = %w( .jpg .gif .png ) files = Dir.entries( - "#{RAILS_ROOT}/public/images/support" + "#{Rails.root}/app/assets/images/support" ).delete_if { |x| !image_files.index(x[-4,4]) } - files[rand(files.length)] + files.sample end private diff --git a/app/mailers/support.rb b/app/mailers/support.rb deleted file mode 100644 index bf25798..0000000 --- a/app/mailers/support.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Support < ActionMailer::Base - - default :from => "roomies@clevercode.net" - - include ActionView::Helpers::TextHelper - - def submit_request(params) - @request = params[:request] - @request[:email] - mail(:to => 'roomies@clevercode.net', - :reply_to => @request[:email], - :subject => "Roomies support: " + truncate(@request[:message], :length => 25, :omission => ' (...)'), - :email => @request[:email] - ) - end -end diff --git a/app/mailers/support_mailer.rb b/app/mailers/support_mailer.rb new file mode 100644 index 0000000..1899bdb --- /dev/null +++ b/app/mailers/support_mailer.rb @@ -0,0 +1,14 @@ +class SupportMailer < ActionMailer::Base + + default :from => "roomies@clevercode.net" + + include ActionView::Helpers::TextHelper + + def submit_request(support_request) + @support_request = support_request + mail(:to => 'roomies@clevercode.net', + :reply_to => @support_request.reply_to, + :subject => "Roomies support: " + truncate(@support_request.message, :length => 25, :omission => ' (...)'), + ) + end +end diff --git a/app/models/house.rb b/app/models/house.rb index 5182c25..7fc8d8f 100644 --- a/app/models/house.rb +++ b/app/models/house.rb @@ -2,13 +2,35 @@ class House include Mongoid::Document # Fields - field :name, :type => String + field :name, type: String - validates :name, :presence => true + validates :name, presence: true attr_accessible :name # Associations has_many :users has_many :assignments + belongs_to :sponsor, class_name: "User" + + # Callbacks + before_save :update_sponsor_subscription + + def sponsored? + sponsor.present? # && !failed_to_bill? + end + + private + + def update_sponsor_subscription + if sponsor_id_changed? + if sponsor_id_was + User.find(sponsor_id_was).billing.cancel_subscription + end + if sponsor + sponsor.billing.update_subscription(plan: 'basic') + end + end + end + end diff --git a/app/models/support_request.rb b/app/models/support_request.rb new file mode 100644 index 0000000..e6ad203 --- /dev/null +++ b/app/models/support_request.rb @@ -0,0 +1,43 @@ +class SupportRequest + + include ActiveModel::AttributeMethods + include ActiveModel::Validations + include ActiveModel::Conversion + extend ActiveModel::Translation + extend ActiveModel::Callbacks + + attr_accessor :name, :email, :message + + validates_presence_of :name + validates_presence_of :email + validates_presence_of :message + + validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i + define_model_callbacks :save + + def initialize(attributes={}) + attributes.each do |name, value| + send("#{name}=", value) + end + end + + def read_attribute_for_validation(key) + send(key) + end + + def reply_to + "#{name} <#{email}>" + end + + def persisted? + false + end + + def save + if valid? + SupportMailer.submit_request(self).deliver + else + return false + end + end +end diff --git a/app/models/user.rb b/app/models/user.rb index 8621edf..d64a44e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,13 +1,13 @@ +require 'digest/md5' +require 'open-uri' + class User include Mongoid::Document include Mongoid::Timestamps - require 'digest/md5' - require 'open-uri' - require 'json' - after_create :send_welcome_email before_create :set_invitation_limit + before_save :update_stripe # Fields field :name, type: String @@ -15,7 +15,11 @@ class User field :locale, type: String, default: "en" field :calendar, type: String, default: "centric" field :secret, type: String - + field :time_zone, type: String + field :stripe_id, type: String + field :last_4_digits, type: String + attr_accessor :stripe_token # Secure card token + # Associations belongs_to :house # => User has a house_id has_many :authentications, dependent: :delete @@ -23,6 +27,9 @@ class User has_many :rewards has_many :achievements + # Indexes + index :email, unique: true + # Devise devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :invitable @@ -36,7 +43,7 @@ class User # message: "misssing, signing up for now." # Setup accessible (or protected) attributes for your model - attr_accessible :name, :email, :password, :remember_me, :locale, :calendar + attr_accessible :name, :email, :password, :remember_me, :locale, :calendar, :stripe_token ### # user methods @@ -162,13 +169,8 @@ def next_achievement Achievement::TYPES.select { |k,v| v[:value] >= self.points } end - def check_payment - if self.secret - url = "http://www.pintpay.com/api/1/subscriptions" - result = JSON.parse( - open("#{url}/#{self.secret}?api_key=#{ENV['PINTPAY_API_KEY']}&api_secret=#{ENV['PINTPAY_API_SECRET']}").read - ) - end + def billing + Stripe::Customer.retrieve(stripe_id) if stripe_id end private @@ -179,6 +181,25 @@ def send_welcome_email def set_invitation_limit self.invitation_limit = 3 end + + def update_stripe + if stripe_token + if stripe_id.present? + stripe_customer = Stripe::Customer.retrieve(stripe_token) + stripe_customer.card = stripe_token + stripe_customer.save + else + stripe_customer = Stripe::Customer.create( + description: email, + card: stripe_token + ) + self[:stripe_id] = stripe_customer.id + end + self.last_4_digits = stripe_customer.active_card.last4 + + else + end + end protected def password_required? diff --git a/app/stylesheets/handheld.sass b/app/stylesheets/handheld.sass deleted file mode 100644 index 626a53b..0000000 --- a/app/stylesheets/handheld.sass +++ /dev/null @@ -1,10 +0,0 @@ -* - float: none - // Screens are not big enough to account for floats - background: #fff - // As much contrast as possible */ - color: #000 - -// Slightly reducing font size to reduce need to scroll -body - font-size: 80% diff --git a/app/stylesheets/partials/_overrides.sass b/app/stylesheets/partials/_overrides.sass deleted file mode 100644 index 4b11ca5..0000000 --- a/app/stylesheets/partials/_overrides.sass +++ /dev/null @@ -1,67 +0,0 @@ -//-------------------------------- -// CSS Reset -//-------------------------------- -+html5-boilerplate-reset - -//-------------------------------- -// Base Fonts -//-------------------------------- -+html5-boilerplate-fonts($base-font-family, $base-font-size, $base-line-height) - -//-------------------------------- -// Minimal Base Styles -//-------------------------------- -html - +force-scrollbar - -ul, ol - margin-left: $list-left-margin - -ol - list-style-type: decimal - -td, td img - vertical-align: top - -sub - +sub - -sup - +sup - -textarea - overflow: auto - -+accessible-focus - -+quoted-pre - -+align-input-labels - -+hand-cursor-inputs - -+webkit-reset-form-elements - -+selected-text - -+webkit-tap-highlight - -+ie-hacks - -+no-nav-margins - -//-------------------------------- -// Helpers -//-------------------------------- -.ir - +image-replacement - -.hidden - +hidden - -.visuallyhidden - +visually-hidden - -.clearfix - +pie-clearfix - // defined by compass core diff --git a/app/stylesheets/partials/_tables.sass b/app/stylesheets/partials/_tables.sass deleted file mode 100644 index b753c25..0000000 --- a/app/stylesheets/partials/_tables.sass +++ /dev/null @@ -1,36 +0,0 @@ -#main - h1 - border: none - table:not(.ui-datepicker-calendar, .battle) - margin: 0 10px - tr - +border-radius(5px) - +column(12, true) - font-size: 16px - line-height: 25px - margin-right: 0px - color: $font-color - +background-image(linear-gradient(#d9eaff, #f2f8ff)) - +background-image(linear-gradient(saturate(lighten($blue, 18%), 40%), saturate(lighten($blue, 23%), 20%))) - +box-shadow(transparentize(white, .5) 0 1px 0 inset, transparentize($blue, .2) 0 0 0 1px inset ) - td, th - +column(2) - padding: 7px 0 - text-align: center - vertical-align: middle - form - margin: 0 - width: auto - td:first-child, th:first-child - +column(3) - text-align: left - padding-left: 20px - td:nth-child(3n+3), th:nth-child(3n+3) - +column(1) - td:last-child, th:last-child - +column(1, true) - &:first-child - line-height: 2 - +background-image(linear-gradient(saturate(lighten($blue, 23%), 20%), saturate(lighten($blue, 13%), 25%))) - - diff --git a/app/stylesheets/style.sass b/app/stylesheets/style.sass deleted file mode 100644 index 23fae99..0000000 --- a/app/stylesheets/style.sass +++ /dev/null @@ -1,47 +0,0 @@ -// Here's where we define some default constants -@import partials/base - -// Then we'll import the compass extension -@import html5-boilerplate - -// Now, you can simply include everything -// (except media) by uncommeting this line -//@include html5-boilerplate; - -// Or, you can pick and choose only the sections -// you want by using the these includes -+html5-boilerplate-reset -+html5-boilerplate-fonts -+html5-boilerplate-styles -+html5-boilerplate-helpers - -// RESET OVERRIDES -// Because I've never seen a unordered list -// with a margin I like -ul - margin-left: 0 - -// Or, you can import the "overrides" partial if -// you want more control over individual mixins -//@import "partials/overrides"; - -// Importing blueprint grid framework -@import blueprint -$blueprint_grid_columns : 12 -$blueprint_grid_width : 60px -$blueprint-grid-margin : 20px -$blueprint-container-size : 960px -// #main - +showgrid() - -// Finally, put your own styles in these partials -// and add more as needed (i.e. forms, tables, nav) -@import partials/fonts -@import partials/page -@import partials/flash -@import partials/modals -@import partials/forms -@import partials/tables - -// Media should come last -@import partials/media diff --git a/app/views/corkboard/_centric_calendar.html.haml b/app/views/corkboards/_centric_calendar.html.haml similarity index 100% rename from app/views/corkboard/_centric_calendar.html.haml rename to app/views/corkboards/_centric_calendar.html.haml diff --git a/app/views/corkboard/_header_bar.html.haml b/app/views/corkboards/_header_bar.html.haml similarity index 100% rename from app/views/corkboard/_header_bar.html.haml rename to app/views/corkboards/_header_bar.html.haml diff --git a/app/views/corkboard/_monthly_calendar.html.haml b/app/views/corkboards/_monthly_calendar.html.haml similarity index 100% rename from app/views/corkboard/_monthly_calendar.html.haml rename to app/views/corkboards/_monthly_calendar.html.haml diff --git a/app/views/corkboard/_notifications.html.haml b/app/views/corkboards/_notifications.html.haml similarity index 100% rename from app/views/corkboard/_notifications.html.haml rename to app/views/corkboards/_notifications.html.haml diff --git a/app/views/corkboard/_upcoming.html.haml b/app/views/corkboards/_upcoming.html.haml similarity index 100% rename from app/views/corkboard/_upcoming.html.haml rename to app/views/corkboards/_upcoming.html.haml diff --git a/app/views/corkboard/index.html.haml b/app/views/corkboards/show.html.haml similarity index 100% rename from app/views/corkboard/index.html.haml rename to app/views/corkboards/show.html.haml diff --git a/app/views/houses/show.html.haml b/app/views/houses/show.html.haml index 629130d..daab946 100644 --- a/app/views/houses/show.html.haml +++ b/app/views/houses/show.html.haml @@ -1,13 +1,6 @@ -%p - %b Name: - = @house.name - - unless @house.users.empty? - %p - Roomies: - %ul - - @house.users.each do |user| - %li= user.name - -= link_to 'Edit', edit_house_path(@house) -\| -= link_to 'Back', houses_path +%h1= @house.name +%ul + - @house.users.each do |user| + %li + = user.name + = user.assignments.count \ No newline at end of file diff --git a/app/views/layouts/_footer.html.haml b/app/views/layouts/_footer.html.haml index a946ee4..13ea0b2 100644 --- a/app/views/layouts/_footer.html.haml +++ b/app/views/layouts/_footer.html.haml @@ -3,13 +3,13 @@ =link_to 'cleverCode LLC.', 'http://clevercode.net' #{t :all_rights_reserved} %p#links - =link_to t(:about_us), about_url + =link_to t(:about_us), about_path | - =link_to t(:privacy_policy), privacy_url + =link_to t(:privacy_policy), privacy_path | - =link_to t(:terms_of_service), service_url + =link_to t(:terms_of_service), service_path | - =link_to t(:support_page), support_index_url + =link_to t(:support_page), new_support_request_path - if user_signed_in? – =link_to t(:sign_out), destroy_user_session_path diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml index 057fce0..b426bde 100644 --- a/app/views/layouts/_head.html.haml +++ b/app/views/layouts/_head.html.haml @@ -19,12 +19,13 @@ -# %link{ :href => "/apple-touch-icon.png", :rel => "apple-touch-icon" }/ = render :partial => 'layouts/stylesheets' + = render :partial => 'layouts/javascripts' - -# catching javascript errors with hoptoad - = hoptoad_javascript_notifier + -# catching javascript errors with hoptoad/airbrake + = airbrake_javascript_notifier -# All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects - = javascript_include_tag 'modernizr.min', 'http://use.typekit.com/urh2gpw.js' + = javascript_include_tag 'http://use.typekit.com/urh2gpw.js' :javascript try{Typekit.load();}catch(e){} diff --git a/app/views/layouts/_header.html.haml b/app/views/layouts/_header.html.haml index 76cdd12..bb196fc 100644 --- a/app/views/layouts/_header.html.haml +++ b/app/views/layouts/_header.html.haml @@ -2,9 +2,9 @@ - unless user_signed_in? =link_to 'Roomies', root_path - else - =link_to 'Roomies', '/corkboard' -- if user_signed_in? && current_user.invitation_limit and current_user.invitation_limit > 0 - #beta= link_to "Beta Invites (#{current_user.invitation_limit})", new_user_invitation_path + =link_to 'Roomies', corkboard_path +/ - if user_signed_in? && current_user.invitation_limit and current_user.invitation_limit > 0 +/ #beta= link_to "Beta Invites (#{current_user.invitation_limit})", new_user_invitation_path %nav - if user_signed_in? %ul @@ -19,15 +19,17 @@ - confirms = current_user.assignments.where(commissioner_id: current_user.id).and(:completed_at.ne => nil).and(validator_id: nil).excludes(completor_id: current_user.id) - unless confirms.blank? %li.notification.confirm - = link_to "#{confirms.count} confirmations", '/confirmations', class: 'ajax' + = link_to "#{confirms.count} confirmations", confirmations_path, class: 'ajax' - pasts = current_user.assignments.past_due - unless pasts.blank? %li.notification.past_due - = link_to "#{pasts.count} past due", '/past_due_assignments', class: 'ajax' + = link_to "#{pasts.count} past due", past_due_assignments_path, class: 'ajax' %li.link.corkboard - = link_to "Corkboard", root_url + = link_to "Corkboard", corkboard_path + %li.link.my_house + = link_to "My House", current_house_path %li.link.profile - = link_to "Profile", current_user + = link_to "Me", current_user_path %li.action - if current_user.house.nil? = link_to t(:build_house), new_house_path, id: 'easy_button', class: 'ajax' diff --git a/app/views/layouts/_javascripts.html.haml b/app/views/layouts/_javascripts.html.haml index 9184a22..50243b9 100644 --- a/app/views/layouts/_javascripts.html.haml +++ b/app/views/layouts/_javascripts.html.haml @@ -1,42 +1,4 @@ --# Grab Google CDN's jQuery, with a protocol relative URL --# Looks for google_api_key first in ENV['GOOGLE_API_KEY'] then in config/google.yml --# remote_jquery and local_jquery helpers use minified jquery unless Rails.env is development - -- if !google_api_key.blank? - = javascript_include_tag "//www.google.com/jsapi?key=#{google_api_key}" - :javascript - google.load(#{ remote_jquery("1.5.1") }); -- else - = javascript_include_tag "//ajax.googleapis.com/ajax/libs/jquery/#{ local_jquery("1.5.1") }" - --# fall back to local jQuery if necessary -:javascript - !window.jQuery && document.write(unescape('%3Cscript src="/javascripts/jquery.min.js"%3E%3C/script%3E')) - --# Including the coffeescript compiled to JS -= javascript_include_tag 'jquery-ui.min', 'rails', 'application', 'plugins', 'date', 'selectivizr-min' - --# Fix any or .png_bg bg-images. Also, please read goo.gl/mZiyb -/[if lt IE 7 ] - = javascript_include_tag 'dd_belatedpng.js' - :javascript - //DD_belatedPNG.fix('img, .png_bg'); - --# Append your own using content_for :javascripts -= yield :javascripts - --# asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet --# Looks for google_account_id first in ENV['GOOGLE_ACCOUNT_ID'] then in config/google.yml -- if !google_account_id.blank? - :javascript - var _gaq = [['_setAccount', '#{google_account_id}'], ['_trackPageview']]; - (function(d, t) { - var g = d.createElement(t), - s = d.getElementsByTagName(t)[0]; - g.async = true; - g.src = ('https:' == location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - s.parentNode.insertBefore(g, s); - })(document, 'script'); += javascript_include_tag "application" :javascript var clicky = { log: function(){ return; }, goal: function(){ return; }}; diff --git a/app/views/layouts/_stylesheets.html.haml b/app/views/layouts/_stylesheets.html.haml index 8998ae7..f3d0531 100644 --- a/app/views/layouts/_stylesheets.html.haml +++ b/app/views/layouts/_stylesheets.html.haml @@ -1,7 +1,2 @@ -# CSS: implied media="all" -= stylesheet_link_tag 'style', :media => 'all' -= stylesheet_link_tag 'handheld.css', :media => 'handheld' -= stylesheet_link_tag 'cupertino/jquery-ui-1.8.11.custom.css', :media => 'all' - --# Append your own using content_for :stylesheets -= yield :stylesheets += stylesheet_link_tag "application" \ No newline at end of file diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 1737c56..625bfd8 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -1,6 +1,5 @@ !!! 5 --# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither --ie_html :class => 'no-js' do +%html = render :partial => 'layouts/head' %body{ :lang => 'en', :class => "#{controller.controller_name} #{signed_in? ? 'signed_in' : ''} bp"} #clouds @@ -17,6 +16,4 @@ .loader %footer#footer .container - = render :partial => 'layouts/footer' - -# Javascript at the bottom for fast page loading - = render :partial => 'layouts/javascripts' + = render :partial => 'layouts/footer' \ No newline at end of file diff --git a/app/views/subscriptions/new.html.haml b/app/views/subscriptions/new.html.haml new file mode 100644 index 0000000..c71b718 --- /dev/null +++ b/app/views/subscriptions/new.html.haml @@ -0,0 +1,49 @@ +#sponsor_house_view + %h1 Be a Hero and Sponsor Your House + %p Your house is currently unsponsored, which means nobody is paying to use Roomies. + + %h2 Reasons to Sponsor: + %ul + %li Heh. + %li Needs. + %li Reasons. + + .payment_details + %h2 Payment Details + - if current_user.last_4_digits.present? + %p.credit_card.selected XXXX-XXXX-XXXX-#{current_user.last_4_digits} + %p Use other card + - else + - # It is intentional that these inputs do not have `name` attributes + - # This prevents them from accidentally being sent to our server. + %form#credit_card_info + %p + %label Credit Card Number + %input(type='text' size='20' id='card_number') + %p + %label CVC + %input(type='text' size='4' id='card_cvc') + %p + %label Expiration Date (MM/YYYY) + %input(type='text' size='2' id='card_expiry_month') + ="/" + %input(type='text' size=4 id='card_expiry_year') + %p + %input(type='submit' value='Add card') + + %a(class='cancel') Cancel + = form_for(:subscription, url: house_subscription_path, method: :post) do |form| + = hidden_field_tag 'stripe_token', '' + = hidden_field_tag 'sponsor', 'me' + = submit_tag('Sponsor') + + %p.agreement + By submiting you acknowledge that $10 will be charged to + the above payment method today and once every month. + += javascript_include_tag 'https://js.stripe.com/v1/' +:javascript + Stripe.setPublishableKey('#{ENV['STRIPE_PUBLISHABLE_KEY']}'); + var sponsor_house_view = new Roomies.SponsorHouseView('#sponsor_house_view') + roomies.ui.sponsor_house_view = sponsor_house_view + diff --git a/app/views/support/submit_request.html.haml b/app/views/support/submit_request.html.haml deleted file mode 100644 index 26498a1..0000000 --- a/app/views/support/submit_request.html.haml +++ /dev/null @@ -1,4 +0,0 @@ -%h1 Someone said something about Roomies! -%h2 It seems you've gotten a new message from a loyal follower at roomies. Yay for you! -%h3 Sent by #{@request[:name] || @request[:email]} -%p= @request[:message] diff --git a/app/views/support_mailer/submit_request.html.haml b/app/views/support_mailer/submit_request.html.haml new file mode 100644 index 0000000..9fd1946 --- /dev/null +++ b/app/views/support_mailer/submit_request.html.haml @@ -0,0 +1,7 @@ +%h1 Someone said something about Roomies! +%h2 It seems you've gotten a new message from a loyal follower at roomies. Yay for you! +%h3 + Sent by #{@support_request.name} + = link_to @support_request.name, @support_request.email +%p= @support_request.message + diff --git a/app/views/support/index.html.haml b/app/views/support_requests/new.html.haml similarity index 74% rename from app/views/support/index.html.haml rename to app/views/support_requests/new.html.haml index 8db2f57..43ec4d5 100644 --- a/app/views/support/index.html.haml +++ b/app/views/support_requests/new.html.haml @@ -8,7 +8,7 @@ %p message us! -=simple_form_for :request do |f| +=simple_form_for @support_request, :url => support_request_path do |f| = f.input :name, label: false, placeholder: t(:name) = f.input :email, label: false, placeholder: t(:email_example) = f.input :message, :as => 'text', label: false, placeholder: "Let's hear it..." @@ -16,4 +16,4 @@ %h2 We're sorry if you're having issues with Roomies. %p If it's any consolation, here's an entertaining picture to make it up to you → -= image_tag "/images/support/#{random_image}", alt: "Silly picture", title: "Yeah we totally stole that from Reddit" += image_tag "support/#{random_image}", alt: "Silly picture", title: "Yeah we totally stole that from Reddit" diff --git a/app/views/user_mailer/_footer.html.haml b/app/views/user_mailer/_footer.html.haml index b48fc48..63ac2ce 100644 --- a/app/views/user_mailer/_footer.html.haml +++ b/app/views/user_mailer/_footer.html.haml @@ -1,5 +1,5 @@ %p Have a great day! %p - %strong= link_to 'Roomies', root_url + %strong= link_to 'Roomies', 'http://roomiesapp.com' crafted by = link_to 'cleverCode', 'http://clevercode.net' diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 8f50246..e05b088 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -25,13 +25,19 @@ -# %p #{(current_user == @user) ? t('.you_have') : t('.this_roomie_has')} #{pluralize(@user.points, t(:point))} #hud - - if @user.house + - if @house #house - .current_house #{@user.house.name} + .current_house #{@house.name} - if signed_in? && current_user == @user - = link_to t('.change_house_name'), edit_house_path(@user.house), :class => 'ajax' + = link_to t('.change_house_name'), edit_house_path(@house), :class => 'ajax' = link_to t('.add_roomies'), new_house_invitation_path, :class => 'ajax' - = link_to t('.move_out'), homeless_url(:id => @user.id, :house_id => @user.house), :confirm => t('.confirm_house_deletion') + = link_to t('.move_out'), homeless_url(:id => @user.id, :house_id => @house), :confirm => t('.confirm_house_deletion') + - if @house.sponsored? && @house.sponsor == current_user + = link_to 'Cancel Sponsorship', house_subscription_path, method: :delete, remote: true + - elsif @house.sponsored? + = link_to "Sponsored by #{@house.sponsor}", '#' + - else + = link_to t('.sponsor'), new_house_subscription_path - else %p#house - if signed_in? && current_user == @user diff --git a/config/application.rb b/config/application.rb index ba4770c..61144a8 100644 --- a/config/application.rb +++ b/config/application.rb @@ -5,14 +5,22 @@ require "action_controller/railtie" require "action_mailer/railtie" require "active_resource/railtie" -require "rails/test_unit/railtie" +# require "rails/test_unit/railtie" # If you have a Gemfile, require the gems listed there, including any gems # you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) if defined?(Bundler) +# Bundler.require(:default, Rails.env) if defined?(Bundler) +Bundler.require *Rails.groups(:assets) if defined?(Bundler) module Roomies class Application < Rails::Application + + # don't generate RSpec tests for views and helpers + config.generators do |g| + g.view_specs false + g.helper_specs false + end + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. @@ -29,11 +37,11 @@ class Application < Rails::Application # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. - # config.time_zone = 'Central Time (US & Canada)' + config.time_zone = 'Eastern Time (US & Canada)' # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - # config.i18n.default_locale = :de + config.i18n.default_locale = :en # JavaScript files you want as :defaults (application.js is always included). # config.action_view.javascript_expansions[:defaults] = %w(jquery rails) @@ -43,5 +51,9 @@ class Application < Rails::Application # Configure sensitive parameters which will be filtered from the log file. config.filter_parameters += [:password, :password_confirmation] + + # Enable the asset pipeline + config.assets.enabled = true + config.sass.preferred_syntax = :sass end end diff --git a/config/compass.rb b/config/compass.rb deleted file mode 100644 index b9787ef..0000000 --- a/config/compass.rb +++ /dev/null @@ -1,18 +0,0 @@ -# This configuration file works with both the Compass command line tool and within Rails. -require 'html5-boilerplate' -# Require any additional compass plugins here. - -project_type = :rails -project_path = Compass::AppIntegration::Rails.root -# Set this to the root of your project when deployed: -http_path = "/" -css_dir = "tmp/stylesheets" -sass_dir = "app/stylesheets" -environment = Compass::AppIntegration::Rails.env -# To enable relative paths to assets via compass helper functions. Uncomment: -# relative_assets = true - -# respect the native sass nesting -output_style = (environment == :production) ? :compressed : :expanded -# get rid of those annoying line comments that make CSSEdit hell -line_comments = (environment == :production) ? false : true diff --git a/config/environment.rb b/config/environment.rb index 59c5b29..e5247c1 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,5 @@ # Load the rails application require File.expand_path('../application', __FILE__) -require 'yaml' -YAML::ENGINE.yamler= 'syck' # Initialize the rails application Roomies::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index a6cf4b1..674be64 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,7 +3,7 @@ # In the development environment your application's code is reloaded on # every request. This slows down response time but is perfect for development - # since you don't have to restart the webserver when you make code changes. + # since you don't have to restart the web server when you make code changes. config.cache_classes = false # Log error messages when you accidentally call methods on nil. @@ -13,6 +13,9 @@ config.consider_all_requests_local = true config.action_controller.perform_caching = false + # Don't care if the mailer can't send + config.action_mailer.raise_delivery_errors = false + # Print deprecation notices to the Rails logger config.active_support.deprecation = :log @@ -31,5 +34,8 @@ :port => 1025, :authentication => 'plain', :enable_starttls_auto => true } + # Do not compress assets + config.assets.compress = false + config.assets.logger = nil end diff --git a/config/environments/production.rb b/config/environments/production.rb index 6438792..91297c5 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,7 +1,6 @@ Roomies::Application.configure do # Settings specified here will take precedence over those in config/application.rb - # The production environment is meant for finished, "live" apps. # Code is not reloaded between requests config.cache_classes = true @@ -9,14 +8,18 @@ config.consider_all_requests_local = false config.action_controller.perform_caching = true - # Specifies the header that your server uses for sending files - config.action_dispatch.x_sendfile_header = "X-Sendfile" + # Disable Rails's static asset server (Apache or nginx will already do this) + config.serve_static_assets = false - # For nginx: - # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' + # Compress JavaScripts and CSS + config.assets.compress = true + + # Specifies the header that your server uses for sending files + # (comment out if your front-end server doesn't support this) + config.action_dispatch.x_sendfile_header = "X-Sendfile" # Use 'X-Accel-Redirect' for nginx - # If you have no front-end server that supports something like X-Sendfile, - # just comment this out and Rails will serve the files + # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. + # config.force_ssl = true # See everything in the log (default is :info) # config.log_level = :debug @@ -26,15 +29,13 @@ # Use a different cache store in production # config.cache_store = :mem_cache_store - config.cache_store = :dalli_store - # Disable Rails's static asset server - # In production, Apache or nginx will already do this - config.serve_static_assets = false - - # Enable serving of images, stylesheets, and javascripts from an asset server + # Enable serving of images, stylesheets, and JavaScripts from an asset server # config.action_controller.asset_host = "http://assets.example.com" + # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added) + # config.assets.precompile += %w( search.js ) + # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false diff --git a/config/environments/test.rb b/config/environments/test.rb index 1bdd7c0..074a8b3 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -5,9 +5,13 @@ # test suite. You never need to work with it otherwise. Remember that # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! - config.cache_classes = true + config.cache_classes = false - # Log error messages when you accidentally call methods on nil. + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Log error messages when you accidentally call methods on nil config.whiny_nils = true # Show full error reports and disable caching diff --git a/config/initializers/airbrake.rb b/config/initializers/airbrake.rb new file mode 100644 index 0000000..0499f5d --- /dev/null +++ b/config/initializers/airbrake.rb @@ -0,0 +1,3 @@ +Airbrake.configure do |config| + config.api_key = '4a8167bfbad945f04d82f546f20b4250' +end diff --git a/config/initializers/barista_config.rb b/config/initializers/barista_config.rb deleted file mode 100644 index 6378a7b..0000000 --- a/config/initializers/barista_config.rb +++ /dev/null @@ -1,61 +0,0 @@ -# Configure barista. -Barista.configure do |c| - c.root = Rails.root.join("app", "coffeescripts") - c.output_root = Rails.root.join("tmp", "javascripts") - - - # Change the root to use app/scripts - # c.root = Rails.root.join("app", "scripts") - - # Change the output root, causing Barista to compile into public/coffeescripts - # c.output_root = Rails.root.join("public", "coffeescripts") - - # Set the compiler - - # Disable wrapping in a closure: - # c.no_wrap = true - # ... or ... - # c.no_wrap! - - # Change the output root for a framework: - - # c.change_output_prefix! 'framework-name', 'output-prefix' - - # or for all frameworks... - - # c.each_framework do |framework| - # c.change_output_prefix! framework.name, "vendor/#{framework.name}" - # end - - # or, prefix the path for the app files: - - # c.change_output_prefix! :default, 'my-app-name' - - # or, hook into the compilation: - - # c.before_compilation { |path| puts "Barista: Compiling #{path}" } - # c.on_compilation { |path| puts "Barista: Successfully compiled #{path}" } - # c.on_compilation_error { |path, output| puts "Barista: Compilation of #{path} failed with:\n#{output}" } - # c.on_compilation_with_warning { |path, output| puts "Barista: Compilation of #{path} had a warning:\n#{output}" } - - # Turn off preambles and exceptions on failure - - # c.verbose = false - - # Or, make sure it is always on - # c.verbose! - - # If you want to use a custom JS file, you can as well - # e.g. vendoring CoffeeScript in your application: - # c.js_path = Rails.root.join('public', 'javascripts', 'coffee-script.js') - -end - -require 'fileutils' - -Rails.configuration.middleware.delete('Barista::Filter') -Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Barista::Filter') -Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static', - :urls => ['/javascripts'], - :root => "#{Rails.root}/tmp") - diff --git a/config/initializers/compass.rb b/config/initializers/compass.rb deleted file mode 100644 index 68e035c..0000000 --- a/config/initializers/compass.rb +++ /dev/null @@ -1,13 +0,0 @@ -require 'compass' -require 'compass/app_integration/rails' -require 'fileutils' - -FileUtils.mkdir_p(Rails.root.join("tmp", "stylesheets")) - -Rails.configuration.middleware.delete('Sass::Plugin::Rack') -Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Sass::Plugin::Rack') - -Rails.configuration.middleware.insert_before('Rack::Sendfile', 'Rack::Static', - :urls => ['/stylesheets'], - :root => "#{Rails.root}/tmp") - diff --git a/config/initializers/hoptoad.rb b/config/initializers/hoptoad.rb deleted file mode 100644 index 3aaf91d..0000000 --- a/config/initializers/hoptoad.rb +++ /dev/null @@ -1,3 +0,0 @@ -HoptoadNotifier.configure do |config| - config.api_key = '39003788e7c247d64145f0979977949a' -end diff --git a/config/initializers/sass.rb b/config/initializers/sass.rb new file mode 100644 index 0000000..1478d23 --- /dev/null +++ b/config/initializers/sass.rb @@ -0,0 +1,3 @@ +Rails.configuration.sass.tap do |config| + config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets" +end \ No newline at end of file diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 1e467de..f02d317 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,15 +1,8 @@ # Be sure to restart your server when you modify this file. -Roomies::Application.config.session_store :cookie_store, :key => '_roomies_session' +Roomies::Application.config.session_store :cookie_store, key: '_roomies_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails generate session_migration") # Roomies::Application.config.session_store :active_record_store -# require 'action_dispatch/middleware/session/dalli_store' -# Rails.application.config.session_store :dalli_store, -# :memcache_server => [MEMCACHE_SERVERS], -# :namespace => 'sessions', -# :key => '_roomies_session', -# :expire_after => 30.minutes - diff --git a/config/initializers/stripe.rb b/config/initializers/stripe.rb new file mode 100644 index 0000000..8204302 --- /dev/null +++ b/config/initializers/stripe.rb @@ -0,0 +1,3 @@ +# These are keys that only work for the test environment +Stripe.api_key = ENV['STRIPE_API_KEY'] || 'hjcGKF9zij9q4C9kvrrmRDzZQNrWVxtY' +ENV['STRIPE_PUBLISHABLE_KEY'] ||= 'pk_iGJoSXScaxHj5M9t4JG3SXqWOg8Oi' diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb new file mode 100644 index 0000000..16c3243 --- /dev/null +++ b/config/initializers/wrap_parameters.rb @@ -0,0 +1,12 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains settings for ActionController::ParamsWrapper which +# is enabled by default. + +# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. +ActionController::Base.wrap_parameters format: [:json] + +# Disable root element in JSON by default. +if defined?(ActiveRecord) + ActiveRecord::Base.include_root_in_json = false +end diff --git a/config/locales/en.yml b/config/locales/en.yml index 7cc1988..b6e16b1 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -256,6 +256,7 @@ en: roomie_battle: "Roomie Battle" new_roomie: "new roomie" lonely: "No roomies." + sponsor: "Sponsor" # rewards rewards: diff --git a/config/mongoid.yml b/config/mongoid.yml index 7c42c48..a15e2c5 100644 --- a/config/mongoid.yml +++ b/config/mongoid.yml @@ -7,6 +7,7 @@ defaults: &defaults reconnect_time: 3 use_object_ids: true + # set these environment variables on your prod server production: uri: 'mongodb://clevercode:jfM2QzkGXkcp6i@flame.mongohq.com:27028/roomies' @@ -14,6 +15,7 @@ production: development: host: localhost database: roomies_development + autocreate_indexes: true test: host: localhost diff --git a/config/routes.rb b/config/routes.rb index c92c977..98f13e5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,6 +2,11 @@ root :to => 'pages#home' + match '/me' => 'users#show', as: 'current_user' + match '/house' => 'houses#show', as: 'current_house' + resource :corkboard, only: %w(show) + resource :support_request, only: %w(new create) + devise_for :users devise_scope :user do get "sign_in", :to => "devise/sessions#new" @@ -10,7 +15,6 @@ resources :users resources :pages - resources :support resources :authentications resources :assignments do member do @@ -20,8 +24,13 @@ end resources :categories resources :achievements - resources :houses - resources :corkboard + + resource :house do + resource :subscription + end + + resources :houses + resources :user_mailer resources :house_invitations resources :rewards @@ -31,11 +40,10 @@ match '/auth/facebook/setup' => 'facebook#setup' match '/registrations' => 'accounts#email' match '/user/:id/homeless/:house_id' => 'houses#destroy_roomie', :as => :homeless - match '/support/index' => 'support#submit_request' match '/assignments/day/:day' => 'assignments#day' match '/beta_sign_up/:invite_token' => 'users#new', :as => :beta_sign_up - match '/confirmations' => 'assignments#confirmations' - match '/past_due_assignments' => 'assignments#past_due_assignments' + match '/confirmations' => 'assignments#confirmations', as: 'confirmations' + match '/past_due_assignments' => 'assignments#past_due_assignments', as: 'past_due_assignments' match '/assignments/:id/confirm' => 'assignments#confirm' match '/assignments/:id/reject' => 'assignments#reject' match '/house_invitations/:id/accept' => 'users#accept_house_invitation' diff --git a/log/production.log b/log/production.log deleted file mode 100644 index e69de29..0000000 diff --git a/public/javascripts/dd_belatedpng.js b/public/javascripts/dd_belatedpng.js deleted file mode 100644 index 6062fb3..0000000 --- a/public/javascripts/dd_belatedpng.js +++ /dev/null @@ -1,13 +0,0 @@ -/** -* DD_belatedPNG: Adds IE6 support: PNG images for CSS background-image and HTML . -* Author: Drew Diller -* Email: drew.diller@gmail.com -* URL: http://www.dillerdesign.com/experiment/DD_belatedPNG/ -* Version: 0.0.8a -* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_belatedPNG/#license -* -* Example usage: -* DD_belatedPNG.fix('.png_bg'); // argument is a CSS selector -* DD_belatedPNG.fixPng( someNode ); // argument is an HTMLDomElement -**/ -var DD_belatedPNG={ns:"DD_belatedPNG",imgSize:{},delay:10,nodesFixed:0,createVmlNameSpace:function(){if(document.namespaces&&!document.namespaces[this.ns]){document.namespaces.add(this.ns,"urn:schemas-microsoft-com:vml")}},createVmlStyleSheet:function(){var b,a;b=document.createElement("style");b.setAttribute("media","screen");document.documentElement.firstChild.insertBefore(b,document.documentElement.firstChild.firstChild);if(b.styleSheet){b=b.styleSheet;b.addRule(this.ns+"\\:*","{behavior:url(#default#VML)}");b.addRule(this.ns+"\\:shape","position:absolute;");b.addRule("img."+this.ns+"_sizeFinder","behavior:none; border:none; position:absolute; z-index:-1; top:-10000px; visibility:hidden;");this.screenStyleSheet=b;a=document.createElement("style");a.setAttribute("media","print");document.documentElement.firstChild.insertBefore(a,document.documentElement.firstChild.firstChild);a=a.styleSheet;a.addRule(this.ns+"\\:*","{display: none !important;}");a.addRule("img."+this.ns+"_sizeFinder","{display: none !important;}")}},readPropertyChange:function(){var b,c,a;b=event.srcElement;if(!b.vmlInitiated){return}if(event.propertyName.search("background")!=-1||event.propertyName.search("border")!=-1){DD_belatedPNG.applyVML(b)}if(event.propertyName=="style.display"){c=(b.currentStyle.display=="none")?"none":"block";for(a in b.vml){if(b.vml.hasOwnProperty(a)){b.vml[a].shape.style.display=c}}}if(event.propertyName.search("filter")!=-1){DD_belatedPNG.vmlOpacity(b)}},vmlOpacity:function(b){if(b.currentStyle.filter.search("lpha")!=-1){var a=b.currentStyle.filter;a=parseInt(a.substring(a.lastIndexOf("=")+1,a.lastIndexOf(")")),10)/100;b.vml.color.shape.style.filter=b.currentStyle.filter;b.vml.image.fill.opacity=a}},handlePseudoHover:function(a){setTimeout(function(){DD_belatedPNG.applyVML(a)},1)},fix:function(a){if(this.screenStyleSheet){var c,b;c=a.split(",");for(b=0;bn.H){i.B=n.H}d.vml.image.shape.style.clip="rect("+i.T+"px "+(i.R+a)+"px "+i.B+"px "+(i.L+a)+"px)"}else{d.vml.image.shape.style.clip="rect("+f.T+"px "+f.R+"px "+f.B+"px "+f.L+"px)"}},figurePercentage:function(d,c,f,a){var b,e;e=true;b=(f=="X");switch(a){case"left":case"top":d[f]=0;break;case"center":d[f]=0.5;break;case"right":case"bottom":d[f]=1;break;default:if(a.search("%")!=-1){d[f]=parseInt(a,10)/100}else{e=false}}d[f]=Math.ceil(e?((c[b?"W":"H"]*d[f])-(c[b?"w":"h"]*d[f])):parseInt(a,10));if(d[f]%2===0){d[f]++}return d[f]},fixPng:function(c){c.style.behavior="none";var g,b,f,a,d;if(c.nodeName=="BODY"||c.nodeName=="TD"||c.nodeName=="TR"){return}c.isImg=false;if(c.nodeName=="IMG"){if(c.src.toLowerCase().search(/\.png$/)!=-1){c.isImg=true;c.style.visibility="hidden"}else{return}}else{if(c.currentStyle.backgroundImage.toLowerCase().search(".png")==-1){return}}g=DD_belatedPNG;c.vml={color:{},image:{}};b={shape:{},fill:{}};for(a in c.vml){if(c.vml.hasOwnProperty(a)){for(d in b){if(b.hasOwnProperty(d)){f=g.ns+":"+d;c.vml[a][d]=document.createElement(f)}}c.vml[a].shape.stroked=false;c.vml[a].shape.appendChild(c.vml[a].fill);c.parentNode.insertBefore(c.vml[a].shape,c)}}c.vml.image.shape.fillcolor="none";c.vml.image.fill.type="tile";c.vml.color.fill.on=false;g.attachHandlers(c);g.giveLayout(c);g.giveLayout(c.offsetParent);c.vmlInitiated=true;g.applyVML(c)}};try{document.execCommand("BackgroundImageCache",false,true)}catch(r){}DD_belatedPNG.createVmlNameSpace();DD_belatedPNG.createVmlStyleSheet(); \ No newline at end of file diff --git a/public/javascripts/jquery-ui.min.js b/public/javascripts/jquery-ui.min.js deleted file mode 100644 index 7093aa3..0000000 --- a/public/javascripts/jquery-ui.min.js +++ /dev/null @@ -1,405 +0,0 @@ -/*! - * jQuery UI 1.8.10 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI - */ -(function(b,d){function e(g){return!b(g).parents().andSelf().filter(function(){return b.curCSS(this,"visibility")==="hidden"||b.expr.filters.hidden(this)}).length}b.ui=b.ui||{};if(!b.ui.version){b.extend(b.ui,{version:"1.8.10",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, -NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});b.fn.extend({_focus:b.fn.focus,focus:function(g,f){return typeof g==="number"?this.each(function(){var a=this;setTimeout(function(){b(a).focus();f&&f.call(a)},g)}):this._focus.apply(this,arguments)},scrollParent:function(){var g;g=b.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(b.curCSS(this, -"position",1))&&/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(b.curCSS(this,"overflow",1)+b.curCSS(this,"overflow-y",1)+b.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!g.length?b(document):g},zIndex:function(g){if(g!==d)return this.css("zIndex",g);if(this.length){g=b(this[0]);for(var f;g.length&&g[0]!==document;){f=g.css("position"); -if(f==="absolute"||f==="relative"||f==="fixed"){f=parseInt(g.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}g=g.parent()}}return 0},disableSelection:function(){return this.bind((b.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(g){g.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});b.each(["Width","Height"],function(g,f){function a(j,n,q,l){b.each(c,function(){n-=parseFloat(b.curCSS(j,"padding"+this,true))||0;if(q)n-=parseFloat(b.curCSS(j, -"border"+this+"Width",true))||0;if(l)n-=parseFloat(b.curCSS(j,"margin"+this,true))||0});return n}var c=f==="Width"?["Left","Right"]:["Top","Bottom"],h=f.toLowerCase(),i={innerWidth:b.fn.innerWidth,innerHeight:b.fn.innerHeight,outerWidth:b.fn.outerWidth,outerHeight:b.fn.outerHeight};b.fn["inner"+f]=function(j){if(j===d)return i["inner"+f].call(this);return this.each(function(){b(this).css(h,a(this,j)+"px")})};b.fn["outer"+f]=function(j,n){if(typeof j!=="number")return i["outer"+f].call(this,j);return this.each(function(){b(this).css(h, -a(this,j,true,n)+"px")})}});b.extend(b.expr[":"],{data:function(g,f,a){return!!b.data(g,a[3])},focusable:function(g){var f=g.nodeName.toLowerCase(),a=b.attr(g,"tabindex");if("area"===f){f=g.parentNode;a=f.name;if(!g.href||!a||f.nodeName.toLowerCase()!=="map")return false;g=b("img[usemap=#"+a+"]")[0];return!!g&&e(g)}return(/input|select|textarea|button|object/.test(f)?!g.disabled:"a"==f?g.href||!isNaN(a):!isNaN(a))&&e(g)},tabbable:function(g){var f=b.attr(g,"tabindex");return(isNaN(f)||f>=0)&&b(g).is(":focusable")}}); -b(function(){var g=document.body,f=g.appendChild(f=document.createElement("div"));b.extend(f.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});b.support.minHeight=f.offsetHeight===100;b.support.selectstart="onselectstart"in f;g.removeChild(f).style.display="none"});b.extend(b.ui,{plugin:{add:function(g,f,a){g=b.ui[g].prototype;for(var c in a){g.plugins[c]=g.plugins[c]||[];g.plugins[c].push([f,a[c]])}},call:function(g,f,a){if((f=g.plugins[f])&&g.element[0].parentNode)for(var c=0;c0)return true;g[f]=1;a=g[f]>0;g[f]=0;return a},isOverAxis:function(g,f,a){return g>f&&g=9)&&!d.button)return this._mouseUp(d);if(this._mouseStarted){this._mouseDrag(d); -return d.preventDefault()}if(this._mouseDistanceMet(d)&&this._mouseDelayMet(d))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,d)!==false)?this._mouseDrag(d):this._mouseUp(d);return!this._mouseStarted},_mouseUp:function(d){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;d.target==this._mouseDownEvent.target&&b.data(d.target,this.widgetName+".preventClickEvent", -true);this._mouseStop(d)}return false},_mouseDistanceMet:function(d){return Math.max(Math.abs(this._mouseDownEvent.pageX-d.pageX),Math.abs(this._mouseDownEvent.pageY-d.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); -(function(b){b.widget("ui.draggable",b.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(d){var e= -this.options;if(this.helper||e.disabled||b(d.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(d);if(!this.handle)return false;return true},_mouseStart:function(d){var e=this.options;this.helper=this._createHelper(d);this._cacheHelperProportions();if(b.ui.ddmanager)b.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- -this.margins.top,left:this.offset.left-this.margins.left};b.extend(this.offset,{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);e.containment&&this._setContainment();if(this._trigger("start",d)===false){this._clear();return false}this._cacheHelperProportions(); -b.ui.ddmanager&&!e.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,d);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(d,true);return true},_mouseDrag:function(d,e){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute");if(!e){e=this._uiHash();if(this._trigger("drag",d,e)===false){this._mouseUp({});return false}this.position=e.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| -this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";b.ui.ddmanager&&b.ui.ddmanager.drag(this,d);return false},_mouseStop:function(d){var e=false;if(b.ui.ddmanager&&!this.options.dropBehaviour)e=b.ui.ddmanager.drop(this,d);if(this.dropped){e=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!e||this.options.revert=="valid"&&e||this.options.revert===true||b.isFunction(this.options.revert)&& -this.options.revert.call(this.element,e)){var g=this;b(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){g._trigger("stop",d)!==false&&g._clear()})}else this._trigger("stop",d)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(d){var e=!this.options.handle||!b(this.options.handle,this.element).length?true:false;b(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== -d.target)e=true});return e},_createHelper:function(d){var e=this.options;d=b.isFunction(e.helper)?b(e.helper.apply(this.element[0],[d])):e.helper=="clone"?this.element.clone():this.element;d.parents("body").length||d.appendTo(e.appendTo=="parent"?this.element[0].parentNode:e.appendTo);d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute");return d},_adjustOffsetFromHelper:function(d){if(typeof d=="string")d=d.split(" ");if(b.isArray(d))d={left:+d[0],top:+d[1]|| -0};if("left"in d)this.offset.click.left=d.left+this.margins.left;if("right"in d)this.offset.click.left=this.helperProportions.width-d.right+this.margins.left;if("top"in d)this.offset.click.top=d.top+this.margins.top;if("bottom"in d)this.offset.click.top=this.helperProportions.height-d.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var d=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0], -this.offsetParent[0])){d.left+=this.scrollParent.scrollLeft();d.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&b.browser.msie)d={top:0,left:0};return{top:d.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:d.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var d=this.element.position();return{top:d.top- -(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:d.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var d=this.options;if(d.containment== -"parent")d.containment=this.helper[0].parentNode;if(d.containment=="document"||d.containment=="window")this.containment=[(d.containment=="document"?0:b(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(d.containment=="document"?0:b(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(d.containment=="document"?0:b(window).scrollLeft())+b(d.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(d.containment=="document"? -0:b(window).scrollTop())+(b(d.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(d.containment)&&d.containment.constructor!=Array){var e=b(d.containment)[0];if(e){d=b(d.containment).offset();var g=b(e).css("overflow")!="hidden";this.containment=[d.left+(parseInt(b(e).css("borderLeftWidth"),10)||0)+(parseInt(b(e).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(b(e).css("borderTopWidth"), -10)||0)+(parseInt(b(e).css("paddingTop"),10)||0)-this.margins.top,d.left+(g?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(b(e).css("borderLeftWidth"),10)||0)-(parseInt(b(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(g?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(b(e).css("borderTopWidth"),10)||0)-(parseInt(b(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(d.containment.constructor== -Array)this.containment=d.containment},_convertPositionTo:function(d,e){if(!e)e=this.position;d=d=="absolute"?1:-1;var g=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(g[0].tagName);return{top:e.top+this.offset.relative.top*d+this.offset.parent.top*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): -f?0:g.scrollTop())*d),left:e.left+this.offset.relative.left*d+this.offset.parent.left*d-(b.browser.safari&&b.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:g.scrollLeft())*d)}},_generatePosition:function(d){var e=this.options,g=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&b.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(g[0].tagName),a=d.pageX,c=d.pageY; -if(this.originalPosition){if(this.containment){if(d.pageX-this.offset.click.leftthis.containment[2])a=this.containment[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])c=this.containment[3]+this.offset.click.top}if(e.grid){c=this.originalPageY+Math.round((c-this.originalPageY)/ -e.grid[1])*e.grid[1];c=this.containment?!(c-this.offset.click.topthis.containment[3])?c:!(c-this.offset.click.topthis.containment[2])?a:!(a-this.offset.click.left

    ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(b(this).offset()).appendTo("body")})}, -stop:function(){b("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});b.ui.plugin.add("draggable","opacity",{start:function(d,e){d=b(e.helper);e=b(this).data("draggable").options;if(d.css("opacity"))e._opacity=d.css("opacity");d.css("opacity",e.opacity)},stop:function(d,e){d=b(this).data("draggable").options;d._opacity&&b(e.helper).css("opacity",d._opacity)}});b.ui.plugin.add("draggable","scroll",{start:function(){var d=b(this).data("draggable");if(d.scrollParent[0]!= -document&&d.scrollParent[0].tagName!="HTML")d.overflowOffset=d.scrollParent.offset()},drag:function(d){var e=b(this).data("draggable"),g=e.options,f=false;if(e.scrollParent[0]!=document&&e.scrollParent[0].tagName!="HTML"){if(!g.axis||g.axis!="x")if(e.overflowOffset.top+e.scrollParent[0].offsetHeight-d.pageY=0;n--){var q=g.snapElements[n].left,l=q+g.snapElements[n].width,k=g.snapElements[n].top,m=k+g.snapElements[n].height;if(q-a=n&&c<=q||h>=n&&h<=q||cq)&&(f>= -i&&f<=j||a>=i&&a<=j||fj);default:return false}};b.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(d,e){var g=b.ui.ddmanager.droppables[d.options.scope]||[],f=e?e.type:null,a=(d.currentItem||d.element).find(":data(droppable)").andSelf(),c=0;a:for(;c
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=f.handles||(!b(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var a=this.handles.split(",");this.handles={};for(var c=0;c
    ');/sw|se|ne|nw/.test(h)&&i.css({zIndex:++f.zIndex});"se"==h&&i.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[h]=".ui-resizable-"+h;this.element.append(i)}}this._renderAxis=function(j){j=j||this.element;for(var n in this.handles){if(this.handles[n].constructor== -String)this.handles[n]=b(this.handles[n],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var q=b(this.handles[n],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(n)?q.outerHeight():q.outerWidth();q=["padding",/ne|nw|n/.test(n)?"Top":/se|sw|s/.test(n)?"Bottom":/^e$/.test(n)?"Right":"Left"].join("");j.css(q,l);this._proportionallyResize()}b(this.handles[n])}};this._renderAxis(this.element);this._handles=b(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!g.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);g.axis=j&&j[1]?j[1]:"se"}});if(f.autoHide){this._handles.hide();b(this.element).addClass("ui-resizable-autohide").hover(function(){b(this).removeClass("ui-resizable-autohide");g._handles.show()},function(){if(!g.resizing){b(this).addClass("ui-resizable-autohide");g._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var g=function(a){b(a).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; -if(this.elementIsWrapper){g(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);g(this.originalElement);return this},_mouseCapture:function(g){var f=false;for(var a in this.handles)if(b(this.handles[a])[0]==g.target)f=true;return!this.options.disabled&&f},_mouseStart:function(g){var f=this.options,a=this.element.position(), -c=this.element;this.resizing=true;this.documentScroll={top:b(document).scrollTop(),left:b(document).scrollLeft()};if(c.is(".ui-draggable")||/absolute/.test(c.css("position")))c.css({position:"absolute",top:a.top,left:a.left});b.browser.opera&&/relative/.test(c.css("position"))&&c.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();a=d(this.helper.css("left"));var h=d(this.helper.css("top"));if(f.containment){a+=b(f.containment).scrollLeft()||0;h+=b(f.containment).scrollTop()||0}this.offset= -this.helper.offset();this.position={left:a,top:h};this.size=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.originalSize=this._helper?{width:c.outerWidth(),height:c.outerHeight()}:{width:c.width(),height:c.height()};this.originalPosition={left:a,top:h};this.sizeDiff={width:c.outerWidth()-c.width(),height:c.outerHeight()-c.height()};this.originalMousePosition={left:g.pageX,top:g.pageY};this.aspectRatio=typeof f.aspectRatio=="number"?f.aspectRatio: -this.originalSize.width/this.originalSize.height||1;f=b(".ui-resizable-"+this.axis).css("cursor");b("body").css("cursor",f=="auto"?this.axis+"-resize":f);c.addClass("ui-resizable-resizing");this._propagate("start",g);return true},_mouseDrag:function(g){var f=this.helper,a=this.originalMousePosition,c=this._change[this.axis];if(!c)return false;a=c.apply(this,[g,g.pageX-a.left||0,g.pageY-a.top||0]);if(this._aspectRatio||g.shiftKey)a=this._updateRatio(a,g);a=this._respectSize(a,g);this._propagate("resize", -g);f.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(a);this._trigger("resize",g,this.ui());return false},_mouseStop:function(g){this.resizing=false;var f=this.options,a=this;if(this._helper){var c=this._proportionallyResizeElements,h=c.length&&/textarea/i.test(c[0].nodeName);c=h&&b.ui.hasScroll(c[0],"left")?0:a.sizeDiff.height; -h=h?0:a.sizeDiff.width;h={width:a.helper.width()-h,height:a.helper.height()-c};c=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var i=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;f.animate||this.element.css(b.extend(h,{top:i,left:c}));a.helper.height(a.size.height);a.helper.width(a.size.width);this._helper&&!f.animate&&this._proportionallyResize()}b("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing"); -this._propagate("stop",g);this._helper&&this.helper.remove();return false},_updateCache:function(g){this.offset=this.helper.offset();if(e(g.left))this.position.left=g.left;if(e(g.top))this.position.top=g.top;if(e(g.height))this.size.height=g.height;if(e(g.width))this.size.width=g.width},_updateRatio:function(g){var f=this.position,a=this.size,c=this.axis;if(g.height)g.width=a.height*this.aspectRatio;else if(g.width)g.height=a.width/this.aspectRatio;if(c=="sw"){g.left=f.left+(a.width-g.width);g.top= -null}if(c=="nw"){g.top=f.top+(a.height-g.height);g.left=f.left+(a.width-g.width)}return g},_respectSize:function(g){var f=this.options,a=this.axis,c=e(g.width)&&f.maxWidth&&f.maxWidthg.width,j=e(g.height)&&f.minHeight&&f.minHeight>g.height;if(i)g.width=f.minWidth;if(j)g.height=f.minHeight;if(c)g.width=f.maxWidth;if(h)g.height=f.maxHeight;var n=this.originalPosition.left+this.originalSize.width,q=this.position.top+ -this.size.height,l=/sw|nw|w/.test(a);a=/nw|ne|n/.test(a);if(i&&l)g.left=n-f.minWidth;if(c&&l)g.left=n-f.maxWidth;if(j&&a)g.top=q-f.minHeight;if(h&&a)g.top=q-f.maxHeight;if((f=!g.width&&!g.height)&&!g.left&&g.top)g.top=null;else if(f&&!g.top&&g.left)g.left=null;return g},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var g=this.helper||this.element,f=0;f
    ');var f=b.browser.msie&&b.browser.version<7,a=f?1:0;f=f?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-a+"px",top:this.elementOffset.top-a+"px",zIndex:++g.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(g, -f){return{width:this.originalSize.width+f}},w:function(g,f){return{left:this.originalPosition.left+f,width:this.originalSize.width-f}},n:function(g,f,a){return{top:this.originalPosition.top+a,height:this.originalSize.height-a}},s:function(g,f,a){return{height:this.originalSize.height+a}},se:function(g,f,a){return b.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[g,f,a]))},sw:function(g,f,a){return b.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[g,f, -a]))},ne:function(g,f,a){return b.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[g,f,a]))},nw:function(g,f,a){return b.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[g,f,a]))}},_propagate:function(g,f){b.ui.plugin.call(this,g,[f,this.ui()]);g!="resize"&&this._trigger(g,f,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize, -originalPosition:this.originalPosition}}});b.extend(b.ui.resizable,{version:"1.8.10"});b.ui.plugin.add("resizable","alsoResize",{start:function(){var g=b(this).data("resizable").options,f=function(a){b(a).each(function(){var c=b(this);c.data("resizable-alsoresize",{width:parseInt(c.width(),10),height:parseInt(c.height(),10),left:parseInt(c.css("left"),10),top:parseInt(c.css("top"),10),position:c.css("position")})})};if(typeof g.alsoResize=="object"&&!g.alsoResize.parentNode)if(g.alsoResize.length){g.alsoResize= -g.alsoResize[0];f(g.alsoResize)}else b.each(g.alsoResize,function(a){f(a)});else f(g.alsoResize)},resize:function(g,f){var a=b(this).data("resizable");g=a.options;var c=a.originalSize,h=a.originalPosition,i={height:a.size.height-c.height||0,width:a.size.width-c.width||0,top:a.position.top-h.top||0,left:a.position.left-h.left||0},j=function(n,q){b(n).each(function(){var l=b(this),k=b(this).data("resizable-alsoresize"),m={},o=q&&q.length?q:l.parents(f.originalElement[0]).length?["width","height"]:["width", -"height","top","left"];b.each(o,function(p,s){if((p=(k[s]||0)+(i[s]||0))&&p>=0)m[s]=p||null});if(b.browser.opera&&/relative/.test(l.css("position"))){a._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(m)})};typeof g.alsoResize=="object"&&!g.alsoResize.nodeType?b.each(g.alsoResize,function(n,q){j(n,q)}):j(g.alsoResize)},stop:function(){var g=b(this).data("resizable"),f=g.options,a=function(c){b(c).each(function(){var h=b(this);h.css({position:h.data("resizable-alsoresize").position})})}; -if(g._revertToRelativePosition){g._revertToRelativePosition=false;typeof f.alsoResize=="object"&&!f.alsoResize.nodeType?b.each(f.alsoResize,function(c){a(c)}):a(f.alsoResize)}b(this).removeData("resizable-alsoresize")}});b.ui.plugin.add("resizable","animate",{stop:function(g){var f=b(this).data("resizable"),a=f.options,c=f._proportionallyResizeElements,h=c.length&&/textarea/i.test(c[0].nodeName),i=h&&b.ui.hasScroll(c[0],"left")?0:f.sizeDiff.height;h={width:f.size.width-(h?0:f.sizeDiff.width),height:f.size.height- -i};i=parseInt(f.element.css("left"),10)+(f.position.left-f.originalPosition.left)||null;var j=parseInt(f.element.css("top"),10)+(f.position.top-f.originalPosition.top)||null;f.element.animate(b.extend(h,j&&i?{top:j,left:i}:{}),{duration:a.animateDuration,easing:a.animateEasing,step:function(){var n={width:parseInt(f.element.css("width"),10),height:parseInt(f.element.css("height"),10),top:parseInt(f.element.css("top"),10),left:parseInt(f.element.css("left"),10)};c&&c.length&&b(c[0]).css({width:n.width, -height:n.height});f._updateCache(n);f._propagate("resize",g)}})}});b.ui.plugin.add("resizable","containment",{start:function(){var g=b(this).data("resizable"),f=g.element,a=g.options.containment;if(f=a instanceof b?a.get(0):/parent/.test(a)?f.parent().get(0):a){g.containerElement=b(f);if(/document/.test(a)||a==document){g.containerOffset={left:0,top:0};g.containerPosition={left:0,top:0};g.parentData={element:b(document),left:0,top:0,width:b(document).width(),height:b(document).height()||document.body.parentNode.scrollHeight}}else{var c= -b(f),h=[];b(["Top","Right","Left","Bottom"]).each(function(n,q){h[n]=d(c.css("padding"+q))});g.containerOffset=c.offset();g.containerPosition=c.position();g.containerSize={height:c.innerHeight()-h[3],width:c.innerWidth()-h[1]};a=g.containerOffset;var i=g.containerSize.height,j=g.containerSize.width;j=b.ui.hasScroll(f,"left")?f.scrollWidth:j;i=b.ui.hasScroll(f)?f.scrollHeight:i;g.parentData={element:f,left:a.left,top:a.top,width:j,height:i}}}},resize:function(g){var f=b(this).data("resizable"),a=f.options, -c=f.containerOffset,h=f.position;g=f._aspectRatio||g.shiftKey;var i={top:0,left:0},j=f.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))i=c;if(h.left<(f._helper?c.left:0)){f.size.width+=f._helper?f.position.left-c.left:f.position.left-i.left;if(g)f.size.height=f.size.width/a.aspectRatio;f.position.left=a.helper?c.left:0}if(h.top<(f._helper?c.top:0)){f.size.height+=f._helper?f.position.top-c.top:f.position.top;if(g)f.size.width=f.size.height*a.aspectRatio;f.position.top=f._helper? -c.top:0}f.offset.left=f.parentData.left+f.position.left;f.offset.top=f.parentData.top+f.position.top;a=Math.abs((f._helper?f.offset.left-i.left:f.offset.left-i.left)+f.sizeDiff.width);c=Math.abs((f._helper?f.offset.top-i.top:f.offset.top-c.top)+f.sizeDiff.height);h=f.containerElement.get(0)==f.element.parent().get(0);i=/relative|absolute/.test(f.containerElement.css("position"));if(h&&i)a-=f.parentData.left;if(a+f.size.width>=f.parentData.width){f.size.width=f.parentData.width-a;if(g)f.size.height= -f.size.width/f.aspectRatio}if(c+f.size.height>=f.parentData.height){f.size.height=f.parentData.height-c;if(g)f.size.width=f.size.height*f.aspectRatio}},stop:function(){var g=b(this).data("resizable"),f=g.options,a=g.containerOffset,c=g.containerPosition,h=g.containerElement,i=b(g.helper),j=i.offset(),n=i.outerWidth()-g.sizeDiff.width;i=i.outerHeight()-g.sizeDiff.height;g._helper&&!f.animate&&/relative/.test(h.css("position"))&&b(this).css({left:j.left-c.left-a.left,width:n,height:i});g._helper&&!f.animate&& -/static/.test(h.css("position"))&&b(this).css({left:j.left-c.left-a.left,width:n,height:i})}});b.ui.plugin.add("resizable","ghost",{start:function(){var g=b(this).data("resizable"),f=g.options,a=g.size;g.ghost=g.originalElement.clone();g.ghost.css({opacity:0.25,display:"block",position:"relative",height:a.height,width:a.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof f.ghost=="string"?f.ghost:"");g.ghost.appendTo(g.helper)},resize:function(){var g=b(this).data("resizable"); -g.ghost&&g.ghost.css({position:"relative",height:g.size.height,width:g.size.width})},stop:function(){var g=b(this).data("resizable");g.ghost&&g.helper&&g.helper.get(0).removeChild(g.ghost.get(0))}});b.ui.plugin.add("resizable","grid",{resize:function(){var g=b(this).data("resizable"),f=g.options,a=g.size,c=g.originalSize,h=g.originalPosition,i=g.axis;f.grid=typeof f.grid=="number"?[f.grid,f.grid]:f.grid;var j=Math.round((a.width-c.width)/(f.grid[0]||1))*(f.grid[0]||1);f=Math.round((a.height-c.height)/ -(f.grid[1]||1))*(f.grid[1]||1);if(/^(se|s|e)$/.test(i)){g.size.width=c.width+j;g.size.height=c.height+f}else if(/^(ne)$/.test(i)){g.size.width=c.width+j;g.size.height=c.height+f;g.position.top=h.top-f}else{if(/^(sw)$/.test(i)){g.size.width=c.width+j;g.size.height=c.height+f}else{g.size.width=c.width+j;g.size.height=c.height+f;g.position.top=h.top-f}g.position.left=h.left-j}}});var d=function(g){return parseInt(g,10)||0},e=function(g){return!isNaN(parseInt(g,10))}})(jQuery); -(function(b){b.widget("ui.selectable",b.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var d=this;this.element.addClass("ui-selectable");this.dragged=false;var e;this.refresh=function(){e=b(d.options.filter,d.element[0]);e.each(function(){var g=b(this),f=g.offset();b.data(this,"selectable-item",{element:this,$element:g,left:f.left,top:f.top,right:f.left+g.outerWidth(),bottom:f.top+g.outerHeight(),startselected:false,selected:g.hasClass("ui-selected"), -selecting:g.hasClass("ui-selecting"),unselecting:g.hasClass("ui-unselecting")})})};this.refresh();this.selectees=e.addClass("ui-selectee");this._mouseInit();this.helper=b("
    ")},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(d){var e=this;this.opos=[d.pageX, -d.pageY];if(!this.options.disabled){var g=this.options;this.selectees=b(g.filter,this.element[0]);this._trigger("start",d);b(g.appendTo).append(this.helper);this.helper.css({left:d.clientX,top:d.clientY,width:0,height:0});g.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var f=b.data(this,"selectable-item");f.startselected=true;if(!d.metaKey){f.$element.removeClass("ui-selected");f.selected=false;f.$element.addClass("ui-unselecting");f.unselecting=true;e._trigger("unselecting", -d,{unselecting:f.element})}});b(d.target).parents().andSelf().each(function(){var f=b.data(this,"selectable-item");if(f){var a=!d.metaKey||!f.$element.hasClass("ui-selected");f.$element.removeClass(a?"ui-unselecting":"ui-selected").addClass(a?"ui-selecting":"ui-unselecting");f.unselecting=!a;f.selecting=a;(f.selected=a)?e._trigger("selecting",d,{selecting:f.element}):e._trigger("unselecting",d,{unselecting:f.element});return false}})}},_mouseDrag:function(d){var e=this;this.dragged=true;if(!this.options.disabled){var g= -this.options,f=this.opos[0],a=this.opos[1],c=d.pageX,h=d.pageY;if(f>c){var i=c;c=f;f=i}if(a>h){i=h;h=a;a=i}this.helper.css({left:f,top:a,width:c-f,height:h-a});this.selectees.each(function(){var j=b.data(this,"selectable-item");if(!(!j||j.element==e.element[0])){var n=false;if(g.tolerance=="touch")n=!(j.left>c||j.righth||j.bottomf&&j.righta&&j.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):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 d=this.items.length-1;d>=0;d--)this.items[d].item.removeData("sortable-item");return this},_setOption:function(d,e){if(d==="disabled"){this.options[d]=e;this.widget()[e?"addClass":"removeClass"]("ui-sortable-disabled")}else b.Widget.prototype._setOption.apply(this, -arguments)},_mouseCapture:function(d,e){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(d);var g=null,f=this;b(d.target).parents().each(function(){if(b.data(this,"sortable-item")==f){g=b(this);return false}});if(b.data(d.target,"sortable-item")==f)g=b(d.target);if(!g)return false;if(this.options.handle&&!e){var a=false;b(this.options.handle,g).find("*").andSelf().each(function(){if(this==d.target)a=true});if(!a)return false}this.currentItem= -g;this._removeCurrentsFromItems();return true},_mouseStart:function(d,e,g){e=this.options;var f=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(d);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");b.extend(this.offset, -{click:{left:d.pageX-this.offset.left,top:d.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(d);this.originalPageX=d.pageX;this.originalPageY=d.pageY;e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();e.containment&&this._setContainment(); -if(e.cursor){if(b("body").css("cursor"))this._storedCursor=b("body").css("cursor");b("body").css("cursor",e.cursor)}if(e.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",e.opacity)}if(e.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",e.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", -d,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!g)for(g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",d,f._uiHash(this));if(b.ui.ddmanager)b.ui.ddmanager.current=this;b.ui.ddmanager&&!e.dropBehaviour&&b.ui.ddmanager.prepareOffsets(this,d);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(d);return true},_mouseDrag:function(d){this.position=this._generatePosition(d);this.positionAbs=this._convertPositionTo("absolute"); -if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var e=this.options,g=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-d.pageY=0;e--){g=this.items[e];var f=g.item[0],a=this._intersectsWithPointer(g);if(a)if(f!=this.currentItem[0]&&this.placeholder[a==1?"next":"prev"]()[0]!=f&&!b.ui.contains(this.placeholder[0],f)&&(this.options.type=="semi-dynamic"?!b.ui.contains(this.element[0],f):true)){this.direction=a==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(g))this._rearrange(d, -g);else break;this._trigger("change",d,this._uiHash());break}}this._contactContainers(d);b.ui.ddmanager&&b.ui.ddmanager.drag(this,d);this._trigger("sort",d,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,e){if(d){b.ui.ddmanager&&!this.options.dropBehaviour&&b.ui.ddmanager.drop(this,d);if(this.options.revert){var g=this;e=g.placeholder.offset();g.reverting=true;b(this.helper).animate({left:e.left-this.offset.parent.left-g.margins.left+(this.offsetParent[0]== -document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-g.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){g._clear(d)})}else this._clear(d,e);return false}},cancel:function(){var d=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length- -1;e>=0;e--){this.containers[e]._trigger("deactivate",null,d._uiHash(this));if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",null,d._uiHash(this));this.containers[e].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();b.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null}); -this.domPosition.prev?b(this.domPosition.prev).after(this.currentItem):b(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(d){var e=this._getItemsAsjQuery(d&&d.connected),g=[];d=d||{};b(e).each(function(){var f=(b(d.item||this).attr(d.attribute||"id")||"").match(d.expression||/(.+)[-=_](.+)/);if(f)g.push((d.key||f[1]+"[]")+"="+(d.key&&d.expression?f[1]:f[2]))});!g.length&&d.key&&g.push(d.key+"=");return g.join("&")},toArray:function(d){var e=this._getItemsAsjQuery(d&& -d.connected),g=[];d=d||{};e.each(function(){g.push(b(d.item||this).attr(d.attribute||"id")||"")});return g},_intersectsWith:function(d){var e=this.positionAbs.left,g=e+this.helperProportions.width,f=this.positionAbs.top,a=f+this.helperProportions.height,c=d.left,h=c+d.width,i=d.top,j=i+d.height,n=this.offset.click.top,q=this.offset.click.left;n=f+n>i&&f+nc&&e+qd[this.floating?"width":"height"]?n:c0?"down":"up")},_getDragHorizontalDirection:function(){var d=this.positionAbs.left-this.lastPositionAbs.left;return d!=0&&(d>0?"right":"left")},refresh:function(d){this._refreshItems(d);this.refreshPositions();return this},_connectWith:function(){var d=this.options;return d.connectWith.constructor==String?[d.connectWith]:d.connectWith},_getItemsAsjQuery:function(d){var e=[],g=[],f=this._connectWith();if(f&&d)for(d=f.length-1;d>=0;d--)for(var a=b(f[d]),c=a.length-1;c>=0;c--){var h= -b.data(a[c],"sortable");if(h&&h!=this&&!h.options.disabled)g.push([b.isFunction(h.options.items)?h.options.items.call(h.element):b(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}g.push([b.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):b(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(d=g.length-1;d>=0;d--)g[d][0].each(function(){e.push(this)}); -return b(e)},_removeCurrentsFromItems:function(){for(var d=this.currentItem.find(":data(sortable-item)"),e=0;e=0;a--)for(var c= -b(f[a]),h=c.length-1;h>=0;h--){var i=b.data(c[h],"sortable");if(i&&i!=this&&!i.options.disabled){g.push([b.isFunction(i.options.items)?i.options.items.call(i.element[0],d,{item:this.currentItem}):b(i.options.items,i.element),i]);this.containers.push(i)}}for(a=g.length-1;a>=0;a--){d=g[a][1];f=g[a][0];h=0;for(c=f.length;h=0;e--){var g=this.items[e],f=this.options.toleranceElement?b(this.options.toleranceElement,g.item):g.item;if(!d){g.width=f.outerWidth();g.height=f.outerHeight()}f=f.offset();g.left=f.left;g.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(e=this.containers.length-1;e>=0;e--){f=this.containers[e].element.offset();this.containers[e].containerCache.left=f.left;this.containers[e].containerCache.top= -f.top;this.containers[e].containerCache.width=this.containers[e].element.outerWidth();this.containers[e].containerCache.height=this.containers[e].element.outerHeight()}return this},_createPlaceholder:function(d){var e=d||this,g=e.options;if(!g.placeholder||g.placeholder.constructor==String){var f=g.placeholder;g.placeholder={element:function(){var a=b(document.createElement(e.currentItem[0].nodeName)).addClass(f||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0]; -if(!f)a.style.visibility="hidden";return a},update:function(a,c){if(!(f&&!g.forcePlaceholderSize)){c.height()||c.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10));c.width()||c.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10))}}}}e.placeholder=b(g.placeholder.element.call(e.element,e.currentItem));e.currentItem.after(e.placeholder); -g.placeholder.update(e,e.placeholder)},_contactContainers:function(d){for(var e=null,g=null,f=this.containers.length-1;f>=0;f--)if(!b.ui.contains(this.currentItem[0],this.containers[f].element[0]))if(this._intersectsWith(this.containers[f].containerCache)){if(!(e&&b.ui.contains(this.containers[f].element[0],e.element[0]))){e=this.containers[f];g=f}}else if(this.containers[f].containerCache.over){this.containers[f]._trigger("out",d,this._uiHash(this));this.containers[f].containerCache.over=0}if(e)if(this.containers.length=== -1){this.containers[g]._trigger("over",d,this._uiHash(this));this.containers[g].containerCache.over=1}else if(this.currentContainer!=this.containers[g]){e=1E4;f=null;for(var a=this.positionAbs[this.containers[g].floating?"left":"top"],c=this.items.length-1;c>=0;c--)if(b.ui.contains(this.containers[g].element[0],this.items[c].item[0])){var h=this.items[c][this.containers[g].floating?"left":"top"];if(Math.abs(h-a)this.containment[2])a=this.containment[2]+this.offset.click.left;if(d.pageY-this.offset.click.top>this.containment[3])c=this.containment[3]+this.offset.click.top}if(e.grid){c=this.originalPageY+Math.round((c-this.originalPageY)/e.grid[1])*e.grid[1];c=this.containment?!(c-this.offset.click.top< -this.containment[1]||c-this.offset.click.top>this.containment[3])?c:!(c-this.offset.click.topthis.containment[2])?a:!(a-this.offset.click.left=0;f--)if(b.ui.contains(this.containers[f].element[0], -this.currentItem[0])&&!e){g.push(function(a){return function(c){a._trigger("receive",c,this._uiHash(this))}}.call(this,this.containers[f]));g.push(function(a){return function(c){a._trigger("update",c,this._uiHash(this))}}.call(this,this.containers[f]))}}for(f=this.containers.length-1;f>=0;f--){e||g.push(function(a){return function(c){a._trigger("deactivate",c,this._uiHash(this))}}.call(this,this.containers[f]));if(this.containers[f].containerCache.over){g.push(function(a){return function(c){a._trigger("out", -c,this._uiHash(this))}}.call(this,this.containers[f]));this.containers[f].containerCache.over=0}}this._storedCursor&&b("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(f=0;f
    ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent", -border:"none",margin:0,padding:0});l.wrap(m);m=l.parent();if(l.css("position")=="static"){m.css({position:"relative"});l.css({position:"relative"})}else{b.extend(k,{position:l.css("position"),zIndex:l.css("z-index")});b.each(["top","left","bottom","right"],function(o,p){k[p]=l.css(p);if(isNaN(parseInt(k[p],10)))k[p]="auto"});l.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}return m.css(k).show()},removeWrapper:function(l){if(l.parent().is(".ui-effects-wrapper"))return l.parent().replaceWith(l); -return l},setTransition:function(l,k,m,o){o=o||{};b.each(k,function(p,s){unit=l.cssUnit(s);if(unit[0]>0)o[s]=unit[0]*m+unit[1]});return o}});b.fn.extend({effect:function(l){var k=h.apply(this,arguments),m={options:k[1],duration:k[2],callback:k[3]};k=m.options.mode;var o=b.effects[l];if(b.fx.off||!o)return k?this[k](m.duration,m.callback):this.each(function(){m.callback&&m.callback.call(this)});return o.call(this,m)},_show:b.fn.show,show:function(l){if(i(l))return this._show.apply(this,arguments); -else{var k=h.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:b.fn.hide,hide:function(l){if(i(l))return this._hide.apply(this,arguments);else{var k=h.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:b.fn.toggle,toggle:function(l){if(i(l)||typeof l==="boolean"||b.isFunction(l))return this.__toggle.apply(this,arguments);else{var k=h.apply(this,arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(l){var k=this.css(l), -m=[];b.each(["em","px","%","pt"],function(o,p){if(k.indexOf(p)>0)m=[parseFloat(k),p]});return m}});b.easing.jswing=b.easing.swing;b.extend(b.easing,{def:"easeOutQuad",swing:function(l,k,m,o,p){return b.easing[b.easing.def](l,k,m,o,p)},easeInQuad:function(l,k,m,o,p){return o*(k/=p)*k+m},easeOutQuad:function(l,k,m,o,p){return-o*(k/=p)*(k-2)+m},easeInOutQuad:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k+m;return-o/2*(--k*(k-2)-1)+m},easeInCubic:function(l,k,m,o,p){return o*(k/=p)*k*k+m},easeOutCubic:function(l, -k,m,o,p){return o*((k=k/p-1)*k*k+1)+m},easeInOutCubic:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k*k+m;return o/2*((k-=2)*k*k+2)+m},easeInQuart:function(l,k,m,o,p){return o*(k/=p)*k*k*k+m},easeOutQuart:function(l,k,m,o,p){return-o*((k=k/p-1)*k*k*k-1)+m},easeInOutQuart:function(l,k,m,o,p){if((k/=p/2)<1)return o/2*k*k*k*k+m;return-o/2*((k-=2)*k*k*k-2)+m},easeInQuint:function(l,k,m,o,p){return o*(k/=p)*k*k*k*k+m},easeOutQuint:function(l,k,m,o,p){return o*((k=k/p-1)*k*k*k*k+1)+m},easeInOutQuint:function(l, -k,m,o,p){if((k/=p/2)<1)return o/2*k*k*k*k*k+m;return o/2*((k-=2)*k*k*k*k+2)+m},easeInSine:function(l,k,m,o,p){return-o*Math.cos(k/p*(Math.PI/2))+o+m},easeOutSine:function(l,k,m,o,p){return o*Math.sin(k/p*(Math.PI/2))+m},easeInOutSine:function(l,k,m,o,p){return-o/2*(Math.cos(Math.PI*k/p)-1)+m},easeInExpo:function(l,k,m,o,p){return k==0?m:o*Math.pow(2,10*(k/p-1))+m},easeOutExpo:function(l,k,m,o,p){return k==p?m+o:o*(-Math.pow(2,-10*k/p)+1)+m},easeInOutExpo:function(l,k,m,o,p){if(k==0)return m;if(k== -p)return m+o;if((k/=p/2)<1)return o/2*Math.pow(2,10*(k-1))+m;return o/2*(-Math.pow(2,-10*--k)+2)+m},easeInCirc:function(l,k,m,o,p){return-o*(Math.sqrt(1-(k/=p)*k)-1)+m},easeOutCirc:function(l,k,m,o,p){return o*Math.sqrt(1-(k=k/p-1)*k)+m},easeInOutCirc:function(l,k,m,o,p){if((k/=p/2)<1)return-o/2*(Math.sqrt(1-k*k)-1)+m;return o/2*(Math.sqrt(1-(k-=2)*k)+1)+m},easeInElastic:function(l,k,m,o,p){l=1.70158;var s=0,r=o;if(k==0)return m;if((k/=p)==1)return m+o;s||(s=p*0.3);if(r
    ").css({position:"absolute",visibility:"visible",left:-j*(c/g),top:-i*(h/e)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:c/g,height:h/e,left:a.left+j*(c/g)+(d.options.mode=="show"?(j-Math.floor(g/2))*(c/g):0),top:a.top+i*(h/e)+(d.options.mode=="show"?(i-Math.floor(e/2))*(h/e):0),opacity:d.options.mode=="show"?0:1}).animate({left:a.left+j*(c/g)+(d.options.mode=="show"?0:(j-Math.floor(g/2))*(c/g)),top:a.top+ -i*(h/e)+(d.options.mode=="show"?0:(i-Math.floor(e/2))*(h/e)),opacity:d.options.mode=="show"?1:0},d.duration||500);setTimeout(function(){d.options.mode=="show"?f.css({visibility:"visible"}):f.css({visibility:"visible"}).hide();d.callback&&d.callback.apply(f[0]);f.dequeue();b("div.ui-effects-explode").remove()},d.duration||500)})}})(jQuery); -(function(b){b.effects.fade=function(d){return this.queue(function(){var e=b(this),g=b.effects.setMode(e,d.options.mode||"hide");e.animate({opacity:g},{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){d.callback&&d.callback.apply(this,arguments);e.dequeue()}})})}})(jQuery); -(function(b){b.effects.fold=function(d){return this.queue(function(){var e=b(this),g=["position","top","bottom","left","right"],f=b.effects.setMode(e,d.options.mode||"hide"),a=d.options.size||15,c=!!d.options.horizFirst,h=d.duration?d.duration/2:b.fx.speeds._default/2;b.effects.save(e,g);e.show();var i=b.effects.createWrapper(e).css({overflow:"hidden"}),j=f=="show"!=c,n=j?["width","height"]:["height","width"];j=j?[i.width(),i.height()]:[i.height(),i.width()];var q=/([0-9]+)%/.exec(a);if(q)a=parseInt(q[1], -10)/100*j[f=="hide"?0:1];if(f=="show")i.css(c?{height:0,width:a}:{height:a,width:0});c={};q={};c[n[0]]=f=="show"?j[0]:a;q[n[1]]=f=="show"?j[1]:0;i.animate(c,h,d.options.easing).animate(q,h,d.options.easing,function(){f=="hide"&&e.hide();b.effects.restore(e,g);b.effects.removeWrapper(e);d.callback&&d.callback.apply(e[0],arguments);e.dequeue()})})}})(jQuery); -(function(b){b.effects.highlight=function(d){return this.queue(function(){var e=b(this),g=["backgroundImage","backgroundColor","opacity"],f=b.effects.setMode(e,d.options.mode||"show"),a={backgroundColor:e.css("backgroundColor")};if(f=="hide")a.opacity=0;b.effects.save(e,g);e.show().css({backgroundImage:"none",backgroundColor:d.options.color||"#ffff99"}).animate(a,{queue:false,duration:d.duration,easing:d.options.easing,complete:function(){f=="hide"&&e.hide();b.effects.restore(e,g);f=="show"&&!b.support.opacity&& -this.style.removeAttribute("filter");d.callback&&d.callback.apply(this,arguments);e.dequeue()}})})}})(jQuery); -(function(b){b.effects.pulsate=function(d){return this.queue(function(){var e=b(this),g=b.effects.setMode(e,d.options.mode||"show");times=(d.options.times||5)*2-1;duration=d.duration?d.duration/2:b.fx.speeds._default/2;isVisible=e.is(":visible");animateTo=0;if(!isVisible){e.css("opacity",0).show();animateTo=1}if(g=="hide"&&isVisible||g=="show"&&!isVisible)times--;for(g=0;g').appendTo(document.body).addClass(d.options.className).css({top:f.top,left:f.left,height:e.innerHeight(),width:e.innerWidth(),position:"absolute"}).animate(g,d.duration,d.options.easing,function(){a.remove();d.callback&&d.callback.apply(e[0],arguments); -e.dequeue()})})}})(jQuery); -(function(b){b.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 d=this,e=d.options;d.running=0;d.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");d.headers= -d.element.find(e.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){e.disabled||b(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){e.disabled||b(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){e.disabled||b(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){e.disabled||b(this).removeClass("ui-state-focus")});d.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); -if(e.navigation){var g=d.element.find("a").filter(e.navigationFilter).eq(0);if(g.length){var f=g.closest(".ui-accordion-header");d.active=f.length?f:g.closest(".ui-accordion-content").prev()}}d.active=d._findActive(d.active||e.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");d.active.next().addClass("ui-accordion-content-active");d._createIcons();d.resize();d.element.attr("role","tablist");d.headers.attr("role","tab").bind("keydown.accordion", -function(a){return d._keydown(a)}).next().attr("role","tabpanel");d.headers.not(d.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();d.active.length?d.active.attr({"aria-expanded":"true",tabIndex:0}):d.headers.eq(0).attr("tabIndex",0);b.browser.safari||d.headers.find("a").attr("tabIndex",-1);e.event&&d.headers.bind(e.event.split(" ").join(".accordion ")+".accordion",function(a){d._clickHandler.call(d,a,this);a.preventDefault()})},_createIcons:function(){var d=this.options;if(d.icons){b("").addClass("ui-icon "+ -d.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var d=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); -this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var e=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(d.autoHeight||d.fillHeight)e.css("height","");return b.Widget.prototype.destroy.call(this)},_setOption:function(d,e){b.Widget.prototype._setOption.apply(this,arguments);d=="active"&&this.activate(e);if(d=="icons"){this._destroyIcons(); -e&&this._createIcons()}if(d=="disabled")this.headers.add(this.headers.next())[e?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(d){if(!(this.options.disabled||d.altKey||d.ctrlKey)){var e=b.ui.keyCode,g=this.headers.length,f=this.headers.index(d.target),a=false;switch(d.keyCode){case e.RIGHT:case e.DOWN:a=this.headers[(f+1)%g];break;case e.LEFT:case e.UP:a=this.headers[(f-1+g)%g];break;case e.SPACE:case e.ENTER:this._clickHandler({target:d.target},d.target); -d.preventDefault()}if(a){b(d.target).attr("tabIndex",-1);b(a).attr("tabIndex",0);a.focus();return false}return true}},resize:function(){var d=this.options,e;if(d.fillSpace){if(b.browser.msie){var g=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}e=this.element.parent().height();b.browser.msie&&this.element.parent().css("overflow",g);this.headers.each(function(){e-=b(this).outerHeight(true)});this.headers.next().each(function(){b(this).height(Math.max(0,e-b(this).innerHeight()+ -b(this).height()))}).css("overflow","auto")}else if(d.autoHeight){e=0;this.headers.next().each(function(){e=Math.max(e,b(this).height("").height())}).height(e)}return this},activate:function(d){this.options.active=d;d=this._findActive(d)[0];this._clickHandler({target:d},d);return this},_findActive:function(d){return d?typeof d==="number"?this.headers.filter(":eq("+d+")"):this.headers.not(this.headers.not(d)):d===false?b([]):this.headers.filter(":eq(0)")},_clickHandler:function(d,e){var g=this.options; -if(!g.disabled)if(d.target){d=b(d.currentTarget||e);e=d[0]===this.active[0];g.active=g.collapsible&&e?false:this.headers.index(d);if(!(this.running||!g.collapsible&&e)){var f=this.active;i=d.next();c=this.active.next();h={options:g,newHeader:e&&g.collapsible?b([]):d,oldHeader:this.active,newContent:e&&g.collapsible?b([]):i,oldContent:c};var a=this.headers.index(this.active[0])>this.headers.index(d[0]);this.active=e?b([]):d;this._toggle(i,c,h,e,a);f.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(g.icons.headerSelected).addClass(g.icons.header); -if(!e){d.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(g.icons.header).addClass(g.icons.headerSelected);d.next().addClass("ui-accordion-content-active")}}}else if(g.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(g.icons.headerSelected).addClass(g.icons.header);this.active.next().addClass("ui-accordion-content-active");var c=this.active.next(), -h={options:g,newHeader:b([]),oldHeader:g.active,newContent:b([]),oldContent:c},i=this.active=b([]);this._toggle(i,c,h)}},_toggle:function(d,e,g,f,a){var c=this,h=c.options;c.toShow=d;c.toHide=e;c.data=g;var i=function(){if(c)return c._completed.apply(c,arguments)};c._trigger("changestart",null,c.data);c.running=e.size()===0?d.size():e.size();if(h.animated){g={};g=h.collapsible&&f?{toShow:b([]),toHide:e,complete:i,down:a,autoHeight:h.autoHeight||h.fillSpace}:{toShow:d,toHide:e,complete:i,down:a,autoHeight:h.autoHeight|| -h.fillSpace};if(!h.proxied)h.proxied=h.animated;if(!h.proxiedDuration)h.proxiedDuration=h.duration;h.animated=b.isFunction(h.proxied)?h.proxied(g):h.proxied;h.duration=b.isFunction(h.proxiedDuration)?h.proxiedDuration(g):h.proxiedDuration;f=b.ui.accordion.animations;var j=h.duration,n=h.animated;if(n&&!f[n]&&!b.easing[n])n="slide";f[n]||(f[n]=function(q){this.slide(q,{easing:n,duration:j||700})});f[n](g)}else{if(h.collapsible&&f)d.toggle();else{e.hide();d.show()}i(true)}e.prev().attr({"aria-expanded":"false", -tabIndex:-1}).blur();d.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(d){this.running=d?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});b.extend(b.ui.accordion,{version:"1.8.10",animations:{slide:function(d,e){d= -b.extend({easing:"swing",duration:300},d,e);if(d.toHide.size())if(d.toShow.size()){var g=d.toShow.css("overflow"),f=0,a={},c={},h;e=d.toShow;h=e[0].style.width;e.width(parseInt(e.parent().width(),10)-parseInt(e.css("paddingLeft"),10)-parseInt(e.css("paddingRight"),10)-(parseInt(e.css("borderLeftWidth"),10)||0)-(parseInt(e.css("borderRightWidth"),10)||0));b.each(["height","paddingTop","paddingBottom"],function(i,j){c[j]="hide";i=(""+b.css(d.toShow[0],j)).match(/^([\d+-.]+)(.*)$/);a[j]={value:i[1], -unit:i[2]||"px"}});d.toShow.css({height:0,overflow:"hidden"}).show();d.toHide.filter(":hidden").each(d.complete).end().filter(":visible").animate(c,{step:function(i,j){if(j.prop=="height")f=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);d.toShow[0].style[j.prop]=f*a[j.prop].value+a[j.prop].unit},duration:d.duration,easing:d.easing,complete:function(){d.autoHeight||d.toShow.css("height","");d.toShow.css({width:h,overflow:g});d.complete()}})}else d.toHide.animate({height:"hide",paddingTop:"hide", -paddingBottom:"hide"},d);else d.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},d)},bounceslide:function(d){this.slide(d,{easing:d.down?"easeOutBounce":"swing",duration:d.down?1E3:200})}}})})(jQuery); -(function(b){var d=0;b.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var e=this,g=this.element[0].ownerDocument,f;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(a){if(!(e.options.disabled||e.element.attr("readonly"))){f=false;var c=b.ui.keyCode; -switch(a.keyCode){case c.PAGE_UP:e._move("previousPage",a);break;case c.PAGE_DOWN:e._move("nextPage",a);break;case c.UP:e._move("previous",a);a.preventDefault();break;case c.DOWN:e._move("next",a);a.preventDefault();break;case c.ENTER:case c.NUMPAD_ENTER:if(e.menu.active){f=true;a.preventDefault()}case c.TAB:if(!e.menu.active)return;e.menu.select(a);break;case c.ESCAPE:e.element.val(e.term);e.close(a);break;default:clearTimeout(e.searching);e.searching=setTimeout(function(){if(e.term!=e.element.val()){e.selectedItem= -null;e.search(null,a)}},e.options.delay);break}}}).bind("keypress.autocomplete",function(a){if(f){f=false;a.preventDefault()}}).bind("focus.autocomplete",function(){if(!e.options.disabled){e.selectedItem=null;e.previous=e.element.val()}}).bind("blur.autocomplete",function(a){if(!e.options.disabled){clearTimeout(e.searching);e.closing=setTimeout(function(){e.close(a);e._change(a)},150)}});this._initSource();this.response=function(){return e._response.apply(e,arguments)};this.menu=b("
      ").addClass("ui-autocomplete").appendTo(b(this.options.appendTo|| -"body",g)[0]).mousedown(function(a){var c=e.menu.element[0];b(a.target).closest(".ui-menu-item").length||setTimeout(function(){b(document).one("mousedown",function(h){h.target!==e.element[0]&&h.target!==c&&!b.ui.contains(c,h.target)&&e.close()})},1);setTimeout(function(){clearTimeout(e.closing)},13)}).menu({focus:function(a,c){c=c.item.data("item.autocomplete");false!==e._trigger("focus",a,{item:c})&&/^key/.test(a.originalEvent.type)&&e.element.val(c.value)},selected:function(a,c){var h=c.item.data("item.autocomplete"), -i=e.previous;if(e.element[0]!==g.activeElement){e.element.focus();e.previous=i;setTimeout(function(){e.previous=i;e.selectedItem=h},1)}false!==e._trigger("select",a,{item:h})&&e.element.val(h.value);e.term=e.element.val();e.close(a);e.selectedItem=h},blur:function(){e.menu.element.is(":visible")&&e.element.val()!==e.term&&e.element.val(e.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");b.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); -this.menu.element.remove();b.Widget.prototype.destroy.call(this)},_setOption:function(e,g){b.Widget.prototype._setOption.apply(this,arguments);e==="source"&&this._initSource();if(e==="appendTo")this.menu.element.appendTo(b(g||"body",this.element[0].ownerDocument)[0]);e==="disabled"&&g&&this.xhr&&this.xhr.abort()},_initSource:function(){var e=this,g,f;if(b.isArray(this.options.source)){g=this.options.source;this.source=function(a,c){c(b.ui.autocomplete.filter(g,a.term))}}else if(typeof this.options.source=== -"string"){f=this.options.source;this.source=function(a,c){e.xhr&&e.xhr.abort();e.xhr=b.ajax({url:f,data:a,dataType:"json",autocompleteRequest:++d,success:function(h){this.autocompleteRequest===d&&c(h)},error:function(){this.autocompleteRequest===d&&c([])}})}}else this.source=this.options.source},search:function(e,g){e=e!=null?e:this.element.val();this.term=this.element.val();if(e.length").data("item.autocomplete",g).append(b("").text(g.label)).appendTo(e)},_move:function(e,g){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(e)||this.menu.last()&&/^next/.test(e)){this.element.val(this.term);this.menu.deactivate()}else this.menu[e](g); -else this.search(null,g)},widget:function(){return this.menu.element}});b.extend(b.ui.autocomplete,{escapeRegex:function(e){return e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(e,g){var f=new RegExp(b.ui.autocomplete.escapeRegex(g),"i");return b.grep(e,function(a){return f.test(a.label||a.value||a)})}})})(jQuery); -(function(b){b.widget("ui.menu",{_create:function(){var d=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(e){if(b(e.target).closest(".ui-menu-item a").length){e.preventDefault();d.select(e)}});this.refresh()},refresh:function(){var d=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", --1).mouseenter(function(e){d.activate(e,b(this).parent())}).mouseleave(function(){d.deactivate()})},activate:function(d,e){this.deactivate();if(this.hasScroll()){var g=e.offset().top-this.element.offset().top,f=this.element.attr("scrollTop"),a=this.element.height();if(g<0)this.element.attr("scrollTop",f+g);else g>=a&&this.element.attr("scrollTop",f+g-a+e.height())}this.active=e.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",d,{item:e})}, -deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(d){this.move("next",".ui-menu-item:first",d)},previous:function(d){this.move("prev",".ui-menu-item:last",d)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(d,e,g){if(this.active){d=this.active[d+"All"](".ui-menu-item").eq(0); -d.length?this.activate(g,d):this.activate(g,this.element.children(e))}else this.activate(g,this.element.children(e))},nextPage:function(d){if(this.hasScroll())if(!this.active||this.last())this.activate(d,this.element.children(".ui-menu-item:first"));else{var e=this.active.offset().top,g=this.element.height(),f=this.element.children(".ui-menu-item").filter(function(){var a=b(this).offset().top-e-g+b(this).height();return a<10&&a>-10});f.length||(f=this.element.children(".ui-menu-item:last"));this.activate(d, -f)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(d){if(this.hasScroll())if(!this.active||this.first())this.activate(d,this.element.children(".ui-menu-item:last"));else{var e=this.active.offset().top,g=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var f=b(this).offset().top-e+g-b(this).height();return f<10&&f>-10});result.length||(result=this.element.children(".ui-menu-item:first")); -this.activate(d,result)}else this.activate(d,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(f.empty()).text(),c=this.options.icons,h=c.primary&&c.secondary,i=[];if(c.primary||c.secondary){i.push("ui-button-text-icon"+(h?"s":c.primary?"-primary":"-secondary"));c.primary&&f.prepend("");c.secondary&&f.append("");if(!this.options.text){i.push(h?"ui-button-icons-only":"ui-button-icon-only"); -f.removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary");this.hasTitle||f.attr("title",a)}}else i.push("ui-button-text-only");f.addClass(i.join(" "))}}});b.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(f,a){f==="disabled"&&this.buttons.button("option",f,a);b.Widget.prototype._setOption.apply(this, -arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return b(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"); -b.Widget.prototype.destroy.call(this)}})})(jQuery); -(function(b,d){function e(){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", -"Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10", -minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false};b.extend(this._defaults,this.regional[""]);this.dpDiv=b('
      ')}function g(a,c){b.extend(a,c);for(var h in c)if(c[h]== -null||c[h]==d)a[h]=c[h];return a}b.extend(b.ui,{datepicker:{version:"1.8.10"}});var f=(new Date).getTime();b.extend(e.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){g(this._defaults,a||{});return this},_attachDatepicker:function(a,c){var h=null;for(var i in this._defaults){var j=a.getAttribute("date:"+i);if(j){h=h||{};try{h[i]=eval(j)}catch(n){h[i]=j}}}i=a.nodeName.toLowerCase(); -j=i=="div"||i=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var q=this._newInst(b(a),j);q.settings=b.extend({},c||{},h||{});if(i=="input")this._connectDatepicker(a,q);else j&&this._inlineDatepicker(a,q)},_newInst:function(a,c){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:c,dpDiv:!c?this.dpDiv:b('
      ')}}, -_connectDatepicker:function(a,c){var h=b(a);c.append=b([]);c.trigger=b([]);if(!h.hasClass(this.markerClassName)){this._attachments(h,c);h.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(i,j,n){c.settings[j]=n}).bind("getData.datepicker",function(i,j){return this._get(c,j)});this._autoSize(c);b.data(a,"datepicker",c)}},_attachments:function(a,c){var h=this._get(c,"appendText"),i=this._get(c,"isRTL");c.append&& -c.append.remove();if(h){c.append=b(''+h+"");a[i?"before":"after"](c.append)}a.unbind("focus",this._showDatepicker);c.trigger&&c.trigger.remove();h=this._get(c,"showOn");if(h=="focus"||h=="both")a.focus(this._showDatepicker);if(h=="button"||h=="both"){h=this._get(c,"buttonText");var j=this._get(c,"buttonImage");c.trigger=b(this._get(c,"buttonImageOnly")?b("").addClass(this._triggerClass).attr({src:j,alt:h,title:h}):b('').addClass(this._triggerClass).html(j== -""?h:b("").attr({src:j,alt:h,title:h})));a[i?"before":"after"](c.trigger);c.trigger.click(function(){b.datepicker._datepickerShowing&&b.datepicker._lastInput==a[0]?b.datepicker._hideDatepicker():b.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var c=new Date(2009,11,20),h=this._get(a,"dateFormat");if(h.match(/[DM]/)){var i=function(j){for(var n=0,q=0,l=0;ln){n=j[l].length;q=l}return q};c.setMonth(i(this._get(a, -h.match(/MM/)?"monthNames":"monthNamesShort")));c.setDate(i(this._get(a,h.match(/DD/)?"dayNames":"dayNamesShort"))+20-c.getDay())}a.input.attr("size",this._formatDate(a,c).length)}},_inlineDatepicker:function(a,c){var h=b(a);if(!h.hasClass(this.markerClassName)){h.addClass(this.markerClassName).append(c.dpDiv).bind("setData.datepicker",function(i,j,n){c.settings[j]=n}).bind("getData.datepicker",function(i,j){return this._get(c,j)});b.data(a,"datepicker",c);this._setDate(c,this._getDefaultDate(c), -true);this._updateDatepicker(c);this._updateAlternate(c);c.dpDiv.show()}},_dialogDatepicker:function(a,c,h,i,j){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=b('');this._dialogInput.keydown(this._doKeyDown);b("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};b.data(this._dialogInput[0],"datepicker",a)}g(a.settings,i||{}); -c=c&&c.constructor==Date?this._formatDate(a,c):c;this._dialogInput.val(c);this._pos=j?j.length?j:[j.pageX,j.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=h;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); -this._showDatepicker(this._dialogInput[0]);b.blockUI&&b.blockUI(this.dpDiv);b.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var c=b(a),h=b.data(a,"datepicker");if(c.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();b.removeData(a,"datepicker");if(i=="input"){h.append.remove();h.trigger.remove();c.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", -this._doKeyUp)}else if(i=="div"||i=="span")c.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var c=b(a),h=b.data(a,"datepicker");if(c.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=false;h.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(i=="div"||i=="span")c.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs, -function(j){return j==a?null:j})}},_disableDatepicker:function(a){var c=b(a),h=b.data(a,"datepicker");if(c.hasClass(this.markerClassName)){var i=a.nodeName.toLowerCase();if(i=="input"){a.disabled=true;h.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(i=="div"||i=="span")c.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=b.map(this._disabledInputs,function(j){return j==a?null: -j});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var c=0;c-1}},_doKeyUp:function(a){a=b.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(b.datepicker.parseDate(b.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,b.datepicker._getFormatConfig(a))){b.datepicker._setDateFromField(a);b.datepicker._updateAlternate(a);b.datepicker._updateDatepicker(a)}}catch(c){b.datepicker.log(c)}return true}, -_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=b("input",a.parentNode)[0];if(!(b.datepicker._isDisabledDatepicker(a)||b.datepicker._lastInput==a)){var c=b.datepicker._getInst(a);b.datepicker._curInst&&b.datepicker._curInst!=c&&b.datepicker._curInst.dpDiv.stop(true,true);var h=b.datepicker._get(c,"beforeShow");g(c.settings,h?h.apply(a,[a,c]):{});c.lastVal=null;b.datepicker._lastInput=a;b.datepicker._setDateFromField(c);if(b.datepicker._inDialog)a.value="";if(!b.datepicker._pos){b.datepicker._pos= -b.datepicker._findPos(a);b.datepicker._pos[1]+=a.offsetHeight}var i=false;b(a).parents().each(function(){i|=b(this).css("position")=="fixed";return!i});if(i&&b.browser.opera){b.datepicker._pos[0]-=document.documentElement.scrollLeft;b.datepicker._pos[1]-=document.documentElement.scrollTop}h={left:b.datepicker._pos[0],top:b.datepicker._pos[1]};b.datepicker._pos=null;c.dpDiv.empty();c.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});b.datepicker._updateDatepicker(c);h=b.datepicker._checkOffset(c, -h,i);c.dpDiv.css({position:b.datepicker._inDialog&&b.blockUI?"static":i?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"});if(!c.inline){h=b.datepicker._get(c,"showAnim");var j=b.datepicker._get(c,"duration"),n=function(){b.datepicker._datepickerShowing=true;var q=c.dpDiv.find("iframe.ui-datepicker-cover");if(q.length){var l=b.datepicker._getBorders(c.dpDiv);q.css({left:-l[0],top:-l[1],width:c.dpDiv.outerWidth(),height:c.dpDiv.outerHeight()})}};c.dpDiv.zIndex(b(a).zIndex()+1);b.effects&& -b.effects[h]?c.dpDiv.show(h,b.datepicker._get(c,"showOptions"),j,n):c.dpDiv[h||"show"](h?j:null,n);if(!h||!j)n();c.input.is(":visible")&&!c.input.is(":disabled")&&c.input.focus();b.datepicker._curInst=c}}},_updateDatepicker:function(a){var c=this,h=b.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var i=a.dpDiv.find("iframe.ui-datepicker-cover");i.length&&i.css({left:-h[0],top:-h[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout", -function(){b(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&b(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&b(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!c._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){b(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");b(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!= --1&&b(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&b(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();h=this._getNumberOfMonths(a);i=h[1];i>1?a.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(h[0]!=1||h[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a, -"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==b.datepicker._curInst&&b.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var j=a.yearshtml;setTimeout(function(){j===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);j=a.yearshtml=null},0)}},_getBorders:function(a){var c=function(h){return{thin:1,medium:2,thick:3}[h]||h};return[parseFloat(c(a.css("border-left-width"))), -parseFloat(c(a.css("border-top-width")))]},_checkOffset:function(a,c,h){var i=a.dpDiv.outerWidth(),j=a.dpDiv.outerHeight(),n=a.input?a.input.outerWidth():0,q=a.input?a.input.outerHeight():0,l=document.documentElement.clientWidth+b(document).scrollLeft(),k=document.documentElement.clientHeight+b(document).scrollTop();c.left-=this._get(a,"isRTL")?i-n:0;c.left-=h&&c.left==a.input.offset().left?b(document).scrollLeft():0;c.top-=h&&c.top==a.input.offset().top+q?b(document).scrollTop():0;c.left-=Math.min(c.left, -c.left+i>l&&l>i?Math.abs(c.left+i-l):0);c.top-=Math.min(c.top,c.top+j>k&&k>j?Math.abs(j+q):0);return c},_findPos:function(a){for(var c=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||b.expr.filters.hidden(a));)a=a[c?"previousSibling":"nextSibling"];a=b(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var c=this._curInst;if(!(!c||a&&c!=b.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(c,"showAnim");var h=this._get(c,"duration"),i=function(){b.datepicker._tidyDialog(c); -this._curInst=null};b.effects&&b.effects[a]?c.dpDiv.hide(a,b.datepicker._get(c,"showOptions"),h,i):c.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?h:null,i);a||i();if(a=this._get(c,"onClose"))a.apply(c.input?c.input[0]:null,[c.input?c.input.val():"",c]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(b.blockUI){b.unblockUI();b("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, -_checkExternalClick:function(a){if(b.datepicker._curInst){a=b(a.target);a[0].id!=b.datepicker._mainDivId&&a.parents("#"+b.datepicker._mainDivId).length==0&&!a.hasClass(b.datepicker.markerClassName)&&!a.hasClass(b.datepicker._triggerClass)&&b.datepicker._datepickerShowing&&!(b.datepicker._inDialog&&b.blockUI)&&b.datepicker._hideDatepicker()}},_adjustDate:function(a,c,h){a=b(a);var i=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(i,c+(h=="M"?this._get(i,"showCurrentAtPos"): -0),h);this._updateDatepicker(i)}},_gotoToday:function(a){a=b(a);var c=this._getInst(a[0]);if(this._get(c,"gotoCurrent")&&c.currentDay){c.selectedDay=c.currentDay;c.drawMonth=c.selectedMonth=c.currentMonth;c.drawYear=c.selectedYear=c.currentYear}else{var h=new Date;c.selectedDay=h.getDate();c.drawMonth=c.selectedMonth=h.getMonth();c.drawYear=c.selectedYear=h.getFullYear()}this._notifyChange(c);this._adjustDate(a)},_selectMonthYear:function(a,c,h){a=b(a);var i=this._getInst(a[0]);i._selectingMonthYear= -false;i["selected"+(h=="M"?"Month":"Year")]=i["draw"+(h=="M"?"Month":"Year")]=parseInt(c.options[c.selectedIndex].value,10);this._notifyChange(i);this._adjustDate(a)},_clickMonthYear:function(a){var c=this._getInst(b(a)[0]);c.input&&c._selectingMonthYear&&setTimeout(function(){c.input.focus()},0);c._selectingMonthYear=!c._selectingMonthYear},_selectDay:function(a,c,h,i){var j=b(a);if(!(b(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(j[0]))){j=this._getInst(j[0]);j.selectedDay=j.currentDay= -b("a",i).html();j.selectedMonth=j.currentMonth=c;j.selectedYear=j.currentYear=h;this._selectDate(a,this._formatDate(j,j.currentDay,j.currentMonth,j.currentYear))}},_clearDate:function(a){a=b(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,c){a=this._getInst(b(a)[0]);c=c!=null?c:this._formatDate(a);a.input&&a.input.val(c);this._updateAlternate(a);var h=this._get(a,"onSelect");if(h)h.apply(a.input?a.input[0]:null,[c,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a); -else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var c=this._get(a,"altField");if(c){var h=this._get(a,"altFormat")||this._get(a,"dateFormat"),i=this._getDate(a),j=this.formatDate(h,i,this._getFormatConfig(a));b(c).each(function(){b(this).val(j)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var c= -a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((c-a)/864E5)/7)+1},parseDate:function(a,c,h){if(a==null||c==null)throw"Invalid arguments";c=typeof c=="object"?c.toString():c+"";if(c=="")return null;var i=(h?h.shortYearCutoff:null)||this._defaults.shortYearCutoff;i=typeof i!="string"?i:(new Date).getFullYear()%100+parseInt(i,10);for(var j=(h?h.dayNamesShort:null)||this._defaults.dayNamesShort,n=(h?h.dayNames:null)||this._defaults.dayNames,q=(h?h.monthNamesShort:null)||this._defaults.monthNamesShort, -l=(h?h.monthNames:null)||this._defaults.monthNames,k=h=-1,m=-1,o=-1,p=false,s=function(x){(x=y+1-1){k=1;m=o;do{i=this._getDaysInMonth(h,k-1);if(m<=i)break;k++;m-=i}while(1)}B=this._daylightSavingAdjust(new Date(h,k-1,m));if(B.getFullYear()!=h||B.getMonth()+1!=k||B.getDate()!=m)throw"Invalid date";return B},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y", -RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,c,h){if(!c)return"";var i=(h?h.dayNamesShort:null)||this._defaults.dayNamesShort,j=(h?h.dayNames:null)||this._defaults.dayNames,n=(h?h.monthNamesShort:null)||this._defaults.monthNamesShort;h=(h?h.monthNames:null)||this._defaults.monthNames;var q=function(s){(s=p+112?a.getHours()+2:0);return a},_setDate:function(a,c,h){var i=!c,j=a.selectedMonth,n=a.selectedYear;c=this._restrictMinMax(a,this._determineDate(a,c,new Date));a.selectedDay= -a.currentDay=c.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=c.getMonth();a.drawYear=a.selectedYear=a.currentYear=c.getFullYear();if((j!=a.selectedMonth||n!=a.selectedYear)&&!h)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(i?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var c=new Date;c=this._daylightSavingAdjust(new Date(c.getFullYear(), -c.getMonth(),c.getDate()));var h=this._get(a,"isRTL"),i=this._get(a,"showButtonPanel"),j=this._get(a,"hideIfNoPrevNext"),n=this._get(a,"navigationAsDateFormat"),q=this._getNumberOfMonths(a),l=this._get(a,"showCurrentAtPos"),k=this._get(a,"stepMonths"),m=q[0]!=1||q[1]!=1,o=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),p=this._getMinMaxDate(a,"min"),s=this._getMinMaxDate(a,"max");l=a.drawMonth-l;var r=a.drawYear;if(l<0){l+=12;r--}if(s){var u= -this._daylightSavingAdjust(new Date(s.getFullYear(),s.getMonth()-q[0]*q[1]+1,s.getDate()));for(u=p&&uu;){l--;if(l<0){l=11;r--}}}a.drawMonth=l;a.drawYear=r;u=this._get(a,"prevText");u=!n?u:this.formatDate(u,this._daylightSavingAdjust(new Date(r,l-k,1)),this._getFormatConfig(a));u=this._canAdjustMonth(a,-1,r,l)?''+u+"":j?"":''+u+"";var v=this._get(a,"nextText");v=!n?v:this.formatDate(v,this._daylightSavingAdjust(new Date(r,l+k,1)),this._getFormatConfig(a));j=this._canAdjustMonth(a,+1,r,l)?''+v+"":j?"":''+v+"";k=this._get(a,"currentText");v=this._get(a,"gotoCurrent")&&a.currentDay?o:c;k=!n?k:this.formatDate(k,v,this._getFormatConfig(a));n=!a.inline?'":"";i=i?'
      '+(h?n:"")+(this._isInRange(a,v)?'":"")+(h?"":n)+"
      ":"";n=parseInt(this._get(a,"firstDay"),10);n=isNaN(n)?0:n;k=this._get(a,"showWeek");v=this._get(a,"dayNames");this._get(a,"dayNamesShort");var w=this._get(a,"dayNamesMin"),y= -this._get(a,"monthNames"),B=this._get(a,"monthNamesShort"),x=this._get(a,"beforeShowDay"),C=this._get(a,"showOtherMonths"),J=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var M=this._getDefaultDate(a),K="",G=0;G1)switch(H){case 0:D+=" ui-datepicker-group-first";A=" ui-corner-"+(h?"right":"left");break;case q[1]- -1:D+=" ui-datepicker-group-last";A=" ui-corner-"+(h?"left":"right");break;default:D+=" ui-datepicker-group-middle";A="";break}D+='">'}D+='
      '+(/all|left/.test(A)&&G==0?h?j:u:"")+(/all|right/.test(A)&&G==0?h?u:j:"")+this._generateMonthYearHeader(a,l,r,p,s,G>0||H>0,y,B)+'
      ';var E=k?'":"";for(A=0;A<7;A++){var z= -(A+n)%7;E+="=5?' class="ui-datepicker-week-end"':"")+'>'+w[z]+""}D+=E+"";E=this._getDaysInMonth(r,l);if(r==a.selectedYear&&l==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,E);A=(this._getFirstDayOfMonth(r,l)-n+7)%7;E=m?6:Math.ceil((A+E)/7);z=this._daylightSavingAdjust(new Date(r,l,1-A));for(var P=0;P";var Q=!k?"":'";for(A=0;A<7;A++){var I= -x?x.apply(a.input?a.input[0]:null,[z]):[true,""],F=z.getMonth()!=l,L=F&&!J||!I[0]||p&&zs;Q+='";z.setDate(z.getDate()+1);z=this._daylightSavingAdjust(z)}D+= -Q+""}l++;if(l>11){l=0;r++}D+="
      '+this._get(a,"weekHeader")+"
      '+this._get(a,"calculateWeek")(z)+""+(F&&!C?" ":L?''+z.getDate()+"":''+z.getDate()+"")+"
      "+(m?""+(q[0]>0&&H==q[1]-1?'
      ':""):"");N+=D}K+=N}K+=i+(b.browser.msie&&parseInt(b.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return K},_generateMonthYearHeader:function(a,c,h,i,j,n,q,l){var k=this._get(a,"changeMonth"),m=this._get(a,"changeYear"),o=this._get(a,"showMonthAfterYear"),p='
      ', -s="";if(n||!k)s+=''+q[c]+"";else{q=i&&i.getFullYear()==h;var r=j&&j.getFullYear()==h;s+='"}o||(p+=s+(n||!(k&& -m)?" ":""));a.yearshtml="";if(n||!m)p+=''+h+"";else{l=this._get(a,"yearRange").split(":");var v=(new Date).getFullYear();q=function(w){w=w.match(/c[+-].*/)?h+parseInt(w.substring(1),10):w.match(/[+-].*/)?v+parseInt(w,10):parseInt(w,10);return isNaN(w)?v:w};c=q(l[0]);l=Math.max(c,q(l[1]||""));c=i?Math.max(c,i.getFullYear()):c;l=j?Math.min(l,j.getFullYear()):l;for(a.yearshtml+='";if(b.browser.mozilla)p+='";else{p+=a.yearshtml;a.yearshtml=null}}p+=this._get(a,"yearSuffix");if(o)p+=(n||!(k&&m)?" ":"")+s;p+="
      ";return p},_adjustInstDate:function(a,c,h){var i= -a.drawYear+(h=="Y"?c:0),j=a.drawMonth+(h=="M"?c:0);c=Math.min(a.selectedDay,this._getDaysInMonth(i,j))+(h=="D"?c:0);i=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(i,j,c)));a.selectedDay=i.getDate();a.drawMonth=a.selectedMonth=i.getMonth();a.drawYear=a.selectedYear=i.getFullYear();if(h=="M"||h=="Y")this._notifyChange(a)},_restrictMinMax:function(a,c){var h=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");c=h&&ca?a:c},_notifyChange:function(a){var c=this._get(a, -"onChangeMonthYear");if(c)c.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,c){return this._determineDate(a,this._get(a,c+"Date"),null)},_getDaysInMonth:function(a,c){return 32-this._daylightSavingAdjust(new Date(a,c,32)).getDate()},_getFirstDayOfMonth:function(a,c){return(new Date(a,c,1)).getDay()},_canAdjustMonth:function(a,c,h,i){var j=this._getNumberOfMonths(a); -h=this._daylightSavingAdjust(new Date(h,i+(c<0?c:j[0]*j[1]),1));c<0&&h.setDate(this._getDaysInMonth(h.getFullYear(),h.getMonth()));return this._isInRange(a,h)},_isInRange:function(a,c){var h=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!h||c.getTime()>=h.getTime())&&(!a||c.getTime()<=a.getTime())},_getFormatConfig:function(a){var c=this._get(a,"shortYearCutoff");c=typeof c!="string"?c:(new Date).getFullYear()%100+parseInt(c,10);return{shortYearCutoff:c,dayNamesShort:this._get(a, -"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,c,h,i){if(!c){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}c=c?typeof c=="object"?c:this._daylightSavingAdjust(new Date(i,h,c)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),c,this._getFormatConfig(a))}});b.fn.datepicker= -function(a){if(!this.length)return this;if(!b.datepicker.initialized){b(document).mousedown(b.datepicker._checkExternalClick).find("body").append(b.datepicker.dpDiv);b.datepicker.initialized=true}var c=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this[0]].concat(c));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return b.datepicker["_"+a+"Datepicker"].apply(b.datepicker, -[this[0]].concat(c));return this.each(function(){typeof a=="string"?b.datepicker["_"+a+"Datepicker"].apply(b.datepicker,[this].concat(c)):b.datepicker._attachDatepicker(this,a)})};b.datepicker=new e;b.datepicker.initialized=false;b.datepicker.uuid=(new Date).getTime();b.datepicker.version="1.8.10";window["DP_jQuery_"+f]=b})(jQuery); -(function(b,d){var e={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},g={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};b.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(f){var a=b(this).css(f).offset().top;a<0&& -b(this).css("top",f.top-a)}},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 f=this,a=f.options,c=a.title||" ",h=b.ui.dialog.getTitleId(f.element),i=(f.uiDialog=b("
      ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+a.dialogClass).css({zIndex:a.zIndex}).attr("tabIndex", --1).css("outline",0).keydown(function(q){if(a.closeOnEscape&&q.keyCode&&q.keyCode===b.ui.keyCode.ESCAPE){f.close(q);q.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(q){f.moveToTop(false,q)});f.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(i);var j=(f.uiDialogTitlebar=b("
      ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(i),n=b('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", -"button").hover(function(){n.addClass("ui-state-hover")},function(){n.removeClass("ui-state-hover")}).focus(function(){n.addClass("ui-state-focus")}).blur(function(){n.removeClass("ui-state-focus")}).click(function(q){f.close(q);return false}).appendTo(j);(f.uiDialogTitlebarCloseText=b("")).addClass("ui-icon ui-icon-closethick").text(a.closeText).appendTo(n);b("").addClass("ui-dialog-title").attr("id",h).html(c).prependTo(j);if(b.isFunction(a.beforeclose)&&!b.isFunction(a.beforeClose))a.beforeClose= -a.beforeclose;j.find("*").add(j).disableSelection();a.draggable&&b.fn.draggable&&f._makeDraggable();a.resizable&&b.fn.resizable&&f._makeResizable();f._createButtons(a.buttons);f._isOpen=false;b.fn.bgiframe&&i.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var f=this;f.overlay&&f.overlay.destroy();f.uiDialog.hide();f.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");f.uiDialog.remove();f.originalTitle&& -f.element.attr("title",f.originalTitle);return f},widget:function(){return this.uiDialog},close:function(f){var a=this,c,h;if(false!==a._trigger("beforeClose",f)){a.overlay&&a.overlay.destroy();a.uiDialog.unbind("keypress.ui-dialog");a._isOpen=false;if(a.options.hide)a.uiDialog.hide(a.options.hide,function(){a._trigger("close",f)});else{a.uiDialog.hide();a._trigger("close",f)}b.ui.dialog.overlay.resize();if(a.options.modal){c=0;b(".ui-dialog").each(function(){if(this!==a.uiDialog[0]){h=b(this).css("z-index"); -isNaN(h)||(c=Math.max(c,h))}});b.ui.dialog.maxZ=c}return a}},isOpen:function(){return this._isOpen},moveToTop:function(f,a){var c=this,h=c.options;if(h.modal&&!f||!h.stack&&!h.modal)return c._trigger("focus",a);if(h.zIndex>b.ui.dialog.maxZ)b.ui.dialog.maxZ=h.zIndex;if(c.overlay){b.ui.dialog.maxZ+=1;c.overlay.$el.css("z-index",b.ui.dialog.overlay.maxZ=b.ui.dialog.maxZ)}f={scrollTop:c.element.attr("scrollTop"),scrollLeft:c.element.attr("scrollLeft")};b.ui.dialog.maxZ+=1;c.uiDialog.css("z-index",b.ui.dialog.maxZ); -c.element.attr(f);c._trigger("focus",a);return c},open:function(){if(!this._isOpen){var f=this,a=f.options,c=f.uiDialog;f.overlay=a.modal?new b.ui.dialog.overlay(f):null;f._size();f._position(a.position);c.show(a.show);f.moveToTop(true);a.modal&&c.bind("keypress.ui-dialog",function(h){if(h.keyCode===b.ui.keyCode.TAB){var i=b(":tabbable",this),j=i.filter(":first");i=i.filter(":last");if(h.target===i[0]&&!h.shiftKey){j.focus(1);return false}else if(h.target===j[0]&&h.shiftKey){i.focus(1);return false}}}); -b(f.element.find(":tabbable").get().concat(c.find(".ui-dialog-buttonpane :tabbable").get().concat(c.get()))).eq(0).focus();f._isOpen=true;f._trigger("open");return f}},_createButtons:function(f){var a=this,c=false,h=b("
      ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),i=b("
      ").addClass("ui-dialog-buttonset").appendTo(h);a.uiDialog.find(".ui-dialog-buttonpane").remove();typeof f==="object"&&f!==null&&b.each(f,function(){return!(c=true)});if(c){b.each(f,function(j, -n){n=b.isFunction(n)?{click:n,text:j}:n;j=b('').attr(n,true).unbind("click").click(function(){n.click.apply(a.element[0],arguments)}).appendTo(i);b.fn.button&&j.button()});h.appendTo(a.uiDialog)}},_makeDraggable:function(){function f(j){return{position:j.position,offset:j.offset}}var a=this,c=a.options,h=b(document),i;a.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(j,n){i= -c.height==="auto"?"auto":b(this).height();b(this).height(b(this).height()).addClass("ui-dialog-dragging");a._trigger("dragStart",j,f(n))},drag:function(j,n){a._trigger("drag",j,f(n))},stop:function(j,n){c.position=[n.position.left-h.scrollLeft(),n.position.top-h.scrollTop()];b(this).removeClass("ui-dialog-dragging").height(i);a._trigger("dragStop",j,f(n));b.ui.dialog.overlay.resize()}})},_makeResizable:function(f){function a(j){return{originalPosition:j.originalPosition,originalSize:j.originalSize, -position:j.position,size:j.size}}f=f===d?this.options.resizable:f;var c=this,h=c.options,i=c.uiDialog.css("position");f=typeof f==="string"?f:"n,e,s,w,se,sw,ne,nw";c.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:c.element,maxWidth:h.maxWidth,maxHeight:h.maxHeight,minWidth:h.minWidth,minHeight:c._minHeight(),handles:f,start:function(j,n){b(this).addClass("ui-dialog-resizing");c._trigger("resizeStart",j,a(n))},resize:function(j,n){c._trigger("resize",j,a(n))},stop:function(j, -n){b(this).removeClass("ui-dialog-resizing");h.height=b(this).height();h.width=b(this).width();c._trigger("resizeStop",j,a(n));b.ui.dialog.overlay.resize()}}).css("position",i).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var f=this.options;return f.height==="auto"?f.minHeight:Math.min(f.minHeight,f.height)},_position:function(f){var a=[],c=[0,0],h;if(f){if(typeof f==="string"||typeof f==="object"&&"0"in f){a=f.split?f.split(" "):[f[0],f[1]];if(a.length=== -1)a[1]=a[0];b.each(["left","top"],function(i,j){if(+a[i]===a[i]){c[i]=a[i];a[i]=j}});f={my:a.join(" "),at:a.join(" "),offset:c.join(" ")}}f=b.extend({},b.ui.dialog.prototype.options.position,f)}else f=b.ui.dialog.prototype.options.position;(h=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(b.extend({of:window},f));h||this.uiDialog.hide()},_setOptions:function(f){var a=this,c={},h=false;b.each(f,function(i,j){a._setOption(i,j);if(i in e)h=true;if(i in -g)c[i]=j});h&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",c)},_setOption:function(f,a){var c=this,h=c.uiDialog;switch(f){case "beforeclose":f="beforeClose";break;case "buttons":c._createButtons(a);break;case "closeText":c.uiDialogTitlebarCloseText.text(""+a);break;case "dialogClass":h.removeClass(c.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+a);break;case "disabled":a?h.addClass("ui-dialog-disabled"):h.removeClass("ui-dialog-disabled"); -break;case "draggable":var i=h.is(":data(draggable)");i&&!a&&h.draggable("destroy");!i&&a&&c._makeDraggable();break;case "position":c._position(a);break;case "resizable":(i=h.is(":data(resizable)"))&&!a&&h.resizable("destroy");i&&typeof a==="string"&&h.resizable("option","handles",a);!i&&a!==false&&c._makeResizable(a);break;case "title":b(".ui-dialog-title",c.uiDialogTitlebar).html(""+(a||" "));break}b.Widget.prototype._setOption.apply(c,arguments)},_size:function(){var f=this.options,a,c,h= -this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(f.minWidth>f.width)f.width=f.minWidth;a=this.uiDialog.css({height:"auto",width:f.width}).height();c=Math.max(0,f.minHeight-a);if(f.height==="auto")if(b.support.minHeight)this.element.css({minHeight:c,height:"auto"});else{this.uiDialog.show();f=this.element.css("height","auto").height();h||this.uiDialog.hide();this.element.height(Math.max(f,c))}else this.element.height(Math.max(f.height-a,0));this.uiDialog.is(":data(resizable)")&& -this.uiDialog.resizable("option","minHeight",this._minHeight())}});b.extend(b.ui.dialog,{version:"1.8.10",uuid:0,maxZ:0,getTitleId:function(f){f=f.attr("id");if(!f){this.uuid+=1;f=this.uuid}return"ui-dialog-title-"+f},overlay:function(f){this.$el=b.ui.dialog.overlay.create(f)}});b.extend(b.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:b.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(f){return f+".dialog-overlay"}).join(" "),create:function(f){if(this.instances.length=== -0){setTimeout(function(){b.ui.dialog.overlay.instances.length&&b(document).bind(b.ui.dialog.overlay.events,function(c){if(b(c.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), -height:this.height()});b.fn.bgiframe&&a.bgiframe();this.instances.push(a);return a},destroy:function(f){var a=b.inArray(f,this.instances);a!=-1&&this.oldInstances.push(this.instances.splice(a,1)[0]);this.instances.length===0&&b([document,window]).unbind(".dialog-overlay");f.remove();var c=0;b.each(this.instances,function(){c=Math.max(c,this.css("z-index"))});this.maxZ=c},height:function(){var f,a;if(b.browser.msie&&b.browser.version<7){f=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); -a=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return f0?a.left-h:Math.max(a.left-c.collisionPosition.left,a.left)},top:function(a,c){var h=b(window);h=c.collisionPosition.top+c.collisionHeight-h.height()-h.scrollTop();a.top=h>0?a.top-h:Math.max(a.top-c.collisionPosition.top,a.top)}},flip:{left:function(a,c){if(c.at[0]!=="center"){var h=b(window);h=c.collisionPosition.left+c.collisionWidth-h.width()-h.scrollLeft();var i=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,j=c.at[0]==="left"?c.targetWidth:-c.targetWidth,n=-2*c.offset[0];a.left+= -c.collisionPosition.left<0?i+j+n:h>0?i+j+n:0}},top:function(a,c){if(c.at[1]!=="center"){var h=b(window);h=c.collisionPosition.top+c.collisionHeight-h.height()-h.scrollTop();var i=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,j=c.at[1]==="top"?c.targetHeight:-c.targetHeight,n=-2*c.offset[1];a.top+=c.collisionPosition.top<0?i+j+n:h>0?i+j+n:0}}}};if(!b.offset.setOffset){b.offset.setOffset=function(a,c){if(/static/.test(b.curCSS(a,"position")))a.style.position="relative";var h=b(a), -i=h.offset(),j=parseInt(b.curCSS(a,"top",true),10)||0,n=parseInt(b.curCSS(a,"left",true),10)||0;i={top:c.top-i.top+j,left:c.left-i.left+n};"using"in c?c.using.call(a,i):h.css(i)};b.fn.offset=function(a){var c=this[0];if(!c||!c.ownerDocument)return null;if(a)return this.each(function(){b.offset.setOffset(this,a)});return f.call(this)}}})(jQuery); -(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
      ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(e){if(e===d)return this._value();this._setOption("value",e);return this},_setOption:function(e,g){if(e==="value"){this.options.value=g;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var e=this.options.value;if(typeof e!=="number")e=0;return Math.min(this.options.max,Math.max(this.min,e))},_percentage:function(){return 100* -this._value()/this.options.max},_refreshValue:function(){var e=this.value(),g=this._percentage();if(this.oldValue!==e){this.oldValue=e;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",e===this.options.max).width(g.toFixed(0)+"%");this.element.attr("aria-valuenow",e)}});b.extend(b.ui.progressbar,{version:"1.8.10"})})(jQuery); -(function(b){b.widget("ui.slider",b.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 d=this,e=this.options;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");e.disabled&&this.element.addClass("ui-slider-disabled ui-disabled"); -this.range=b([]);if(e.range){if(e.range===true){this.range=b("
      ");if(!e.values)e.values=[this._valueMin(),this._valueMin()];if(e.values.length&&e.values.length!==2)e.values=[e.values[0],e.values[0]]}else this.range=b("
      ");this.range.appendTo(this.element).addClass("ui-slider-range");if(e.range==="min"||e.range==="max")this.range.addClass("ui-slider-range-"+e.range);this.range.addClass("ui-widget-header")}b(".ui-slider-handle",this.element).length===0&&b("").appendTo(this.element).addClass("ui-slider-handle"); -if(e.values&&e.values.length)for(;b(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=b(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){e.disabled||b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")}).focus(function(){if(e.disabled)b(this).blur(); -else{b(".ui-slider .ui-state-focus").removeClass("ui-state-focus");b(this).addClass("ui-state-focus")}}).blur(function(){b(this).removeClass("ui-state-focus")});this.handles.each(function(g){b(this).data("index.ui-slider-handle",g)});this.handles.keydown(function(g){var f=true,a=b(this).data("index.ui-slider-handle"),c,h,i;if(!d.options.disabled){switch(g.keyCode){case b.ui.keyCode.HOME:case b.ui.keyCode.END:case b.ui.keyCode.PAGE_UP:case b.ui.keyCode.PAGE_DOWN:case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:f= -false;if(!d._keySliding){d._keySliding=true;b(this).addClass("ui-state-active");c=d._start(g,a);if(c===false)return}break}i=d.options.step;c=d.options.values&&d.options.values.length?(h=d.values(a)):(h=d.value());switch(g.keyCode){case b.ui.keyCode.HOME:h=d._valueMin();break;case b.ui.keyCode.END:h=d._valueMax();break;case b.ui.keyCode.PAGE_UP:h=d._trimAlignValue(c+(d._valueMax()-d._valueMin())/5);break;case b.ui.keyCode.PAGE_DOWN:h=d._trimAlignValue(c-(d._valueMax()-d._valueMin())/5);break;case b.ui.keyCode.UP:case b.ui.keyCode.RIGHT:if(c=== -d._valueMax())return;h=d._trimAlignValue(c+i);break;case b.ui.keyCode.DOWN:case b.ui.keyCode.LEFT:if(c===d._valueMin())return;h=d._trimAlignValue(c-i);break}d._slide(g,a,h);return f}}).keyup(function(g){var f=b(this).data("index.ui-slider-handle");if(d._keySliding){d._keySliding=false;d._stop(g,f);d._change(g,f);b(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); -this._mouseDestroy();return this},_mouseCapture:function(d){var e=this.options,g,f,a,c,h;if(e.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();g=this._normValueFromMouse({x:d.pageX,y:d.pageY});f=this._valueMax()-this._valueMin()+1;c=this;this.handles.each(function(i){var j=Math.abs(g-c.values(i));if(f>j){f=j;a=b(this);h=i}});if(e.range===true&&this.values(1)===e.min){h+=1;a=b(this.handles[h])}if(this._start(d, -h)===false)return false;this._mouseSliding=true;c._handleIndex=h;a.addClass("ui-state-active").focus();e=a.offset();this._clickOffset=!b(d.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:d.pageX-e.left-a.width()/2,top:d.pageY-e.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(d,h,g);return this._animateOff=true},_mouseStart:function(){return true}, -_mouseDrag:function(d){var e=this._normValueFromMouse({x:d.pageX,y:d.pageY});this._slide(d,this._handleIndex,e);return false},_mouseStop:function(d){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(d,this._handleIndex);this._change(d,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var e; -if(this.orientation==="horizontal"){e=this.elementSize.width;d=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{e=this.elementSize.height;d=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}e=d/e;if(e>1)e=1;if(e<0)e=0;if(this.orientation==="vertical")e=1-e;d=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+e*d)},_start:function(d,e){var g={handle:this.handles[e],value:this.value()};if(this.options.values&&this.options.values.length){g.value= -this.values(e);g.values=this.values()}return this._trigger("start",d,g)},_slide:function(d,e,g){var f;if(this.options.values&&this.options.values.length){f=this.values(e?0:1);if(this.options.values.length===2&&this.options.range===true&&(e===0&&g>f||e===1&&g1){this.options.values[d]=this._trimAlignValue(e);this._refreshValue();this._change(null,d)}if(arguments.length)if(b.isArray(arguments[0])){g=this.options.values;f=arguments[0];for(a=0;a=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,g=(d-this._valueMin())%e;alignValue=d-g;if(Math.abs(g)*2>=e)alignValue+=g>0?e:-e;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, -_refreshValue:function(){var d=this.options.range,e=this.options,g=this,f=!this._animateOff?e.animate:false,a,c={},h,i,j,n;if(this.options.values&&this.options.values.length)this.handles.each(function(q){a=(g.values(q)-g._valueMin())/(g._valueMax()-g._valueMin())*100;c[g.orientation==="horizontal"?"left":"bottom"]=a+"%";b(this).stop(1,1)[f?"animate":"css"](c,e.animate);if(g.options.range===true)if(g.orientation==="horizontal"){if(q===0)g.range.stop(1,1)[f?"animate":"css"]({left:a+"%"},e.animate); -if(q===1)g.range[f?"animate":"css"]({width:a-h+"%"},{queue:false,duration:e.animate})}else{if(q===0)g.range.stop(1,1)[f?"animate":"css"]({bottom:a+"%"},e.animate);if(q===1)g.range[f?"animate":"css"]({height:a-h+"%"},{queue:false,duration:e.animate})}h=a});else{i=this.value();j=this._valueMin();n=this._valueMax();a=n!==j?(i-j)/(n-j)*100:0;c[g.orientation==="horizontal"?"left":"bottom"]=a+"%";this.handle.stop(1,1)[f?"animate":"css"](c,e.animate);if(d==="min"&&this.orientation==="horizontal")this.range.stop(1, -1)[f?"animate":"css"]({width:a+"%"},e.animate);if(d==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-a+"%"},{queue:false,duration:e.animate});if(d==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:a+"%"},e.animate);if(d==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-a+"%"},{queue:false,duration:e.animate})}}});b.extend(b.ui.slider,{version:"1.8.10"})})(jQuery); -(function(b,d){function e(){return++f}function g(){return++a}var f=0,a=0;b.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:"
      ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
    • #{label}
    • "},_create:function(){this._tabify(true)},_setOption:function(c,h){if(c=="selected")this.options.collapsible&& -h==this.options.selected||this.select(h);else{this.options[c]=h;this._tabify()}},_tabId:function(c){return c.title&&c.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(c){return c.replace(/:/g,"\\:")},_cookie:function(){var c=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+g());return b.cookie.apply(null,[c].concat(b.makeArray(arguments)))},_ui:function(c,h){return{tab:c,panel:h,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var c= -b(this);c.html(c.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function h(r,u){r.css("display","");!b.support.opacity&&u.opacity&&r[0].style.removeAttribute("filter")}var i=this,j=this.options,n=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=b(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return b("a",this)[0]});this.panels=b([]);this.anchors.each(function(r,u){var v=b(u).attr("href"),w=v.split("#")[0],y;if(w&&(w===location.toString().split("#")[0]|| -(y=b("base")[0])&&w===y.href)){v=u.hash;u.href=v}if(n.test(v))i.panels=i.panels.add(i.element.find(i._sanitizeSelector(v)));else if(v&&v!=="#"){b.data(u,"href.tabs",v);b.data(u,"load.tabs",v.replace(/#.*$/,""));v=i._tabId(u);u.href="#"+v;u=i.element.find("#"+v);if(!u.length){u=b(j.panelTemplate).attr("id",v).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(i.panels[r-1]||i.list);u.data("destroy.tabs",true)}i.panels=i.panels.add(u)}else j.disabled.push(r)});if(c){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===d){location.hash&&this.anchors.each(function(r,u){if(u.hash==location.hash){j.selected=r;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(i._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=b.unique(j.disabled.concat(b.map(this.lis.filter(".ui-state-disabled"),function(r){return i.lis.index(r)}))).sort();b.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(b.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(j.selected>=0&&this.anchors.length){i.element.find(i._sanitizeSelector(i.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");i.element.queue("tabs",function(){i._trigger("show",null,i._ui(i.anchors[j.selected],i.element.find(i._sanitizeSelector(i.anchors[j.selected].hash))[0]))});this.load(j.selected)}b(window).bind("unload",function(){i.lis.add(i.anchors).unbind(".tabs");i.lis=i.anchors=i.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);c=0;for(var q;q=this.lis[c];c++)b(q)[b.inArray(c,j.disabled)!=-1&&!b(q).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var l=function(r,u){u.is(":not(.ui-state-disabled)")&&u.addClass("ui-state-"+r)},k=function(r,u){u.removeClass("ui-state-"+ -r)};this.lis.bind("mouseover.tabs",function(){l("hover",b(this))});this.lis.bind("mouseout.tabs",function(){k("hover",b(this))});this.anchors.bind("focus.tabs",function(){l("focus",b(this).closest("li"))});this.anchors.bind("blur.tabs",function(){k("focus",b(this).closest("li"))})}var m,o;if(j.fx)if(b.isArray(j.fx)){m=j.fx[0];o=j.fx[1]}else m=o=j.fx;var p=o?function(r,u){b(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){h(u,o);i._trigger("show",null,i._ui(r,u[0]))})}:function(r,u){b(r).closest("li").addClass("ui-tabs-selected ui-state-active");u.removeClass("ui-tabs-hide");i._trigger("show",null,i._ui(r,u[0]))},s=m?function(r,u){u.animate(m,m.duration||"normal",function(){i.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");h(u,m);i.element.dequeue("tabs")})}:function(r,u){i.lis.removeClass("ui-tabs-selected ui-state-active");u.addClass("ui-tabs-hide");i.element.dequeue("tabs")}; -this.anchors.bind(j.event+".tabs",function(){var r=this,u=b(r).closest("li"),v=i.panels.filter(":not(.ui-tabs-hide)"),w=i.element.find(i._sanitizeSelector(r.hash));if(u.hasClass("ui-tabs-selected")&&!j.collapsible||u.hasClass("ui-state-disabled")||u.hasClass("ui-state-processing")||i.panels.filter(":animated").length||i._trigger("select",null,i._ui(this,w[0]))===false){this.blur();return false}j.selected=i.anchors.index(this);i.abort();if(j.collapsible)if(u.hasClass("ui-tabs-selected")){j.selected= --1;j.cookie&&i._cookie(j.selected,j.cookie);i.element.queue("tabs",function(){s(r,v)}).dequeue("tabs");this.blur();return false}else if(!v.length){j.cookie&&i._cookie(j.selected,j.cookie);i.element.queue("tabs",function(){p(r,w)});i.load(i.anchors.index(this));this.blur();return false}j.cookie&&i._cookie(j.selected,j.cookie);if(w.length){v.length&&i.element.queue("tabs",function(){s(r,v)});i.element.queue("tabs",function(){p(r,w)});i.load(i.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -b.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(c){if(typeof c=="string")c=this.anchors.index(this.anchors.filter("[href$="+c+"]"));return c},destroy:function(){var c=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var h= -b.data(this,"href.tabs");if(h)this.href=h;var i=b(this).unbind(".tabs");b.each(["href","load","cache"],function(j,n){i.removeData(n+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){b.data(this,"destroy.tabs")?b(this).remove():b(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});c.cookie&&this._cookie(null,c.cookie);return this},add:function(c, -h,i){if(i===d)i=this.anchors.length;var j=this,n=this.options;h=b(n.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,h));c=!c.indexOf("#")?c.replace("#",""):this._tabId(b("a",h)[0]);h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var q=j.element.find("#"+c);q.length||(q=b(n.panelTemplate).attr("id",c).data("destroy.tabs",true));q.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(i>=this.lis.length){h.appendTo(this.list);q.appendTo(this.list[0].parentNode)}else{h.insertBefore(this.lis[i]); -q.insertBefore(this.panels[i])}n.disabled=b.map(n.disabled,function(l){return l>=i?++l:l});this._tabify();if(this.anchors.length==1){n.selected=0;h.addClass("ui-tabs-selected ui-state-active");q.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[i],this.panels[i]));return this},remove:function(c){c=this._getIndex(c);var h=this.options,i=this.lis.eq(c).remove(),j=this.panels.eq(c).remove(); -if(i.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(c+(c+1=c?--n:n});this._tabify();this._trigger("remove",null,this._ui(i.find("a")[0],j[0]));return this},enable:function(c){c=this._getIndex(c);var h=this.options;if(b.inArray(c,h.disabled)!=-1){this.lis.eq(c).removeClass("ui-state-disabled");h.disabled=b.grep(h.disabled,function(i){return i!=c});this._trigger("enable",null, -this._ui(this.anchors[c],this.panels[c]));return this}},disable:function(c){c=this._getIndex(c);var h=this.options;if(c!=h.selected){this.lis.eq(c).addClass("ui-state-disabled");h.disabled.push(c);h.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}return this},select:function(c){c=this._getIndex(c);if(c==-1)if(this.options.collapsible&&this.options.selected!=-1)c=this.options.selected;else return this;this.anchors.eq(c).trigger(this.options.event+".tabs");return this}, -load:function(c){c=this._getIndex(c);var h=this,i=this.options,j=this.anchors.eq(c)[0],n=b.data(j,"load.tabs");this.abort();if(!n||this.element.queue("tabs").length!==0&&b.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(c).addClass("ui-state-processing");if(i.spinner){var q=b("span",j);q.data("label.tabs",q.html()).html(i.spinner)}this.xhr=b.ajax(b.extend({},i.ajaxOptions,{url:n,success:function(l,k){h.element.find(h._sanitizeSelector(j.hash)).html(l);h._cleanup();i.cache&&b.data(j, -"cache.tabs",true);h._trigger("load",null,h._ui(h.anchors[c],h.panels[c]));try{i.ajaxOptions.success(l,k)}catch(m){}},error:function(l,k){h._cleanup();h._trigger("load",null,h._ui(h.anchors[c],h.panels[c]));try{i.ajaxOptions.error(l,k,c,j)}catch(m){}}}));h.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(c,h){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",h);return this},length:function(){return this.anchors.length}});b.extend(b.ui.tabs,{version:"1.8.10"});b.extend(b.ui.tabs.prototype,{rotation:null,rotate:function(c,h){var i=this,j=this.options,n=i._rotate||(i._rotate=function(q){clearTimeout(i.rotation);i.rotation=setTimeout(function(){var l=j.selected;i.select(++l").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;ic)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="
      a";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
      ",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
      t
      ";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

      ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="
      ";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(var g=c;g0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/",""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div
      ","
      "]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1>");try{for(var c=0,e=this.length;c1&&l0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]===""&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/)<[^<]*)*<\/script>/gi,bA=/^(?:select|textarea)/i,bB=/\s+/,bC=/([?&])_=[^&]*/,bD=/(^|\-)([a-z])/g,bE=function(a,b,c){return b+c.toUpperCase()},bF=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bG=d.fn.load,bH={},bI={},bJ,bK;try{bJ=c.location.href}catch(bL){bJ=c.createElement("a"),bJ.href="",bJ=bJ.href}bK=bF.exec(bJ.toLowerCase()),d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bG)return bG.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("
      ").append(c.replace(bz,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bA.test(this.nodeName)||bu.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(br,"\r\n")}}):{name:b.name,value:c.replace(br,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bJ,isLocal:bv.test(bK[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bM(bH),ajaxTransport:bM(bI),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bP(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bQ(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bD,bE)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bt.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bs,"").replace(bx,bK[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bB),e.crossDomain||(q=bF.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bK[1]||q[2]!=bK[2]||(q[3]||(q[1]==="http:"?80:443))!=(bK[3]||(bK[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bN(bH,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bw.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(by.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bC,"$1_="+w);e.url=x+(x===e.url?(by.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bN(bI,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bO(g,a[g],c,f);return e.join("&").replace(bp,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bR=d.now(),bS=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bR++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bS.test(b.url)||f&&bS.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bS,l),b.url===j&&(f&&(k=k.replace(bS,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bT=d.now(),bU,bV;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bX()||bY()}:bX,bV=d.ajaxSettings.xhr(),d.support.ajax=!!bV,d.support.cors=bV&&"withCredentials"in bV,bV=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),(!a.crossDomain||a.hasContent)&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bU[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bU||(bU={},bW()),h=bT++,g.onreadystatechange=bU[h]=c):c()},abort:function(){c&&c(0,1)}}}});var bZ={},b$=/^(?:toggle|show|hide)$/,b_=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ca,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(cc("show",3),a,b,c);for(var g=0,h=this.length;g=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:cc("show",1),slideUp:cc("hide",1),slideToggle:cc("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!ca&&(ca=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b
      ";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=cf.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!cf.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=cg(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=cg(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window); \ No newline at end of file diff --git a/public/javascripts/rails.js b/public/javascripts/rails.js deleted file mode 100644 index 39341e6..0000000 --- a/public/javascripts/rails.js +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Unobtrusive scripting adapter for jQuery - * - * Requires jQuery 1.4.3 or later. - * https://github.com/rails/jquery-ujs - */ - -(function($) { - // Make sure that every Ajax request sends the CSRF token - function CSRFProtection(xhr) { - var token = $('meta[name="csrf-token"]').attr('content'); - if (token) xhr.setRequestHeader('X-CSRF-Token', token); - } - if ('ajaxPrefilter' in $) $.ajaxPrefilter(function(options, originalOptions, xhr){ CSRFProtection(xhr) }); - else $(document).ajaxSend(function(e, xhr){ CSRFProtection(xhr) }); - - // Triggers an event on an element and returns the event result - function fire(obj, name, data) { - var event = $.Event(name); - obj.trigger(event, data); - return event.result !== false; - } - - // Submits "remote" forms and links with ajax - function handleRemote(element) { - var method, url, data, - dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType); - - if (fire(element, 'ajax:before')) { - if (element.is('form')) { - method = element.attr('method'); - url = element.attr('action'); - data = element.serializeArray(); - // memoized value from clicked submit button - var button = element.data('ujs:submit-button'); - if (button) { - data.push(button); - element.data('ujs:submit-button', null); - } - } else { - method = element.data('method'); - url = element.attr('href'); - data = null; - } - $.ajax({ - url: url, type: method || 'GET', data: data, dataType: dataType, - // stopping the "ajax:beforeSend" event will cancel the ajax request - beforeSend: function(xhr, settings) { - if (settings.dataType === undefined) { - xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script); - } - return fire(element, 'ajax:beforeSend', [xhr, settings]); - }, - success: function(data, status, xhr) { - element.trigger('ajax:success', [data, status, xhr]); - }, - complete: function(xhr, status) { - element.trigger('ajax:complete', [xhr, status]); - }, - error: function(xhr, status, error) { - element.trigger('ajax:error', [xhr, status, error]); - } - }); - } - } - - // Handles "data-method" on links such as: - // Delete - function handleMethod(link) { - var href = link.attr('href'), - method = link.data('method'), - csrf_token = $('meta[name=csrf-token]').attr('content'), - csrf_param = $('meta[name=csrf-param]').attr('content'), - form = $('
      '), - metadata_input = ''; - - if (csrf_param !== undefined && csrf_token !== undefined) { - metadata_input += ''; - } - - form.hide().append(metadata_input).appendTo('body'); - form.submit(); - } - - function disableFormElements(form) { - form.find('input[data-disable-with]').each(function() { - var input = $(this); - input.data('ujs:enable-with', input.val()) - .val(input.data('disable-with')) - .attr('disabled', 'disabled'); - }); - } - - function enableFormElements(form) { - form.find('input[data-disable-with]').each(function() { - var input = $(this); - input.val(input.data('ujs:enable-with')).removeAttr('disabled'); - }); - } - - function allowAction(element) { - var message = element.data('confirm'); - return !message || (fire(element, 'confirm') && confirm(message)); - } - - function requiredValuesMissing(form) { - var missing = false; - form.find('input[name][required]').each(function() { - if (!$(this).val()) missing = true; - }); - return missing; - } - - $('a[data-confirm], a[data-method], a[data-remote]').live('click.rails', function(e) { - var link = $(this); - if (!allowAction(link)) return false; - - if (link.data('remote') != undefined) { - handleRemote(link); - return false; - } else if (link.data('method')) { - handleMethod(link); - return false; - } - }); - - $('form').live('submit.rails', function(e) { - var form = $(this), remote = form.data('remote') != undefined; - if (!allowAction(form)) return false; - - // skip other logic when required values are missing - if (requiredValuesMissing(form)) return !remote; - - if (remote) { - handleRemote(form); - return false; - } else { - // slight timeout so that the submit button gets properly serialized - setTimeout(function(){ disableFormElements(form) }, 13); - } - }); - - $('form input[type=submit], form button[type=submit], form button:not([type])').live('click.rails', function() { - var button = $(this); - if (!allowAction(button)) return false; - // register the pressed submit button - var name = button.attr('name'), data = name ? {name:name, value:button.val()} : null; - button.closest('form').data('ujs:submit-button', data); - }); - - $('form').live('ajax:beforeSend.rails', function(event) { - if (this == event.target) disableFormElements($(this)); - }); - - $('form').live('ajax:complete.rails', function(event) { - if (this == event.target) enableFormElements($(this)); - }); -})( jQuery ); diff --git a/spec/controllers/corkboard_controller_spec.rb b/spec/controllers/corkboard_controller_spec.rb deleted file mode 100644 index 2ac404f..0000000 --- a/spec/controllers/corkboard_controller_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -require 'spec_helper' -describe CorkboardController do - - context 'locale inference' do - let(:user) { Factory.create(:user) } - before(:each) do - sign_in user - end - - it 'should be set with a user preference' do - user.update_attribute(:locale,'de') - get :index - I18n.locale.should == :de - end - - it 'should be overridable via params[:locale]' do - get :index, :locale => 'fr' - I18n.locale.should == :fr - end - - it 'should default to english' do - get :index - I18n.locale.should == :en - end - - end -end diff --git a/spec/controllers/corkboards_controller_spec.rb b/spec/controllers/corkboards_controller_spec.rb new file mode 100644 index 0000000..ea25ed8 --- /dev/null +++ b/spec/controllers/corkboards_controller_spec.rb @@ -0,0 +1,20 @@ +require 'spec_helper' + +describe CorkboardsController do + context 'CorkboardsController when signed in' do + let(:user) { Factory.create(:user) } + before(:each) do + sign_in user + end + + context 'GET #show' do + before do + get :show + end + + it { should respond_with(:success) } + it { should render_template(:show) } + end + end +end + diff --git a/spec/controllers/dummy_locale_controller_spec.rb b/spec/controllers/dummy_locale_controller_spec.rb new file mode 100644 index 0000000..ded47f1 --- /dev/null +++ b/spec/controllers/dummy_locale_controller_spec.rb @@ -0,0 +1,57 @@ +require 'spec_helper' + +# Mock a Controller +class DummyLocaleController < ApplicationController + def test + render :nothing => true + end +end + +describe DummyLocaleController do + + def with_dummy_routing + with_routing do |set| + set.draw do + match 'dummy_locale/test' => 'dummy_locale#test' + end + yield + end + end + + context 'locale inference when signed in' do + let(:user) { ignore_mailers { Factory.create(:user) } } + before(:each) do + sign_in user + end + + it 'should be set with a user preference' do + user.update_attribute(:locale,'de') + with_dummy_routing { get :test } + I18n.locale.should == :de + end + + it 'should be overridable via params[:locale]' do + with_dummy_routing { get :test, :locale => 'fr' } + I18n.locale.should == :fr + end + + it 'should default to english' do + with_dummy_routing { get :test } + I18n.locale.should == :en + end + + end + + context 'locale inference when not signed in' do + it 'should be overridable via params[:locale]' do + with_dummy_routing { get :test, :locale => 'fr' } + I18n.locale.should == :fr + end + + it 'should default to english' do + with_dummy_routing { get :test } + I18n.locale.should == :en + end + end + +end diff --git a/spec/controllers/dummy_time_zone_controller_spec.rb b/spec/controllers/dummy_time_zone_controller_spec.rb new file mode 100644 index 0000000..c5d5100 --- /dev/null +++ b/spec/controllers/dummy_time_zone_controller_spec.rb @@ -0,0 +1,47 @@ +require 'spec_helper' + +# Mock a Controller +class DummyTimeZoneController < ApplicationController + def test + render :text => Time.zone.name + end +end + +describe DummyTimeZoneController do + + def with_dummy_routing + with_routing do |set| + set.draw do + match 'dummy_time_zone/test' => 'dummy_time_zone#test' + end + yield + end + end + + context 'Time.zone' do + it 'should default to Eastern time' do + Time.zone.name.should == "Eastern Time (US & Canada)" + end + + context 'when a user is signed in' do + let(:user) { Factory.create(:user) } + before do + sign_in user + end + + it "should use the user's preferred time zone" do + user.update_attribute(:time_zone, "Paris") + with_dummy_routing { get :test } + response.body.should == "Paris" + end + + it "should use the default if the user doesn't have a time zone set" do + user.update_attribute(:time_zone, "") + with_dummy_routing { get :test } + response.body.should == "Eastern Time (US & Canada)" + end + end + end + +end + diff --git a/spec/controllers/home_controller_spec.rb b/spec/controllers/home_controller_spec.rb deleted file mode 100644 index 81a7f56..0000000 --- a/spec/controllers/home_controller_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'spec_helper' -describe HomeController do - context 'locale inference' do - it 'should default to english' do - get :index - I18n.locale.should == :en - end - - it 'should be overridable via params[:locale]' do - get :index, :locale => 'fr' - I18n.locale.should == :fr - end - end -end diff --git a/spec/controllers/house_invitations_controller_spec.rb b/spec/controllers/house_invitations_controller_spec.rb deleted file mode 100644 index 1e02b54..0000000 --- a/spec/controllers/house_invitations_controller_spec.rb +++ /dev/null @@ -1,126 +0,0 @@ -require 'spec_helper' - -# This spec was generated by rspec-rails when you ran the scaffold generator. -# It demonstrates how one might use RSpec to specify the controller code that -# was generated by the Rails when you ran the scaffold generator. - -describe HouseInvitationsController - do - - def mock_house_invitation(stubs={}) - @mock_house_invitation ||= mock_model(HouseInvitation, stubs).as_null_object - end - - describe "GET index" do - it "assigns all house_invitations as @house_invitations" do - HouseInvitation.stub(:all) { [mock_house_invitation] } - get :index - assigns(:house_invitations).should eq([mock_house_invitation]) - end - end - - describe "GET show" do - it "assigns the requested house_invitation as @house_invitation" do - HouseInvitation.stub(:find).with("37") { mock_house_invitation } - get :show, :id => "37" - assigns(:house_invitation).should be(mock_house_invitation) - end - end - - describe "GET new" do - it "assigns a new house_invitation as @house_invitation" do - HouseInvitation.stub(:new) { mock_house_invitation } - get :new - assigns(:house_invitation).should be(mock_house_invitation) - end - end - - describe "GET edit" do - it "assigns the requested house_invitation as @house_invitation" do - HouseInvitation.stub(:find).with("37") { mock_house_invitation } - get :edit, :id => "37" - assigns(:house_invitation).should be(mock_house_invitation) - end - end - - describe "POST create" do - describe "with valid params" do - it "assigns a newly created house_invitation as @house_invitation" do - HouseInvitation.stub(:new).with({'these' => 'params'}) { mock_house_invitation(:save => true) } - post :create, :house_invitation => {'these' => 'params'} - assigns(:house_invitation).should be(mock_house_invitation) - end - - it "redirects to the created invitation" do - HouseInvitation.stub(:new) { mock_house_invitation(:save => true) } - post :create, :house_invitation => {} - response.should redirect_to(invitation_url(mock_house_invitation)) - end - end - - describe "with invalid params" do - it "assigns a newly created but unsaved house_invitation as @house_invitation" do - HouseInvitation.stub(:new).with({'these' => 'params'}) { mock_house_invitation(:save => false) } - post :create, :house_invitation => {'these' => 'params'} - assigns(:house_invitation).should be(mock_house_invitation) - end - - it "re-renders the 'new' template" do - HouseInvitation.stub(:new) { mock_house_invitation(:save => false) } - post :create, :house_invitation => {} - response.should render_template("new") - end - end - end - - describe "PUT update" do - describe "with valid params" do - it "updates the requested invitation" do - HouseInvitation.stub(:find).with("37") { mock_house_invitation } - mock_house_invitation.should_receive(:update_attributes).with({'these' => 'params'}) - put :update, :id => "37", :house_invitation => {'these' => 'params'} - end - - it "assigns the requested house_invitation as @house_invitation" do - HouseInvitation.stub(:find) { mock_house_invitation(:update_attributes => true) } - put :update, :id => "1" - assigns(:house_invitation).should be(mock_house_invitation) - end - - it "redirects to the invitation" do - HouseInvitation.stub(:find) { mock_house_invitation(:update_attributes => true) } - put :update, :id => "1" - response.should redirect_to(invitation_url(mock_house_invitation)) - end - end - - describe "with invalid params" do - it "assigns the house_invitation as @house_invitation" do - HouseInvitation.stub(:find) { mock_house_invitation(:update_attributes => false) } - put :update, :id => "1" - assigns(:house_invitation).should be(mock_house_invitation) - end - - it "re-renders the 'edit' template" do - HouseInvitation.stub(:find) { mock_house_invitation(:update_attributes => false) } - put :update, :id => "1" - response.should render_template("edit") - end - end - end - - describe "DELETE destroy" do - it "destroys the requested invitation" do - HouseInvitation.stub(:find).with("37") { mock_house_invitation } - mock_house_invitation.should_receive(:destroy) - delete :destroy, :id => "37" - end - - it "redirects to the house_invitations list" do - HouseInvitation.stub(:find) { mock_house_invitation } - delete :destroy, :id => "1" - response.should redirect_to(house_invitations_url) - end - end - -end diff --git a/spec/controllers/support_requests_controller_spec.rb b/spec/controllers/support_requests_controller_spec.rb new file mode 100644 index 0000000..4d81c2f --- /dev/null +++ b/spec/controllers/support_requests_controller_spec.rb @@ -0,0 +1,36 @@ +require 'spec_helper' + +describe SupportRequestsController do + + context 'GET #new' do + before do + get :new + end + + it { should respond_with(:success) } + it { should assign_to(:support_request).with_kind_of(SupportRequest) } + end + + context 'POST #create' do + + context 'with valid params' do + before do + post :create, :support_request => Factory.attributes_for(:support_request) + end + + it { should redirect_to(root_url) } + it { should set_the_flash } + it { should have_sent_email } + end + + context 'with invalid params' do + before do + post :create, :support_request => Factory.attributes_for(:support_request, :email => '') + end + + it { should respond_with(:success) } + it { should render_template(:new) } + end + end + +end diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 0000000..f37e5ed --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,34 @@ +require 'spec_helper' + +describe UsersController do + + context 'GET #show' do + context 'when signed in' do + let(:user) { Factory.create(:user) } + before do + sign_in user + end + + context 'without a user id' do + before do + get :show + end + + it { should respond_with(:success) } + it { should render_template(:show) } + it { should assign_to(:user).with(user) } + end + + context 'with a user id' do + let(:other_user) { Factory.create(:user) } + before do + get :show, :id => other_user.to_param + end + + it { should respond_with(:success) } + it { should render_template(:show) } + it { should assign_to(:user).with(other_user) } + end + end + end +end diff --git a/spec/factories.rb b/spec/factories.rb index b921f22..5d64e6f 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -1,9 +1,25 @@ -require 'factory_girl' +FactoryGirl.define do -Factory.define :user do |u| - u.name 'Test User' - u.email 'user@test.com' - u.password 'please' - u.invitation_token 'faketoken' + sequence :email do |n| + "user#{n}@example.com" + end + + factory :user do + name 'Test User' + email + password 'please' + invitation_token 'faketoken' + house + end + + factory :house do + name 'Our House' + end + + factory :support_request do + name "John Appleseed" + email + message "Seems like theres a serious lack of apples" + end end diff --git a/spec/helpers/pages_helper_spec.rb b/spec/helpers/pages_helper_spec.rb deleted file mode 100644 index 4f75448..0000000 --- a/spec/helpers/pages_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -# Specs in this file have access to a helper object that includes -# the PagesHelper. For example: -# -# describe PagesHelper do -# describe "string concat" do -# it "concats two strings with spaces" do -# helper.concat_strings("this","that").should == "this that" -# end -# end -# end -describe PagesHelper do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/helpers/payments_helper_spec.rb b/spec/helpers/payments_helper_spec.rb deleted file mode 100644 index 32a5d73..0000000 --- a/spec/helpers/payments_helper_spec.rb +++ /dev/null @@ -1,15 +0,0 @@ -require 'spec_helper' - -# Specs in this file have access to a helper object that includes -# the PaymentsHelper. For example: -# -# describe PaymentsHelper do -# describe "string concat" do -# it "concats two strings with spaces" do -# helper.concat_strings("this","that").should == "this that" -# end -# end -# end -describe PaymentsHelper do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/mailers/support_spec.rb b/spec/mailers/support_spec.rb deleted file mode 100644 index 50831a8..0000000 --- a/spec/mailers/support_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require "spec_helper" - -describe Support do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb deleted file mode 100644 index 8d004b3..0000000 --- a/spec/mailers/user_mailer_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require "spec_helper" - -describe UserMailer do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/models/house_spec.rb b/spec/models/house_spec.rb index 25f6ec7..ad6f45e 100644 --- a/spec/models/house_spec.rb +++ b/spec/models/house_spec.rb @@ -1,30 +1,19 @@ require 'spec_helper' describe House do - before(:each) do - @attr = { - :name => "House" - } - end - - it "should create a new house given valid attributes" do - house = House.new(@attr) - house.should be_valid - end - - it "should require a name to be created" do - house = House.new(@attr.merge(:name => "")) - house.should_not be_valid - end + let(:house) { Factory(:house) } - it "should accept duplicate names" do - House.create!(@attr) - house = House.new(@attr) - house.should be_valid + context 'validations' do + it { should validate_presence_of(:name) } + it { should_not validate_uniqueness_of(:name) } end - - it "should have access to any users who belong to it" do - house = House.new(@attr) - house.should respond_to(:users) + + describe '#sponsored?' do + it "should return true when there is a sponsor" do + user = Factory(:user) + house.sponsor = user + house.should be_sponsored + end end -end \ No newline at end of file + +end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 4e5d2b0..5b1ea82 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,78 +1,61 @@ require 'spec_helper' describe User do - before(:each) do - @attr = { - :name => "Andrew Smith", - :email => "ae@smith.com", - :password => "muffins" - } - end - - it "should create a new user given valid attributes" do - User.create!(@attr) - end - it "should not require a name" do - user = User.new(@attr.merge(:name => "")) - user.should be_valid - end + context 'attributes' do + it { should have_field(:time_zone).of_type(String) } - it "should require an email address" do - user = User.new(@attr.merge(:email => "")) - user.should_not be_valid - end + # Stripe + it { should have_field(:stripe_id).of_type(String) } + it { should have_field(:last_4_digits).of_type(String) } + it "should have a non-persisted `stripe_token`" do + user = Factory(:user) + user.stripe_token = 'fake token' + user.stripe_token.should == 'fake token' + user.stub(:update_stripe) + user.save - it "should accept valid email addresses" do - addresses = %w[user@email.com THE_USER@e.mail.org first.last@something.pu] - addresses.each do |address| - user = User.new(@attr.merge(:email => address)) - user.should be_valid + User.find(user.id).stripe_token.should be_nil end end - it "should reject invalid email addresses" do - addresses = %w[user@email,com user_at_email.org first.last@email.] - addresses.each do |address| - user = User.new(@attr.merge(:email => address)) - user.should_not be_valid - end - end - - it "should reject duplicate email addresses" do - User.create!(@attr) - user = User.new(@attr) - user.should_not be_valid - end + context 'indexes' do + it { should have_index_for(:email).with_options(unique: true) } - it "should reject email addresses identical to upcase" do - email = @attr[:email].upcase - User.create!(@attr.merge(:email => email)) - user = User.new(@attr) - user.should_not be_valid end - describe "passwords" do - before(:each) do - @user = User.new(@attr) + context 'validations' do + it { should_not validate_presence_of(:name) } + it { should validate_presence_of(:email) } + it { should validate_uniqueness_of(:email) } + it { should validate_length_of(:password).within(6..32) } + it "should accept valid email addresses" do + addresses = %w[user@email.com THE_USER@e.mail.org first.last@something.pu] + addresses.each do |address| + user = Factory.build(:user, :email => address) + user.should be_valid + end end - it "should not accept passwords shorter than 6 characters" do - pass = 'z' * 5 - user = User.new(@attr.merge(:password => pass)) - user.should_not be_valid + it "should reject invalid email addresses" do + addresses = %w[user@email,com user_at_email.org first.last@email.] + addresses.each do |address| + user = Factory.build(:user, :email => address) + user.should_not be_valid + end end - - it "should not accept passwords longer than 32 characters" do - pass = 'z' * 33 - user = User.new(@attr.merge(:password => pass)) - user.should_not be_valid + + it "should reject email addresses identical to upcase" do + user1 = Factory.create :user + user2 = Factory.build :user, :email => user1.email.upcase + user2.should_not be_valid end + end it "should have access to the house it belongs to" do house = House.new(:name => "House") - user = User.new(@attr.merge(:house => @house)) + user = Factory.build(:user, :house => @house) user.should respond_to(:house) end end diff --git a/spec/requests/house_invitations_spec.rb b/spec/requests/house_invitations_spec.rb deleted file mode 100644 index 7ea92de..0000000 --- a/spec/requests/house_invitations_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'spec_helper' - -describe "HouseInvitations" do - describe "GET /house_invitations" do - it "works! (now write some real specs)" do - # Run the generator again with the --webrat flag if you want to use webrat methods/matchers - get house_invitations_path - response.status.should be(200) - end - end -end diff --git a/spec/routing/house_invitations_routing_spec.rb b/spec/routing/house_invitations_routing_spec.rb deleted file mode 100644 index c7de3fd..0000000 --- a/spec/routing/house_invitations_routing_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require "spec_helper" - -describe HouseInvitationsController do - describe "routing" do - - it "recognizes and generates #index" do - { :get => "/house_invitations" }.should route_to(:controller => "house_invitations", :action => "index") - end - - it "recognizes and generates #new" do - { :get => "/house_invitations/new" }.should route_to(:controller => "house_invitations", :action => "new") - end - - it "recognizes and generates #show" do - { :get => "/house_invitations/1" }.should route_to(:controller => "house_invitations", :action => "show", :id => "1") - end - - it "recognizes and generates #edit" do - { :get => "/house_invitations/1/edit" }.should route_to(:controller => "house_invitations", :action => "edit", :id => "1") - end - - it "recognizes and generates #create" do - { :post => "/house_invitations" }.should route_to(:controller => "house_invitations", :action => "create") - end - - it "recognizes and generates #update" do - { :put => "/house_invitations/1" }.should route_to(:controller => "house_invitations", :action => "update", :id => "1") - end - - it "recognizes and generates #destroy" do - { :delete => "/house_invitations/1" }.should route_to(:controller => "house_invitations", :action => "destroy", :id => "1") - end - - end -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bc38435..81a9eb9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,48 +1,61 @@ -# This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' -require File.expand_path("../../config/environment", __FILE__) -require 'rspec/rails' - -# Requires supporting ruby files with custom matchers and macros, etc, -# in spec/support/ and its subdirectories. -Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} - -RSpec.configure do |config| - # == Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr - config.mock_with :rspec - - # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - # config.fixture_path = "#{::Rails.root}/spec/fixtures" - - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, remove the following line or assign false - # instead of true. - # config.use_transactional_fixtures = true - - # Other things - config.include Devise::TestHelpers, :type => :controller - - # Clean up the database - require 'database_cleaner' - config.before(:suite) do - DatabaseCleaner.strategy = :truncation - DatabaseCleaner.orm = "mongoid" - end - - config.before(:each) do - DatabaseCleaner.clean - end - - config.after :suite do - Mongoid.master.collections.select do |collection| - collection.name !~ /system/ - end.each(&:drop) +require 'rubygems' +require 'spork' + +Spork.prefork do + ENV["RAILS_ENV"] ||= 'test' + + # Prevents Mongoid from preloading models + # Must come before environment is loaded + require 'rails/mongoid' + Spork.trap_class_method(Rails::Mongoid, :load_models) + + # Prevents Devise from loading the user model + require 'rails/application' + Spork.trap_method(Rails::Application::RoutesReloader, :reload!) + + require File.expand_path("../../config/environment", __FILE__) + require 'rspec/rails' + + # Loading more in this block will cause your tests to run faster. However, + # if you change any configuration or code from libraries loaded here, you'll + # need to restart spork for it take effect. + + # Requires supporting ruby files with custom matchers and macros, etc, + # in spec/support/ and its subdirectories. + Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} + + RSpec.configure do |config| + # == Mock Framework + # + # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: + # + # config.mock_with :mocha + # config.mock_with :flexmock + # config.mock_with :rr + config.mock_with :rspec + + # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures + # config.fixture_path = "#{::Rails.root}/spec/fixtures" + + # MongoDB requires special cleanup + config.before(:suite) do + DatabaseCleaner.strategy = :truncation + DatabaseCleaner.orm = "mongoid" + end + config.before(:each) do + DatabaseCleaner.clean + end + config.after :suite do + Mongoid.master.collections.select do |collection| + collection.name !~ /system/ + end.each(&:drop) + end end +end +Spork.each_run do + # This code will be run each time you run your specs. + Roomies::Application.reload_routes! + FactoryGirl.reload end + diff --git a/spec/support/action_mailer.rb b/spec/support/action_mailer.rb new file mode 100644 index 0000000..a9117c5 --- /dev/null +++ b/spec/support/action_mailer.rb @@ -0,0 +1,15 @@ +module ActionMailerHelpers + def ignore_mailers + ActionMailer::Base.any_instance.stub!(:deliver).and_return true + result = yield + ActionMailer::Base.any_instance.unstub!(:deliver) + return result + end +end + + +RSpec.configure do |config| + config.include ActionMailerHelpers + config.include Shoulda::Matchers::ActionMailer +end + diff --git a/spec/support/mongoid.rb b/spec/support/mongoid.rb index 8acfc31..5737267 100644 --- a/spec/support/mongoid.rb +++ b/spec/support/mongoid.rb @@ -1,3 +1,55 @@ +module Mongoid # HACK: Remove when mongoid-rspec gets updated + module Matchers + class HaveIndexForMatcher # :nodoc: + def initialize(index_fields) + @index_fields = index_fields + end + + def with_options(options = {}) + @options = options + self + end + + def matches?(klass) + @klass = klass.is_a?(Class) ? klass : klass.class + @errors = [] + + if @klass.index_options[@index_fields].nil? + @errors.push "no index for #{@index_fields}" + else + if !@options.nil? && !@options.empty? + @options.each do |option, option_value| + if @klass.index_options[@index_fields].include?(option) && @klass.index_options[@index_fields][option] != option_value + @errors.push "index for #{@index_fields.inspect} with options of #{@klass.index_options[@index_fields].inspect}" + end + end + end + end + + @errors.empty? + end + + def failure_message_for_should + "Expected #{@klass.inspect} to #{description}, got #{@errors.to_sentence}" + end + + def failure_message_for_should_not + "Expected #{@klass.inspect} to not #{description}, got #{@klass.inspect} to #{description}" + end + + def description + desc = "have an index for #{@index_fields.inspect}" + desc << " with options of #{@options.inspect}" if @options + desc + end + end + + def have_index_for(index_fields) + HaveIndexForMatcher.new(index_fields) + end + end +end + RSpec.configure do |config| config.include Mongoid::Matchers end diff --git a/spec/views/pages/about.html.haml_spec.rb b/spec/views/pages/about.html.haml_spec.rb deleted file mode 100644 index 9b7b881..0000000 --- a/spec/views/pages/about.html.haml_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe "pages/about.html.haml" do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/views/pages/privacy.html.haml_spec.rb b/spec/views/pages/privacy.html.haml_spec.rb deleted file mode 100644 index 8f18ece..0000000 --- a/spec/views/pages/privacy.html.haml_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe "pages/privacy.html.haml" do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/spec/views/pages/service.html.haml_spec.rb b/spec/views/pages/service.html.haml_spec.rb deleted file mode 100644 index 470138c..0000000 --- a/spec/views/pages/service.html.haml_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'spec_helper' - -describe "pages/service.html.haml" do - pending "add some examples to (or delete) #{__FILE__}" -end diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb deleted file mode 100644 index 867fc8c..0000000 --- a/test/performance/browsing_test.rb +++ /dev/null @@ -1,9 +0,0 @@ -require 'test_helper' -require 'rails/performance_test_help' - -# Profiling results for each test method are written to tmp/performance. -class BrowsingTest < ActionDispatch::PerformanceTest - def test_homepage - get '/' - end -end diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index 8bf1192..0000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,13 +0,0 @@ -ENV["RAILS_ENV"] = "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - fixtures :all - - # Add more helper methods to be used by all tests here... -end diff --git a/public/stylesheets/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png b/vendor/assets/images/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png rename to vendor/assets/images/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png diff --git a/public/stylesheets/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png b/vendor/assets/images/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png rename to vendor/assets/images/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png diff --git a/public/stylesheets/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png b/vendor/assets/images/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png rename to vendor/assets/images/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png diff --git a/public/stylesheets/cupertino/images/ui-bg_glass_50_3baae3_1x400.png b/vendor/assets/images/cupertino/images/ui-bg_glass_50_3baae3_1x400.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_glass_50_3baae3_1x400.png rename to vendor/assets/images/cupertino/images/ui-bg_glass_50_3baae3_1x400.png diff --git a/public/stylesheets/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png b/vendor/assets/images/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png rename to vendor/assets/images/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png diff --git a/public/stylesheets/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png b/vendor/assets/images/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png rename to vendor/assets/images/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png diff --git a/public/stylesheets/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png b/vendor/assets/images/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png rename to vendor/assets/images/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png diff --git a/public/stylesheets/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png b/vendor/assets/images/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png rename to vendor/assets/images/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png diff --git a/public/stylesheets/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png b/vendor/assets/images/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png rename to vendor/assets/images/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png diff --git a/public/stylesheets/cupertino/images/ui-icons_2694e8_256x240.png b/vendor/assets/images/cupertino/images/ui-icons_2694e8_256x240.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-icons_2694e8_256x240.png rename to vendor/assets/images/cupertino/images/ui-icons_2694e8_256x240.png diff --git a/public/stylesheets/cupertino/images/ui-icons_2e83ff_256x240.png b/vendor/assets/images/cupertino/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-icons_2e83ff_256x240.png rename to vendor/assets/images/cupertino/images/ui-icons_2e83ff_256x240.png diff --git a/public/stylesheets/cupertino/images/ui-icons_3d80b3_256x240.png b/vendor/assets/images/cupertino/images/ui-icons_3d80b3_256x240.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-icons_3d80b3_256x240.png rename to vendor/assets/images/cupertino/images/ui-icons_3d80b3_256x240.png diff --git a/public/stylesheets/cupertino/images/ui-icons_72a7cf_256x240.png b/vendor/assets/images/cupertino/images/ui-icons_72a7cf_256x240.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-icons_72a7cf_256x240.png rename to vendor/assets/images/cupertino/images/ui-icons_72a7cf_256x240.png diff --git a/public/stylesheets/cupertino/images/ui-icons_ffffff_256x240.png b/vendor/assets/images/cupertino/images/ui-icons_ffffff_256x240.png similarity index 100% rename from public/stylesheets/cupertino/images/ui-icons_ffffff_256x240.png rename to vendor/assets/images/cupertino/images/ui-icons_ffffff_256x240.png diff --git a/public/javascripts/date.js b/vendor/assets/javascripts/date.js similarity index 100% rename from public/javascripts/date.js rename to vendor/assets/javascripts/date.js diff --git a/public/javascripts/modernizr.min.js b/vendor/assets/javascripts/modernizr.min.js similarity index 100% rename from public/javascripts/modernizr.min.js rename to vendor/assets/javascripts/modernizr.min.js diff --git a/public/javascripts/selectivizr-min.js b/vendor/assets/javascripts/selectivizr.min.js similarity index 100% rename from public/javascripts/selectivizr-min.js rename to vendor/assets/javascripts/selectivizr.min.js diff --git a/public/javascripts/underscore.min.js b/vendor/assets/javascripts/underscore.min.js similarity index 100% rename from public/javascripts/underscore.min.js rename to vendor/assets/javascripts/underscore.min.js diff --git a/public/stylesheets/cupertino/jquery-ui-1.8.11.custom.css b/vendor/assets/stylesheets/jquery-ui-1.8.11.custom.css similarity index 100% rename from public/stylesheets/cupertino/jquery-ui-1.8.11.custom.css rename to vendor/assets/stylesheets/jquery-ui-1.8.11.custom.css