├── .gitignore ├── .rspec ├── Gemfile ├── Gemfile.lock ├── README.markdown ├── Rakefile ├── app ├── controllers │ ├── application_controller.rb │ └── welcome_controller.rb ├── helpers │ ├── application_helper.rb │ ├── error_messages_helper.rb │ ├── layout_helper.rb │ └── welcome_helper.rb ├── models │ ├── brand.rb │ ├── brand_subtype.rb │ └── product.rb └── views │ ├── layouts │ └── application.html.erb │ └── welcome │ ├── _form.html.erb │ ├── ajax_form_example.html.erb │ ├── formtastic.html.erb │ ├── id_element_example.html.erb │ ├── show.html.erb │ ├── show_the_form.js.erb │ └── subtype.html.erb ├── autotest └── discover.rb ├── config.ru ├── config ├── application.rb ├── boot.rb ├── cucumber.yml ├── database.yml ├── environment.rb ├── environments │ ├── development.rb │ ├── production.rb │ └── test.rb ├── initializers │ ├── backtrace_silencers.rb │ ├── inflections.rb │ ├── mime_types.rb │ ├── secret_token.rb │ └── session_store.rb ├── locales │ └── en.yml └── routes.rb ├── db ├── migrate │ ├── 20100728042321_create_brands.rb │ ├── 20100908164249_create_products.rb │ └── 20101122185506_create_brand_subtypes.rb ├── schema.rb └── seeds.rb ├── doc └── README_FOR_APP ├── features ├── ajax_form.feature ├── autocomplete.feature ├── step_definitions │ ├── autocomplete_steps.rb │ ├── pickle_steps.rb │ └── web_steps.rb └── support │ ├── env.rb │ ├── paths.rb │ └── pickle.rb ├── lib └── tasks │ ├── .gitkeep │ └── cucumber.rake ├── public ├── 404.html ├── 422.html ├── 500.html ├── favicon.ico ├── images │ └── rails.png ├── javascripts │ ├── .gitkeep │ ├── application.js │ ├── autocomplete-rails.js │ ├── jquery-1.4.2.min.js │ ├── jquery-ui-1.8.2.custom.min.js │ └── rails.js ├── robots.txt └── stylesheets │ ├── .gitkeep │ ├── application.css │ ├── images │ ├── ui-anim_basic_16x16.gif │ ├── ui-bg_diagonals-thick_18_b81900_40x40.png │ ├── ui-bg_diagonals-thick_20_666666_40x40.png │ ├── ui-bg_flat_10_000000_40x100.png │ ├── ui-bg_glass_100_f6f6f6_1x400.png │ ├── ui-bg_glass_100_fdf5ce_1x400.png │ ├── ui-bg_glass_65_ffffff_1x400.png │ ├── ui-bg_gloss-wave_35_f6a828_500x100.png │ ├── ui-bg_highlight-soft_100_eeeeee_1x100.png │ ├── ui-bg_highlight-soft_75_ffe45c_1x100.png │ ├── ui-icons_222222_256x240.png │ ├── ui-icons_228ef1_256x240.png │ ├── ui-icons_ef8c08_256x240.png │ ├── ui-icons_ffd27a_256x240.png │ └── ui-icons_ffffff_256x240.png │ └── jquery-ui-1.8.2.custom.css ├── script ├── cucumber └── rails ├── spec ├── spec_helper.rb └── support │ └── blueprints.rb └── vendor └── plugins └── .gitkeep /.gitignore: -------------------------------------------------------------------------------- 1 | .bundle 2 | db/*.sqlite3 3 | log/*.log 4 | tmp/**/* 5 | .DS_Store 6 | test 7 | .rvmrc 8 | **.swp 9 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --colour 2 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | 3 | gem 'rails', '3.0.0' 4 | 5 | gem 'sqlite3-ruby', :require => 'sqlite3' 6 | gem 'nifty-generators' 7 | gem 'rails3-jquery-autocomplete', '0.6.0' 8 | gem 'formtastic' 9 | 10 | group :test do 11 | gem 'cucumber-rails' 12 | gem 'capybara' 13 | gem 'pickle' 14 | gem 'machinist', '>= 2.0.0.beta2' 15 | gem 'rspec-rails', '>=2.0.0.beta.20' 16 | gem 'webrat' 17 | gem 'database_cleaner' 18 | end 19 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | abstract (1.0.0) 5 | actionmailer (3.0.0) 6 | actionpack (= 3.0.0) 7 | mail (~> 2.2.5) 8 | actionpack (3.0.0) 9 | activemodel (= 3.0.0) 10 | activesupport (= 3.0.0) 11 | builder (~> 2.1.2) 12 | erubis (~> 2.6.6) 13 | i18n (~> 0.4.1) 14 | rack (~> 1.2.1) 15 | rack-mount (~> 0.6.12) 16 | rack-test (~> 0.5.4) 17 | tzinfo (~> 0.3.23) 18 | activemodel (3.0.0) 19 | activesupport (= 3.0.0) 20 | builder (~> 2.1.2) 21 | i18n (~> 0.4.1) 22 | activerecord (3.0.0) 23 | activemodel (= 3.0.0) 24 | activesupport (= 3.0.0) 25 | arel (~> 1.0.0) 26 | tzinfo (~> 0.3.23) 27 | activeresource (3.0.0) 28 | activemodel (= 3.0.0) 29 | activesupport (= 3.0.0) 30 | activesupport (3.0.0) 31 | arel (1.0.1) 32 | activesupport (~> 3.0.0) 33 | builder (2.1.2) 34 | capybara (0.4.0) 35 | celerity (>= 0.7.9) 36 | culerity (>= 0.2.4) 37 | mime-types (>= 1.16) 38 | nokogiri (>= 1.3.3) 39 | rack (>= 1.0.0) 40 | rack-test (>= 0.5.4) 41 | selenium-webdriver (>= 0.0.27) 42 | xpath (~> 0.1.2) 43 | celerity (0.8.4) 44 | childprocess (0.1.4) 45 | ffi (~> 0.6.3) 46 | cucumber (0.9.4) 47 | builder (~> 2.1.2) 48 | diff-lcs (~> 1.1.2) 49 | gherkin (~> 2.2.9) 50 | json (~> 1.4.6) 51 | term-ansicolor (~> 1.0.5) 52 | cucumber-rails (0.3.2) 53 | cucumber (>= 0.8.0) 54 | culerity (0.2.12) 55 | database_cleaner (0.6.0) 56 | diff-lcs (1.1.2) 57 | erubis (2.6.6) 58 | abstract (>= 1.0.0) 59 | ffi (0.6.3) 60 | rake (>= 0.8.7) 61 | formtastic (1.2.2) 62 | actionpack (>= 2.3.7) 63 | activesupport (>= 2.3.7) 64 | i18n (>= 0.4.0) 65 | gherkin (2.2.9) 66 | json (~> 1.4.6) 67 | term-ansicolor (~> 1.0.5) 68 | i18n (0.4.2) 69 | json (1.4.6) 70 | json_pure (1.4.6) 71 | machinist (2.0.0.beta2) 72 | mail (2.2.12) 73 | activesupport (>= 2.3.6) 74 | i18n (>= 0.4.0) 75 | mime-types (~> 1.16) 76 | treetop (~> 1.4.8) 77 | mime-types (1.16) 78 | nifty-generators (0.4.2) 79 | nokogiri (1.4.4) 80 | pickle (0.4.3) 81 | cucumber (>= 0.8) 82 | rake 83 | rspec (>= 1.3) 84 | yard 85 | polyglot (0.3.1) 86 | rack (1.2.1) 87 | rack-mount (0.6.13) 88 | rack (>= 1.0.0) 89 | rack-test (0.5.6) 90 | rack (>= 1.0) 91 | rails (3.0.0) 92 | actionmailer (= 3.0.0) 93 | actionpack (= 3.0.0) 94 | activerecord (= 3.0.0) 95 | activeresource (= 3.0.0) 96 | activesupport (= 3.0.0) 97 | bundler (~> 1.0.0) 98 | railties (= 3.0.0) 99 | rails3-jquery-autocomplete (0.6.0) 100 | railties (3.0.0) 101 | actionpack (= 3.0.0) 102 | activesupport (= 3.0.0) 103 | rake (>= 0.8.4) 104 | thor (~> 0.14.0) 105 | rake (0.8.7) 106 | rspec (2.2.0) 107 | rspec-core (~> 2.2) 108 | rspec-expectations (~> 2.2) 109 | rspec-mocks (~> 2.2) 110 | rspec-core (2.2.1) 111 | rspec-expectations (2.2.0) 112 | diff-lcs (~> 1.1.2) 113 | rspec-mocks (2.2.0) 114 | rspec-rails (2.2.1) 115 | actionpack (~> 3.0) 116 | activesupport (~> 3.0) 117 | railties (~> 3.0) 118 | rspec (~> 2.2.0) 119 | rubyzip (0.9.4) 120 | selenium-webdriver (0.1.1) 121 | childprocess (= 0.1.4) 122 | ffi (~> 0.6.3) 123 | json_pure 124 | rubyzip 125 | sqlite3-ruby (1.3.2) 126 | term-ansicolor (1.0.5) 127 | thor (0.14.6) 128 | treetop (1.4.9) 129 | polyglot (>= 0.3.1) 130 | tzinfo (0.3.23) 131 | webrat (0.7.2) 132 | nokogiri (>= 1.2.0) 133 | rack (>= 1.0) 134 | rack-test (>= 0.5.3) 135 | xpath (0.1.2) 136 | nokogiri (~> 1.3) 137 | yard (0.6.3) 138 | 139 | PLATFORMS 140 | ruby 141 | 142 | DEPENDENCIES 143 | capybara 144 | cucumber-rails 145 | database_cleaner 146 | formtastic 147 | machinist (>= 2.0.0.beta2) 148 | nifty-generators 149 | pickle 150 | rails (= 3.0.0) 151 | rails3-jquery-autocomplete (= 0.6.0) 152 | rspec-rails (>= 2.0.0.beta.20) 153 | sqlite3-ruby 154 | webrat 155 | -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # rails3-jquery-autocomplete Example Application 2 | 3 | This app is meant to show you how to use the [rails3-jquery-autocomplete](http://github.com/crowdint/rails3-jquery-autocomplete) gem. 4 | 5 | You can find the same example using *MongoID* [here](http://github.com/crowdint/rails3-jquery-autocomplete-app/tree/mongoid). 6 | 7 | # The Application, step by step 8 | 9 | ## Create the app 10 | 11 | Use the rails command to create a new application 12 | 13 | rails new rails3-jquery-autocomplete -J 14 | 15 | The _-J_ option is used to skip prototype, at this point I assume you won't need it. 16 | 17 | ## Gem requirements 18 | 19 | The first thing to do is, add the following line to the Gemfile: 20 | 21 | gem 'rails', '3.0.0' 22 | gem 'rails3-jquery-autocomplete' 23 | gem 'nifty-generators' 24 | 25 | This will include the rails3-jquery-autocomplete and Ryan Bates' nifty-generators gem as dependencies for the application. 26 | 27 | We will use nifty-generators to speed things up a bit. 28 | 29 | Now, make sure you install the required gems by running: 30 | 31 | bundle install 32 | 33 | Run the nifty-generators layout command to install some default files: 34 | 35 | rails g nifty:layout 36 | 37 | ## Run the generator 38 | 39 | Run the generator to install the required files: 40 | 41 | rails g autocomplete:install 42 | 43 | ## Javascript files 44 | 45 | Go to [http://jqueryui.com/download](http://jqueryui.com/download) and create a custom build for jQuery-UI. Obviously, make sure you select the Autocomplete widget. 46 | 47 | Click on download and extract all the files in the zip file you just downloaded. 48 | 49 | Copy the files on the *js* folder to the *public/javascripts* folder on your app. 50 | 51 | Copy the files on the *css* folder to the *public/stylesheets* folder on your 52 | app. Note that these files may be one level down from the css folder, in 53 | a folder called "ui-lightness". 54 | 55 | Go to [http://github.com/rails/jquery-ujs](http://github.com/rails/jquery-ujs) and copy *rails.js* to the *public/javascripts* folder on your app. 56 | 57 | ## Include the files on your layout 58 | 59 | Open app/views/layouts/application.html.erb and put the following lines on the 60 | section (be sure to examine your public/stylesheets and 61 | public/javascripts folders and use the correct version numbers for jQuery and 62 | jQuery-UI, which may be different from this example) : 63 | 64 | 65 | <%= javascript_include_tag 'jquery-1.4.2.min.js', 'jquery-ui-1.8.4.custom.min.js', 'autocomplete-rails.js', 'rails.js' %> 66 | <%= stylesheet_link_tag 'jquery-ui-1.8.4.custom.css' %> 67 | 68 | 69 | ## Create a model 70 | 71 | Let's create a model named Brand that will have a name attribute: 72 | 73 | rails g model Brand name:string 74 | 75 | Create your database by running: 76 | 77 | rake db:create 78 | rake db:migrate 79 | 80 | Now, to make sure we have something to test the app, lets add something to the seed file. Open *db/seeds.rb* and add the following lines: 81 | 82 | Brand.create(:name => 'Alpha') 83 | Brand.create(:name => 'Beta') 84 | Brand.create(:name => 'Gama') 85 | 86 | Then, run *rake db:seed* to populate the database with the values on the seeds file. 87 | 88 | ## Create a Controller 89 | 90 | Create a controller called welcome with a show action: 91 | 92 | rails g controller welcome show 93 | 94 | Edit the *config/routes.rb* file, add the following two lines: 95 | 96 | get "welcome/show" 97 | root :to => "welcome#show" 98 | 99 | Delete the *public/index.html* file. 100 | 101 | Run the server, 102 | 103 | rails s 104 | 105 | Go to http://127.0.0.1:3000 on your browser and make sure everything is running just fine. 106 | 107 | ### The magic 108 | 109 | Add this line at the very top of the *app/controllers/welcome_controller.rb* file: 110 | 111 | autocomplete :brand, :name 112 | 113 | And add to *config/routes.rb*: 114 | 115 | get 'welcome/autocomplete_brand_name' 116 | 117 | Now, run *rake routes* and you should have something like: 118 | 119 | welcome_show GET /welcome/show {:controller=>"welcome", :action=>"show"} 120 | welcome_autocomplete_brand_name GET /welcome/autocomplete_brand_name {:controller=>"welcome", :action=>"autocomplete_brand_name"} 121 | root / {:controller=>"welcome", :action=>"show"} 122 | 123 | ## The view 124 | 125 | Replace *app/views/welcome/show.html.erb* with the following code: 126 | 127 |

Welcome!

128 | <%= form_tag do %> 129 | <%=text_field_tag 'name', '', :autocomplete => welcome_autocomplete_brand_name_path %> 130 | <% end %> 131 | 132 | Notice how I used the autocomplete action's *_path* helper as the value for :autocomplete? 133 | 134 | Run your server, go to http://127.0.0.1:3000 and try typing 'Al' on the text field. 135 | 136 | If you can see the Autocomplete widget. You're done. 137 | 138 | # Testing with Cucumber 139 | 140 | You can find examples on how to test the autocomplete feature using cucumber in the *features* folder. 141 | 142 | You can run the tests with the *cucumber* command. 143 | 144 | # About the Author 145 | 146 | [Crowd Interactive](http://www.crowdint.com) is an American web design and development company that happens to work in Colima, Mexico. 147 | We specialize in building and growing online retail stores. We don’t work with everyone – just companies we believe in. Call us today to see if there’s a fit. 148 | Find more info [here](http://www.crowdint.com)! 149 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require File.expand_path('../config/application', __FILE__) 5 | require 'rake' 6 | 7 | Rails3JqueryAutocompleteApp::Application.load_tasks 8 | -------------------------------------------------------------------------------- /app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | protect_from_forgery 3 | end 4 | -------------------------------------------------------------------------------- /app/controllers/welcome_controller.rb: -------------------------------------------------------------------------------- 1 | class WelcomeController < ApplicationController 2 | autocomplete :brand, :name 3 | 4 | def show 5 | @product = Product.new 6 | end 7 | 8 | def id_element_example 9 | @product = Product.new 10 | end 11 | 12 | def ajax_form_example 13 | 14 | end 15 | 16 | def show_the_form 17 | @product = Product.new 18 | end 19 | 20 | def formtastic 21 | @product = Product.new 22 | end 23 | 24 | autocomplete :brand_subtype, :name 25 | def subtype 26 | @product = Product.new 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/helpers/error_messages_helper.rb: -------------------------------------------------------------------------------- 1 | module ErrorMessagesHelper 2 | # Render error messages for the given objects. The :message and :header_message options are allowed. 3 | def error_messages_for(*objects) 4 | options = objects.extract_options! 5 | options[:header_message] ||= "Invalid Fields" 6 | options[:message] ||= "Correct the following errors and try again." 7 | messages = objects.compact.map { |o| o.errors.full_messages }.flatten 8 | unless messages.empty? 9 | content_tag(:div, :class => "error_messages") do 10 | list_items = messages.map { |msg| content_tag(:li, msg) } 11 | content_tag(:h2, options[:header_message]) + content_tag(:p, options[:message]) + content_tag(:ul, list_items.join.html_safe) 12 | end 13 | end 14 | end 15 | 16 | module FormBuilderAdditions 17 | def error_messages(options = {}) 18 | @template.error_messages_for(@object, options) 19 | end 20 | end 21 | end 22 | 23 | ActionView::Helpers::FormBuilder.send(:include, ErrorMessagesHelper::FormBuilderAdditions) 24 | -------------------------------------------------------------------------------- /app/helpers/layout_helper.rb: -------------------------------------------------------------------------------- 1 | # These helper methods can be called in your template to set variables to be used in the layout 2 | # This module should be included in all views globally, 3 | # to do so you may need to add this line to your ApplicationController 4 | # helper :layout 5 | module LayoutHelper 6 | def title(page_title, show_title = true) 7 | content_for(:title) { page_title.to_s } 8 | @show_title = show_title 9 | end 10 | 11 | def show_title? 12 | @show_title 13 | end 14 | 15 | def stylesheet(*args) 16 | content_for(:head) { stylesheet_link_tag(*args) } 17 | end 18 | 19 | def javascript(*args) 20 | content_for(:head) { javascript_include_tag(*args) } 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /app/helpers/welcome_helper.rb: -------------------------------------------------------------------------------- 1 | module WelcomeHelper 2 | end 3 | -------------------------------------------------------------------------------- /app/models/brand.rb: -------------------------------------------------------------------------------- 1 | class Brand < ActiveRecord::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/models/brand_subtype.rb: -------------------------------------------------------------------------------- 1 | class BrandSubtype < Brand 2 | end 3 | -------------------------------------------------------------------------------- /app/models/product.rb: -------------------------------------------------------------------------------- 1 | class Product < ActiveRecord::Base 2 | end 3 | -------------------------------------------------------------------------------- /app/views/layouts/application.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | <%= yield(:title) || "Untitled" %> 5 | <%= stylesheet_link_tag "application" %> 6 | <%= javascript_include_tag :defaults %> 7 | <%= csrf_meta_tag %> 8 | <%= javascript_include_tag 'jquery-1.4.2.min.js', 'jquery-ui-1.8.2.custom.min.js', 'rails.js', 'autocomplete-rails.js' %> 9 | <%= stylesheet_link_tag 'jquery-ui-1.8.2.custom.css' %> 10 | <%= yield(:head) %> 11 | 12 | 13 |
14 | <% flash.each do |name, msg| %> 15 | <%= content_tag :div, msg, :id => "flash_#{name}" %> 16 | <% end %> 17 | <%= content_tag :h1, yield(:title) if show_title? %> 18 | <%= yield %> 19 |
20 | 21 | 22 | -------------------------------------------------------------------------------- /app/views/welcome/_form.html.erb: -------------------------------------------------------------------------------- 1 | <%= form_for @product do |f| %> 2 | <%=f.label :brand_name %> 3 | <%=f.autocomplete_field :brand_name, welcome_autocomplete_brand_name_path, :id_element => "#id_element_placeholder" %> 4 | <%= label_tag :id_element_placeholder, 'Put the id here:' %> 5 | <%= text_field_tag :id_element_placeholder, '' %> 6 | <% end %> 7 | 8 | -------------------------------------------------------------------------------- /app/views/welcome/ajax_form_example.html.erb: -------------------------------------------------------------------------------- 1 |

Ajax Form Example

2 | <%= link_to "Show the form", welcome_show_the_form_path, :remote => true %> 3 |
4 | -------------------------------------------------------------------------------- /app/views/welcome/formtastic.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome!

2 | <%= semantic_form_for @product do |f| %> 3 | <%=f.label :brand_name %> 4 | <%=f.autocomplete_field :brand_name, welcome_autocomplete_brand_name_path, :id_element => "#id_element_placeholder" %> 5 | <%= label_tag :id_element_placeholder, 'Put the id here:' %> 6 | <%= text_field_tag :id_element_placeholder, '' %> 7 | <% end %> 8 | <%= link_to 'ID Element option example', welcome_id_element_example_path %> -------------------------------------------------------------------------------- /app/views/welcome/id_element_example.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome!

2 | <%= render :partial => 'form' %> 3 | -------------------------------------------------------------------------------- /app/views/welcome/show.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome!

2 | <%= form_for @product do |f| %> 3 | <%=f.label :brand_name %> 4 | <%=f.autocomplete_field :brand_name, welcome_autocomplete_brand_name_path %> 5 | <% end %> 6 | <%= link_to 'ID Element option example', welcome_id_element_example_path %> 7 | -------------------------------------------------------------------------------- /app/views/welcome/show_the_form.js.erb: -------------------------------------------------------------------------------- 1 | $('#form_placeholder').html('<%=escape_javascript(render(:partial => 'form'))%>'); 2 | -------------------------------------------------------------------------------- /app/views/welcome/subtype.html.erb: -------------------------------------------------------------------------------- 1 |

Welcome!

2 | <%= form_for @product do |f| %> 3 | <%=f.label :brand_name %> 4 | <%=f.autocomplete_field :brand_name, welcome_autocomplete_brand_subtype_name_path %> 5 | <% end %> 6 | -------------------------------------------------------------------------------- /autotest/discover.rb: -------------------------------------------------------------------------------- 1 | Autotest.add_discovery { "rails" } 2 | Autotest.add_discovery { "rspec2" } 3 | -------------------------------------------------------------------------------- /config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require ::File.expand_path('../config/environment', __FILE__) 4 | run Rails3JqueryAutocompleteApp::Application 5 | -------------------------------------------------------------------------------- /config/application.rb: -------------------------------------------------------------------------------- 1 | require File.expand_path('../boot', __FILE__) 2 | 3 | require 'rails/all' 4 | 5 | # If you have a Gemfile, require the gems listed there, including any gems 6 | # you've limited to :test, :development, or :production. 7 | Bundler.require(:default, Rails.env) if defined?(Bundler) 8 | 9 | module Rails3JqueryAutocompleteApp 10 | class Application < Rails::Application 11 | # Settings in config/environments/* take precedence over those specified here. 12 | # Application configuration should go into files in config/initializers 13 | # -- all .rb files in that directory are automatically loaded. 14 | 15 | # Custom directories with classes and modules you want to be autoloadable. 16 | # config.autoload_paths += %W(#{config.root}/extras) 17 | 18 | # Only load the plugins named here, in the order given (default is alphabetical). 19 | # :all can be used as a placeholder for all plugins not explicitly named. 20 | # config.plugins = [ :exception_notification, :ssl_requirement, :all ] 21 | 22 | # Activate observers that should always be running. 23 | # config.active_record.observers = :cacher, :garbage_collector, :forum_observer 24 | 25 | # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. 26 | # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. 27 | # config.time_zone = 'Central Time (US & Canada)' 28 | 29 | # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. 30 | # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] 31 | # config.i18n.default_locale = :de 32 | 33 | # JavaScript files you want as :defaults (application.js is always included). 34 | config.action_view.javascript_expansions[:defaults] = %w() 35 | 36 | # Configure the default encoding used in templates for Ruby 1.9. 37 | config.encoding = "utf-8" 38 | 39 | # Configure sensitive parameters which will be filtered from the log file. 40 | config.filter_parameters += [:password] 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /config/boot.rb: -------------------------------------------------------------------------------- 1 | require 'rubygems' 2 | 3 | # Set up gems listed in the Gemfile. 4 | gemfile = File.expand_path('../../Gemfile', __FILE__) 5 | begin 6 | ENV['BUNDLE_GEMFILE'] = gemfile 7 | require 'bundler' 8 | Bundler.setup 9 | rescue Bundler::GemNotFound => e 10 | STDERR.puts e.message 11 | STDERR.puts "Try running `bundle install`." 12 | exit! 13 | end if File.exist?(gemfile) 14 | -------------------------------------------------------------------------------- /config/cucumber.yml: -------------------------------------------------------------------------------- 1 | <% 2 | rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" 3 | rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" 4 | std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" 5 | %> 6 | default: <%= std_opts %> features 7 | wip: --tags @wip:3 --wip features 8 | rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip 9 | -------------------------------------------------------------------------------- /config/database.yml: -------------------------------------------------------------------------------- 1 | # SQLite version 3.x 2 | # gem install sqlite3-ruby (not necessary on OS X Leopard) 3 | development: 4 | adapter: sqlite3 5 | database: db/development.sqlite3 6 | pool: 5 7 | timeout: 5000 8 | 9 | # Warning: The database defined as "test" will be erased and 10 | # re-generated from your development database when you run "rake". 11 | # Do not set this db to the same as development or production. 12 | test: &test 13 | adapter: sqlite3 14 | database: db/test.sqlite3 15 | pool: 5 16 | timeout: 5000 17 | 18 | production: 19 | adapter: sqlite3 20 | database: db/production.sqlite3 21 | pool: 5 22 | timeout: 5000 23 | 24 | cucumber: 25 | <<: *test -------------------------------------------------------------------------------- /config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the rails application 2 | require File.expand_path('../application', __FILE__) 3 | 4 | # Initialize the rails application 5 | Rails3JqueryAutocompleteApp::Application.initialize! 6 | -------------------------------------------------------------------------------- /config/environments/development.rb: -------------------------------------------------------------------------------- 1 | Rails3JqueryAutocompleteApp::Application.configure do 2 | # Settings specified here will take precedence over those in config/environment.rb 3 | 4 | # In the development environment your application's code is reloaded on 5 | # every request. This slows down response time but is perfect for development 6 | # since you don't have to restart the webserver when you make code changes. 7 | config.cache_classes = false 8 | 9 | # Log error messages when you accidentally call methods on nil. 10 | config.whiny_nils = true 11 | 12 | # Show full error reports and disable caching 13 | config.consider_all_requests_local = true 14 | config.action_view.debug_rjs = true 15 | config.action_controller.perform_caching = false 16 | 17 | # Don't care if the mailer can't send 18 | config.action_mailer.raise_delivery_errors = false 19 | 20 | # Print deprecation notices to the Rails logger 21 | config.active_support.deprecation = :log 22 | end 23 | -------------------------------------------------------------------------------- /config/environments/production.rb: -------------------------------------------------------------------------------- 1 | Rails3JqueryAutocompleteApp::Application.configure do 2 | # Settings specified here will take precedence over those in config/environment.rb 3 | 4 | # The production environment is meant for finished, "live" apps. 5 | # Code is not reloaded between requests 6 | config.cache_classes = true 7 | 8 | # Full error reports are disabled and caching is turned on 9 | config.consider_all_requests_local = false 10 | config.action_controller.perform_caching = true 11 | 12 | # Specifies the header that your server uses for sending files 13 | config.action_dispatch.x_sendfile_header = "X-Sendfile" 14 | 15 | # For nginx: 16 | # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' 17 | 18 | # If you have no front-end server that supports something like X-Sendfile, 19 | # just comment this out and Rails will serve the files 20 | 21 | # See everything in the log (default is :info) 22 | # config.log_level = :debug 23 | 24 | # Use a different logger for distributed setups 25 | # config.logger = SyslogLogger.new 26 | 27 | # Use a different cache store in production 28 | # config.cache_store = :mem_cache_store 29 | 30 | # Disable Rails's static asset server 31 | # In production, Apache or nginx will already do this 32 | config.serve_static_assets = false 33 | 34 | # Enable serving of images, stylesheets, and javascripts from an asset server 35 | # config.action_controller.asset_host = "http://assets.example.com" 36 | 37 | # Disable delivery errors, bad email addresses will be ignored 38 | # config.action_mailer.raise_delivery_errors = false 39 | 40 | # Enable threaded mode 41 | # config.threadsafe! 42 | 43 | # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 44 | # the I18n.default_locale when a translation can not be found) 45 | config.i18n.fallbacks = true 46 | 47 | # Send deprecation notices to registered listeners 48 | config.active_support.deprecation = :notify 49 | end 50 | -------------------------------------------------------------------------------- /config/environments/test.rb: -------------------------------------------------------------------------------- 1 | Rails3JqueryAutocompleteApp::Application.configure do 2 | # Settings specified here will take precedence over those in config/environment.rb 3 | 4 | # The test environment is used exclusively to run your application's 5 | # test suite. You never need to work with it otherwise. Remember that 6 | # your test database is "scratch space" for the test suite and is wiped 7 | # and recreated between test runs. Don't rely on the data there! 8 | config.cache_classes = true 9 | 10 | # Log error messages when you accidentally call methods on nil. 11 | config.whiny_nils = true 12 | 13 | # Show full error reports and disable caching 14 | config.consider_all_requests_local = true 15 | config.action_controller.perform_caching = false 16 | 17 | # Raise exceptions instead of rendering exception templates 18 | config.action_dispatch.show_exceptions = false 19 | 20 | # Disable request forgery protection in test environment 21 | config.action_controller.allow_forgery_protection = false 22 | 23 | # Tell Action Mailer not to deliver emails to the real world. 24 | # The :test delivery method accumulates sent emails in the 25 | # ActionMailer::Base.deliveries array. 26 | config.action_mailer.delivery_method = :test 27 | 28 | # Use SQL instead of Active Record's schema dumper when creating the test database. 29 | # This is necessary if your schema can't be completely dumped by the schema dumper, 30 | # like if you have constraints or database-specific column types 31 | # config.active_record.schema_format = :sql 32 | 33 | # Print deprecation notices to the stderr 34 | config.active_support.deprecation = :stderr 35 | end 36 | -------------------------------------------------------------------------------- /config/initializers/backtrace_silencers.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. 4 | # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ } 5 | 6 | # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code. 7 | # Rails.backtrace_cleaner.remove_silencers! 8 | -------------------------------------------------------------------------------- /config/initializers/inflections.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new inflection rules using the following format 4 | # (all these examples are active by default): 5 | # ActiveSupport::Inflector.inflections do |inflect| 6 | # inflect.plural /^(ox)$/i, '\1en' 7 | # inflect.singular /^(ox)en/i, '\1' 8 | # inflect.irregular 'person', 'people' 9 | # inflect.uncountable %w( fish sheep ) 10 | # end 11 | -------------------------------------------------------------------------------- /config/initializers/mime_types.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Add new mime types for use in respond_to blocks: 4 | # Mime::Type.register "text/richtext", :rtf 5 | # Mime::Type.register_alias "text/html", :iphone 6 | -------------------------------------------------------------------------------- /config/initializers/secret_token.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Your secret key for verifying the integrity of signed cookies. 4 | # If you change this key, all old signed cookies will become invalid! 5 | # Make sure the secret is at least 30 characters and all random, 6 | # no regular words or you'll be exposed to dictionary attacks. 7 | Rails3JqueryAutocompleteApp::Application.config.secret_token = '89c05dbc4988ea5f3c7e5b0880d2bbfc9b1baf2f98af42fa08e1a86c1ef98e5c2db0f0dc82f2d6faba25af043a08b11a9b404a846dc929e668aeee3269483cca' 8 | -------------------------------------------------------------------------------- /config/initializers/session_store.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | Rails3JqueryAutocompleteApp::Application.config.session_store :cookie_store, :key => '_rails3-jquery-autocomplete-app_session' 4 | 5 | # Use the database for sessions instead of the cookie-based default, 6 | # which shouldn't be used to store highly confidential information 7 | # (create the session table with "rake db:sessions:create") 8 | # Rails3JqueryAutocompleteApp::Application.config.session_store :active_record_store 9 | -------------------------------------------------------------------------------- /config/locales/en.yml: -------------------------------------------------------------------------------- 1 | # Sample localization file for English. Add more files in this directory for other locales. 2 | # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. 3 | 4 | en: 5 | hello: "Hello world" 6 | -------------------------------------------------------------------------------- /config/routes.rb: -------------------------------------------------------------------------------- 1 | Rails3JqueryAutocompleteApp::Application.routes.draw do 2 | get "welcome/show" 3 | get 'welcome/autocomplete_brand_name' 4 | get 'welcome/id_element_example' 5 | get "welcome/ajax_form_example" 6 | get "welcome/show_the_form" 7 | get "welcome/formtastic" 8 | 9 | get 'welcome/autocomplete_brand_subtype_name' 10 | get "welcome/subtype" 11 | 12 | resources :products 13 | 14 | root :to => "welcome#show" 15 | 16 | # The priority is based upon order of creation: 17 | # first created -> highest priority. 18 | 19 | # Sample of regular route: 20 | # match 'products/:id' => 'catalog#view' 21 | # Keep in mind you can assign values other than :controller and :action 22 | 23 | # Sample of named route: 24 | # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase 25 | # This route can be invoked with purchase_url(:id => product.id) 26 | 27 | # Sample resource route (maps HTTP verbs to controller actions automatically): 28 | # resources :products 29 | 30 | # Sample resource route with options: 31 | # resources :products do 32 | # member do 33 | # get :short 34 | # post :toggle 35 | # end 36 | # 37 | # collection do 38 | # get :sold 39 | # end 40 | # end 41 | 42 | # Sample resource route with sub-resources: 43 | # resources :products do 44 | # resources :comments, :sales 45 | # resource :seller 46 | # end 47 | 48 | # Sample resource route with more complex sub-resources 49 | # resources :products do 50 | # resources :comments 51 | # resources :sales do 52 | # get :recent, :on => :collection 53 | # end 54 | # end 55 | 56 | # Sample resource route within a namespace: 57 | # namespace :admin do 58 | # # Directs /admin/products/* to Admin::ProductsController 59 | # # (app/controllers/admin/products_controller.rb) 60 | # resources :products 61 | # end 62 | 63 | # You can have the root of your site routed with "root" 64 | # just remember to delete public/index.html. 65 | # root :to => "welcome#index" 66 | 67 | # See how all your routes lay out with "rake routes" 68 | 69 | # This is a legacy wild controller route that's not recommended for RESTful applications. 70 | # Note: This route will make all actions in every controller accessible via GET requests. 71 | # match ':controller(/:action(/:id(.:format)))' 72 | end 73 | -------------------------------------------------------------------------------- /db/migrate/20100728042321_create_brands.rb: -------------------------------------------------------------------------------- 1 | class CreateBrands < ActiveRecord::Migration 2 | def self.up 3 | create_table :brands do |t| 4 | t.string :name 5 | 6 | t.timestamps 7 | end 8 | end 9 | 10 | def self.down 11 | drop_table :brands 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20100908164249_create_products.rb: -------------------------------------------------------------------------------- 1 | class CreateProducts < ActiveRecord::Migration 2 | def self.up 3 | create_table :products, :force => true do |t| 4 | t.string :brand_name 5 | t.timestamps 6 | end 7 | end 8 | 9 | def self.down 10 | drop_table :products 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20101122185506_create_brand_subtypes.rb: -------------------------------------------------------------------------------- 1 | class CreateBrandSubtypes < ActiveRecord::Migration 2 | def self.up 3 | change_table :brands do |t| 4 | t.string :type 5 | end 6 | end 7 | 8 | def self.down 9 | remove_column :brands, :type 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/schema.rb: -------------------------------------------------------------------------------- 1 | # This file is auto-generated from the current state of the database. Instead 2 | # of editing this file, please use the migrations feature of Active Record to 3 | # incrementally modify your database, and then regenerate this schema definition. 4 | # 5 | # Note that this schema.rb definition is the authoritative source for your 6 | # database schema. If you need to create the application database on another 7 | # system, you should be using db:schema:load, not running all the migrations 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). 10 | # 11 | # It's strongly recommended to check this file into your version control system. 12 | 13 | ActiveRecord::Schema.define(:version => 20101122185506) do 14 | 15 | create_table "brands", :force => true do |t| 16 | t.string "name" 17 | t.datetime "created_at" 18 | t.datetime "updated_at" 19 | t.string "type" 20 | end 21 | 22 | create_table "products", :force => true do |t| 23 | t.string "brand_name" 24 | t.datetime "created_at" 25 | t.datetime "updated_at" 26 | end 27 | 28 | end 29 | -------------------------------------------------------------------------------- /db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should contain all the record creation needed to seed the database with its default values. 2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). 3 | # 4 | # Examples: 5 | # 6 | # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) 7 | # Mayor.create(:name => 'Daley', :city => cities.first) 8 | 9 | Brand.create(:name => 'Alpha') 10 | Brand.create(:name => 'Beta') 11 | Brand.create(:name => 'Gama') 12 | BrandSubtype.create(:name => 'Alpha') 13 | BrandSubtype.create(:name => 'Beta') 14 | BrandSubtype.create(:name => 'Gama') 15 | -------------------------------------------------------------------------------- /doc/README_FOR_APP: -------------------------------------------------------------------------------- 1 | Use this README file to introduce your application and point to useful places in the API for learning more. 2 | Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries. 3 | -------------------------------------------------------------------------------- /features/ajax_form.feature: -------------------------------------------------------------------------------- 1 | Feature: Autocomplete 2 | In order to do funky stuff 3 | As a User 4 | I want autocomplete on my Ajax forms! 5 | 6 | @javascript 7 | Scenario: Autocomplete 8 | Given the following brands exists: 9 | | name | 10 | | Alpha | 11 | | Beta | 12 | | Gamma | 13 | When I go to the welcome ajax form example page 14 | And I follow "Show the form" 15 | And I fill in "Brand name" with "al" 16 | And I choose "Alpha" in the autocomplete list 17 | Then the "Brand name" field should contain "Alpha" 18 | -------------------------------------------------------------------------------- /features/autocomplete.feature: -------------------------------------------------------------------------------- 1 | Feature: Autocomplete 2 | In order to do funky stuff 3 | As a User 4 | I want autocomplete! 5 | 6 | Background: 7 | Given the following brands exists: 8 | | id | name | 9 | | 1 | Alpha | 10 | | 2 | Beta | 11 | | 3 | Gamma | 12 | 13 | @javascript 14 | Scenario: Autocomplete 15 | Given I go to the home page 16 | And I fill in "Brand name" with "al" 17 | And I choose "Alpha" in the autocomplete list 18 | Then the "Brand name" field should contain "Alpha" 19 | 20 | @javascript 21 | Scenario: Autocomplete ID Element usage example 22 | Given I go to the welcome id element example page 23 | And I fill in "Brand name" with "al" 24 | And I choose "Alpha" in the autocomplete list 25 | Then the "Brand name" field should contain "Alpha" 26 | Then the "Put the id here:" field should contain the id for "Alpha" 27 | 28 | @javascript 29 | Scenario: Autocomplete with Formtastic 30 | Given I go to the welcome formtastic page 31 | And I fill in "Brand name" with "al" 32 | And I choose "Alpha" in the autocomplete list 33 | Then the "Brand name" field should contain "Alpha" 34 | Then the "Put the id here:" field should contain the id for "Alpha" 35 | 36 | @javascript @focus 37 | Scenario: Autocomplete with a brand subtype 38 | Given the following brand_subtypes exists: 39 | | name | 40 | | Alpha | 41 | | Beta | 42 | | Gamma | 43 | And I go to the welcome subtype page 44 | And I fill in "Brand name" with "al" 45 | And I choose "Alpha" in the autocomplete list 46 | Then the "Brand name" field should contain "Alpha" 47 | -------------------------------------------------------------------------------- /features/step_definitions/autocomplete_steps.rb: -------------------------------------------------------------------------------- 1 | Then /^the "([^"]*)" field should contain the id for "([^"]*)"$/ do |field, name| 2 | brand = Brand.find_by_name(name) 3 | Then %{the "#{field}" field should contain "#{brand.id}"} 4 | end 5 | -------------------------------------------------------------------------------- /features/step_definitions/pickle_steps.rb: -------------------------------------------------------------------------------- 1 | # this file generated by script/generate pickle 2 | 3 | # create a model 4 | Given(/^#{capture_model} exists?(?: with #{capture_fields})?$/) do |name, fields| 5 | create_model(name, fields) 6 | end 7 | 8 | # create n models 9 | Given(/^(\d+) #{capture_plural_factory} exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields| 10 | count.to_i.times { create_model(plural_factory.singularize, fields) } 11 | end 12 | 13 | # create models from a table 14 | Given(/^the following #{capture_plural_factory} exists?:?$/) do |plural_factory, table| 15 | create_models_from_table(plural_factory, table) 16 | end 17 | 18 | # find a model 19 | Then(/^#{capture_model} should exist(?: with #{capture_fields})?$/) do |name, fields| 20 | find_model!(name, fields) 21 | end 22 | 23 | # not find a model 24 | Then(/^#{capture_model} should not exist(?: with #{capture_fields})?$/) do |name, fields| 25 | find_model(name, fields).should be_nil 26 | end 27 | 28 | # find models with a table 29 | Then(/^the following #{capture_plural_factory} should exists?:?$/) do |plural_factory, table| 30 | find_models_from_table(plural_factory, table).should_not be_any(&:nil?) 31 | end 32 | 33 | # find exactly n models 34 | Then(/^(\d+) #{capture_plural_factory} should exist(?: with #{capture_fields})?$/) do |count, plural_factory, fields| 35 | find_models(plural_factory.singularize, fields).size.should == count.to_i 36 | end 37 | 38 | # assert equality of models 39 | Then(/^#{capture_model} should be #{capture_model}$/) do |a, b| 40 | model!(a).should == model!(b) 41 | end 42 | 43 | # assert model is in another model's has_many assoc 44 | Then(/^#{capture_model} should be (?:in|one of|amongst) #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association| 45 | model!(owner).send(association).should include(model!(target)) 46 | end 47 | 48 | # assert model is not in another model's has_many assoc 49 | Then(/^#{capture_model} should not be (?:in|one of|amongst) #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association| 50 | model!(owner).send(association).should_not include(model!(target)) 51 | end 52 | 53 | # assert model is another model's has_one/belongs_to assoc 54 | Then(/^#{capture_model} should be #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association| 55 | model!(owner).send(association).should == model!(target) 56 | end 57 | 58 | # assert model is not another model's has_one/belongs_to assoc 59 | Then(/^#{capture_model} should not be #{capture_model}(?:'s)? (\w+)$/) do |target, owner, association| 60 | model!(owner).send(association).should_not == model!(target) 61 | end 62 | 63 | # assert model.predicate? 64 | Then(/^#{capture_model} should (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate| 65 | if model!(name).respond_to?("has_#{predicate.gsub(' ', '_')}") 66 | model!(name).should send("have_#{predicate.gsub(' ', '_')}") 67 | else 68 | model!(name).should send("be_#{predicate.gsub(' ', '_')}") 69 | end 70 | end 71 | 72 | # assert not model.predicate? 73 | Then(/^#{capture_model} should not (?:be|have) (?:an? )?#{capture_predicate}$/) do |name, predicate| 74 | if model!(name).respond_to?("has_#{predicate.gsub(' ', '_')}") 75 | model!(name).should_not send("have_#{predicate.gsub(' ', '_')}") 76 | else 77 | model!(name).should_not send("be_#{predicate.gsub(' ', '_')}") 78 | end 79 | end 80 | 81 | # model.attribute.should eql(value) 82 | # model.attribute.should_not eql(value) 83 | Then(/^#{capture_model}'s (\w+) (should(?: not)?) be #{capture_value}$/) do |name, attribute, expectation, expected| 84 | actual_value = model(name).send(attribute) 85 | expectation = expectation.gsub(' ', '_') 86 | 87 | case expected 88 | when 'nil', 'true', 'false' 89 | actual_value.send(expectation, send("be_#{expected}")) 90 | when /^[+-]?[0-9_]+(\.\d+)?$/ 91 | actual_value.send(expectation, eql(expected.to_f)) 92 | else 93 | actual_value.to_s.send(expectation, eql(eval(expected))) 94 | end 95 | end 96 | 97 | # assert size of association 98 | Then /^#{capture_model} should have (\d+) (\w+)$/ do |name, size, association| 99 | model!(name).send(association).size.should == size.to_i 100 | end 101 | -------------------------------------------------------------------------------- /features/step_definitions/web_steps.rb: -------------------------------------------------------------------------------- 1 | # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. 2 | # It is recommended to regenerate this file in the future when you upgrade to a 3 | # newer version of cucumber-rails. Consider adding your own code to a new file 4 | # instead of editing this one. Cucumber will automatically load all features/**/*.rb 5 | # files. 6 | 7 | 8 | require 'uri' 9 | require 'cgi' 10 | require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) 11 | 12 | module WithinHelpers 13 | def with_scope(locator) 14 | locator ? within(locator) { yield } : yield 15 | end 16 | end 17 | World(WithinHelpers) 18 | 19 | Given /^(?:|I )am on (.+)$/ do |page_name| 20 | visit path_to(page_name) 21 | end 22 | 23 | When /^(?:|I )go to (.+)$/ do |page_name| 24 | visit path_to(page_name) 25 | end 26 | 27 | When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| 28 | with_scope(selector) do 29 | click_button(button) 30 | end 31 | end 32 | 33 | When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector| 34 | with_scope(selector) do 35 | click_link(link) 36 | end 37 | end 38 | 39 | When /^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/ do |field, value, selector| 40 | with_scope(selector) do 41 | fill_in(field, :with => value) 42 | end 43 | end 44 | 45 | When /^(?:|I )fill in "([^"]*)" for "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| 46 | with_scope(selector) do 47 | fill_in(field, :with => value) 48 | end 49 | end 50 | 51 | # Use this to fill in an entire form with data from a table. Example: 52 | # 53 | # When I fill in the following: 54 | # | Account Number | 5002 | 55 | # | Expiry date | 2009-11-01 | 56 | # | Note | Nice guy | 57 | # | Wants Email? | | 58 | # 59 | # TODO: Add support for checkbox, select og option 60 | # based on naming conventions. 61 | # 62 | When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| 63 | with_scope(selector) do 64 | fields.rows_hash.each do |name, value| 65 | When %{I fill in "#{name}" with "#{value}"} 66 | end 67 | end 68 | end 69 | 70 | When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| 71 | with_scope(selector) do 72 | select(value, :from => field) 73 | end 74 | end 75 | 76 | When /^(?:|I )check "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| 77 | with_scope(selector) do 78 | check(field) 79 | end 80 | end 81 | 82 | When /^(?:|I )uncheck "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| 83 | with_scope(selector) do 84 | uncheck(field) 85 | end 86 | end 87 | 88 | When /^(?:|I )choose "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| 89 | with_scope(selector) do 90 | choose(field) 91 | end 92 | end 93 | 94 | When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector| 95 | with_scope(selector) do 96 | attach_file(field, path) 97 | end 98 | end 99 | 100 | Then /^(?:|I )should see JSON:$/ do |expected_json| 101 | require 'json' 102 | expected = JSON.pretty_generate(JSON.parse(expected_json)) 103 | actual = JSON.pretty_generate(JSON.parse(response.body)) 104 | expected.should == actual 105 | end 106 | 107 | Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| 108 | with_scope(selector) do 109 | if page.respond_to? :should 110 | page.should have_content(text) 111 | else 112 | assert page.has_content?(text) 113 | end 114 | end 115 | end 116 | 117 | Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| 118 | regexp = Regexp.new(regexp) 119 | with_scope(selector) do 120 | if page.respond_to? :should 121 | page.should have_xpath('//*', :text => regexp) 122 | else 123 | assert page.has_xpath?('//*', :text => regexp) 124 | end 125 | end 126 | end 127 | 128 | Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| 129 | with_scope(selector) do 130 | if page.respond_to? :should 131 | page.should have_no_content(text) 132 | else 133 | assert page.has_no_content?(text) 134 | end 135 | end 136 | end 137 | 138 | Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| 139 | regexp = Regexp.new(regexp) 140 | with_scope(selector) do 141 | if page.respond_to? :should 142 | page.should have_no_xpath('//*', :text => regexp) 143 | else 144 | assert page.has_no_xpath?('//*', :text => regexp) 145 | end 146 | end 147 | end 148 | 149 | Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |field, selector, value| 150 | with_scope(selector) do 151 | field = find_field(field) 152 | field_value = (field.tag_name == 'textarea') ? field.text : field.value 153 | if field_value.respond_to? :should 154 | field_value.should =~ /#{value}/ 155 | else 156 | assert_match(/#{value}/, field_value) 157 | end 158 | end 159 | end 160 | 161 | Then /^the "([^"]*)" field(?: within "([^"]*)")? should not contain "([^"]*)"$/ do |field, selector, value| 162 | with_scope(selector) do 163 | field = find_field(field) 164 | field_value = (field.tag_name == 'textarea') ? field.text : field.value 165 | if field_value.respond_to? :should_not 166 | field_value.should_not =~ /#{value}/ 167 | else 168 | assert_no_match(/#{value}/, field_value) 169 | end 170 | end 171 | end 172 | 173 | Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector| 174 | with_scope(selector) do 175 | field_checked = find_field(label)['checked'] 176 | if field_checked.respond_to? :should 177 | field_checked.should be_true 178 | else 179 | assert field_checked 180 | end 181 | end 182 | end 183 | 184 | Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector| 185 | with_scope(selector) do 186 | field_checked = find_field(label)['checked'] 187 | if field_checked.respond_to? :should 188 | field_checked.should be_false 189 | else 190 | assert !field_checked 191 | end 192 | end 193 | end 194 | 195 | Then /^(?:|I )should be on (.+)$/ do |page_name| 196 | current_path = URI.parse(current_url).path 197 | if current_path.respond_to? :should 198 | current_path.should == path_to(page_name) 199 | else 200 | assert_equal path_to(page_name), current_path 201 | end 202 | end 203 | 204 | Then /^(?:|I )should have the following query string:$/ do |expected_pairs| 205 | query = URI.parse(current_url).query 206 | actual_params = query ? CGI.parse(query) : {} 207 | expected_params = {} 208 | expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} 209 | 210 | if actual_params.respond_to? :should 211 | actual_params.should == expected_params 212 | else 213 | assert_equal expected_params, actual_params 214 | end 215 | end 216 | 217 | Then /^show me the page$/ do 218 | save_and_open_page 219 | end 220 | -------------------------------------------------------------------------------- /features/support/env.rb: -------------------------------------------------------------------------------- 1 | # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. 2 | # It is recommended to regenerate this file in the future when you upgrade to a 3 | # newer version of cucumber-rails. Consider adding your own code to a new file 4 | # instead of editing this one. Cucumber will automatically load all features/**/*.rb 5 | # files. 6 | 7 | ENV["RAILS_ENV"] ||= "test" 8 | require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') 9 | 10 | require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support 11 | require 'cucumber/rails/world' 12 | require 'cucumber/rails/active_record' 13 | require 'cucumber/web/tableish' 14 | 15 | # rails3-jquery-autocomplete cucumber steps 16 | require 'cucumber/autocomplete' 17 | 18 | require 'capybara/rails' 19 | require 'capybara/cucumber' 20 | require 'capybara/session' 21 | require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript 22 | # Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In 23 | # order to ease the transition to Capybara we set the default here. If you'd 24 | # prefer to use XPath just remove this line and adjust any selectors in your 25 | # steps to use the XPath syntax. 26 | Capybara.default_selector = :css 27 | Capybara.default_wait_time = 5 28 | 29 | # If you set this to false, any error raised from within your app will bubble 30 | # up to your step definition and out to cucumber unless you catch it somewhere 31 | # on the way. You can make Rails rescue errors and render error pages on a 32 | # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. 33 | # 34 | # If you set this to true, Rails will rescue all errors and render error 35 | # pages, more or less in the same way your application would behave in the 36 | # default production environment. It's not recommended to do this for all 37 | # of your scenarios, as this makes it hard to discover errors in your application. 38 | ActionController::Base.allow_rescue = false 39 | 40 | # If you set this to true, each scenario will run in a database transaction. 41 | # You can still turn off transactions on a per-scenario basis, simply tagging 42 | # a feature or scenario with the @no-txn tag. If you are using Capybara, 43 | # tagging with @culerity or @javascript will also turn transactions off. 44 | # 45 | # If you set this to false, transactions will be off for all scenarios, 46 | # regardless of whether you use @no-txn or not. 47 | # 48 | # Beware that turning transactions off will leave data in your database 49 | # after each scenario, which can lead to hard-to-debug failures in 50 | # subsequent scenarios. If you do this, we recommend you create a Before 51 | # block that will explicitly put your database in a known state. 52 | Cucumber::Rails::World.use_transactional_fixtures = true 53 | # How to clean your database when transactions are turned off. See 54 | # http://github.com/bmabey/database_cleaner for more info. 55 | if defined?(ActiveRecord::Base) 56 | begin 57 | require 'database_cleaner' 58 | DatabaseCleaner.strategy = :truncation 59 | rescue LoadError => ignore_if_database_cleaner_not_present 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /features/support/paths.rb: -------------------------------------------------------------------------------- 1 | module NavigationHelpers 2 | # Maps a name to a path. Used by the 3 | # 4 | # When /^I go to (.+)$/ do |page_name| 5 | # 6 | # step definition in web_steps.rb 7 | # 8 | def path_to(page_name) 9 | case page_name 10 | 11 | when /the home\s?page/ 12 | '/' 13 | 14 | # Add more mappings here. 15 | # Here is an example that pulls values out of the Regexp: 16 | # 17 | # when /^(.*)'s profile page$/i 18 | # user_profile_path(User.find_by_login($1)) 19 | 20 | else 21 | begin 22 | page_name =~ /the (.*) page/ 23 | path_components = $1.split(/\s+/) 24 | self.send(path_components.push('path').join('_').to_sym) 25 | rescue Object => e 26 | raise "Can't find mapping from \"#{page_name}\" to a path.\n" + 27 | "Now, go and add a mapping in #{__FILE__}" 28 | end 29 | end 30 | end 31 | end 32 | 33 | World(NavigationHelpers) 34 | -------------------------------------------------------------------------------- /features/support/pickle.rb: -------------------------------------------------------------------------------- 1 | # this file generated by script/generate pickle [paths] [email] 2 | # 3 | # Make sure that you are loading your factory of choice in your cucumber environment 4 | # 5 | # For machinist add: features/support/machinist.rb 6 | # 7 | # require 'machinist/active_record' # or your chosen adaptor 8 | # require File.dirname(__FILE__) + '/../../spec/blueprints' # or wherever your blueprints are 9 | # Before { Sham.reset } # to reset Sham's seed between scenarios so each run has same random sequences 10 | # 11 | # For FactoryGirl add: features/support/factory_girl.rb 12 | # 13 | # require 'factory_girl' 14 | # require File.dirname(__FILE__) + '/../../spec/factories' # or wherever your factories are 15 | # 16 | # You may also need to add gem dependencies on your factory of choice in config/environments/cucumber.rb 17 | 18 | require 'pickle/world' 19 | # Example of configuring pickle: 20 | # 21 | # Pickle.configure do |config| 22 | # config.adapters = [:machinist] 23 | # config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"' 24 | # end 25 | -------------------------------------------------------------------------------- /lib/tasks/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/lib/tasks/.gitkeep -------------------------------------------------------------------------------- /lib/tasks/cucumber.rake: -------------------------------------------------------------------------------- 1 | # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. 2 | # It is recommended to regenerate this file in the future when you upgrade to a 3 | # newer version of cucumber-rails. Consider adding your own code to a new file 4 | # instead of editing this one. Cucumber will automatically load all features/**/*.rb 5 | # files. 6 | 7 | 8 | unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks 9 | 10 | vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first 11 | $LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? 12 | 13 | begin 14 | require 'cucumber/rake/task' 15 | 16 | namespace :cucumber do 17 | Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| 18 | t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. 19 | t.fork = true # You may get faster startup if you set this to false 20 | t.profile = 'default' 21 | end 22 | 23 | Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| 24 | t.binary = vendored_cucumber_bin 25 | t.fork = true # You may get faster startup if you set this to false 26 | t.profile = 'wip' 27 | end 28 | 29 | Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| 30 | t.binary = vendored_cucumber_bin 31 | t.fork = true # You may get faster startup if you set this to false 32 | t.profile = 'rerun' 33 | end 34 | 35 | desc 'Run all features' 36 | task :all => [:ok, :wip] 37 | end 38 | desc 'Alias for cucumber:ok' 39 | task :cucumber => 'cucumber:ok' 40 | 41 | task :default => :cucumber 42 | 43 | task :features => :cucumber do 44 | STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" 45 | end 46 | rescue LoadError 47 | desc 'cucumber rake task not available (cucumber not installed)' 48 | task :cucumber do 49 | abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' 50 | end 51 | end 52 | 53 | end 54 | -------------------------------------------------------------------------------- /public/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The page you were looking for doesn't exist (404) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The page you were looking for doesn't exist.

23 |

You may have mistyped the address or the page may have moved.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/422.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | The change you wanted was rejected (422) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

The change you wanted was rejected.

23 |

Maybe you tried to change something you didn't have access to.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/500.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | We're sorry, but something went wrong (500) 5 | 17 | 18 | 19 | 20 | 21 |
22 |

We're sorry, but something went wrong.

23 |

We've been notified about this issue and we'll take a look at it shortly.

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/favicon.ico -------------------------------------------------------------------------------- /public/images/rails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/images/rails.png -------------------------------------------------------------------------------- /public/javascripts/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/javascripts/.gitkeep -------------------------------------------------------------------------------- /public/javascripts/application.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/javascripts/application.js -------------------------------------------------------------------------------- /public/javascripts/autocomplete-rails.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Unobtrusive autocomplete 3 | * 4 | * To use it, you just have to include the HTML attribute autocomplete 5 | * with the autocomplete URL as the value 6 | * 7 | * Example: 8 | * 9 | * 10 | * Optionally, you can use a jQuery selector to specify a field that can 11 | * be updated with the element id whenever you find a matching value 12 | * 13 | * Example: 14 | * 15 | */ 16 | 17 | $(document).ready(function(){ 18 | $('input[data-autocomplete]').railsAutocomplete(); 19 | }); 20 | 21 | (function(jQuery) 22 | { 23 | var self = null; 24 | jQuery.fn.railsAutocomplete = function() { 25 | return this.live('focus',function() { 26 | if (!this.railsAutoCompleter) { 27 | this.railsAutoCompleter = new jQuery.railsAutocomplete(this); 28 | } 29 | }); 30 | }; 31 | 32 | jQuery.railsAutocomplete = function (e) { 33 | _e = e; 34 | this.init(_e); 35 | }; 36 | 37 | jQuery.railsAutocomplete.fn = jQuery.railsAutocomplete.prototype = { 38 | railsAutocomplete: '0.0.1' 39 | }; 40 | 41 | jQuery.railsAutocomplete.fn.extend = jQuery.railsAutocomplete.extend = jQuery.extend; 42 | jQuery.railsAutocomplete.fn.extend({ 43 | init: function(e) { 44 | e.delimiter = $(e).attr('data-delimiter') || null; 45 | function split( val ) { 46 | return val.split( e.delimiter ); 47 | } 48 | function extractLast( term ) { 49 | return split( term ).pop(); 50 | } 51 | 52 | $(e).autocomplete({ 53 | source: function( request, response ) { 54 | $.getJSON( $(e).attr('data-autocomplete'), { 55 | term: extractLast( request.term ) 56 | }, response ); 57 | }, 58 | search: function() { 59 | // custom minLength 60 | var term = extractLast( this.value ); 61 | if ( term.length < 2 ) { 62 | return false; 63 | } 64 | }, 65 | focus: function() { 66 | // prevent value inserted on focus 67 | return false; 68 | }, 69 | select: function( event, ui ) { 70 | var terms = split( this.value ); 71 | // remove the current input 72 | terms.pop(); 73 | // add the selected item 74 | terms.push( ui.item.value ); 75 | // add placeholder to get the comma-and-space at the end 76 | if (e.delimiter != null) { 77 | terms.push( "" ); 78 | this.value = terms.join( e.delimiter ); 79 | } else { 80 | this.value = terms.join(""); 81 | if ($(this).attr('id_element')) { 82 | $($(this).attr('id_element')).val(ui.item.id); 83 | } 84 | }; 85 | 86 | return false; 87 | } 88 | }); 89 | } 90 | }); 91 | })(jQuery); 92 | -------------------------------------------------------------------------------- /public/javascripts/jquery-1.4.2.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery JavaScript Library v1.4.2 3 | * http://jquery.com/ 4 | * 5 | * Copyright 2010, John Resig 6 | * Dual licensed under the MIT or GPL Version 2 licenses. 7 | * http://jquery.org/license 8 | * 9 | * Includes Sizzle.js 10 | * http://sizzlejs.com/ 11 | * Copyright 2010, The Dojo Foundation 12 | * Released under the MIT, BSD, and GPL Licenses. 13 | * 14 | * Date: Sat Feb 13 22:33:48 2010 -0500 15 | */ 16 | (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, 21 | Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& 22 | (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, 23 | a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== 24 | "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(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(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, 25 | function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b
a"; 34 | var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, 35 | parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= 36 | false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= 37 | s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, 38 | applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; 39 | else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, 40 | a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== 41 | w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, 42 | cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= 47 | c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); 48 | a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, 49 | function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); 50 | k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), 51 | C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type= 53 | e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& 54 | f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; 55 | if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", 63 | e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, 64 | "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, 65 | d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, 71 | e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); 72 | t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| 73 | g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, 80 | CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, 81 | g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, 82 | text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, 83 | setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= 84 | h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== 86 | "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, 87 | h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& 90 | q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=""; 91 | if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="

";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); 92 | (function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: 93 | function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= 96 | {},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== 97 | "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", 98 | d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? 99 | a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== 100 | 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"},F={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= 102 | c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, 103 | wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, 104 | prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(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,false,function(b){this.parentNode.insertBefore(b, 105 | this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); 106 | return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, 107 | ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); 111 | return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", 112 | ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= 113 | c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? 114 | c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= 115 | function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= 116 | Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, 117 | "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= 118 | a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= 119 | a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=//gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== 120 | "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("
").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, 121 | serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), 122 | function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, 123 | global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& 124 | e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? 125 | "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== 126 | false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= 127 | false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", 128 | c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| 129 | d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); 130 | g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== 131 | 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== 132 | "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; 133 | if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== 139 | "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| 140 | c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; 141 | this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= 142 | this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, 143 | e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b
"; 149 | a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); 150 | c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, 151 | d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- 152 | f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": 153 | "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in 154 | e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); 155 | -------------------------------------------------------------------------------- /public/javascripts/rails.js: -------------------------------------------------------------------------------- 1 | jQuery(function ($) { 2 | var csrf_token = $('meta[name=csrf-token]').attr('content'), 3 | csrf_param = $('meta[name=csrf-param]').attr('content'); 4 | 5 | $.fn.extend({ 6 | /** 7 | * Triggers a custom event on an element and returns the event result 8 | * this is used to get around not being able to ensure callbacks are placed 9 | * at the end of the chain. 10 | * 11 | * TODO: deprecate with jQuery 1.4.2 release, in favor of subscribing to our 12 | * own events and placing ourselves at the end of the chain. 13 | */ 14 | triggerAndReturn: function (name, data) { 15 | var event = new $.Event(name); 16 | this.trigger(event, data); 17 | 18 | return event.result !== false; 19 | }, 20 | 21 | /** 22 | * Handles execution of remote calls firing overridable events along the way 23 | */ 24 | callRemote: function () { 25 | var el = this, 26 | method = el.attr('method') || el.attr('data-method') || 'GET', 27 | url = el.attr('action') || el.attr('href'), 28 | dataType = el.attr('data-type') || 'script'; 29 | 30 | if (url === undefined) { 31 | throw "No URL specified for remote call (action or href must be present)."; 32 | } else { 33 | if (el.triggerAndReturn('ajax:before')) { 34 | var data = el.is('form') ? el.serializeArray() : []; 35 | $.ajax({ 36 | url: url, 37 | data: data, 38 | dataType: dataType, 39 | type: method.toUpperCase(), 40 | beforeSend: function (xhr) { 41 | el.trigger('ajax:loading', xhr); 42 | }, 43 | success: function (data, status, xhr) { 44 | el.trigger('ajax:success', [data, status, xhr]); 45 | }, 46 | complete: function (xhr) { 47 | el.trigger('ajax:complete', xhr); 48 | }, 49 | error: function (xhr, status, error) { 50 | el.trigger('ajax:failure', [xhr, status, error]); 51 | } 52 | }); 53 | } 54 | 55 | el.trigger('ajax:after'); 56 | } 57 | } 58 | }); 59 | 60 | /** 61 | * confirmation handler 62 | */ 63 | $('a[data-confirm],input[data-confirm]').live('click', function () { 64 | var el = $(this); 65 | if (el.triggerAndReturn('confirm')) { 66 | if (!confirm(el.attr('data-confirm'))) { 67 | return false; 68 | } 69 | } 70 | }); 71 | 72 | 73 | /** 74 | * remote handlers 75 | */ 76 | $('form[data-remote]').live('submit', function (e) { 77 | $(this).callRemote(); 78 | e.preventDefault(); 79 | }); 80 | 81 | $('a[data-remote],input[data-remote]').live('click', function (e) { 82 | $(this).callRemote(); 83 | e.preventDefault(); 84 | }); 85 | 86 | $('a[data-method]:not([data-remote])').live('click', function (e){ 87 | var link = $(this), 88 | href = link.attr('href'), 89 | method = link.attr('data-method'), 90 | form = $('
'), 91 | metadata_input = ''; 92 | 93 | if (csrf_param != null && csrf_token != null) { 94 | metadata_input += ''; 95 | } 96 | 97 | form.hide() 98 | .append(metadata_input) 99 | .appendTo('body'); 100 | 101 | e.preventDefault(); 102 | form.submit(); 103 | }); 104 | 105 | /** 106 | * disable-with handlers 107 | */ 108 | var disable_with_input_selector = 'input[data-disable-with]'; 109 | var disable_with_form_selector = 'form[data-remote]:has(' + disable_with_input_selector + ')'; 110 | 111 | $(disable_with_form_selector).live('ajax:before', function () { 112 | $(this).find(disable_with_input_selector).each(function () { 113 | var input = $(this); 114 | input.data('enable-with', input.val()) 115 | .attr('value', input.attr('data-disable-with')) 116 | .attr('disabled', 'disabled'); 117 | }); 118 | }); 119 | 120 | $(disable_with_form_selector).live('ajax:complete', function () { 121 | $(this).find(disable_with_input_selector).each(function () { 122 | var input = $(this); 123 | input.removeAttr('disabled') 124 | .val(input.data('enable-with')); 125 | }); 126 | }); 127 | }); -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file 2 | # 3 | # To ban all spiders from the entire site uncomment the next two lines: 4 | # User-Agent: * 5 | # Disallow: / 6 | -------------------------------------------------------------------------------- /public/stylesheets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/.gitkeep -------------------------------------------------------------------------------- /public/stylesheets/application.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #4B7399; 3 | font-family: Verdana, Helvetica, Arial; 4 | font-size: 14px; 5 | } 6 | 7 | a img { 8 | border: none; 9 | } 10 | 11 | a { 12 | color: #0000FF; 13 | } 14 | 15 | .clear { 16 | clear: both; 17 | height: 0; 18 | overflow: hidden; 19 | } 20 | 21 | #container { 22 | width: 75%; 23 | margin: 0 auto; 24 | background-color: #FFF; 25 | padding: 20px 40px; 26 | border: solid 1px black; 27 | margin-top: 20px; 28 | } 29 | 30 | #flash_notice, #flash_error, #flash_alert { 31 | padding: 5px 8px; 32 | margin: 10px 0; 33 | } 34 | 35 | #flash_notice { 36 | background-color: #CFC; 37 | border: solid 1px #6C6; 38 | } 39 | 40 | #flash_error, #flash_alert { 41 | background-color: #FCC; 42 | border: solid 1px #C66; 43 | } 44 | 45 | .fieldWithErrors { 46 | display: inline; 47 | } 48 | 49 | .error_messages { 50 | width: 400px; 51 | border: 2px solid #CF0000; 52 | padding: 0px; 53 | padding-bottom: 12px; 54 | margin-bottom: 20px; 55 | background-color: #f0f0f0; 56 | font-size: 12px; 57 | } 58 | 59 | .error_messages h2 { 60 | text-align: left; 61 | font-weight: bold; 62 | padding: 5px 10px; 63 | font-size: 12px; 64 | margin: 0; 65 | background-color: #c00; 66 | color: #fff; 67 | } 68 | 69 | .error_messages p { 70 | margin: 8px 10px; 71 | } 72 | 73 | .error_messages ul { 74 | margin: 0; 75 | } 76 | -------------------------------------------------------------------------------- /public/stylesheets/images/ui-anim_basic_16x16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-anim_basic_16x16.gif -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_diagonals-thick_18_b81900_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_diagonals-thick_18_b81900_40x40.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_diagonals-thick_20_666666_40x40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_diagonals-thick_20_666666_40x40.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_flat_10_000000_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_flat_10_000000_40x100.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_glass_100_f6f6f6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_glass_100_f6f6f6_1x400.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_glass_100_fdf5ce_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_glass_100_fdf5ce_1x400.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_gloss-wave_35_f6a828_500x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_gloss-wave_35_f6a828_500x100.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_highlight-soft_100_eeeeee_1x100.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-bg_highlight-soft_75_ffe45c_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-bg_highlight-soft_75_ffe45c_1x100.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-icons_228ef1_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-icons_228ef1_256x240.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-icons_ef8c08_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-icons_ef8c08_256x240.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-icons_ffd27a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-icons_ffd27a_256x240.png -------------------------------------------------------------------------------- /public/stylesheets/images/ui-icons_ffffff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/public/stylesheets/images/ui-icons_ffffff_256x240.png -------------------------------------------------------------------------------- /public/stylesheets/jquery-ui-1.8.2.custom.css: -------------------------------------------------------------------------------- 1 | /* 2 | * jQuery UI CSS Framework 3 | * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 4 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 5 | */ 6 | 7 | /* Layout helpers 8 | ----------------------------------*/ 9 | .ui-helper-hidden { display: none; } 10 | .ui-helper-hidden-accessible { position: absolute; left: -99999999px; } 11 | .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } 12 | .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } 13 | .ui-helper-clearfix { display: inline-block; } 14 | /* required comment for clearfix to work in Opera \*/ 15 | * html .ui-helper-clearfix { height:1%; } 16 | .ui-helper-clearfix { display:block; } 17 | /* end clearfix */ 18 | .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } 19 | 20 | 21 | /* Interaction Cues 22 | ----------------------------------*/ 23 | .ui-state-disabled { cursor: default !important; } 24 | 25 | 26 | /* Icons 27 | ----------------------------------*/ 28 | 29 | /* states and images */ 30 | .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } 31 | 32 | 33 | /* Misc visuals 34 | ----------------------------------*/ 35 | 36 | /* Overlays */ 37 | .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } 38 | 39 | 40 | /* 41 | * jQuery UI CSS Framework 42 | * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about) 43 | * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. 44 | * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px 45 | */ 46 | 47 | 48 | /* Component containers 49 | ----------------------------------*/ 50 | .ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } 51 | .ui-widget .ui-widget { font-size: 1em; } 52 | .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } 53 | .ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } 54 | .ui-widget-content a { color: #333333; } 55 | .ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } 56 | .ui-widget-header a { color: #ffffff; } 57 | 58 | /* Interaction states 59 | ----------------------------------*/ 60 | .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } 61 | .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } 62 | .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } 63 | .ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } 64 | .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } 65 | .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } 66 | .ui-widget :active { outline: none; } 67 | 68 | /* Interaction Cues 69 | ----------------------------------*/ 70 | .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } 71 | .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } 72 | .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } 73 | .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } 74 | .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } 75 | .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } 76 | .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } 77 | .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } 78 | 79 | /* Icons 80 | ----------------------------------*/ 81 | 82 | /* states and images */ 83 | .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } 84 | .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } 85 | .ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } 86 | .ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } 87 | .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } 88 | .ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } 89 | .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } 90 | .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } 91 | 92 | /* positioning */ 93 | .ui-icon-carat-1-n { background-position: 0 0; } 94 | .ui-icon-carat-1-ne { background-position: -16px 0; } 95 | .ui-icon-carat-1-e { background-position: -32px 0; } 96 | .ui-icon-carat-1-se { background-position: -48px 0; } 97 | .ui-icon-carat-1-s { background-position: -64px 0; } 98 | .ui-icon-carat-1-sw { background-position: -80px 0; } 99 | .ui-icon-carat-1-w { background-position: -96px 0; } 100 | .ui-icon-carat-1-nw { background-position: -112px 0; } 101 | .ui-icon-carat-2-n-s { background-position: -128px 0; } 102 | .ui-icon-carat-2-e-w { background-position: -144px 0; } 103 | .ui-icon-triangle-1-n { background-position: 0 -16px; } 104 | .ui-icon-triangle-1-ne { background-position: -16px -16px; } 105 | .ui-icon-triangle-1-e { background-position: -32px -16px; } 106 | .ui-icon-triangle-1-se { background-position: -48px -16px; } 107 | .ui-icon-triangle-1-s { background-position: -64px -16px; } 108 | .ui-icon-triangle-1-sw { background-position: -80px -16px; } 109 | .ui-icon-triangle-1-w { background-position: -96px -16px; } 110 | .ui-icon-triangle-1-nw { background-position: -112px -16px; } 111 | .ui-icon-triangle-2-n-s { background-position: -128px -16px; } 112 | .ui-icon-triangle-2-e-w { background-position: -144px -16px; } 113 | .ui-icon-arrow-1-n { background-position: 0 -32px; } 114 | .ui-icon-arrow-1-ne { background-position: -16px -32px; } 115 | .ui-icon-arrow-1-e { background-position: -32px -32px; } 116 | .ui-icon-arrow-1-se { background-position: -48px -32px; } 117 | .ui-icon-arrow-1-s { background-position: -64px -32px; } 118 | .ui-icon-arrow-1-sw { background-position: -80px -32px; } 119 | .ui-icon-arrow-1-w { background-position: -96px -32px; } 120 | .ui-icon-arrow-1-nw { background-position: -112px -32px; } 121 | .ui-icon-arrow-2-n-s { background-position: -128px -32px; } 122 | .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } 123 | .ui-icon-arrow-2-e-w { background-position: -160px -32px; } 124 | .ui-icon-arrow-2-se-nw { background-position: -176px -32px; } 125 | .ui-icon-arrowstop-1-n { background-position: -192px -32px; } 126 | .ui-icon-arrowstop-1-e { background-position: -208px -32px; } 127 | .ui-icon-arrowstop-1-s { background-position: -224px -32px; } 128 | .ui-icon-arrowstop-1-w { background-position: -240px -32px; } 129 | .ui-icon-arrowthick-1-n { background-position: 0 -48px; } 130 | .ui-icon-arrowthick-1-ne { background-position: -16px -48px; } 131 | .ui-icon-arrowthick-1-e { background-position: -32px -48px; } 132 | .ui-icon-arrowthick-1-se { background-position: -48px -48px; } 133 | .ui-icon-arrowthick-1-s { background-position: -64px -48px; } 134 | .ui-icon-arrowthick-1-sw { background-position: -80px -48px; } 135 | .ui-icon-arrowthick-1-w { background-position: -96px -48px; } 136 | .ui-icon-arrowthick-1-nw { background-position: -112px -48px; } 137 | .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } 138 | .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } 139 | .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } 140 | .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } 141 | .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } 142 | .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } 143 | .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } 144 | .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } 145 | .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } 146 | .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } 147 | .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } 148 | .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } 149 | .ui-icon-arrowreturn-1-w { background-position: -64px -64px; } 150 | .ui-icon-arrowreturn-1-n { background-position: -80px -64px; } 151 | .ui-icon-arrowreturn-1-e { background-position: -96px -64px; } 152 | .ui-icon-arrowreturn-1-s { background-position: -112px -64px; } 153 | .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } 154 | .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } 155 | .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } 156 | .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } 157 | .ui-icon-arrow-4 { background-position: 0 -80px; } 158 | .ui-icon-arrow-4-diag { background-position: -16px -80px; } 159 | .ui-icon-extlink { background-position: -32px -80px; } 160 | .ui-icon-newwin { background-position: -48px -80px; } 161 | .ui-icon-refresh { background-position: -64px -80px; } 162 | .ui-icon-shuffle { background-position: -80px -80px; } 163 | .ui-icon-transfer-e-w { background-position: -96px -80px; } 164 | .ui-icon-transferthick-e-w { background-position: -112px -80px; } 165 | .ui-icon-folder-collapsed { background-position: 0 -96px; } 166 | .ui-icon-folder-open { background-position: -16px -96px; } 167 | .ui-icon-document { background-position: -32px -96px; } 168 | .ui-icon-document-b { background-position: -48px -96px; } 169 | .ui-icon-note { background-position: -64px -96px; } 170 | .ui-icon-mail-closed { background-position: -80px -96px; } 171 | .ui-icon-mail-open { background-position: -96px -96px; } 172 | .ui-icon-suitcase { background-position: -112px -96px; } 173 | .ui-icon-comment { background-position: -128px -96px; } 174 | .ui-icon-person { background-position: -144px -96px; } 175 | .ui-icon-print { background-position: -160px -96px; } 176 | .ui-icon-trash { background-position: -176px -96px; } 177 | .ui-icon-locked { background-position: -192px -96px; } 178 | .ui-icon-unlocked { background-position: -208px -96px; } 179 | .ui-icon-bookmark { background-position: -224px -96px; } 180 | .ui-icon-tag { background-position: -240px -96px; } 181 | .ui-icon-home { background-position: 0 -112px; } 182 | .ui-icon-flag { background-position: -16px -112px; } 183 | .ui-icon-calendar { background-position: -32px -112px; } 184 | .ui-icon-cart { background-position: -48px -112px; } 185 | .ui-icon-pencil { background-position: -64px -112px; } 186 | .ui-icon-clock { background-position: -80px -112px; } 187 | .ui-icon-disk { background-position: -96px -112px; } 188 | .ui-icon-calculator { background-position: -112px -112px; } 189 | .ui-icon-zoomin { background-position: -128px -112px; } 190 | .ui-icon-zoomout { background-position: -144px -112px; } 191 | .ui-icon-search { background-position: -160px -112px; } 192 | .ui-icon-wrench { background-position: -176px -112px; } 193 | .ui-icon-gear { background-position: -192px -112px; } 194 | .ui-icon-heart { background-position: -208px -112px; } 195 | .ui-icon-star { background-position: -224px -112px; } 196 | .ui-icon-link { background-position: -240px -112px; } 197 | .ui-icon-cancel { background-position: 0 -128px; } 198 | .ui-icon-plus { background-position: -16px -128px; } 199 | .ui-icon-plusthick { background-position: -32px -128px; } 200 | .ui-icon-minus { background-position: -48px -128px; } 201 | .ui-icon-minusthick { background-position: -64px -128px; } 202 | .ui-icon-close { background-position: -80px -128px; } 203 | .ui-icon-closethick { background-position: -96px -128px; } 204 | .ui-icon-key { background-position: -112px -128px; } 205 | .ui-icon-lightbulb { background-position: -128px -128px; } 206 | .ui-icon-scissors { background-position: -144px -128px; } 207 | .ui-icon-clipboard { background-position: -160px -128px; } 208 | .ui-icon-copy { background-position: -176px -128px; } 209 | .ui-icon-contact { background-position: -192px -128px; } 210 | .ui-icon-image { background-position: -208px -128px; } 211 | .ui-icon-video { background-position: -224px -128px; } 212 | .ui-icon-script { background-position: -240px -128px; } 213 | .ui-icon-alert { background-position: 0 -144px; } 214 | .ui-icon-info { background-position: -16px -144px; } 215 | .ui-icon-notice { background-position: -32px -144px; } 216 | .ui-icon-help { background-position: -48px -144px; } 217 | .ui-icon-check { background-position: -64px -144px; } 218 | .ui-icon-bullet { background-position: -80px -144px; } 219 | .ui-icon-radio-off { background-position: -96px -144px; } 220 | .ui-icon-radio-on { background-position: -112px -144px; } 221 | .ui-icon-pin-w { background-position: -128px -144px; } 222 | .ui-icon-pin-s { background-position: -144px -144px; } 223 | .ui-icon-play { background-position: 0 -160px; } 224 | .ui-icon-pause { background-position: -16px -160px; } 225 | .ui-icon-seek-next { background-position: -32px -160px; } 226 | .ui-icon-seek-prev { background-position: -48px -160px; } 227 | .ui-icon-seek-end { background-position: -64px -160px; } 228 | .ui-icon-seek-start { background-position: -80px -160px; } 229 | /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ 230 | .ui-icon-seek-first { background-position: -80px -160px; } 231 | .ui-icon-stop { background-position: -96px -160px; } 232 | .ui-icon-eject { background-position: -112px -160px; } 233 | .ui-icon-volume-off { background-position: -128px -160px; } 234 | .ui-icon-volume-on { background-position: -144px -160px; } 235 | .ui-icon-power { background-position: 0 -176px; } 236 | .ui-icon-signal-diag { background-position: -16px -176px; } 237 | .ui-icon-signal { background-position: -32px -176px; } 238 | .ui-icon-battery-0 { background-position: -48px -176px; } 239 | .ui-icon-battery-1 { background-position: -64px -176px; } 240 | .ui-icon-battery-2 { background-position: -80px -176px; } 241 | .ui-icon-battery-3 { background-position: -96px -176px; } 242 | .ui-icon-circle-plus { background-position: 0 -192px; } 243 | .ui-icon-circle-minus { background-position: -16px -192px; } 244 | .ui-icon-circle-close { background-position: -32px -192px; } 245 | .ui-icon-circle-triangle-e { background-position: -48px -192px; } 246 | .ui-icon-circle-triangle-s { background-position: -64px -192px; } 247 | .ui-icon-circle-triangle-w { background-position: -80px -192px; } 248 | .ui-icon-circle-triangle-n { background-position: -96px -192px; } 249 | .ui-icon-circle-arrow-e { background-position: -112px -192px; } 250 | .ui-icon-circle-arrow-s { background-position: -128px -192px; } 251 | .ui-icon-circle-arrow-w { background-position: -144px -192px; } 252 | .ui-icon-circle-arrow-n { background-position: -160px -192px; } 253 | .ui-icon-circle-zoomin { background-position: -176px -192px; } 254 | .ui-icon-circle-zoomout { background-position: -192px -192px; } 255 | .ui-icon-circle-check { background-position: -208px -192px; } 256 | .ui-icon-circlesmall-plus { background-position: 0 -208px; } 257 | .ui-icon-circlesmall-minus { background-position: -16px -208px; } 258 | .ui-icon-circlesmall-close { background-position: -32px -208px; } 259 | .ui-icon-squaresmall-plus { background-position: -48px -208px; } 260 | .ui-icon-squaresmall-minus { background-position: -64px -208px; } 261 | .ui-icon-squaresmall-close { background-position: -80px -208px; } 262 | .ui-icon-grip-dotted-vertical { background-position: 0 -224px; } 263 | .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } 264 | .ui-icon-grip-solid-vertical { background-position: -32px -224px; } 265 | .ui-icon-grip-solid-horizontal { background-position: -48px -224px; } 266 | .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } 267 | .ui-icon-grip-diagonal-se { background-position: -80px -224px; } 268 | 269 | 270 | /* Misc visuals 271 | ----------------------------------*/ 272 | 273 | /* Corner radius */ 274 | .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; } 275 | .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } 276 | .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } 277 | .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } 278 | .ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; } 279 | .ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } 280 | .ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } 281 | .ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } 282 | .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } 283 | 284 | /* Overlays */ 285 | .ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } 286 | .ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; }/* Resizable 287 | ----------------------------------*/ 288 | .ui-resizable { position: relative;} 289 | .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} 290 | .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } 291 | .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } 292 | .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } 293 | .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } 294 | .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } 295 | .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } 296 | .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } 297 | .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } 298 | .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Selectable 299 | ----------------------------------*/ 300 | .ui-selectable-helper { border:1px dotted black } 301 | /* Accordion 302 | ----------------------------------*/ 303 | .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } 304 | .ui-accordion .ui-accordion-li-fix { display: inline; } 305 | .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } 306 | .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } 307 | /* IE7-/Win - Fix extra vertical space in lists */ 308 | .ui-accordion a { zoom: 1; } 309 | .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } 310 | .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } 311 | .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } 312 | .ui-accordion .ui-accordion-content-active { display: block; }/* Autocomplete 313 | ----------------------------------*/ 314 | .ui-autocomplete { position: absolute; cursor: default; } 315 | .ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; } 316 | 317 | /* workarounds */ 318 | * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ 319 | 320 | /* Menu 321 | ----------------------------------*/ 322 | .ui-menu { 323 | list-style:none; 324 | padding: 2px; 325 | margin: 0; 326 | display:block; 327 | } 328 | .ui-menu .ui-menu { 329 | margin-top: -3px; 330 | } 331 | .ui-menu .ui-menu-item { 332 | margin:0; 333 | padding: 0; 334 | zoom: 1; 335 | float: left; 336 | clear: left; 337 | width: 100%; 338 | } 339 | .ui-menu .ui-menu-item a { 340 | text-decoration:none; 341 | display:block; 342 | padding:.2em .4em; 343 | line-height:1.5; 344 | zoom:1; 345 | } 346 | .ui-menu .ui-menu-item a.ui-state-hover, 347 | .ui-menu .ui-menu-item a.ui-state-active { 348 | font-weight: normal; 349 | margin: -1px; 350 | } 351 | /* Button 352 | ----------------------------------*/ 353 | 354 | .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ 355 | .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ 356 | button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ 357 | .ui-button-icons-only { width: 3.4em; } 358 | button.ui-button-icons-only { width: 3.7em; } 359 | 360 | /*button text element */ 361 | .ui-button .ui-button-text { display: block; line-height: 1.4; } 362 | .ui-button-text-only .ui-button-text { padding: .4em 1em; } 363 | .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } 364 | .ui-button-text-icon .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } 365 | .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } 366 | /* no icon support for input elements, provide padding by default */ 367 | input.ui-button { padding: .4em 1em; } 368 | 369 | /*button icon element(s) */ 370 | .ui-button-icon-only .ui-icon, .ui-button-text-icon .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } 371 | .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } 372 | .ui-button-text-icon .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } 373 | .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } 374 | 375 | /*button sets*/ 376 | .ui-buttonset { margin-right: 7px; } 377 | .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } 378 | 379 | /* workarounds */ 380 | button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ 381 | 382 | 383 | 384 | 385 | 386 | /* Dialog 387 | ----------------------------------*/ 388 | .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } 389 | .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; } 390 | .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; } 391 | .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } 392 | .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } 393 | .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } 394 | .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } 395 | .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } 396 | .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } 397 | .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } 398 | .ui-draggable .ui-dialog-titlebar { cursor: move; } 399 | /* Slider 400 | ----------------------------------*/ 401 | .ui-slider { position: relative; text-align: left; } 402 | .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } 403 | .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } 404 | 405 | .ui-slider-horizontal { height: .8em; } 406 | .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } 407 | .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } 408 | .ui-slider-horizontal .ui-slider-range-min { left: 0; } 409 | .ui-slider-horizontal .ui-slider-range-max { right: 0; } 410 | 411 | .ui-slider-vertical { width: .8em; height: 100px; } 412 | .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } 413 | .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } 414 | .ui-slider-vertical .ui-slider-range-min { bottom: 0; } 415 | .ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs 416 | ----------------------------------*/ 417 | .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ 418 | .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } 419 | .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } 420 | .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } 421 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } 422 | .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } 423 | .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ 424 | .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } 425 | .ui-tabs .ui-tabs-hide { display: none !important; } 426 | /* Datepicker 427 | ----------------------------------*/ 428 | .ui-datepicker { width: 17em; padding: .2em .2em 0; } 429 | .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } 430 | .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } 431 | .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } 432 | .ui-datepicker .ui-datepicker-prev { left:2px; } 433 | .ui-datepicker .ui-datepicker-next { right:2px; } 434 | .ui-datepicker .ui-datepicker-prev-hover { left:1px; } 435 | .ui-datepicker .ui-datepicker-next-hover { right:1px; } 436 | .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } 437 | .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } 438 | .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } 439 | .ui-datepicker select.ui-datepicker-month-year {width: 100%;} 440 | .ui-datepicker select.ui-datepicker-month, 441 | .ui-datepicker select.ui-datepicker-year { width: 49%;} 442 | .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } 443 | .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } 444 | .ui-datepicker td { border: 0; padding: 1px; } 445 | .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } 446 | .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } 447 | .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } 448 | .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } 449 | 450 | /* with multiple calendars */ 451 | .ui-datepicker.ui-datepicker-multi { width:auto; } 452 | .ui-datepicker-multi .ui-datepicker-group { float:left; } 453 | .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } 454 | .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } 455 | .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } 456 | .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } 457 | .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } 458 | .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } 459 | .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } 460 | .ui-datepicker-row-break { clear:both; width:100%; } 461 | 462 | /* RTL support */ 463 | .ui-datepicker-rtl { direction: rtl; } 464 | .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } 465 | .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } 466 | .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } 467 | .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } 468 | .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } 469 | .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } 470 | .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } 471 | .ui-datepicker-rtl .ui-datepicker-group { float:right; } 472 | .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 473 | .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } 474 | 475 | /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ 476 | .ui-datepicker-cover { 477 | display: none; /*sorry for IE5*/ 478 | display/**/: block; /*sorry for IE5*/ 479 | position: absolute; /*must have*/ 480 | z-index: -1; /*must have*/ 481 | filter: mask(); /*must have*/ 482 | top: -4px; /*must have*/ 483 | left: -4px; /*must have*/ 484 | width: 200px; /*must have*/ 485 | height: 200px; /*must have*/ 486 | }/* Progressbar 487 | ----------------------------------*/ 488 | .ui-progressbar { height:2em; text-align: left; } 489 | .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } -------------------------------------------------------------------------------- /script/cucumber: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first 4 | if vendored_cucumber_bin 5 | load File.expand_path(vendored_cucumber_bin) 6 | else 7 | require 'rubygems' unless ENV['NO_RUBYGEMS'] 8 | require 'cucumber' 9 | load Cucumber::BINARY 10 | end 11 | -------------------------------------------------------------------------------- /script/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. 3 | 4 | APP_PATH = File.expand_path('../../config/application', __FILE__) 5 | require File.expand_path('../../config/boot', __FILE__) 6 | require 'rails/commands' 7 | -------------------------------------------------------------------------------- /spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | # This file is copied to spec/ when you run 'rails generate rspec:install' 2 | ENV["RAILS_ENV"] ||= 'test' 3 | require File.expand_path("../../config/environment", __FILE__) 4 | require 'rspec/rails' 5 | 6 | # Requires supporting ruby files with custom matchers and macros, etc, 7 | # in spec/support/ and its subdirectories. 8 | Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} 9 | 10 | RSpec.configure do |config| 11 | # == Mock Framework 12 | # 13 | # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: 14 | # 15 | # config.mock_with :mocha 16 | # config.mock_with :flexmock 17 | # config.mock_with :rr 18 | config.mock_with :rspec 19 | 20 | config.fixture_path = "#{::Rails.root}/spec/fixtures" 21 | 22 | # If you're not using ActiveRecord, or you'd prefer not to run each of your 23 | # examples within a transaction, comment the following line or assign false 24 | # instead of true. 25 | config.use_transactional_fixtures = true 26 | end 27 | -------------------------------------------------------------------------------- /spec/support/blueprints.rb: -------------------------------------------------------------------------------- 1 | require 'machinist/active_record' 2 | 3 | # Add your blueprints here. 4 | # 5 | # e.g. 6 | # Post.blueprint do 7 | # title { "Post #{sn}" } 8 | # body { "Lorem ipsum..." } 9 | # end 10 | 11 | Brand.blueprint do 12 | name 13 | end -------------------------------------------------------------------------------- /vendor/plugins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/crowdint/rails3-jquery-autocomplete-app/f132ddbe9624e1faada39ca04265ca1330ef4a49/vendor/plugins/.gitkeep --------------------------------------------------------------------------------