Browse files

Add new 2013 teaser site

  • Loading branch information...
1 parent 4f4a750 commit 9265a611d9d008d36e99cacf8f997021327b8d3d Ryan Merrill committed Nov 30, 2012
Showing with 28,805 additions and 198 deletions.
  1. +7 −11 Gemfile
  2. +79 −90 Gemfile.lock
  3. +79 −0 README.md
  4. +14 −88 config.rb
  5. +3 −9 config.ru
  6. +32 −0 config/deploy.rb
  7. BIN source/fonts/font-awesome/fontawesome-webfont.eot
  8. +255 −0 source/fonts/font-awesome/fontawesome-webfont.svg
  9. BIN source/fonts/font-awesome/fontawesome-webfont.svgz
  10. BIN source/fonts/font-awesome/fontawesome-webfont.ttf
  11. BIN source/fonts/font-awesome/fontawesome-webfont.woff
  12. BIN source/images/backgrounds/bg-building.png
  13. BIN source/images/backgrounds/bg-page.png
  14. BIN source/images/img-building.png
  15. BIN source/images/img-logo.png
  16. BIN source/images/img-logo@2x.png
  17. +223 −0 source/index.html.erb
  18. +1,018 −0 source/javascripts/libs/chosen.jquery.js
  19. +14,742 −0 source/javascripts/libs/jquery-ui.js
  20. +160 −0 source/javascripts/libs/jquery.anystretch.js
  21. +185 −0 source/javascripts/libs/jquery.backstretch.js
  22. +181 −0 source/javascripts/libs/jquery.formalize.js
  23. +9,227 −0 source/javascripts/libs/jquery.js
  24. +1,334 −0 source/javascripts/libs/modernizr.js
  25. +5 −0 source/javascripts/public.js
  26. +22 −0 source/javascripts/public/public.js.coffee
  27. +2 −0 source/layouts/.gitignore
  28. +68 −0 source/layouts/public.erb
  29. +87 −0 source/stylesheets/partials/_base.scss
  30. +32 −0 source/stylesheets/partials/_bootstrap-responsive.scss
  31. +423 −0 source/stylesheets/partials/_custom_mixins.scss
  32. +330 −0 source/stylesheets/partials/_font_awesome.scss
  33. +5 −0 source/stylesheets/print.css.scss
  34. +292 −0 source/stylesheets/screen.css.scss
  35. 0 tmp/restart.txt
View
18 Gemfile
@@ -1,12 +1,8 @@
-source 'http://rubygems.org'
+source :rubygems
-gem "rack-contrib"
-
-group :development do
- gem "middleman", '>= 2.0.0'
- gem "foreman"
- gem "heroku"
- gem "watchr"
- gem "rb-fsevent"
- gem "growl_notify"
-end
+gem "coffee_cup"
+gem "sass", "~> 3.2.1"
+gem "susy", "~> 1.0.5"
+gem "middleman", "~> 3.0.6"
+gem 'middleman-smusher'
+gem "compass", "~> 0.12.2"
View
169 Gemfile.lock
@@ -1,133 +1,122 @@
GEM
remote: http://rubygems.org/
specs:
- activesupport (3.2.3)
+ activesupport (3.2.8)
i18n (~> 0.6)
multi_json (~> 1.0)
- addressable (2.2.7)
- chunky_png (1.2.5)
+ chunky_png (1.2.6)
coffee-script (2.2.0)
coffee-script-source
execjs
- coffee-script-source (1.2.0)
- compass (0.12.1)
+ coffee-script-source (1.3.3)
+ coffee_cup (0.0.4)
+ compass (0.12.2)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
- daemons (1.1.8)
- em-websocket (0.3.6)
- addressable (>= 2.1.1)
- eventmachine (>= 0.12.9)
- eventmachine (0.12.10)
- execjs (1.2.13)
+ execjs (1.4.0)
multi_json (~> 1.0)
- foreman (0.41.0)
- thor (>= 0.13.6)
- fssm (0.2.8.1)
- growl_notify (0.0.3)
- rb-appscript
- guard (0.6.3)
- thor (~> 0.14.6)
- guard-livereload (0.3.1)
- em-websocket (>= 0.2.0)
- guard (>= 0.4.0)
- multi_json (~> 1.0.3)
- haml (3.1.4)
- heroku (2.24.0)
- launchy (>= 0.3.2)
- netrc (~> 0.7.1)
- rest-client (~> 1.6.1)
- rubyzip
+ ffi (1.1.5)
+ fssm (0.2.9)
+ haml (3.1.7)
hike (1.2.1)
http_router (0.10.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
- i18n (0.6.0)
- launchy (2.1.0)
- addressable (~> 2.2.6)
- maruku (0.6.0)
+ httpclient (2.2.7)
+ i18n (0.6.1)
+ json (1.7.5)
+ listen (0.5.3)
+ maruku (0.6.1)
syntax (>= 1.0.0)
- middleman (2.0.15.2)
- coffee-script (~> 2.2.0)
- compass (~> 0.11)
- execjs (~> 1.2.7)
- guard (~> 0.6.2)
- haml (~> 3.1.0)
- maruku (~> 0.6.0)
- middleman-livereload (~> 0.2.0)
- padrino-core (~> 0.10.5)
- padrino-helpers (~> 0.10.5)
- rack (~> 1.3.5)
+ middleman (3.0.6)
+ middleman-core (= 3.0.6)
+ middleman-more (= 3.0.6)
+ middleman-sprockets (~> 3.0.2)
+ middleman-core (3.0.6)
+ activesupport (~> 3.2.6)
+ bundler (~> 1.1)
+ listen (~> 0.5.2)
+ rack (~> 1.4.1)
rack-test (~> 0.6.1)
- sass (>= 3.1.7)
- sinatra (~> 1.3.1)
- slim (~> 1.0.2)
- sprockets (~> 2.0.3)
- thin (~> 1.2.11)
- thor (~> 0.14.0)
+ rb-fsevent (~> 0.9.1)
+ rb-inotify (~> 0.8.8)
+ thor (~> 0.15.4)
tilt (~> 1.3.1)
- uglifier (~> 1.2)
- middleman-livereload (0.2.1)
- guard-livereload (~> 0.3.1)
- mime-types (1.18)
- multi_json (1.0.4)
- netrc (0.7.1)
- padrino-core (0.10.6)
+ middleman-more (3.0.6)
+ coffee-script (~> 2.2.0)
+ coffee-script-source (~> 1.3.3)
+ compass (>= 0.12.2)
+ execjs (~> 1.4.0)
+ haml (>= 3.1.6)
+ i18n (~> 0.6.0)
+ maruku (~> 0.6.0)
+ middleman-core (= 3.0.6)
+ padrino-helpers (= 0.10.7)
+ sass (>= 3.1.20)
+ uglifier (~> 1.2.6)
+ middleman-smusher (3.0.0)
+ middleman (>= 3.0.0)
+ smusher (~> 0.4.9)
+ middleman-sprockets (3.0.4)
+ middleman-more (~> 3.0.1)
+ sprockets (~> 2.1, < 2.5)
+ sprockets-sass (~> 0.8.0)
+ multi_json (1.3.6)
+ padrino-core (0.10.7)
activesupport (~> 3.2.0)
http_router (~> 0.10.2)
sinatra (~> 1.3.1)
- thor (~> 0.14.3)
+ thor (~> 0.15.2)
tilt (~> 1.3.0)
- padrino-helpers (0.10.6)
+ padrino-helpers (0.10.7)
i18n (~> 0.6)
- padrino-core (= 0.10.6)
- rack (1.3.6)
- rack-contrib (1.1.0)
- rack (>= 0.9.1)
+ padrino-core (= 0.10.7)
+ rack (1.4.1)
rack-protection (1.2.0)
rack
- rack-test (0.6.1)
+ rack-test (0.6.2)
rack (>= 1.0)
- rb-appscript (0.6.1)
- rb-fsevent (0.9.0)
- rest-client (1.6.7)
- mime-types (>= 1.16)
- rubyzip (0.9.6.1)
- sass (3.1.15)
- sinatra (1.3.2)
+ rake (0.9.2.2)
+ rb-fsevent (0.9.2)
+ rb-inotify (0.8.8)
+ ffi (>= 0.5.0)
+ sass (3.2.1)
+ sinatra (1.3.3)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
- slim (1.0.4)
- temple (~> 0.3.4)
- tilt (~> 1.3.2)
- sprockets (2.0.3)
+ smusher (0.4.9)
+ httpclient (>= 2.2)
+ json
+ rake
+ sprockets (2.4.5)
hike (~> 1.2)
+ multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
+ sprockets-sass (0.8.0)
+ sprockets (~> 2.0)
+ tilt (~> 1.1)
+ susy (1.0.5)
+ compass (>= 0.12.2)
+ sass (>= 3.2.0)
syntax (1.0.0)
- temple (0.3.5)
- thin (1.2.11)
- daemons (>= 1.0.9)
- eventmachine (>= 0.12.6)
- rack (>= 1.0.0)
- thor (0.14.6)
+ thor (0.15.4)
tilt (1.3.3)
- uglifier (1.2.4)
+ uglifier (1.2.7)
execjs (>= 0.3.0)
- multi_json (>= 1.0.2)
+ multi_json (~> 1.3)
url_mount (0.2.1)
rack
- watchr (0.7)
PLATFORMS
ruby
DEPENDENCIES
- foreman
- growl_notify
- heroku
- middleman (>= 2.0.0)
- rack-contrib
- rb-fsevent
- watchr
+ coffee_cup
+ compass (~> 0.12.2)
+ middleman (~> 3.0.6)
+ middleman-smusher
+ sass (~> 3.2.1)
+ susy (~> 1.0.5)
View
79 README.md
@@ -0,0 +1,79 @@
+# Getting Started Guide
+
+[Ample](http://www.helloample.com/) is using [Middleman](http://middlemanapp.com/guides/getting-started) to allow for templating, SASS & CoffeeScript. This is our getting started styles and markup guide. Enjoy.
+
+## Setup
+
+###Get the repo up and running locally:
+
+1. #####Create a new repo#####
+
+2. #####Clone the Getting Started repo#####
+
+ ```
+ $ git clone git@github.com:ample/ample-getting-started.git
+ ```
+3. #####Rename the cloned directory and cd into it#####
+
+ ```
+ $ mv ample-getting-started your-project
+ $ cd your-project
+ ```
+4. #####Remove the git directory#####
+
+ ```
+ $ rm -rf .git
+ ```
+5. #####Re-init the git repo#####
+
+ ```
+ $ git init
+ ```
+6. #####Add the new origin#####
+
+ ```
+ $ git remote add origin git@github.com:ample/your-project.git
+ ```
+7. #####Add the new files and commit#####
+
+ ```
+ $ git add .
+ $ git commit -m "Initial commit."
+ ```
+8. #####Create a new gemset with the name of your project#####
+
+ ```
+ $ echo 'rvm 1.9.3@your-project --create' > .rvmrc
+ ```
+9. #####Move out of the directory and then back in to initialize your gemset#####
+
+ ```
+ $ cd ..
+ $ cd your-project
+ ```
+10. #####Install bundler#####
+
+ ```
+ $ gem install bundler
+ ```
+11. #####Install the project's gems with bundler
+
+ ```
+ $ bundle install
+ ```
+
+## Usage
+
+### Running the server
+
+ # Start the middleman server
+ $ middleman server
+
+### Generate static assets for release:
+
+ $ middleman build
+
+## Questions?
+
+
+Contact developers@helloample.com
View
102 config.rb
@@ -1,92 +1,18 @@
-###
-# Compass
-###
-
-# Susy grids in Compass
-# First: gem install compass-susy-plugin
-# require 'susy'
-
-# Change Compass configuration
-# compass_config do |config|
-# config.output_style = :compact
-# end
-
-###
-# Haml
-###
-
-# CodeRay syntax highlighting in Haml
-# First: gem install haml-coderay
-# require 'haml-coderay'
-
-# CoffeeScript filters in Haml
-# First: gem install coffee-filter
-# require 'coffee-filter'
-
-# Automatic image dimensions on image_tag helper
-# activate :automatic_image_sizes
-
-###
-# Page command
-###
-
-# Per-page layout changes:
-#
-# With no layout
-# page "/path/to/file.html", :layout => false
-#
-# With alternative layout
-# page "/path/to/file.html", :layout => :otherlayout
-#
-# A path which all have the same layout
-# with_layout :admin do
-# page "/admin/*"
-# end
-
-# Proxy (fake) files
-# page "/this-page-has-no-template.html", :proxy => "/template-file.html" do
-# @which_fake_page = "Rendering a fake page with a variable"
-# end
-
-###
-# Helpers
-###
+require 'compass'
# Methods defined in the helpers block are available in templates
-# helpers do
-# def some_helper
-# "Helping"
-# end
-# end
-
-# Change the CSS directory
-# set :css_dir, "alternative_css_directory"
-
-# Change the JS directory
-# set :js_dir, "alternative_js_directory"
-
-# Change the images directory
-# set :images_dir, "alternative_image_directory"
-
-# Build-specific configuration
-configure :build do
- # For example, change the Compass output style for deployment
- # activate :minify_css
+helpers do
- # Minify Javascript on build
- # activate :minify_javascript
+ # Calculate the years for a copyright
+ def copyright_years(start_year)
+ end_year = Date.today.year
+ if start_year == end_year
+ start_year.to_s
+ else
+ start_year.to_s + '-' + end_year.to_s
+ end
+ end
- # Enable cache buster
- # activate :cache_buster
-
- # Use relative URLs
- # activate :relative_assets
-
- # Compress PNGs after build
- # First: gem install middleman-smusher
- # require "middleman-smusher"
- # activate :smusher
-
- # Or use a different image path
- # set :http_path, "/Content/images/"
-end
+end
+
+page "*", :layout => "public"
View
12 config.ru
@@ -1,10 +1,4 @@
-require 'rack'
-require 'rack/contrib/try_static'
+require 'rubygems'
+require 'middleman'
-use ::Rack::TryStatic,
- :root => "build", # where middleman files are generated
- :urls => %w[/], # match all requests
- :try => ['.html', 'index.html', '/index.html'] # try these postfixes sequentially
-
-# 404
-run lambda { |env| [404, {'Content-Type' => 'text/html'}, ['whoops! Not Found']] }
+run Middleman.server
View
32 config/deploy.rb
@@ -0,0 +1,32 @@
+set :application, 'learningally'
+set :repository, 'build'
+set :scm, :none
+set :deploy_via, :copy
+set :copy_compression, :gzip
+set :use_sudo, false
+set :user, 'uhlenbrock'
+set :group, user
+set :host, '67.207.143.235'
+set :deploy_to, "/home/#{user}/sites/#{application}.helloample.com"
+set :keep_releases, 4
+
+role :web, host
+role :app, host
+role :db, host, :primary => true
+ssh_options[:port] = 30123
+
+before 'deploy:update', 'deploy:build_middleman'
+
+namespace :deploy do
+
+ [:start, :stop, :restart, :finalize_update].each do |t|
+ desc "#{t} task is a no-op with middleman"
+ task t, :roles => :app do ; end
+ end
+
+ desc 'Run middleman build to update site before uploading'
+ task :build_middleman do
+ %x(rm -rf build && bundle exec middleman build)
+ end
+
+end
View
BIN source/fonts/font-awesome/fontawesome-webfont.eot
Binary file not shown.
View
255 source/fonts/font-awesome/fontawesome-webfont.svg
255 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
BIN source/fonts/font-awesome/fontawesome-webfont.svgz
Binary file not shown.
View
BIN source/fonts/font-awesome/fontawesome-webfont.ttf
Binary file not shown.
View
BIN source/fonts/font-awesome/fontawesome-webfont.woff
Binary file not shown.
View
BIN source/images/backgrounds/bg-building.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN source/images/backgrounds/bg-page.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN source/images/img-building.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN source/images/img-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN source/images/img-logo@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
223 source/index.html.erb
@@ -0,0 +1,223 @@
+<section class="description">
+ <div class="description-content">
+ <header class="description-header">
+ <h2>
+ It's a conference without cubicles
+ </h2>
+ <h3>
+ Where developers, designers and social media types
+ <br /> share what they know.
+ </h3>
+ </header>
+ <!-- description-header -->
+ <ul class="date-time">
+ <li>
+ May 10 &amp; 11, 2013
+ </li>
+ <li>
+ Contemporary Arts Center
+ </li>
+ <li>
+ Cincinnati, OH
+ </li>
+ </ul>
+ <!-- /date-time -->
+ </div>
+
+
+</section>
+<!-- /description -->
+
+
+<section class="email-signup">
+
+ <div id="mc_embed_signup">
+ <form action="http://qcmerge.us4.list-manage.com/subscribe/post?u=8c64d42f5af77dfcaa8d23c71&amp;id=2583a69c7d" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
+ <div class="mc-field-group">
+ <label for="mce-EMAIL">Sign up for upcoming details about this conference</label>
+ <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Email Address">
+ </div>
+
+ <div id="mce-responses" class="clear">
+ <div class="response" id="mce-error-response" style="display:none"></div>
+ <div class="response" id="mce-success-response" style="display:none"></div>
+ </div>
+ <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
+ </form>
+ </div>
+ <script type="text/javascript">
+ var fnames = new Array();var ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';
+ try {
+ var jqueryLoaded=jQuery;
+ jqueryLoaded=true;
+ } catch(err) {
+ var jqueryLoaded=false;
+ }
+ var head= document.getElementsByTagName('head')[0];
+ if (!jqueryLoaded) {
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js';
+ head.appendChild(script);
+ if (script.readyState && script.onload!==null){
+ script.onreadystatechange= function () {
+ if (this.readyState == 'complete') mce_preload_check();
+ }
+ }
+ }
+ var script = document.createElement('script');
+ script.type = 'text/javascript';
+ script.src = 'http://downloads.mailchimp.com/js/jquery.form-n-validate.js';
+ head.appendChild(script);
+ var err_style = '';
+ try{
+ err_style = mc_custom_error_style;
+ } catch(e){
+ err_style = '#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}';
+ }
+ var head= document.getElementsByTagName('head')[0];
+ var style= document.createElement('style');
+ style.type= 'text/css';
+ if (style.styleSheet) {
+ style.styleSheet.cssText = err_style;
+ } else {
+ style.appendChild(document.createTextNode(err_style));
+ }
+ head.appendChild(style);
+ setTimeout('mce_preload_check();', 250);
+
+ var mce_preload_checks = 0;
+ function mce_preload_check(){
+ if (mce_preload_checks>40) return;
+ mce_preload_checks++;
+ try {
+ var jqueryLoaded=jQuery;
+ } catch(err) {
+ setTimeout('mce_preload_check();', 250);
+ return;
+ }
+ try {
+ var validatorLoaded=jQuery("#fake-form").validate({});
+ } catch(err) {
+ setTimeout('mce_preload_check();', 250);
+ return;
+ }
+ mce_init_form();
+ }
+ function mce_init_form(){
+ jQuery(document).ready( function($) {
+ var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){} };
+ var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
+ $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
+ options = { url: 'http://qcmerge.us4.list-manage1.com/subscribe/post-json?u=8c64d42f5af77dfcaa8d23c71&id=2583a69c7d&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
+ beforeSubmit: function(){
+ $('#mce_tmp_error_msg').remove();
+ $('.datefield','#mc_embed_signup').each(
+ function(){
+ var txt = 'filled';
+ var fields = new Array();
+ var i = 0;
+ $(':text', this).each(
+ function(){
+ fields[i] = this;
+ i++;
+ });
+ $(':hidden', this).each(
+ function(){
+ var bday = false;
+ if (fields.length == 2){
+ bday = true;
+ fields[2] = {'value':1970};//trick birthdays into having years
+ }
+ if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
+ this.value = '';
+ } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
+ this.value = '';
+ } else {
+ if (/\[day\]/.test(fields[0].name)){
+ this.value = fields[1].value+'/'+fields[0].value+'/'+fields[2].value;
+ } else {
+ this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
+ }
+ }
+ });
+ });
+ return mce_validator.form();
+ },
+ success: mce_success_cb
+ };
+ $('#mc-embedded-subscribe-form').ajaxForm(options);
+ });
+ }
+ function mce_success_cb(resp){
+ $('#mce-success-response').hide();
+ $('#mce-error-response').hide();
+ if (resp.result=="success"){
+ $('#mce-'+resp.result+'-response').show();
+ $('#mce-'+resp.result+'-response').html(resp.msg);
+ $('#mc-embedded-subscribe-form').each(function(){
+ this.reset();
+ });
+ } else {
+ var index = -1;
+ var msg;
+ try {
+ var parts = resp.msg.split(' - ',2);
+ if (parts[1]==undefined){
+ msg = resp.msg;
+ } else {
+ i = parseInt(parts[0]);
+ if (i.toString() == parts[0]){
+ index = parts[0];
+ msg = parts[1];
+ } else {
+ index = -1;
+ msg = resp.msg;
+ }
+ }
+ } catch(e){
+ index = -1;
+ msg = resp.msg;
+ }
+ try{
+ if (index== -1){
+ $('#mce-'+resp.result+'-response').show();
+ $('#mce-'+resp.result+'-response').html(msg);
+ } else {
+ err_id = 'mce_tmp_error_msg';
+ html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
+
+ var input_id = '#mc_embed_signup';
+ var f = $(input_id);
+ if (ftypes[index]=='address'){
+ input_id = '#mce-'+fnames[index]+'-addr1';
+ f = $(input_id).parent().parent().get(0);
+ } else if (ftypes[index]=='date'){
+ input_id = '#mce-'+fnames[index]+'-month';
+ f = $(input_id).parent().parent().get(0);
+ } else {
+ input_id = '#mce-'+fnames[index];
+ f = $().parent(input_id).get(0);
+ }
+ if (f){
+ $(f).append(html);
+ $(input_id).focus();
+ } else {
+ $('#mce-'+resp.result+'-response').show();
+ $('#mce-'+resp.result+'-response').html(msg);
+ }
+ }
+ } catch(e){
+ $('#mce-'+resp.result+'-response').show();
+ $('#mce-'+resp.result+'-response').html(msg);
+ }
+ }
+ }
+
+ </script>
+ <!--End mc_embed_signup-->
+
+
+
+</section>
+<!-- /email-signup -->
View
1,018 source/javascripts/libs/chosen.jquery.js
@@ -0,0 +1,1018 @@
+// Chosen, a Select Box Enhancer for jQuery and Protoype
+// by Patrick Filler for Harvest, http://getharvest.com
+//
+// Version 0.9.8
+// Full source at https://github.com/harvesthq/chosen
+// Copyright (c) 2011 Harvest http://getharvest.com
+
+// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
+// This file is generated by `cake build`, do not edit it by hand.
+(function() {
+ var SelectParser;
+
+ SelectParser = (function() {
+
+ function SelectParser() {
+ this.options_index = 0;
+ this.parsed = [];
+ }
+
+ SelectParser.prototype.add_node = function(child) {
+ if (child.nodeName.toUpperCase() === "OPTGROUP") {
+ return this.add_group(child);
+ } else {
+ return this.add_option(child);
+ }
+ };
+
+ SelectParser.prototype.add_group = function(group) {
+ var group_position, option, _i, _len, _ref, _results;
+ group_position = this.parsed.length;
+ this.parsed.push({
+ array_index: group_position,
+ group: true,
+ label: group.label,
+ children: 0,
+ disabled: group.disabled
+ });
+ _ref = group.childNodes;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ option = _ref[_i];
+ _results.push(this.add_option(option, group_position, group.disabled));
+ }
+ return _results;
+ };
+
+ SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
+ if (option.nodeName.toUpperCase() === "OPTION") {
+ if (option.text !== "") {
+ if (group_position != null) this.parsed[group_position].children += 1;
+ this.parsed.push({
+ array_index: this.parsed.length,
+ options_index: this.options_index,
+ value: option.value,
+ text: option.text,
+ html: option.innerHTML,
+ selected: option.selected,
+ disabled: group_disabled === true ? group_disabled : option.disabled,
+ group_array_index: group_position,
+ classes: option.className,
+ style: option.style.cssText
+ });
+ } else {
+ this.parsed.push({
+ array_index: this.parsed.length,
+ options_index: this.options_index,
+ empty: true
+ });
+ }
+ return this.options_index += 1;
+ }
+ };
+
+ return SelectParser;
+
+ })();
+
+ SelectParser.select_to_array = function(select) {
+ var child, parser, _i, _len, _ref;
+ parser = new SelectParser();
+ _ref = select.childNodes;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ child = _ref[_i];
+ parser.add_node(child);
+ }
+ return parser.parsed;
+ };
+
+ this.SelectParser = SelectParser;
+
+}).call(this);
+
+/*
+Chosen source: generate output using 'cake build'
+Copyright (c) 2011 by Harvest
+*/
+
+(function() {
+ var AbstractChosen, root;
+
+ root = this;
+
+ AbstractChosen = (function() {
+
+ function AbstractChosen(form_field, options) {
+ this.form_field = form_field;
+ this.options = options != null ? options : {};
+ this.set_default_values();
+ this.is_multiple = this.form_field.multiple;
+ this.set_default_text();
+ this.setup();
+ this.set_up_html();
+ this.register_observers();
+ this.finish_setup();
+ }
+
+ AbstractChosen.prototype.set_default_values = function() {
+ var _this = this;
+ this.click_test_action = function(evt) {
+ return _this.test_active_click(evt);
+ };
+ this.activate_action = function(evt) {
+ return _this.activate_field(evt);
+ };
+ this.active_field = false;
+ this.mouse_on_container = false;
+ this.results_showing = false;
+ this.result_highlighted = null;
+ this.result_single_selected = null;
+ this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
+ this.disable_search_threshold = this.options.disable_search_threshold || 0;
+ this.disable_search = this.options.disable_search || false;
+ this.search_contains = this.options.search_contains || false;
+ this.choices = 0;
+ this.single_backstroke_delete = this.options.single_backstroke_delete || false;
+ return this.max_selected_options = this.options.max_selected_options || Infinity;
+ };
+
+ AbstractChosen.prototype.set_default_text = function() {
+ if (this.form_field.getAttribute("data-placeholder")) {
+ this.default_text = this.form_field.getAttribute("data-placeholder");
+ } else if (this.is_multiple) {
+ this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || "Select Some Options";
+ } else {
+ this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || "Select an Option";
+ }
+ return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "No results match";
+ };
+
+ AbstractChosen.prototype.mouse_enter = function() {
+ return this.mouse_on_container = true;
+ };
+
+ AbstractChosen.prototype.mouse_leave = function() {
+ return this.mouse_on_container = false;
+ };
+
+ AbstractChosen.prototype.input_focus = function(evt) {
+ var _this = this;
+ if (this.is_multiple) {
+ if (!this.active_field) {
+ return setTimeout((function() {
+ return _this.container_mousedown();
+ }), 50);
+ }
+ } else {
+ if (!this.active_field) return this.activate_field();
+ }
+ };
+
+ AbstractChosen.prototype.input_blur = function(evt) {
+ var _this = this;
+ if (!this.mouse_on_container) {
+ this.active_field = false;
+ return setTimeout((function() {
+ return _this.blur_test();
+ }), 100);
+ }
+ };
+
+ AbstractChosen.prototype.result_add_option = function(option) {
+ var classes, style;
+ if (!option.disabled) {
+ option.dom_id = this.container_id + "_o_" + option.array_index;
+ classes = option.selected && this.is_multiple ? [] : ["active-result"];
+ if (option.selected) classes.push("result-selected");
+ if (option.group_array_index != null) classes.push("group-option");
+ if (option.classes !== "") classes.push(option.classes);
+ style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
+ return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
+ } else {
+ return "";
+ }
+ };
+
+ AbstractChosen.prototype.results_update_field = function() {
+ if (!this.is_multiple) this.results_reset_cleanup();
+ this.result_clear_highlight();
+ this.result_single_selected = null;
+ return this.results_build();
+ };
+
+ AbstractChosen.prototype.results_toggle = function() {
+ if (this.results_showing) {
+ return this.results_hide();
+ } else {
+ return this.results_show();
+ }
+ };
+
+ AbstractChosen.prototype.results_search = function(evt) {
+ if (this.results_showing) {
+ return this.winnow_results();
+ } else {
+ return this.results_show();
+ }
+ };
+
+ AbstractChosen.prototype.keyup_checker = function(evt) {
+ var stroke, _ref;
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
+ this.search_field_scale();
+ switch (stroke) {
+ case 8:
+ if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
+ return this.keydown_backstroke();
+ } else if (!this.pending_backstroke) {
+ this.result_clear_highlight();
+ return this.results_search();
+ }
+ break;
+ case 13:
+ evt.preventDefault();
+ if (this.results_showing) return this.result_select(evt);
+ break;
+ case 27:
+ if (this.results_showing) this.results_hide();
+ return true;
+ case 9:
+ case 38:
+ case 40:
+ case 16:
+ case 91:
+ case 17:
+ break;
+ default:
+ return this.results_search();
+ }
+ };
+
+ AbstractChosen.prototype.generate_field_id = function() {
+ var new_id;
+ new_id = this.generate_random_id();
+ this.form_field.id = new_id;
+ return new_id;
+ };
+
+ AbstractChosen.prototype.generate_random_char = function() {
+ var chars, newchar, rand;
+ chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ rand = Math.floor(Math.random() * chars.length);
+ return newchar = chars.substring(rand, rand + 1);
+ };
+
+ return AbstractChosen;
+
+ })();
+
+ root.AbstractChosen = AbstractChosen;
+
+}).call(this);
+
+/*
+Chosen source: generate output using 'cake build'
+Copyright (c) 2011 by Harvest
+*/
+
+(function() {
+ var $, Chosen, get_side_border_padding, root,
+ __hasProp = Object.prototype.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };
+
+ root = this;
+
+ $ = jQuery;
+
+ $.fn.extend({
+ chosen: function(options) {
+ if ($.browser.msie && ($.browser.version === "6.0" || ($.browser.version === "7.0" && document.documentMode === 7))) {
+ return this;
+ }
+ return this.each(function(input_field) {
+ var $this;
+ $this = $(this);
+ if (!$this.hasClass("chzn-done")) {
+ return $this.data('chosen', new Chosen(this, options));
+ }
+ });
+ }
+ });
+
+ Chosen = (function(_super) {
+
+ __extends(Chosen, _super);
+
+ function Chosen() {
+ Chosen.__super__.constructor.apply(this, arguments);
+ }
+
+ Chosen.prototype.setup = function() {
+ this.form_field_jq = $(this.form_field);
+ this.current_value = this.form_field_jq.val();
+ return this.is_rtl = this.form_field_jq.hasClass("chzn-rtl");
+ };
+
+ Chosen.prototype.finish_setup = function() {
+ return this.form_field_jq.addClass("chzn-done");
+ };
+
+ Chosen.prototype.set_up_html = function() {
+ var container_div, dd_top, dd_width, sf_width;
+ this.container_id = this.form_field.id.length ? this.form_field.id.replace(/[^\w]/g, '_') : this.generate_field_id();
+ this.container_id += "_chzn";
+ this.f_width = this.form_field_jq.outerWidth();
+ container_div = $("<div />", {
+ id: this.container_id,
+ "class": "chzn-container" + (this.is_rtl ? ' chzn-rtl' : ''),
+ style: 'width: ' + this.f_width + 'px;'
+ });
+ if (this.is_multiple) {
+ container_div.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>');
+ } else {
+ container_div.html('<a href="javascript:void(0)" class="chzn-single chzn-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>');
+ }
+ this.form_field_jq.hide().after(container_div);
+ this.container = $('#' + this.container_id);
+ this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
+ this.dropdown = this.container.find('div.chzn-drop').first();
+ dd_top = this.container.height();
+ dd_width = this.f_width - get_side_border_padding(this.dropdown);
+ this.dropdown.css({
+ "width": dd_width + "px",
+ "top": dd_top + "px"
+ });
+ this.search_field = this.container.find('input').first();
+ this.search_results = this.container.find('ul.chzn-results').first();
+ this.search_field_scale();
+ this.search_no_results = this.container.find('li.no-results').first();
+ if (this.is_multiple) {
+ this.search_choices = this.container.find('ul.chzn-choices').first();
+ this.search_container = this.container.find('li.search-field').first();
+ } else {
+ this.search_container = this.container.find('div.chzn-search').first();
+ this.selected_item = this.container.find('.chzn-single').first();
+ sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
+ this.search_field.css({
+ "width": sf_width + "px"
+ });
+ }
+ this.results_build();
+ this.set_tab_index();
+ return this.form_field_jq.trigger("liszt:ready", {
+ chosen: this
+ });
+ };
+
+ Chosen.prototype.register_observers = function() {
+ var _this = this;
+ this.container.mousedown(function(evt) {
+ return _this.container_mousedown(evt);
+ });
+ this.container.mouseup(function(evt) {
+ return _this.container_mouseup(evt);
+ });
+ this.container.mouseenter(function(evt) {
+ return _this.mouse_enter(evt);
+ });
+ this.container.mouseleave(function(evt) {
+ return _this.mouse_leave(evt);
+ });
+ this.search_results.mouseup(function(evt) {
+ return _this.search_results_mouseup(evt);
+ });
+ this.search_results.mouseover(function(evt) {
+ return _this.search_results_mouseover(evt);
+ });
+ this.search_results.mouseout(function(evt) {
+ return _this.search_results_mouseout(evt);
+ });
+ this.form_field_jq.bind("liszt:updated", function(evt) {
+ return _this.results_update_field(evt);
+ });
+ this.form_field_jq.bind("liszt:activate", function(evt) {
+ return _this.activate_field(evt);
+ });
+ this.form_field_jq.bind("liszt:open", function(evt) {
+ return _this.container_mousedown(evt);
+ });
+ this.search_field.blur(function(evt) {
+ return _this.input_blur(evt);
+ });
+ this.search_field.keyup(function(evt) {
+ return _this.keyup_checker(evt);
+ });
+ this.search_field.keydown(function(evt) {
+ return _this.keydown_checker(evt);
+ });
+ this.search_field.focus(function(evt) {
+ return _this.input_focus(evt);
+ });
+ if (this.is_multiple) {
+ return this.search_choices.click(function(evt) {
+ return _this.choices_click(evt);
+ });
+ } else {
+ return this.container.click(function(evt) {
+ return evt.preventDefault();
+ });
+ }
+ };
+
+ Chosen.prototype.search_field_disabled = function() {
+ this.is_disabled = this.form_field_jq[0].disabled;
+ if (this.is_disabled) {
+ this.container.addClass('chzn-disabled');
+ this.search_field[0].disabled = true;
+ if (!this.is_multiple) {
+ this.selected_item.unbind("focus", this.activate_action);
+ }
+ return this.close_field();
+ } else {
+ this.container.removeClass('chzn-disabled');
+ this.search_field[0].disabled = false;
+ if (!this.is_multiple) {
+ return this.selected_item.bind("focus", this.activate_action);
+ }
+ }
+ };
+
+ Chosen.prototype.container_mousedown = function(evt) {
+ var target_closelink;
+ if (!this.is_disabled) {
+ target_closelink = evt != null ? ($(evt.target)).hasClass("search-choice-close") : false;
+ if (evt && evt.type === "mousedown" && !this.results_showing) {
+ evt.stopPropagation();
+ }
+ if (!this.pending_destroy_click && !target_closelink) {
+ if (!this.active_field) {
+ if (this.is_multiple) this.search_field.val("");
+ $(document).click(this.click_test_action);
+ this.results_show();
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
+ evt.preventDefault();
+ this.results_toggle();
+ }
+ return this.activate_field();
+ } else {
+ return this.pending_destroy_click = false;
+ }
+ }
+ };
+
+ Chosen.prototype.container_mouseup = function(evt) {
+ if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
+ return this.results_reset(evt);
+ }
+ };
+
+ Chosen.prototype.blur_test = function(evt) {
+ if (!this.active_field && this.container.hasClass("chzn-container-active")) {
+ return this.close_field();
+ }
+ };
+
+ Chosen.prototype.close_field = function() {
+ $(document).unbind("click", this.click_test_action);
+ this.active_field = false;
+ this.results_hide();
+ this.container.removeClass("chzn-container-active");
+ this.winnow_results_clear();
+ this.clear_backstroke();
+ this.show_search_field_default();
+ return this.search_field_scale();
+ };
+
+ Chosen.prototype.activate_field = function() {
+ this.container.addClass("chzn-container-active");
+ this.active_field = true;
+ this.search_field.val(this.search_field.val());
+ return this.search_field.focus();
+ };
+
+ Chosen.prototype.test_active_click = function(evt) {
+ if ($(evt.target).parents('#' + this.container_id).length) {
+ return this.active_field = true;
+ } else {
+ return this.close_field();
+ }
+ };
+
+ Chosen.prototype.results_build = function() {
+ var content, data, _i, _len, _ref;
+ this.parsing = true;
+ this.results_data = root.SelectParser.select_to_array(this.form_field);
+ if (this.is_multiple && this.choices > 0) {
+ this.search_choices.find("li.search-choice").remove();
+ this.choices = 0;
+ } else if (!this.is_multiple) {
+ this.selected_item.addClass("chzn-default").find("span").text(this.default_text);
+ if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
+ this.container.addClass("chzn-container-single-nosearch");
+ } else {
+ this.container.removeClass("chzn-container-single-nosearch");
+ }
+ }
+ content = '';
+ _ref = this.results_data;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ data = _ref[_i];
+ if (data.group) {
+ content += this.result_add_group(data);
+ } else if (!data.empty) {
+ content += this.result_add_option(data);
+ if (data.selected && this.is_multiple) {
+ this.choice_build(data);
+ } else if (data.selected && !this.is_multiple) {
+ this.selected_item.removeClass("chzn-default").find("span").text(data.text);
+ if (this.allow_single_deselect) this.single_deselect_control_build();
+ }
+ }
+ }
+ this.search_field_disabled();
+ this.show_search_field_default();
+ this.search_field_scale();
+ this.search_results.html(content);
+ return this.parsing = false;
+ };
+
+ Chosen.prototype.result_add_group = function(group) {
+ if (!group.disabled) {
+ group.dom_id = this.container_id + "_g_" + group.array_index;
+ return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
+ } else {
+ return "";
+ }
+ };
+
+ Chosen.prototype.result_do_highlight = function(el) {
+ var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
+ if (el.length) {
+ this.result_clear_highlight();
+ this.result_highlight = el;
+ this.result_highlight.addClass("highlighted");
+ maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
+ visible_top = this.search_results.scrollTop();
+ visible_bottom = maxHeight + visible_top;
+ high_top = this.result_highlight.position().top + this.search_results.scrollTop();
+ high_bottom = high_top + this.result_highlight.outerHeight();
+ if (high_bottom >= visible_bottom) {
+ return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
+ } else if (high_top < visible_top) {
+ return this.search_results.scrollTop(high_top);
+ }
+ }
+ };
+
+ Chosen.prototype.result_clear_highlight = function() {
+ if (this.result_highlight) this.result_highlight.removeClass("highlighted");
+ return this.result_highlight = null;
+ };
+
+ Chosen.prototype.results_show = function() {
+ var dd_top;
+ if (!this.is_multiple) {
+ this.selected_item.addClass("chzn-single-with-drop");
+ if (this.result_single_selected) {
+ this.result_do_highlight(this.result_single_selected);
+ }
+ } else if (this.max_selected_options <= this.choices) {
+ this.form_field_jq.trigger("liszt:maxselected", {
+ chosen: this
+ });
+ return false;
+ }
+ dd_top = this.is_multiple ? this.container.height() : this.container.height() - 1;
+ this.form_field_jq.trigger("liszt:showing_dropdown", {
+ chosen: this
+ });
+ this.dropdown.css({
+ "top": dd_top + "px",
+ "left": 0
+ });
+ this.results_showing = true;
+ this.search_field.focus();
+ this.search_field.val(this.search_field.val());
+ return this.winnow_results();
+ };
+
+ Chosen.prototype.results_hide = function() {
+ if (!this.is_multiple) {
+ this.selected_item.removeClass("chzn-single-with-drop");
+ }
+ this.result_clear_highlight();
+ this.form_field_jq.trigger("liszt:hiding_dropdown", {
+ chosen: this
+ });
+ this.dropdown.css({
+ "left": "-9000px"
+ });
+ return this.results_showing = false;
+ };
+
+ Chosen.prototype.set_tab_index = function(el) {
+ var ti;
+ if (this.form_field_jq.attr("tabindex")) {
+ ti = this.form_field_jq.attr("tabindex");
+ this.form_field_jq.attr("tabindex", -1);
+ return this.search_field.attr("tabindex", ti);
+ }
+ };
+
+ Chosen.prototype.show_search_field_default = function() {
+ if (this.is_multiple && this.choices < 1 && !this.active_field) {
+ this.search_field.val(this.default_text);
+ return this.search_field.addClass("default");
+ } else {
+ this.search_field.val("");
+ return this.search_field.removeClass("default");
+ }
+ };
+
+ Chosen.prototype.search_results_mouseup = function(evt) {
+ var target;
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
+ if (target.length) {
+ this.result_highlight = target;
+ this.result_select(evt);
+ return this.search_field.focus();
+ }
+ };
+
+ Chosen.prototype.search_results_mouseover = function(evt) {
+ var target;
+ target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
+ if (target) return this.result_do_highlight(target);
+ };
+
+ Chosen.prototype.search_results_mouseout = function(evt) {
+ if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
+ return this.result_clear_highlight();
+ }
+ };
+
+ Chosen.prototype.choices_click = function(evt) {
+ evt.preventDefault();
+ if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
+ return this.results_show();
+ }
+ };
+
+ Chosen.prototype.choice_build = function(item) {
+ var choice_id, html, link,
+ _this = this;
+ if (this.is_multiple && this.max_selected_options <= this.choices) {
+ this.form_field_jq.trigger("liszt:maxselected", {
+ chosen: this
+ });
+ return false;
+ }
+ choice_id = this.container_id + "_c_" + item.array_index;
+ this.choices += 1;
+ if (item.disabled) {
+ html = '<li class="search-choice search-choice-disabled" id="' + choice_id + '"><span>' + item.html + '</span></li>';
+ } else {
+ html = '<li class="search-choice" id="' + choice_id + '"><span>' + item.html + '</span><a href="javascript:void(0)" class="search-choice-close" rel="' + item.array_index + '"></a></li>';
+ }
+ this.search_container.before(html);
+ link = $('#' + choice_id).find("a").first();
+ return link.click(function(evt) {
+ return _this.choice_destroy_link_click(evt);
+ });
+ };
+
+ Chosen.prototype.choice_destroy_link_click = function(evt) {
+ evt.preventDefault();
+ if (!this.is_disabled) {
+ this.pending_destroy_click = true;
+ return this.choice_destroy($(evt.target));
+ } else {
+ return evt.stopPropagation;
+ }
+ };
+
+ Chosen.prototype.choice_destroy = function(link) {
+ if (this.result_deselect(link.attr("rel"))) {
+ this.choices -= 1;
+ this.show_search_field_default();
+ if (this.is_multiple && this.choices > 0 && this.search_field.val().length < 1) {
+ this.results_hide();
+ }
+ return link.parents('li').first().remove();
+ }
+ };
+
+ Chosen.prototype.results_reset = function() {
+ this.form_field.options[0].selected = true;
+ this.selected_item.find("span").text(this.default_text);
+ if (!this.is_multiple) this.selected_item.addClass("chzn-default");
+ this.show_search_field_default();
+ this.results_reset_cleanup();
+ this.form_field_jq.trigger("change");
+ if (this.active_field) return this.results_hide();
+ };
+
+ Chosen.prototype.results_reset_cleanup = function() {
+ this.current_value = this.form_field_jq.val();
+ return this.selected_item.find("abbr").remove();
+ };
+
+ Chosen.prototype.result_select = function(evt) {
+ var high, high_id, item, position;
+ if (this.result_highlight) {
+ high = this.result_highlight;
+ high_id = high.attr("id");
+ this.result_clear_highlight();
+ if (this.is_multiple) {
+ this.result_deactivate(high);
+ } else {
+ this.search_results.find(".result-selected").removeClass("result-selected");
+ this.result_single_selected = high;
+ this.selected_item.removeClass("chzn-default");
+ }
+ high.addClass("result-selected");
+ position = high_id.substr(high_id.lastIndexOf("_") + 1);
+ item = this.results_data[position];
+ item.selected = true;
+ this.form_field.options[item.options_index].selected = true;
+ if (this.is_multiple) {
+ this.choice_build(item);
+ } else {
+ this.selected_item.find("span").first().text(item.text);
+ if (this.allow_single_deselect) this.single_deselect_control_build();
+ }
+ if (!(evt.metaKey && this.is_multiple)) this.results_hide();
+ this.search_field.val("");
+ if (this.is_multiple || this.form_field_jq.val() !== this.current_value) {
+ this.form_field_jq.trigger("change", {
+ 'selected': this.form_field.options[item.options_index].value
+ });
+ }
+ this.current_value = this.form_field_jq.val();
+ return this.search_field_scale();
+ }
+ };
+
+ Chosen.prototype.result_activate = function(el) {
+ return el.addClass("active-result");
+ };
+
+ Chosen.prototype.result_deactivate = function(el) {
+ return el.removeClass("active-result");
+ };
+
+ Chosen.prototype.result_deselect = function(pos) {
+ var result, result_data;
+ result_data = this.results_data[pos];
+ if (!this.form_field.options[result_data.options_index].disabled) {
+ result_data.selected = false;
+ this.form_field.options[result_data.options_index].selected = false;
+ result = $("#" + this.container_id + "_o_" + pos);
+ result.removeClass("result-selected").addClass("active-result").show();
+ this.result_clear_highlight();
+ this.winnow_results();
+ this.form_field_jq.trigger("change", {
+ deselected: this.form_field.options[result_data.options_index].value
+ });
+ this.search_field_scale();
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ Chosen.prototype.single_deselect_control_build = function() {
+ if (this.allow_single_deselect && this.selected_item.find("abbr").length < 1) {
+ return this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
+ }
+ };
+
+ Chosen.prototype.winnow_results = function() {
+ var found, option, part, parts, regex, regexAnchor, result, result_id, results, searchText, startpos, text, zregex, _i, _j, _len, _len2, _ref;
+ this.no_results_clear();
+ results = 0;
+ searchText = this.search_field.val() === this.default_text ? "" : $('<div/>').text($.trim(this.search_field.val())).html();
+ regexAnchor = this.search_contains ? "" : "^";
+ regex = new RegExp(regexAnchor + searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
+ zregex = new RegExp(searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"), 'i');
+ _ref = this.results_data;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ option = _ref[_i];
+ if (!option.disabled && !option.empty) {
+ if (option.group) {
+ $('#' + option.dom_id).css('display', 'none');
+ } else if (!(this.is_multiple && option.selected)) {
+ found = false;
+ result_id = option.dom_id;
+ result = $("#" + result_id);
+ if (regex.test(option.html)) {
+ found = true;
+ results += 1;
+ } else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
+ parts = option.html.replace(/\[|\]/g, "").split(" ");
+ if (parts.length) {
+ for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
+ part = parts[_j];
+ if (regex.test(part)) {
+ found = true;
+ results += 1;
+ }
+ }
+ }
+ }
+ if (found) {
+ if (searchText.length) {
+ startpos = option.html.search(zregex);
+ text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
+ text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
+ } else {
+ text = option.html;
+ }
+ result.html(text);
+ this.result_activate(result);
+ if (option.group_array_index != null) {
+ $("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
+ }
+ } else {
+ if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
+ this.result_clear_highlight();
+ }
+ this.result_deactivate(result);
+ }
+ }
+ }
+ }
+ if (results < 1 && searchText.length) {
+ return this.no_results(searchText);
+ } else {
+ return this.winnow_results_set_highlight();
+ }
+ };
+
+ Chosen.prototype.winnow_results_clear = function() {
+ var li, lis, _i, _len, _results;
+ this.search_field.val("");
+ lis = this.search_results.find("li");
+ _results = [];
+ for (_i = 0, _len = lis.length; _i < _len; _i++) {
+ li = lis[_i];
+ li = $(li);
+ if (li.hasClass("group-result")) {
+ _results.push(li.css('display', 'auto'));
+ } else if (!this.is_multiple || !li.hasClass("result-selected")) {
+ _results.push(this.result_activate(li));
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ };
+
+ Chosen.prototype.winnow_results_set_highlight = function() {
+ var do_high, selected_results;
+ if (!this.result_highlight) {
+ selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
+ do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
+ if (do_high != null) return this.result_do_highlight(do_high);
+ }
+ };
+
+ Chosen.prototype.no_results = function(terms) {
+ var no_results_html;
+ no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
+ no_results_html.find("span").first().html(terms);
+ return this.search_results.append(no_results_html);
+ };
+
+ Chosen.prototype.no_results_clear = function() {
+ return this.search_results.find(".no-results").remove();
+ };
+
+ Chosen.prototype.keydown_arrow = function() {
+ var first_active, next_sib;
+ if (!this.result_highlight) {
+ first_active = this.search_results.find("li.active-result").first();
+ if (first_active) this.result_do_highlight($(first_active));
+ } else if (this.results_showing) {
+ next_sib = this.result_highlight.nextAll("li.active-result").first();
+ if (next_sib) this.result_do_highlight(next_sib);
+ }
+ if (!this.results_showing) return this.results_show();
+ };
+
+ Chosen.prototype.keyup_arrow = function() {
+ var prev_sibs;
+ if (!this.results_showing && !this.is_multiple) {
+ return this.results_show();
+ } else if (this.result_highlight) {
+ prev_sibs = this.result_highlight.prevAll("li.active-result");
+ if (prev_sibs.length) {
+ return this.result_do_highlight(prev_sibs.first());
+ } else {
+ if (this.choices > 0) this.results_hide();
+ return this.result_clear_highlight();
+ }
+ }
+ };
+
+ Chosen.prototype.keydown_backstroke = function() {
+ var next_available_destroy;
+ if (this.pending_backstroke) {
+ this.choice_destroy(this.pending_backstroke.find("a").first());
+ return this.clear_backstroke();
+ } else {
+ next_available_destroy = this.search_container.siblings("li.search-choice").last();
+ if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
+ this.pending_backstroke = next_available_destroy;
+ if (this.single_backstroke_delete) {
+ return this.keydown_backstroke();
+ } else {
+ return this.pending_backstroke.addClass("search-choice-focus");
+ }
+ }
+ }
+ };
+
+ Chosen.prototype.clear_backstroke = function() {
+ if (this.pending_backstroke) {
+ this.pending_backstroke.removeClass("search-choice-focus");
+ }
+ return this.pending_backstroke = null;
+ };
+
+ Chosen.prototype.keydown_checker = function(evt) {
+ var stroke, _ref;
+ stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
+ this.search_field_scale();
+ if (stroke !== 8 && this.pending_backstroke) this.clear_backstroke();
+ switch (stroke) {
+ case 8:
+ this.backstroke_length = this.search_field.val().length;
+ break;
+ case 9:
+ if (this.results_showing && !this.is_multiple) this.result_select(evt);
+ this.mouse_on_container = false;
+ break;
+ case 13:
+ evt.preventDefault();
+ break;
+ case 38:
+ evt.preventDefault();
+ this.keyup_arrow();
+ break;
+ case 40:
+ this.keydown_arrow();
+ break;
+ }
+ };
+
+ Chosen.prototype.search_field_scale = function() {
+ var dd_top, div, h, style, style_block, styles, w, _i, _len;
+ if (this.is_multiple) {
+ h = 0;
+ w = 0;
+ style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
+ styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
+ for (_i = 0, _len = styles.length; _i < _len; _i++) {
+ style = styles[_i];
+ style_block += style + ":" + this.search_field.css(style) + ";";
+ }
+ div = $('<div />', {
+ 'style': style_block
+ });
+ div.text(this.search_field.val());
+ $('body').append(div);
+ w = div.width() + 25;
+ div.remove();
+ if (w > this.f_width - 10) w = this.f_width - 10;
+ this.search_field.css({
+ 'width': w + 'px'
+ });
+ dd_top = this.container.height();
+ return this.dropdown.css({
+ "top": dd_top + "px"
+ });
+ }
+ };
+
+ Chosen.prototype.generate_random_id = function() {
+ var string;
+ string = "sel" + this.generate_random_char() + this.generate_random_char() + this.generate_random_char();
+ while ($("#" + string).length > 0) {
+ string += this.generate_random_char();
+ }
+ return string;
+ };
+
+ return Chosen;
+
+ })(AbstractChosen);
+
+ get_side_border_padding = function(elmt) {
+ var side_border_padding;
+ return side_border_padding = elmt.outerWidth() - elmt.width();
+ };
+
+ root.get_side_border_padding = get_side_border_padding;
+
+}).call(this);
View
14,742 source/javascripts/libs/jquery-ui.js
14,742 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
160 source/javascripts/libs/jquery.anystretch.js
@@ -0,0 +1,160 @@
+/*
+ * jQuery Anystretch
+ * Version 1.1
+ * https://github.com/danmillar/jquery-anystretch
+ *
+ * Add a dynamically-resized background image to the body
+ * of a page or any other block level element within it
+ *
+ * Copyright (c) 2012 Dan Millar (@danmillar / decode.uk.com)
+ * Dual licensed under the MIT and GPL licenses.
+ *
+ * This is a fork of jQuery Backstretch (v1.2)
+ * Copyright (c) 2011 Scott Robbin (srobbin.com)
+*/
+
+;(function($) {
+
+ $.fn.anystretch = function(src, options, callback) {
+ var isBody = this.selector.length ? false : true; // Decide whether anystretch is being called on an element or not
+
+ return this.each(function(i){
+ var defaultSettings = {
+ positionX: 'center', // Should we center the image on the X axis?
+ positionY: 'center', // Should we center the image on the Y axis?
+ speed: 0, // fadeIn speed for background after image loads (e.g. "fast" or 500)
+ elPosition: 'relative' // position of containing element when not being added to the body
+ },
+ el = $(this),
+ container = isBody ? $('.anystretch') : el.children(".anystretch"),
+ settings = container.data("settings") || defaultSettings, // If this has been called once before, use the old settings as the default
+ existingSettings = container.data('settings'),
+ imgRatio, bgImg, bgWidth, bgHeight, bgOffset, bgCSS;
+
+ // Extend the settings with those the user has provided
+ if(options && typeof options == "object") $.extend(settings, options);
+
+ // Just in case the user passed in a function without options
+ if(options && typeof options == "function") callback = options;
+
+ // Initialize
+ $(document).ready(_init);
+
+ // For chaining
+ return this;
+
+ function _init() {
+ // Prepend image, wrapped in a DIV, with some positioning and zIndex voodoo
+ if(src) {
+ var img;
+
+ if(!isBody) {
+ // If not being added to the body set position to elPosition (default: relative) to keep anystretch contained
+ el.css({position: settings.elPosition, background: "none"});
+ }
+
+ // If this is the first time that anystretch is being called
+ if(container.length == 0) {
+ container = $("<div />").attr("class", "anystretch")
+ .css({left: 0, top: 0, position: (isBody ? "fixed" : "absolute"), overflow: "hidden", zIndex: (isBody ? -999999 : -999998), margin: 0, padding: 0, height: "100%", width: "100%"});
+ } else {
+ // Prepare to delete any old images
+ container.find("img").addClass("deleteable");
+ }
+
+ img = $("<img />").css({position: "absolute", display: "none", margin: 0, padding: 0, border: "none", zIndex: -999999})
+ .bind("load", function(e) {
+ var self = $(this),
+ imgWidth, imgHeight;
+
+ self.css({width: "auto", height: "auto"});
+ imgWidth = this.width || $(e.target).width();
+ imgHeight = this.height || $(e.target).height();
+ imgRatio = imgWidth / imgHeight;
+
+ _adjustBG(function() {
+ self.fadeIn(settings.speed, function(){
+ // Remove the old images, if necessary.
+ container.find('.deleteable').remove();
+ // Callback
+ if(typeof callback == "function") callback();
+ });
+ });
+
+ })
+ .appendTo(container);
+
+ // Append the container to the body, if it's not already there
+ if(el.children(".anystretch").length == 0) {
+ if(isBody) {
+ $('body').append(container);
+ } else {
+ el.append(container);
+ }
+ }
+
+ // Attach the settings
+ container.data("settings", settings);
+
+ img.attr("src", src); // Hack for IE img onload event
+
+ // Adjust the background size when the window is resized or orientation has changed (iOS)
+ $(window).resize(_adjustBG);
+ }
+ }
+
+ function _adjustBG(fn) {
+ try {
+ bgCSS = {left: 0, top: 0};
+ bgWidth = _width();
+ bgHeight = bgWidth / imgRatio;
+
+ // Make adjustments based on image ratio
+ // Note: Offset code provided by Peter Baker (http://ptrbkr.com/). Thanks, Peter!
+ if(bgHeight >= _height()) {
+ bgOffset = (bgHeight - _height()) /2;
+ if(settings.positionY == 'center' || settings.centeredY) { //
+ $.extend(bgCSS, {top: "-" + bgOffset + "px"});
+ } else if(settings.positionY == 'bottom') {
+ $.extend(bgCSS, {top: "auto", bottom: "0px"});
+ }
+ } else {
+ bgHeight = _height();
+ bgWidth = bgHeight * imgRatio;
+ bgOffset = (bgWidth - _width()) / 2;
+ if(settings.positionX == 'center' || settings.centeredX) {
+ $.extend(bgCSS, {left: "-" + bgOffset + "px"});
+ } else if(settings.positionX == 'right') {
+ $.extend(bgCSS, {left: "auto", right: "0px"});
+ }
+ }
+
+ container.children("img:not(.deleteable)").width( bgWidth ).height( bgHeight )
+ .filter("img").css(bgCSS);
+ } catch(err) {
+ // IE7 seems to trigger _adjustBG before the image is loaded.
+ // This try/catch block is a hack to let it fail gracefully.
+ }
+
+ // Executed the passed in function, if necessary
+ if (typeof fn == "function") fn();
+ }
+
+ function _width() {
+ return isBody ? el.width() : el.innerWidth();
+ }
+
+ function _height() {
+ return isBody ? el.height() : el.innerHeight();
+ }
+
+ });
+ };
+
+ $.anystretch = function(src, options, callback) {
+ var el = ("onorientationchange" in window) ? $(document) : $(window); // hack to acccount for iOS position:fixed shortcomings
+
+ el.anystretch(src, options, callback);
+ };
+
+})(jQuery);
View
185 source/javascripts/libs/jquery.backstretch.js
@@ -0,0 +1,185 @@
+/*
+ * jQuery Backstretch
+ * Version 1.2.8
+ * http://srobbin.com/jquery-plugins/jquery-backstretch/
+ *
+ * Add a dynamically-resized background image to the page
+ *
+ * Copyright (c) 2012 Scott Robbin (srobbin.com)
+ * Licensed under the MIT license
+ * https://raw.github.com/srobbin/jquery-backstretch/master/LICENSE.txt
+ *
+*/
+
+;(function($) {
+
+ $.backstretch = function(src, options, callback) {
+ var defaultSettings = {
+ centeredX: true // Should we center the image on the X axis?
+ , centeredY: true // Should we center the image on the Y axis?
+ , speed: 0 // fadeIn speed for background after image loads (e.g. "fast" or 500)
+ }
+ , $container = $("#backstretch")
+ , settings = $container.data("settings") || defaultSettings // If this has been called once before, use the old settings as the default
+ , existingSettings = $container.data('settings')
+ , rootElement, supportsFixedPosition, useWindowInnerHeight
+ , imgRatio, bgImg, bgWidth, bgHeight, bgOffset, bgCSS;
+
+ // Extend the settings with those the user has provided
+ if(options && typeof options == "object") $.extend(settings, options);
+
+ // Just in case the user passed in a function without options
+ if(options && typeof options == "function") callback = options;
+
+ $(document).ready(function() {
+ /*
+ * Taken from jQuery Mobile 1.1.0
+ * http://jquerymobile.com/
+ *
+ * In a nutshell, we need to figure out if fixed positioning is supported.
+ * Unfortunately, this is very difficult to do on iOS, and usually involves
+ * injecting content, scrolling the page, etc.. It's ugly.
+ * jQuery Mobile uses this workaround. It's not ideal, but works.
+ *
+ * Modified to detect IE6
+ */
+ var w = window
+ , ua = navigator.userAgent
+ , platform = navigator.platform
+ // Rendering engine is Webkit, and capture major version
+ , wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ )
+ , wkversion = !!wkmatch && wkmatch[ 1 ]
+ , ffmatch = ua.match( /Fennec\/([0-9]+)/ )
+ , ffversion = !!ffmatch && ffmatch[ 1 ]
+ , operammobilematch = ua.match( /Opera Mobi\/([0-9]+)/ )
+ , omversion = !!operammobilematch && operammobilematch[ 1 ]
+ , iematch = ua.match( /MSIE ([0-9]+)/ )
+ , ieversion = !!iematch && iematch[ 1 ];
+
+ supportsFixedPosition = !(
+ // iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
+ (( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 )
+ ||
+ // Opera Mini
+ ( w.operamini && ({}).toString.call( w.operamini ) === "[object OperaMini]" )
+ ||
+ ( operammobilematch && omversion < 7458 )
+ ||
+ //Android lte 2.1: Platform is Android and Webkit version is less than 533 (Android 2.2)
+ ( ua.indexOf( "Android" ) > -1 && wkversion && wkversion < 533 )
+ ||
+ // Firefox Mobile before 6.0 -
+ ( ffversion && ffversion < 6 )
+ ||
+ // WebOS less than 3
+ ( "palmGetResource" in window && wkversion && wkversion < 534 )
+ ||
+ // MeeGo
+ ( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 )
+ ||
+ // IE6
+ ( ieversion && ieversion <= 6)
+ );
+
+ // Set the root element
+ rootElement = supportsFixedPosition ? $(window) : $(document);
+
+ // Should we use the window's innerHeight?
+ useWindowInnerHeight = supportsFixedPosition && window.innerHeight;
+
+ // Initialize the plugin
+ _init();
+ });
+
+ // For chaining
+ return this;
+
+ function _init() {
+ // Prepend image, wrapped in a DIV, with some positioning and zIndex voodoo
+ if(src) {
+ var img;
+
+ // If this is the first time that backstretch is being called
+ if($container.length == 0) {
+ $container = $("<div />").attr("id", "backstretch")
+ .css({left: 0, top: 0, position: supportsFixedPosition ? "fixed" : "absolute", overflow: "hidden", zIndex: -999999, margin: 0, padding: 0, height: "100%", width: "100%"});
+ } else {
+ // Prepare to delete any old images
+ $container.find("img").addClass("deleteable");
+ }
+
+ img = $("<img />").css({position: "absolute", display: "none", margin: 0, padding: 0, border: "none", zIndex: -999999, maxWidth: "none"})
+ .bind("load", function(e) {
+ var $self = $(this),
+ imgWidth, imgHeight;
+
+ $self.css({width: "auto", height: "auto"});
+ imgWidth = this.width || $(e.target).width();
+ imgHeight = this.height || $(e.target).height();
+ imgRatio = imgWidth / imgHeight;
+
+ _adjustBG();
+ $self.fadeIn(settings.speed, function(){
+ // Remove the old images, if necessary.
+ $container.find('.deleteable').remove();
+ // Callback
+ if(typeof callback == "function") callback();
+ });
+ })
+ .appendTo($container);
+
+ // Append the container to the body, if it's not already there
+ if($("body #backstretch").length == 0) {
+ /*
+ * Scroll the page one pixel to get the right window height on iOS
+ * Pretty harmless for everyone else
+ */
+ if ($(window).scrollTop() === 0 ) window.scrollTo(0, 0);
+ $("body").append($container);
+ }
+
+ // Attach the settings
+ $container.data("settings", settings);
+
+ img.attr("src", src); // Hack for IE img onload event
+
+ // Adjust the background size when the window is resized or orientation has changed (iOS)
+ $(window).unbind("resize.backstretch").bind("resize.backstretch", function() {
+ // Need to do this in order to get the right window height
+ if("onorientationchange" in window) {
+ if (window.pageYOffset === 0) window.scrollTo(0, 1);
+ }
+ _adjustBG()
+ });
+ }
+ }
+
+ function _adjustBG() {
+ try {
+ bgCSS = {left: 0, top: 0}
+ , rootWidth = bgWidth = rootElement.width()
+ , rootHeight = useWindowInnerHeight ? window.innerHeight : rootElement.height()
+ , bgHeight = bgWidth / imgRatio;
+
+ // Make adjustments based on image ratio
+ // Note: Offset code provided by Peter Baker (http://ptrbkr.com/). Thanks, Peter!
+ if(bgHeight >= rootHeight) {
+ bgOffset = (bgHeight - rootHeight) /2;
+ if(settings.centeredY) bgCSS.top = "-" + bgOffset + "px";
+ } else {
+ bgHeight = rootHeight;
+ bgWidth = bgHeight * imgRatio;
+ bgOffset = (bgWidth - rootWidth) / 2;
+ if(settings.centeredX) bgCSS.left = "-" + bgOffset + "px";
+ }
+
+ $container.css({width: rootWidth, height: rootHeight})
+ .find("img:not(.deleteable)").css({width: bgWidth, height: bgHeight}).css(bgCSS);
+ } catch(err) {
+ // IE7 seems to trigger _adjustBG before the image is loaded.
+ // This try/catch block is a hack to let it fail gracefully.
+ }
+ }
+ };
+
+})(jQuery);
View
181 source/javascripts/libs/jquery.formalize.js
@@ -0,0 +1,181 @@
+/*
+ Formalize - version 1.2
+
+ Note: This file depends on the jQuery library.
+*/
+
+// Module pattern:
+// http://yuiblog.com/blog/2007/06/12/module-pattern
+var FORMALIZE = (function($, window, document, undefined) {
+ // Internet Explorer detection.